| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312 |
- /*!
- *
- * antd v5.27.4
- *
- * Copyright 2015-present, Alipay, Inc.
- * All rights reserved.
- *
- */
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("react"), require("react-dom"), require("dayjs"));
- else if(typeof define === 'function' && define.amd)
- define(["react", "react-dom", "dayjs"], factory);
- else if(typeof exports === 'object')
- exports["antd"] = factory(require("react"), require("react-dom"), require("dayjs"));
- else
- root["antd"] = factory(root["React"], root["ReactDOM"], root["dayjs"]);
- })(this, function(__WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_dayjs__) {
- return /******/ (function() { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ "./alias/cssinjs.js":
- /*!**************************!*\
- !*** ./alias/cssinjs.js ***!
- \**************************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- /* eslint-disable no-restricted-globals */
- // This is a alias proxy, which will use global `@ant-design/cssinjs` first.
- // Use local if global not found.
- let cssinjs;
- if (typeof window !== 'undefined' && window.antdCssinjs) {
- // Use window UMD version
- cssinjs = window.antdCssinjs;
- } else if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.antdCssinjs) {
- // Use global UMD version
- cssinjs = __webpack_require__.g.antdCssinjs;
- } else {
- // Use local version.
- // Use relative path since webpack will also replace module here.
- // eslint-disable-next-line antfu/no-import-node-modules-by-path
- cssinjs = __webpack_require__(/*! ../node_modules/@ant-design/cssinjs */ "./node_modules/@ant-design/cssinjs/es/index.js");
- }
- module.exports = cssinjs;
- /***/ }),
- /***/ "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$":
- /*!***************************************************************!*\
- !*** ./components/ sync ^\.\/[^_][\w-]+\/style\/index\.tsx?$ ***!
- \***************************************************************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var map = {
- "./affix/style/index.ts": "./components/affix/style/index.ts",
- "./alert/style/index.ts": "./components/alert/style/index.ts",
- "./anchor/style/index.ts": "./components/anchor/style/index.ts",
- "./app/style/index.ts": "./components/app/style/index.ts",
- "./avatar/style/index.ts": "./components/avatar/style/index.ts",
- "./back-top/style/index.ts": "./components/back-top/style/index.ts",
- "./badge/style/index.ts": "./components/badge/style/index.ts",
- "./breadcrumb/style/index.ts": "./components/breadcrumb/style/index.ts",
- "./button/style/index.ts": "./components/button/style/index.ts",
- "./calendar/style/index.ts": "./components/calendar/style/index.ts",
- "./card/style/index.ts": "./components/card/style/index.ts",
- "./carousel/style/index.ts": "./components/carousel/style/index.ts",
- "./cascader/style/index.ts": "./components/cascader/style/index.ts",
- "./checkbox/style/index.ts": "./components/checkbox/style/index.ts",
- "./col/style/index.ts": "./components/col/style/index.ts",
- "./collapse/style/index.ts": "./components/collapse/style/index.ts",
- "./color-picker/style/index.ts": "./components/color-picker/style/index.ts",
- "./config-provider/style/index.ts": "./components/config-provider/style/index.ts",
- "./date-picker/style/index.ts": "./components/date-picker/style/index.ts",
- "./descriptions/style/index.ts": "./components/descriptions/style/index.ts",
- "./divider/style/index.ts": "./components/divider/style/index.ts",
- "./drawer/style/index.ts": "./components/drawer/style/index.ts",
- "./dropdown/style/index.ts": "./components/dropdown/style/index.ts",
- "./empty/style/index.ts": "./components/empty/style/index.ts",
- "./flex/style/index.ts": "./components/flex/style/index.ts",
- "./float-button/style/index.ts": "./components/float-button/style/index.ts",
- "./form/style/index.ts": "./components/form/style/index.ts",
- "./grid/style/index.ts": "./components/grid/style/index.ts",
- "./image/style/index.ts": "./components/image/style/index.ts",
- "./input-number/style/index.ts": "./components/input-number/style/index.ts",
- "./input/style/index.ts": "./components/input/style/index.ts",
- "./layout/style/index.ts": "./components/layout/style/index.ts",
- "./list/style/index.ts": "./components/list/style/index.ts",
- "./mentions/style/index.ts": "./components/mentions/style/index.ts",
- "./menu/style/index.ts": "./components/menu/style/index.ts",
- "./message/style/index.ts": "./components/message/style/index.ts",
- "./modal/style/index.ts": "./components/modal/style/index.ts",
- "./notification/style/index.ts": "./components/notification/style/index.ts",
- "./pagination/style/index.ts": "./components/pagination/style/index.ts",
- "./popconfirm/style/index.ts": "./components/popconfirm/style/index.ts",
- "./popover/style/index.ts": "./components/popover/style/index.ts",
- "./progress/style/index.ts": "./components/progress/style/index.ts",
- "./qr-code/style/index.ts": "./components/qr-code/style/index.ts",
- "./qrcode/style/index.ts": "./components/qrcode/style/index.ts",
- "./radio/style/index.ts": "./components/radio/style/index.ts",
- "./rate/style/index.ts": "./components/rate/style/index.ts",
- "./result/style/index.ts": "./components/result/style/index.ts",
- "./row/style/index.ts": "./components/row/style/index.ts",
- "./segmented/style/index.ts": "./components/segmented/style/index.ts",
- "./select/style/index.ts": "./components/select/style/index.ts",
- "./skeleton/style/index.ts": "./components/skeleton/style/index.ts",
- "./slider/style/index.ts": "./components/slider/style/index.ts",
- "./space/style/index.ts": "./components/space/style/index.ts",
- "./spin/style/index.ts": "./components/spin/style/index.ts",
- "./splitter/style/index.ts": "./components/splitter/style/index.ts",
- "./statistic/style/index.ts": "./components/statistic/style/index.ts",
- "./steps/style/index.ts": "./components/steps/style/index.ts",
- "./switch/style/index.ts": "./components/switch/style/index.ts",
- "./table/style/index.ts": "./components/table/style/index.ts",
- "./tabs/style/index.ts": "./components/tabs/style/index.ts",
- "./tag/style/index.ts": "./components/tag/style/index.ts",
- "./timeline/style/index.ts": "./components/timeline/style/index.ts",
- "./tooltip/style/index.ts": "./components/tooltip/style/index.ts",
- "./tour/style/index.ts": "./components/tour/style/index.ts",
- "./transfer/style/index.ts": "./components/transfer/style/index.ts",
- "./tree-select/style/index.ts": "./components/tree-select/style/index.ts",
- "./tree/style/index.ts": "./components/tree/style/index.ts",
- "./typography/style/index.ts": "./components/typography/style/index.ts",
- "./upload/style/index.ts": "./components/upload/style/index.ts"
- };
- function webpackContext(req) {
- var id = webpackContextResolve(req);
- return __webpack_require__(id);
- }
- function webpackContextResolve(req) {
- if(!__webpack_require__.o(map, req)) {
- var e = new Error("Cannot find module '" + req + "'");
- e.code = 'MODULE_NOT_FOUND';
- throw e;
- }
- return map[req];
- }
- webpackContext.keys = function webpackContextKeys() {
- return Object.keys(map);
- };
- webpackContext.resolve = webpackContextResolve;
- module.exports = webpackContext;
- webpackContext.id = "./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$";
- /***/ }),
- /***/ "./components/_util/hooks/useZIndex.ts":
- /*!*********************************************!*\
- !*** ./components/_util/hooks/useZIndex.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ CONTAINER_MAX_OFFSET: function() { return /* binding */ CONTAINER_MAX_OFFSET; },
- /* harmony export */ useZIndex: function() { return /* binding */ useZIndex; }
- /* harmony export */ });
- /* unused harmony exports containerBaseZIndexOffset, consumerBaseZIndexOffset */
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_useToken__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/useToken */ "./components/theme/useToken.ts");
- /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../warning */ "./components/_util/warning.ts");
- /* harmony import */ var _zindexContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../zindexContext */ "./components/_util/zindexContext.ts");
- // Z-Index control range
- // Container: 1000 + offset 100 (max base + 10 * offset = 2000)
- // Popover: offset 50
- // Notification: Container Max zIndex + componentOffset
- const CONTAINER_OFFSET = 100;
- const CONTAINER_OFFSET_MAX_COUNT = 10;
- const CONTAINER_MAX_OFFSET = CONTAINER_OFFSET * CONTAINER_OFFSET_MAX_COUNT;
- /**
- * Static function will default be the `CONTAINER_MAX_OFFSET`.
- * But it still may have children component like Select, Dropdown.
- * So the warning zIndex should exceed the `CONTAINER_MAX_OFFSET`.
- */
- const CONTAINER_MAX_OFFSET_WITH_CHILDREN = CONTAINER_MAX_OFFSET + CONTAINER_OFFSET;
- const containerBaseZIndexOffset = {
- Modal: CONTAINER_OFFSET,
- Drawer: CONTAINER_OFFSET,
- Popover: CONTAINER_OFFSET,
- Popconfirm: CONTAINER_OFFSET,
- Tooltip: CONTAINER_OFFSET,
- Tour: CONTAINER_OFFSET,
- FloatButton: CONTAINER_OFFSET
- };
- const consumerBaseZIndexOffset = {
- SelectLike: 50,
- Dropdown: 50,
- DatePicker: 50,
- Menu: 50,
- ImagePreview: 1
- };
- function isContainerType(type) {
- return type in containerBaseZIndexOffset;
- }
- const useZIndex = (componentType, customZIndex) => {
- const [, token] = (0,_theme_useToken__WEBPACK_IMPORTED_MODULE_1__["default"])();
- const parentZIndex = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(_zindexContext__WEBPACK_IMPORTED_MODULE_3__["default"]);
- const isContainer = isContainerType(componentType);
- let result;
- if (customZIndex !== undefined) {
- result = [customZIndex, customZIndex];
- } else {
- let zIndex = parentZIndex !== null && parentZIndex !== void 0 ? parentZIndex : 0;
- if (isContainer) {
- zIndex +=
- // Use preset token zIndex by default but not stack when has parent container
- (parentZIndex ? 0 : token.zIndexPopupBase) +
- // Container offset
- containerBaseZIndexOffset[componentType];
- } else {
- zIndex += consumerBaseZIndexOffset[componentType];
- }
- result = [parentZIndex === undefined ? customZIndex : zIndex, zIndex];
- }
- if (true) {
- const warning = (0,_warning__WEBPACK_IMPORTED_MODULE_2__.devUseWarning)(componentType);
- const maxZIndex = token.zIndexPopupBase + CONTAINER_MAX_OFFSET_WITH_CHILDREN;
- const currentZIndex = result[0] || 0;
- true ? warning(customZIndex !== undefined || currentZIndex <= maxZIndex, 'usage', '`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.') : 0;
- }
- return result;
- };
- /***/ }),
- /***/ "./components/_util/motion.ts":
- /*!************************************!*\
- !*** ./components/_util/motion.ts ***!
- \************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ getTransitionName: function() { return /* binding */ getTransitionName; }
- /* harmony export */ });
- /* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config-provider */ "./components/config-provider/context.ts");
- // ================== Collapse Motion ==================
- const getCollapsedHeight = () => ({
- height: 0,
- opacity: 0
- });
- const getRealHeight = node => {
- const {
- scrollHeight
- } = node;
- return {
- height: scrollHeight,
- opacity: 1
- };
- };
- const getCurrentHeight = node => ({
- height: node ? node.offsetHeight : 0
- });
- const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
- const initCollapseMotion = (rootCls = _config_provider__WEBPACK_IMPORTED_MODULE_0__.defaultPrefixCls) => ({
- motionName: `${rootCls}-motion-collapse`,
- onAppearStart: getCollapsedHeight,
- onEnterStart: getCollapsedHeight,
- onAppearActive: getRealHeight,
- onEnterActive: getRealHeight,
- onLeaveStart: getCurrentHeight,
- onLeaveActive: getCollapsedHeight,
- onAppearEnd: skipOpacityTransition,
- onEnterEnd: skipOpacityTransition,
- onLeaveEnd: skipOpacityTransition,
- motionDeadline: 500
- });
- const _SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'];
- const getTransitionName = (rootPrefixCls, motion, transitionName) => {
- if (transitionName !== undefined) {
- return transitionName;
- }
- return `${rootPrefixCls}-${motion}`;
- };
- /* harmony default export */ __webpack_exports__["default"] = (initCollapseMotion);
- /***/ }),
- /***/ "./components/_util/reactNode.ts":
- /*!***************************************!*\
- !*** ./components/_util/reactNode.ts ***!
- \***************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ cloneElement: function() { return /* binding */ cloneElement; },
- /* harmony export */ isFragment: function() { return /* binding */ isFragment; },
- /* harmony export */ replaceElement: function() { return /* binding */ replaceElement; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- function isFragment(child) {
- return child && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(child) && child.type === (react__WEBPACK_IMPORTED_MODULE_0___default().Fragment);
- }
- const replaceElement = (element, replacement, props) => {
- if (! /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(element)) {
- return replacement;
- }
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
- };
- function cloneElement(element, props) {
- return replaceElement(element, element, props);
- }
- /***/ }),
- /***/ "./components/_util/warning.ts":
- /*!*************************************!*\
- !*** ./components/_util/warning.ts ***!
- \*************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ WarningContext: function() { return /* binding */ WarningContext; },
- /* harmony export */ devUseWarning: function() { return /* binding */ devUseWarning; }
- /* harmony export */ });
- /* unused harmony exports noop, resetWarned */
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/warning */ "./node_modules/rc-util/es/warning.js");
- function noop() {}
- let deprecatedWarnList = null;
- function resetWarned() {
- deprecatedWarnList = null;
- (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__.resetWarned)();
- }
- let _warning = noop;
- if (true) {
- _warning = (valid, component, message) => {
- (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__["default"])(valid, `[antd: ${component}] ${message}`);
- // StrictMode will inject console which will not throw warning in React 17.
- if (false) // removed by dead control flow
- {}
- };
- }
- const warning = _warning;
- const WarningContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({});
- /**
- * This is a hook but we not named as `useWarning`
- * since this is only used in development.
- * We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
- */
- const devUseWarning = true ? component => {
- const {
- strict
- } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(WarningContext);
- const typeWarning = (valid, type, message) => {
- if (!valid) {
- if (strict === false && type === 'deprecated') {
- const existWarning = deprecatedWarnList;
- if (!deprecatedWarnList) {
- deprecatedWarnList = {};
- }
- deprecatedWarnList[component] = deprecatedWarnList[component] || [];
- if (!deprecatedWarnList[component].includes(message || '')) {
- deprecatedWarnList[component].push(message || '');
- }
- // Warning for the first time
- if (!existWarning) {
- console.warn('[antd] There exists deprecated usage in your code:', deprecatedWarnList);
- }
- } else {
- true ? warning(valid, component, message) : 0;
- }
- }
- };
- typeWarning.deprecated = (valid, oldProp, newProp, message) => {
- typeWarning(valid, 'deprecated', `\`${oldProp}\` is deprecated. Please use \`${newProp}\` instead.${message ? ` ${message}` : ''}`);
- };
- return typeWarning;
- } : 0;
- /* harmony default export */ __webpack_exports__["default"] = (warning);
- /***/ }),
- /***/ "./components/_util/zindexContext.ts":
- /*!*******************************************!*\
- !*** ./components/_util/zindexContext.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- const zIndexContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(undefined);
- if (true) {
- zIndexContext.displayName = 'zIndexContext';
- }
- /* harmony default export */ __webpack_exports__["default"] = (zIndexContext);
- /***/ }),
- /***/ "./components/affix/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/affix/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Shared ==============================
- const genSharedAffixStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- position: 'fixed',
- zIndex: token.zIndexPopup
- }
- };
- };
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexBase + 10
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.genStyleHooks)('Affix', genSharedAffixStyle, prepareComponentToken));
- /***/ }),
- /***/ "./components/alert/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/alert/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genActionStyle: function() { return /* binding */ genActionStyle; },
- /* harmony export */ genBaseStyle: function() { return /* binding */ genBaseStyle; },
- /* harmony export */ genTypeStyle: function() { return /* binding */ genTypeStyle; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genAlertTypeStyle = (bgColor, borderColor, iconColor, token, alertCls) => ({
- background: bgColor,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${borderColor}`,
- [`${alertCls}-icon`]: {
- color: iconColor
- }
- });
- const genBaseStyle = token => {
- const {
- componentCls,
- motionDurationSlow: duration,
- marginXS,
- marginSM,
- fontSize,
- fontSizeLG,
- lineHeight,
- borderRadiusLG: borderRadius,
- motionEaseInOutCirc,
- withDescriptionIconSize,
- colorText,
- colorTextHeading,
- withDescriptionPadding,
- defaultPadding
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- display: 'flex',
- alignItems: 'center',
- padding: defaultPadding,
- wordWrap: 'break-word',
- borderRadius,
- [`&${componentCls}-rtl`]: {
- direction: 'rtl'
- },
- [`${componentCls}-content`]: {
- flex: 1,
- minWidth: 0
- },
- [`${componentCls}-icon`]: {
- marginInlineEnd: marginXS,
- lineHeight: 0
- },
- '&-description': {
- display: 'none',
- fontSize,
- lineHeight
- },
- '&-message': {
- color: colorTextHeading
- },
- [`&${componentCls}-motion-leave`]: {
- overflow: 'hidden',
- opacity: 1,
- transition: `max-height ${duration} ${motionEaseInOutCirc}, opacity ${duration} ${motionEaseInOutCirc},
- padding-top ${duration} ${motionEaseInOutCirc}, padding-bottom ${duration} ${motionEaseInOutCirc},
- margin-bottom ${duration} ${motionEaseInOutCirc}`
- },
- [`&${componentCls}-motion-leave-active`]: {
- maxHeight: 0,
- marginBottom: '0 !important',
- paddingTop: 0,
- paddingBottom: 0,
- opacity: 0
- }
- }),
- [`${componentCls}-with-description`]: {
- alignItems: 'flex-start',
- padding: withDescriptionPadding,
- [`${componentCls}-icon`]: {
- marginInlineEnd: marginSM,
- fontSize: withDescriptionIconSize,
- lineHeight: 0
- },
- [`${componentCls}-message`]: {
- display: 'block',
- marginBottom: marginXS,
- color: colorTextHeading,
- fontSize: fontSizeLG
- },
- [`${componentCls}-description`]: {
- display: 'block',
- color: colorText
- }
- },
- [`${componentCls}-banner`]: {
- marginBottom: 0,
- border: '0 !important',
- borderRadius: 0
- }
- };
- };
- const genTypeStyle = token => {
- const {
- componentCls,
- colorSuccess,
- colorSuccessBorder,
- colorSuccessBg,
- colorWarning,
- colorWarningBorder,
- colorWarningBg,
- colorError,
- colorErrorBorder,
- colorErrorBg,
- colorInfo,
- colorInfoBorder,
- colorInfoBg
- } = token;
- return {
- [componentCls]: {
- '&-success': genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token, componentCls),
- '&-info': genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token, componentCls),
- '&-warning': genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token, componentCls),
- '&-error': Object.assign(Object.assign({}, genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token, componentCls)), {
- [`${componentCls}-description > pre`]: {
- margin: 0,
- padding: 0
- }
- })
- }
- };
- };
- const genActionStyle = token => {
- const {
- componentCls,
- iconCls,
- motionDurationMid,
- marginXS,
- fontSizeIcon,
- colorIcon,
- colorIconHover
- } = token;
- return {
- [componentCls]: {
- '&-action': {
- marginInlineStart: marginXS
- },
- [`${componentCls}-close-icon`]: {
- marginInlineStart: marginXS,
- padding: 0,
- overflow: 'hidden',
- fontSize: fontSizeIcon,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(fontSizeIcon),
- backgroundColor: 'transparent',
- border: 'none',
- outline: 'none',
- cursor: 'pointer',
- [`${iconCls}-close`]: {
- color: colorIcon,
- transition: `color ${motionDurationMid}`,
- '&:hover': {
- color: colorIconHover
- }
- }
- },
- '&-close-text': {
- color: colorIcon,
- transition: `color ${motionDurationMid}`,
- '&:hover': {
- color: colorIconHover
- }
- }
- }
- };
- };
- const prepareComponentToken = token => {
- const paddingHorizontal = 12; // Fixed value here.
- return {
- withDescriptionIconSize: token.fontSizeHeading3,
- defaultPadding: `${token.paddingContentVerticalSM}px ${paddingHorizontal}px`,
- withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Alert', token => [genBaseStyle(token), genTypeStyle(token), genActionStyle(token)], prepareComponentToken));
- /***/ }),
- /***/ "./components/anchor/style/index.ts":
- /*!******************************************!*\
- !*** ./components/anchor/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Shared ==============================
- const genSharedAnchorStyle = token => {
- const {
- componentCls,
- holderOffsetBlock,
- motionDurationSlow,
- lineWidthBold,
- colorPrimary,
- lineType,
- colorSplit,
- calc
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- marginBlockStart: calc(holderOffsetBlock).mul(-1).equal(),
- paddingBlockStart: holderOffsetBlock,
- // delete overflow: auto
- // overflow: 'auto',
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- paddingInlineStart: lineWidthBold,
- [`${componentCls}-link`]: {
- paddingBlock: token.linkPaddingBlock,
- paddingInline: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.linkPaddingInlineStart)} 0`,
- '&-title': Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis), {
- position: 'relative',
- display: 'block',
- marginBlockEnd: token.anchorTitleBlock,
- color: token.colorText,
- transition: `all ${token.motionDurationSlow}`,
- '&:only-child': {
- marginBlockEnd: 0
- }
- }),
- [`&-active > ${componentCls}-link-title`]: {
- color: token.colorPrimary
- },
- // link link
- [`${componentCls}-link`]: {
- paddingBlock: token.anchorPaddingBlockSecondary
- }
- }
- }),
- [`&:not(${componentCls}-wrapper-horizontal)`]: {
- [componentCls]: {
- '&::before': {
- position: 'absolute',
- insetInlineStart: 0,
- top: 0,
- height: '100%',
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidthBold)} ${lineType} ${colorSplit}`,
- content: '" "'
- },
- [`${componentCls}-ink`]: {
- position: 'absolute',
- insetInlineStart: 0,
- display: 'none',
- transform: 'translateY(-50%)',
- transition: `top ${motionDurationSlow} ease-in-out`,
- width: lineWidthBold,
- backgroundColor: colorPrimary,
- [`&${componentCls}-ink-visible`]: {
- display: 'inline-block'
- }
- }
- }
- },
- [`${componentCls}-fixed ${componentCls}-ink ${componentCls}-ink`]: {
- display: 'none'
- }
- }
- };
- };
- const genSharedAnchorHorizontalStyle = token => {
- const {
- componentCls,
- motionDurationSlow,
- lineWidthBold,
- colorPrimary
- } = token;
- return {
- [`${componentCls}-wrapper-horizontal`]: {
- position: 'relative',
- '&::before': {
- position: 'absolute',
- left: {
- _skip_check_: true,
- value: 0
- },
- right: {
- _skip_check_: true,
- value: 0
- },
- bottom: 0,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- content: '" "'
- },
- [componentCls]: {
- overflowX: 'scroll',
- position: 'relative',
- display: 'flex',
- scrollbarWidth: 'none' /* Firefox */,
- '&::-webkit-scrollbar': {
- display: 'none' /* Safari and Chrome */
- },
- [`${componentCls}-link:first-of-type`]: {
- paddingInline: 0
- },
- [`${componentCls}-ink`]: {
- position: 'absolute',
- bottom: 0,
- transition: `left ${motionDurationSlow} ease-in-out, width ${motionDurationSlow} ease-in-out`,
- height: lineWidthBold,
- backgroundColor: colorPrimary
- }
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- linkPaddingBlock: token.paddingXXS,
- linkPaddingInlineStart: token.padding
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Anchor', token => {
- const {
- fontSize,
- fontSizeLG,
- paddingXXS,
- calc
- } = token;
- const anchorToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- holderOffsetBlock: paddingXXS,
- anchorPaddingBlockSecondary: calc(paddingXXS).div(2).equal(),
- anchorTitleBlock: calc(fontSize).div(14).mul(3).equal(),
- anchorBallSize: calc(fontSizeLG).div(2).equal()
- });
- return [genSharedAnchorStyle(anchorToken), genSharedAnchorHorizontalStyle(anchorToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/app/style/index.ts":
- /*!***************************************!*\
- !*** ./components/app/style/index.ts ***!
- \***************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- colorText,
- fontSize,
- lineHeight,
- fontFamily
- } = token;
- return {
- [componentCls]: {
- color: colorText,
- fontSize,
- lineHeight,
- fontFamily,
- [`&${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- }
- };
- };
- const prepareComponentToken = () => ({});
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.genStyleHooks)('App', genBaseStyle, prepareComponentToken));
- /***/ }),
- /***/ "./components/avatar/style/index.ts":
- /*!******************************************!*\
- !*** ./components/avatar/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBaseStyle = token => {
- const {
- antCls,
- componentCls,
- iconCls,
- avatarBg,
- avatarColor,
- containerSize,
- containerSizeLG,
- containerSizeSM,
- textFontSize,
- textFontSizeLG,
- textFontSizeSM,
- iconFontSize,
- iconFontSizeLG,
- iconFontSizeSM,
- borderRadius,
- borderRadiusLG,
- borderRadiusSM,
- lineWidth,
- lineType
- } = token;
- // Avatar size style
- const avatarSizeStyle = (size, fontSize, iconFontSize, radius) => ({
- width: size,
- height: size,
- borderRadius: '50%',
- fontSize,
- [`&${componentCls}-square`]: {
- borderRadius: radius
- },
- [`&${componentCls}-icon`]: {
- fontSize: iconFontSize,
- [`> ${iconCls}`]: {
- margin: 0
- }
- }
- });
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- display: 'inline-flex',
- justifyContent: 'center',
- alignItems: 'center',
- overflow: 'hidden',
- color: avatarColor,
- whiteSpace: 'nowrap',
- textAlign: 'center',
- verticalAlign: 'middle',
- background: avatarBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} transparent`,
- '&-image': {
- background: 'transparent'
- },
- [`${antCls}-image-img`]: {
- display: 'block'
- }
- }), avatarSizeStyle(containerSize, textFontSize, iconFontSize, borderRadius)), {
- '&-lg': Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, iconFontSizeLG, borderRadiusLG)),
- '&-sm': Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, iconFontSizeSM, borderRadiusSM)),
- '> img': {
- display: 'block',
- width: '100%',
- height: '100%',
- objectFit: 'cover'
- }
- })
- };
- };
- const genGroupStyle = token => {
- const {
- componentCls,
- groupBorderColor,
- groupOverlapping,
- groupSpace
- } = token;
- return {
- [`${componentCls}-group`]: {
- display: 'inline-flex',
- [componentCls]: {
- borderColor: groupBorderColor
- },
- '> *:not(:first-child)': {
- marginInlineStart: groupOverlapping
- }
- },
- [`${componentCls}-group-popover`]: {
- [`${componentCls} + ${componentCls}`]: {
- marginInlineStart: groupSpace
- }
- }
- };
- };
- const prepareComponentToken = token => {
- const {
- controlHeight,
- controlHeightLG,
- controlHeightSM,
- fontSize,
- fontSizeLG,
- fontSizeXL,
- fontSizeHeading3,
- marginXS,
- marginXXS,
- colorBorderBg
- } = token;
- return {
- containerSize: controlHeight,
- containerSizeLG: controlHeightLG,
- containerSizeSM: controlHeightSM,
- textFontSize: fontSize,
- textFontSizeLG: fontSize,
- textFontSizeSM: fontSize,
- iconFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),
- iconFontSizeLG: fontSizeHeading3,
- iconFontSizeSM: fontSize,
- groupSpace: marginXXS,
- groupOverlapping: -marginXS,
- groupBorderColor: colorBorderBg
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Avatar', token => {
- const {
- colorTextLightSolid,
- colorTextPlaceholder
- } = token;
- const avatarToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- avatarBg: colorTextPlaceholder,
- avatarColor: colorTextLightSolid
- });
- return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/back-top/style/index.ts":
- /*!********************************************!*\
- !*** ./components/back-top/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Shared ==============================
- const genSharedBackTopStyle = token => {
- const {
- componentCls,
- backTopFontSize,
- backTopSize,
- zIndexPopup
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'fixed',
- insetInlineEnd: token.backTopInlineEnd,
- insetBlockEnd: token.backTopBlockEnd,
- zIndex: zIndexPopup,
- width: 40,
- height: 40,
- cursor: 'pointer',
- '&:empty': {
- display: 'none'
- },
- [`${componentCls}-content`]: {
- width: backTopSize,
- height: backTopSize,
- overflow: 'hidden',
- color: token.backTopColor,
- textAlign: 'center',
- backgroundColor: token.backTopBackground,
- borderRadius: backTopSize,
- transition: `all ${token.motionDurationMid}`,
- '&:hover': {
- backgroundColor: token.backTopHoverBackground,
- transition: `all ${token.motionDurationMid}`
- }
- },
- // change to .backtop .backtop-icon
- [`${componentCls}-icon`]: {
- fontSize: backTopFontSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(backTopSize)
- }
- })
- };
- };
- const genMediaBackTopStyle = token => {
- const {
- componentCls,
- screenMD,
- screenXS,
- backTopInlineEndMD,
- backTopInlineEndXS
- } = token;
- return {
- [`@media (max-width: ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(screenMD)})`]: {
- [componentCls]: {
- insetInlineEnd: backTopInlineEndMD
- }
- },
- [`@media (max-width: ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(screenXS)})`]: {
- [componentCls]: {
- insetInlineEnd: backTopInlineEndXS
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexBase + 10
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('BackTop', token => {
- const {
- fontSizeHeading3,
- colorTextDescription,
- colorTextLightSolid,
- colorText,
- controlHeightLG,
- calc
- } = token;
- const backTopToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- backTopBackground: colorTextDescription,
- backTopColor: colorTextLightSolid,
- backTopHoverBackground: colorText,
- backTopFontSize: fontSizeHeading3,
- backTopSize: controlHeightLG,
- backTopBlockEnd: calc(controlHeightLG).mul(1.25).equal(),
- backTopInlineEnd: calc(controlHeightLG).mul(2.5).equal(),
- backTopInlineEndMD: calc(controlHeightLG).mul(1.5).equal(),
- backTopInlineEndXS: calc(controlHeightLG).mul(0.5).equal()
- });
- return [genSharedBackTopStyle(backTopToken), genMediaBackTopStyle(backTopToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/badge/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/badge/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- /* harmony export */ prepareToken: function() { return /* binding */ prepareToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genPresetColor.ts");
- const antStatusProcessing = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antStatusProcessing', {
- '0%': {
- transform: 'scale(0.8)',
- opacity: 0.5
- },
- '100%': {
- transform: 'scale(2.4)',
- opacity: 0
- }
- });
- const antZoomBadgeIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomBadgeIn', {
- '0%': {
- transform: 'scale(0) translate(50%, -50%)',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1) translate(50%, -50%)'
- }
- });
- const antZoomBadgeOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomBadgeOut', {
- '0%': {
- transform: 'scale(1) translate(50%, -50%)'
- },
- '100%': {
- transform: 'scale(0) translate(50%, -50%)',
- opacity: 0
- }
- });
- const antNoWrapperZoomBadgeIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antNoWrapperZoomBadgeIn', {
- '0%': {
- transform: 'scale(0)',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)'
- }
- });
- const antNoWrapperZoomBadgeOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antNoWrapperZoomBadgeOut', {
- '0%': {
- transform: 'scale(1)'
- },
- '100%': {
- transform: 'scale(0)',
- opacity: 0
- }
- });
- const antBadgeLoadingCircle = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antBadgeLoadingCircle', {
- '0%': {
- transformOrigin: '50%'
- },
- '100%': {
- transform: 'translate(50%, -50%) rotate(360deg)',
- transformOrigin: '50%'
- }
- });
- const genSharedBadgeStyle = token => {
- const {
- componentCls,
- iconCls,
- antCls,
- badgeShadowSize,
- textFontSize,
- textFontSizeSM,
- statusSize,
- dotSize,
- textFontWeight,
- indicatorHeight,
- indicatorHeightSM,
- marginXS,
- calc
- } = token;
- const numberPrefixCls = `${antCls}-scroll-number`;
- const colorPreset = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__["default"])(token, (colorKey, {
- darkColor
- }) => ({
- [`&${componentCls} ${componentCls}-color-${colorKey}`]: {
- background: darkColor,
- [`&:not(${componentCls}-count)`]: {
- color: darkColor
- },
- 'a:hover &': {
- background: darkColor
- }
- }
- }));
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- display: 'inline-block',
- width: 'fit-content',
- lineHeight: 1,
- [`${componentCls}-count`]: {
- display: 'inline-flex',
- justifyContent: 'center',
- zIndex: token.indicatorZIndex,
- minWidth: indicatorHeight,
- height: indicatorHeight,
- color: token.badgeTextColor,
- fontWeight: textFontWeight,
- fontSize: textFontSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(indicatorHeight),
- whiteSpace: 'nowrap',
- textAlign: 'center',
- background: token.badgeColor,
- borderRadius: calc(indicatorHeight).div(2).equal(),
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(badgeShadowSize)} ${token.badgeShadowColor}`,
- transition: `background ${token.motionDurationMid}`,
- a: {
- color: token.badgeTextColor
- },
- 'a:hover': {
- color: token.badgeTextColor
- },
- 'a:hover &': {
- background: token.badgeColorHover
- }
- },
- [`${componentCls}-count-sm`]: {
- minWidth: indicatorHeightSM,
- height: indicatorHeightSM,
- fontSize: textFontSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(indicatorHeightSM),
- borderRadius: calc(indicatorHeightSM).div(2).equal()
- },
- [`${componentCls}-multiple-words`]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)}`,
- bdi: {
- unicodeBidi: 'plaintext'
- }
- },
- [`${componentCls}-dot`]: {
- zIndex: token.indicatorZIndex,
- width: dotSize,
- minWidth: dotSize,
- height: dotSize,
- background: token.badgeColor,
- borderRadius: '100%',
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(badgeShadowSize)} ${token.badgeShadowColor}`
- },
- [`${componentCls}-count, ${componentCls}-dot, ${numberPrefixCls}-custom-component`]: {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- transform: 'translate(50%, -50%)',
- transformOrigin: '100% 0%',
- [`&${iconCls}-spin`]: {
- animationName: antBadgeLoadingCircle,
- animationDuration: '1s',
- animationIterationCount: 'infinite',
- animationTimingFunction: 'linear'
- }
- },
- [`&${componentCls}-status`]: {
- lineHeight: 'inherit',
- verticalAlign: 'baseline',
- [`${componentCls}-status-dot`]: {
- position: 'relative',
- top: -1,
- // Magic number, but seems better experience
- display: 'inline-block',
- width: statusSize,
- height: statusSize,
- verticalAlign: 'middle',
- borderRadius: '50%'
- },
- [`${componentCls}-status-success`]: {
- backgroundColor: token.colorSuccess
- },
- [`${componentCls}-status-processing`]: {
- overflow: 'visible',
- color: token.colorInfo,
- backgroundColor: token.colorInfo,
- borderColor: 'currentcolor',
- '&::after': {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- width: '100%',
- height: '100%',
- borderWidth: badgeShadowSize,
- borderStyle: 'solid',
- borderColor: 'inherit',
- borderRadius: '50%',
- animationName: antStatusProcessing,
- animationDuration: token.badgeProcessingDuration,
- animationIterationCount: 'infinite',
- animationTimingFunction: 'ease-in-out',
- content: '""'
- }
- },
- [`${componentCls}-status-default`]: {
- backgroundColor: token.colorTextPlaceholder
- },
- [`${componentCls}-status-error`]: {
- backgroundColor: token.colorError
- },
- [`${componentCls}-status-warning`]: {
- backgroundColor: token.colorWarning
- },
- [`${componentCls}-status-text`]: {
- marginInlineStart: marginXS,
- color: token.colorText,
- fontSize: token.fontSize
- }
- }
- }), colorPreset), {
- [`${componentCls}-zoom-appear, ${componentCls}-zoom-enter`]: {
- animationName: antZoomBadgeIn,
- animationDuration: token.motionDurationSlow,
- animationTimingFunction: token.motionEaseOutBack,
- animationFillMode: 'both'
- },
- [`${componentCls}-zoom-leave`]: {
- animationName: antZoomBadgeOut,
- animationDuration: token.motionDurationSlow,
- animationTimingFunction: token.motionEaseOutBack,
- animationFillMode: 'both'
- },
- [`&${componentCls}-not-a-wrapper`]: {
- [`${componentCls}-zoom-appear, ${componentCls}-zoom-enter`]: {
- animationName: antNoWrapperZoomBadgeIn,
- animationDuration: token.motionDurationSlow,
- animationTimingFunction: token.motionEaseOutBack
- },
- [`${componentCls}-zoom-leave`]: {
- animationName: antNoWrapperZoomBadgeOut,
- animationDuration: token.motionDurationSlow,
- animationTimingFunction: token.motionEaseOutBack
- },
- [`&:not(${componentCls}-status)`]: {
- verticalAlign: 'middle'
- },
- [`${numberPrefixCls}-custom-component, ${componentCls}-count`]: {
- transform: 'none'
- },
- [`${numberPrefixCls}-custom-component, ${numberPrefixCls}`]: {
- position: 'relative',
- top: 'auto',
- display: 'block',
- transformOrigin: '50% 50%'
- }
- },
- [numberPrefixCls]: {
- overflow: 'hidden',
- transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack}`,
- [`${numberPrefixCls}-only`]: {
- position: 'relative',
- display: 'inline-block',
- height: indicatorHeight,
- transition: `all ${token.motionDurationSlow} ${token.motionEaseOutBack}`,
- WebkitTransformStyle: 'preserve-3d',
- WebkitBackfaceVisibility: 'hidden',
- [`> p${numberPrefixCls}-only-unit`]: {
- height: indicatorHeight,
- margin: 0,
- WebkitTransformStyle: 'preserve-3d',
- WebkitBackfaceVisibility: 'hidden'
- }
- },
- [`${numberPrefixCls}-symbol`]: {
- verticalAlign: 'top'
- }
- },
- // ====================== RTL =======================
- '&-rtl': {
- direction: 'rtl',
- [`${componentCls}-count, ${componentCls}-dot, ${numberPrefixCls}-custom-component`]: {
- transform: 'translate(-50%, -50%)'
- }
- }
- })
- };
- };
- // ============================== Export ==============================
- const prepareToken = token => {
- const {
- fontHeight,
- lineWidth,
- marginXS,
- colorBorderBg
- } = token;
- const badgeFontHeight = fontHeight;
- const badgeShadowSize = lineWidth;
- const badgeTextColor = token.colorTextLightSolid;
- const badgeColor = token.colorError;
- const badgeColorHover = token.colorErrorHover;
- const badgeToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- badgeFontHeight,
- badgeShadowSize,
- badgeTextColor,
- badgeColor,
- badgeColorHover,
- badgeShadowColor: colorBorderBg,
- badgeProcessingDuration: '1.2s',
- badgeRibbonOffset: marginXS,
- // Follow token just by Design. Not related with token
- badgeRibbonCornerTransform: 'scaleY(0.75)',
- badgeRibbonCornerFilter: `brightness(75%)`
- });
- return badgeToken;
- };
- const prepareComponentToken = token => {
- const {
- fontSize,
- lineHeight,
- fontSizeSM,
- lineWidth
- } = token;
- return {
- indicatorZIndex: 'auto',
- indicatorHeight: Math.round(fontSize * lineHeight) - 2 * lineWidth,
- indicatorHeightSM: fontSize,
- dotSize: fontSizeSM / 2,
- textFontSize: fontSizeSM,
- textFontSizeSM: fontSizeSM,
- textFontWeight: 'normal',
- statusSize: fontSizeSM / 2
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Badge', token => {
- const badgeToken = prepareToken(token);
- return genSharedBadgeStyle(badgeToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/breadcrumb/style/index.ts":
- /*!**********************************************!*\
- !*** ./components/breadcrumb/style/index.ts ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBreadcrumbStyle = token => {
- const {
- componentCls,
- iconCls,
- calc
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- color: token.itemColor,
- fontSize: token.fontSize,
- [iconCls]: {
- fontSize: token.iconFontSize
- },
- ol: {
- display: 'flex',
- flexWrap: 'wrap',
- margin: 0,
- padding: 0,
- listStyle: 'none'
- },
- a: Object.assign({
- color: token.linkColor,
- transition: `color ${token.motionDurationMid}`,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXXS)}`,
- borderRadius: token.borderRadiusSM,
- height: token.fontHeight,
- display: 'inline-block',
- marginInline: calc(token.marginXXS).mul(-1).equal(),
- '&:hover': {
- color: token.linkHoverColor,
- backgroundColor: token.colorBgTextHover
- }
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusStyle)(token)),
- 'li:last-child': {
- color: token.lastItemColor
- },
- [`${componentCls}-separator`]: {
- marginInline: token.separatorMargin,
- color: token.separatorColor
- },
- [`${componentCls}-link`]: {
- [`
- > ${iconCls} + span,
- > ${iconCls} + a
- `]: {
- marginInlineStart: token.marginXXS
- }
- },
- [`${componentCls}-overlay-link`]: {
- borderRadius: token.borderRadiusSM,
- height: token.fontHeight,
- display: 'inline-block',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXXS)}`,
- marginInline: calc(token.marginXXS).mul(-1).equal(),
- [`> ${iconCls}`]: {
- marginInlineStart: token.marginXXS,
- fontSize: token.fontSizeIcon
- },
- '&:hover': {
- color: token.linkHoverColor,
- backgroundColor: token.colorBgTextHover,
- a: {
- color: token.linkHoverColor
- }
- },
- a: {
- '&:hover': {
- backgroundColor: 'transparent'
- }
- }
- },
- // rtl style
- [`&${token.componentCls}-rtl`]: {
- direction: 'rtl'
- }
- })
- };
- };
- const prepareComponentToken = token => ({
- itemColor: token.colorTextDescription,
- lastItemColor: token.colorText,
- iconFontSize: token.fontSize,
- linkColor: token.colorTextDescription,
- linkHoverColor: token.colorText,
- separatorColor: token.colorTextDescription,
- separatorMargin: token.marginXS
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Breadcrumb', token => {
- const breadcrumbToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {});
- return genBreadcrumbStyle(breadcrumbToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/button/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/button/style/index.ts + 1 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ button_style; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/interface/presetColors.ts
- var presetColors = __webpack_require__("./components/theme/interface/presetColors.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- ;// ./components/button/style/group.ts
- const genButtonBorderStyle = (buttonTypeCls, borderColor) => ({
- // Border
- [`> span, > ${buttonTypeCls}`]: {
- '&:not(:last-child)': {
- [`&, & > ${buttonTypeCls}`]: {
- '&:not(:disabled)': {
- borderInlineEndColor: borderColor
- }
- }
- },
- '&:not(:first-child)': {
- [`&, & > ${buttonTypeCls}`]: {
- '&:not(:disabled)': {
- borderInlineStartColor: borderColor
- }
- }
- }
- }
- });
- const genGroupStyle = token => {
- const {
- componentCls,
- fontSize,
- lineWidth,
- groupBorderColor,
- colorErrorHover
- } = token;
- return {
- [`${componentCls}-group`]: [{
- position: 'relative',
- display: 'inline-flex',
- // Border
- [`> span, > ${componentCls}`]: {
- '&:not(:last-child)': {
- [`&, & > ${componentCls}`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- '&:not(:first-child)': {
- marginInlineStart: token.calc(lineWidth).mul(-1).equal(),
- [`&, & > ${componentCls}`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- }
- },
- [componentCls]: {
- position: 'relative',
- zIndex: 1,
- '&:hover, &:focus, &:active': {
- zIndex: 2
- },
- '&[disabled]': {
- zIndex: 0
- }
- },
- [`${componentCls}-icon-only`]: {
- fontSize
- }
- },
- // Border Color
- genButtonBorderStyle(`${componentCls}-primary`, groupBorderColor), genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover)]
- };
- };
- /* harmony default export */ var group = (genGroupStyle);
- // EXTERNAL MODULE: ./components/button/style/token.ts
- var style_token = __webpack_require__("./components/button/style/token.ts");
- ;// ./components/button/style/index.ts
- // ============================== Shared ==============================
- const genSharedButtonStyle = token => {
- const {
- componentCls,
- iconCls,
- fontWeight,
- opacityLoading,
- motionDurationSlow,
- motionEaseInOut,
- iconGap,
- calc
- } = token;
- return {
- [componentCls]: {
- outline: 'none',
- position: 'relative',
- display: 'inline-flex',
- gap: iconGap,
- alignItems: 'center',
- justifyContent: 'center',
- fontWeight,
- whiteSpace: 'nowrap',
- textAlign: 'center',
- backgroundImage: 'none',
- background: 'transparent',
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} transparent`,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
- userSelect: 'none',
- touchAction: 'manipulation',
- color: token.colorText,
- '&:disabled > *': {
- pointerEvents: 'none'
- },
- // https://github.com/ant-design/ant-design/issues/51380
- [`${componentCls}-icon > svg`]: (0,style.resetIcon)(),
- '> a': {
- color: 'currentColor'
- },
- '&:not(:disabled)': (0,style.genFocusStyle)(token),
- [`&${componentCls}-two-chinese-chars::first-letter`]: {
- letterSpacing: '0.34em'
- },
- [`&${componentCls}-two-chinese-chars > *:not(${iconCls})`]: {
- marginInlineEnd: '-0.34em',
- letterSpacing: '0.34em'
- },
- [`&${componentCls}-icon-only`]: {
- paddingInline: 0,
- // make `btn-icon-only` not too narrow
- [`&${componentCls}-compact-item`]: {
- flex: 'none'
- }
- },
- // Loading
- [`&${componentCls}-loading`]: {
- opacity: opacityLoading,
- cursor: 'default'
- },
- [`${componentCls}-loading-icon`]: {
- transition: ['width', 'opacity', 'margin'].map(transition => `${transition} ${motionDurationSlow} ${motionEaseInOut}`).join(',')
- },
- // iconPosition
- [`&:not(${componentCls}-icon-end)`]: {
- [`${componentCls}-loading-icon-motion`]: {
- '&-appear-start, &-enter-start': {
- marginInlineEnd: calc(iconGap).mul(-1).equal()
- },
- '&-appear-active, &-enter-active': {
- marginInlineEnd: 0
- },
- '&-leave-start': {
- marginInlineEnd: 0
- },
- '&-leave-active': {
- marginInlineEnd: calc(iconGap).mul(-1).equal()
- }
- }
- },
- '&-icon-end': {
- flexDirection: 'row-reverse',
- [`${componentCls}-loading-icon-motion`]: {
- '&-appear-start, &-enter-start': {
- marginInlineStart: calc(iconGap).mul(-1).equal()
- },
- '&-appear-active, &-enter-active': {
- marginInlineStart: 0
- },
- '&-leave-start': {
- marginInlineStart: 0
- },
- '&-leave-active': {
- marginInlineStart: calc(iconGap).mul(-1).equal()
- }
- }
- }
- }
- };
- };
- const genHoverActiveButtonStyle = (btnCls, hoverStyle, activeStyle) => ({
- [`&:not(:disabled):not(${btnCls}-disabled)`]: {
- '&:hover': hoverStyle,
- '&:active': activeStyle
- }
- });
- // ============================== Shape ===============================
- const genCircleButtonStyle = token => ({
- minWidth: token.controlHeight,
- paddingInline: 0,
- borderRadius: '50%'
- });
- const genDisabledStyle = token => ({
- cursor: 'not-allowed',
- borderColor: token.borderColorDisabled,
- color: token.colorTextDisabled,
- background: token.colorBgContainerDisabled,
- boxShadow: 'none'
- });
- const genGhostButtonStyle = (btnCls, background, textColor, borderColor, textColorDisabled, borderColorDisabled, hoverStyle, activeStyle) => ({
- [`&${btnCls}-background-ghost`]: Object.assign(Object.assign({
- color: textColor || undefined,
- background,
- borderColor: borderColor || undefined,
- boxShadow: 'none'
- }, genHoverActiveButtonStyle(btnCls, Object.assign({
- background
- }, hoverStyle), Object.assign({
- background
- }, activeStyle))), {
- '&:disabled': {
- cursor: 'not-allowed',
- color: textColorDisabled || undefined,
- borderColor: borderColorDisabled || undefined
- }
- })
- });
- const genSolidDisabledButtonStyle = token => ({
- [`&:disabled, &${token.componentCls}-disabled`]: Object.assign({}, genDisabledStyle(token))
- });
- const genPureDisabledButtonStyle = token => ({
- [`&:disabled, &${token.componentCls}-disabled`]: {
- cursor: 'not-allowed',
- color: token.colorTextDisabled
- }
- });
- // ============================== Variant =============================
- const genVariantButtonStyle = (token, hoverStyle, activeStyle, variant) => {
- const isPureDisabled = variant && ['link', 'text'].includes(variant);
- const genDisabledButtonStyle = isPureDisabled ? genPureDisabledButtonStyle : genSolidDisabledButtonStyle;
- return Object.assign(Object.assign({}, genDisabledButtonStyle(token)), genHoverActiveButtonStyle(token.componentCls, hoverStyle, activeStyle));
- };
- const genSolidButtonStyle = (token, textColor, background, hoverStyle, activeStyle) => ({
- [`&${token.componentCls}-variant-solid`]: Object.assign({
- color: textColor,
- background
- }, genVariantButtonStyle(token, hoverStyle, activeStyle))
- });
- const genOutlinedDashedButtonStyle = (token, borderColor, background, hoverStyle, activeStyle) => ({
- [`&${token.componentCls}-variant-outlined, &${token.componentCls}-variant-dashed`]: Object.assign({
- borderColor,
- background
- }, genVariantButtonStyle(token, hoverStyle, activeStyle))
- });
- const genDashedButtonStyle = token => ({
- [`&${token.componentCls}-variant-dashed`]: {
- borderStyle: 'dashed'
- }
- });
- const genFilledButtonStyle = (token, background, hoverStyle, activeStyle) => ({
- [`&${token.componentCls}-variant-filled`]: Object.assign({
- boxShadow: 'none',
- background
- }, genVariantButtonStyle(token, hoverStyle, activeStyle))
- });
- const genTextLinkButtonStyle = (token, textColor, variant, hoverStyle, activeStyle) => ({
- [`&${token.componentCls}-variant-${variant}`]: Object.assign({
- color: textColor,
- boxShadow: 'none'
- }, genVariantButtonStyle(token, hoverStyle, activeStyle, variant))
- });
- // =============================== Color ==============================
- const genPresetColorStyle = token => {
- const {
- componentCls
- } = token;
- return presetColors.PresetColors.reduce((prev, colorKey) => {
- const darkColor = token[`${colorKey}6`];
- const lightColor = token[`${colorKey}1`];
- const hoverColor = token[`${colorKey}5`];
- const lightHoverColor = token[`${colorKey}2`];
- const lightBorderColor = token[`${colorKey}3`];
- const activeColor = token[`${colorKey}7`];
- return Object.assign(Object.assign({}, prev), {
- [`&${componentCls}-color-${colorKey}`]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- color: darkColor,
- boxShadow: token[`${colorKey}ShadowColor`]
- }, genSolidButtonStyle(token, token.colorTextLightSolid, darkColor, {
- background: hoverColor
- }, {
- background: activeColor
- })), genOutlinedDashedButtonStyle(token, darkColor, token.colorBgContainer, {
- color: hoverColor,
- borderColor: hoverColor,
- background: token.colorBgContainer
- }, {
- color: activeColor,
- borderColor: activeColor,
- background: token.colorBgContainer
- })), genDashedButtonStyle(token)), genFilledButtonStyle(token, lightColor, {
- color: darkColor,
- background: lightHoverColor
- }, {
- color: darkColor,
- background: lightBorderColor
- })), genTextLinkButtonStyle(token, darkColor, 'link', {
- color: hoverColor
- }, {
- color: activeColor
- })), genTextLinkButtonStyle(token, darkColor, 'text', {
- color: hoverColor,
- background: lightColor
- }, {
- color: activeColor,
- background: lightBorderColor
- }))
- });
- }, {});
- };
- const genDefaultButtonStyle = token => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- color: token.defaultColor,
- boxShadow: token.defaultShadow
- }, genSolidButtonStyle(token, token.solidTextColor, token.colorBgSolid, {
- color: token.solidTextColor,
- background: token.colorBgSolidHover
- }, {
- color: token.solidTextColor,
- background: token.colorBgSolidActive
- })), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorFillTertiary, {
- color: token.defaultColor,
- background: token.colorFillSecondary
- }, {
- color: token.defaultColor,
- background: token.colorFill
- })), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder)), genTextLinkButtonStyle(token, token.textTextColor, 'link', {
- color: token.colorLinkHover,
- background: token.linkHoverBg
- }, {
- color: token.colorLinkActive
- }));
- const genPrimaryButtonStyle = token => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- color: token.colorPrimary,
- boxShadow: token.primaryShadow
- }, genOutlinedDashedButtonStyle(token, token.colorPrimary, token.colorBgContainer, {
- color: token.colorPrimaryTextHover,
- borderColor: token.colorPrimaryHover,
- background: token.colorBgContainer
- }, {
- color: token.colorPrimaryTextActive,
- borderColor: token.colorPrimaryActive,
- background: token.colorBgContainer
- })), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorPrimaryBg, {
- color: token.colorPrimary,
- background: token.colorPrimaryBgHover
- }, {
- color: token.colorPrimary,
- background: token.colorPrimaryBorder
- })), genTextLinkButtonStyle(token, token.colorPrimaryText, 'text', {
- color: token.colorPrimaryTextHover,
- background: token.colorPrimaryBg
- }, {
- color: token.colorPrimaryTextActive,
- background: token.colorPrimaryBorder
- })), genTextLinkButtonStyle(token, token.colorPrimaryText, 'link', {
- color: token.colorPrimaryTextHover,
- background: token.linkHoverBg
- }, {
- color: token.colorPrimaryTextActive
- })), genGhostButtonStyle(token.componentCls, token.ghostBg, token.colorPrimary, token.colorPrimary, token.colorTextDisabled, token.colorBorder, {
- color: token.colorPrimaryHover,
- borderColor: token.colorPrimaryHover
- }, {
- color: token.colorPrimaryActive,
- borderColor: token.colorPrimaryActive
- }));
- const genDangerousStyle = token => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- color: token.colorError,
- boxShadow: token.dangerShadow
- }, genSolidButtonStyle(token, token.dangerColor, token.colorError, {
- background: token.colorErrorHover
- }, {
- background: token.colorErrorActive
- })), genOutlinedDashedButtonStyle(token, token.colorError, token.colorBgContainer, {
- color: token.colorErrorHover,
- borderColor: token.colorErrorBorderHover
- }, {
- color: token.colorErrorActive,
- borderColor: token.colorErrorActive
- })), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorErrorBg, {
- color: token.colorError,
- background: token.colorErrorBgFilledHover
- }, {
- color: token.colorError,
- background: token.colorErrorBgActive
- })), genTextLinkButtonStyle(token, token.colorError, 'text', {
- color: token.colorErrorHover,
- background: token.colorErrorBg
- }, {
- color: token.colorErrorHover,
- background: token.colorErrorBgActive
- })), genTextLinkButtonStyle(token, token.colorError, 'link', {
- color: token.colorErrorHover
- }, {
- color: token.colorErrorActive
- })), genGhostButtonStyle(token.componentCls, token.ghostBg, token.colorError, token.colorError, token.colorTextDisabled, token.colorBorder, {
- color: token.colorErrorHover,
- borderColor: token.colorErrorHover
- }, {
- color: token.colorErrorActive,
- borderColor: token.colorErrorActive
- }));
- const genLinkStyle = token => Object.assign(Object.assign({}, genTextLinkButtonStyle(token, token.colorLink, 'link', {
- color: token.colorLinkHover
- }, {
- color: token.colorLinkActive
- })), genGhostButtonStyle(token.componentCls, token.ghostBg, token.colorInfo, token.colorInfo, token.colorTextDisabled, token.colorBorder, {
- color: token.colorInfoHover,
- borderColor: token.colorInfoHover
- }, {
- color: token.colorInfoActive,
- borderColor: token.colorInfoActive
- }));
- const genColorButtonStyle = token => {
- const {
- componentCls
- } = token;
- return Object.assign({
- [`${componentCls}-color-default`]: genDefaultButtonStyle(token),
- [`${componentCls}-color-primary`]: genPrimaryButtonStyle(token),
- [`${componentCls}-color-dangerous`]: genDangerousStyle(token),
- [`${componentCls}-color-link`]: genLinkStyle(token)
- }, genPresetColorStyle(token));
- };
- // =========== Compatible with versions earlier than 5.21.0 ===========
- const genCompatibleButtonStyle = token => Object.assign(Object.assign(Object.assign(Object.assign({}, genOutlinedDashedButtonStyle(token, token.defaultBorderColor, token.defaultBg, {
- color: token.defaultHoverColor,
- borderColor: token.defaultHoverBorderColor,
- background: token.defaultHoverBg
- }, {
- color: token.defaultActiveColor,
- borderColor: token.defaultActiveBorderColor,
- background: token.defaultActiveBg
- })), genTextLinkButtonStyle(token, token.textTextColor, 'text', {
- color: token.textTextHoverColor,
- background: token.textHoverBg
- }, {
- color: token.textTextActiveColor,
- background: token.colorBgTextActive
- })), genSolidButtonStyle(token, token.primaryColor, token.colorPrimary, {
- background: token.colorPrimaryHover,
- color: token.primaryColor
- }, {
- background: token.colorPrimaryActive,
- color: token.primaryColor
- })), genTextLinkButtonStyle(token, token.colorLink, 'link', {
- color: token.colorLinkHover,
- background: token.linkHoverBg
- }, {
- color: token.colorLinkActive
- }));
- // =============================== Size ===============================
- const genButtonStyle = (token, prefixCls = '') => {
- const {
- componentCls,
- controlHeight,
- fontSize,
- borderRadius,
- buttonPaddingHorizontal,
- iconCls,
- buttonPaddingVertical,
- buttonIconOnlyFontSize
- } = token;
- return [{
- [prefixCls]: {
- fontSize,
- height: controlHeight,
- padding: `${(0,cssinjs.unit)(buttonPaddingVertical)} ${(0,cssinjs.unit)(buttonPaddingHorizontal)}`,
- borderRadius,
- [`&${componentCls}-icon-only`]: {
- width: controlHeight,
- [iconCls]: {
- fontSize: buttonIconOnlyFontSize
- }
- }
- }
- },
- // Shape - patch prefixCls again to override solid border radius style
- {
- [`${componentCls}${componentCls}-circle${prefixCls}`]: genCircleButtonStyle(token)
- }, {
- [`${componentCls}${componentCls}-round${prefixCls}`]: {
- borderRadius: token.controlHeight,
- [`&:not(${componentCls}-icon-only)`]: {
- paddingInline: token.buttonPaddingHorizontal
- }
- }
- }];
- };
- const genSizeBaseButtonStyle = token => {
- const baseToken = (0,es.mergeToken)(token, {
- fontSize: token.contentFontSize
- });
- return genButtonStyle(baseToken, token.componentCls);
- };
- const genSizeSmallButtonStyle = token => {
- const smallToken = (0,es.mergeToken)(token, {
- controlHeight: token.controlHeightSM,
- fontSize: token.contentFontSizeSM,
- padding: token.paddingXS,
- buttonPaddingHorizontal: token.paddingInlineSM,
- buttonPaddingVertical: 0,
- borderRadius: token.borderRadiusSM,
- buttonIconOnlyFontSize: token.onlyIconSizeSM
- });
- return genButtonStyle(smallToken, `${token.componentCls}-sm`);
- };
- const genSizeLargeButtonStyle = token => {
- const largeToken = (0,es.mergeToken)(token, {
- controlHeight: token.controlHeightLG,
- fontSize: token.contentFontSizeLG,
- buttonPaddingHorizontal: token.paddingInlineLG,
- buttonPaddingVertical: 0,
- borderRadius: token.borderRadiusLG,
- buttonIconOnlyFontSize: token.onlyIconSizeLG
- });
- return genButtonStyle(largeToken, `${token.componentCls}-lg`);
- };
- const genBlockButtonStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- [`&${componentCls}-block`]: {
- width: '100%'
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var button_style = ((0,genStyleUtils.genStyleHooks)('Button', token => {
- const buttonToken = (0,style_token.prepareToken)(token);
- return [
- // Shared
- genSharedButtonStyle(buttonToken),
- // Size
- genSizeBaseButtonStyle(buttonToken), genSizeSmallButtonStyle(buttonToken), genSizeLargeButtonStyle(buttonToken),
- // Block
- genBlockButtonStyle(buttonToken),
- // Color
- genColorButtonStyle(buttonToken),
- // https://github.com/ant-design/ant-design/issues/50969
- genCompatibleButtonStyle(buttonToken),
- // Button Group
- group(buttonToken)];
- }, style_token.prepareComponentToken, {
- unitless: {
- fontWeight: true,
- contentLineHeight: true,
- contentLineHeightSM: true,
- contentLineHeightLG: true
- }
- }));
- /***/ }),
- /***/ "./components/button/style/token.ts":
- /*!******************************************!*\
- !*** ./components/button/style/token.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- /* harmony export */ prepareToken: function() { return /* binding */ prepareToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _color_picker_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../color-picker/color */ "./components/color-picker/color.ts");
- /* harmony import */ var _color_picker_components_ColorPresets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../color-picker/components/ColorPresets */ "./components/color-picker/components/ColorPresets.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/themes/shared/genFontSizes.ts");
- /* harmony import */ var _theme_interface__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/interface */ "./components/theme/interface/presetColors.ts");
- /* harmony import */ var _theme_util_getAlphaColor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/util/getAlphaColor */ "./components/theme/util/getAlphaColor.ts");
- const prepareToken = token => {
- const {
- paddingInline,
- onlyIconSize
- } = token;
- const buttonToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- buttonPaddingHorizontal: paddingInline,
- buttonPaddingVertical: 0,
- buttonIconOnlyFontSize: onlyIconSize
- });
- return buttonToken;
- };
- const prepareComponentToken = token => {
- var _a, _b, _c, _d, _e, _f;
- const contentFontSize = (_a = token.contentFontSize) !== null && _a !== void 0 ? _a : token.fontSize;
- const contentFontSizeSM = (_b = token.contentFontSizeSM) !== null && _b !== void 0 ? _b : token.fontSize;
- const contentFontSizeLG = (_c = token.contentFontSizeLG) !== null && _c !== void 0 ? _c : token.fontSizeLG;
- const contentLineHeight = (_d = token.contentLineHeight) !== null && _d !== void 0 ? _d : (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.getLineHeight)(contentFontSize);
- const contentLineHeightSM = (_e = token.contentLineHeightSM) !== null && _e !== void 0 ? _e : (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.getLineHeight)(contentFontSizeSM);
- const contentLineHeightLG = (_f = token.contentLineHeightLG) !== null && _f !== void 0 ? _f : (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.getLineHeight)(contentFontSizeLG);
- const solidTextColor = (0,_color_picker_components_ColorPresets__WEBPACK_IMPORTED_MODULE_2__.isBright)(new _color_picker_color__WEBPACK_IMPORTED_MODULE_1__.AggregationColor(token.colorBgSolid), '#fff') ? '#000' : '#fff';
- const shadowColorTokens = _theme_interface__WEBPACK_IMPORTED_MODULE_5__.PresetColors.reduce((prev, colorKey) => Object.assign(Object.assign({}, prev), {
- [`${colorKey}ShadowColor`]: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.controlOutlineWidth)} 0 ${(0,_theme_util_getAlphaColor__WEBPACK_IMPORTED_MODULE_6__["default"])(token[`${colorKey}1`], token.colorBgContainer)}`
- }), {});
- return Object.assign(Object.assign({}, shadowColorTokens), {
- fontWeight: 400,
- iconGap: token.marginXS,
- defaultShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`,
- primaryShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`,
- dangerShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`,
- primaryColor: token.colorTextLightSolid,
- dangerColor: token.colorTextLightSolid,
- borderColorDisabled: token.colorBorder,
- defaultGhostColor: token.colorBgContainer,
- ghostBg: 'transparent',
- defaultGhostBorderColor: token.colorBgContainer,
- paddingInline: token.paddingContentHorizontal - token.lineWidth,
- paddingInlineLG: token.paddingContentHorizontal - token.lineWidth,
- paddingInlineSM: 8 - token.lineWidth,
- onlyIconSize: 'inherit',
- onlyIconSizeSM: 'inherit',
- onlyIconSizeLG: 'inherit',
- groupBorderColor: token.colorPrimaryHover,
- linkHoverBg: 'transparent',
- textTextColor: token.colorText,
- textTextHoverColor: token.colorText,
- textTextActiveColor: token.colorText,
- textHoverBg: token.colorFillTertiary,
- defaultColor: token.colorText,
- defaultBg: token.colorBgContainer,
- defaultBorderColor: token.colorBorder,
- defaultBorderColorDisabled: token.colorBorder,
- defaultHoverBg: token.colorBgContainer,
- defaultHoverColor: token.colorPrimaryHover,
- defaultHoverBorderColor: token.colorPrimaryHover,
- defaultActiveBg: token.colorBgContainer,
- defaultActiveColor: token.colorPrimaryActive,
- defaultActiveBorderColor: token.colorPrimaryActive,
- solidTextColor,
- contentFontSize,
- contentFontSizeSM,
- contentFontSizeLG,
- contentLineHeight,
- contentLineHeightSM,
- contentLineHeightLG,
- paddingBlock: Math.max((token.controlHeight - contentFontSize * contentLineHeight) / 2 - token.lineWidth, 0),
- paddingBlockSM: Math.max((token.controlHeightSM - contentFontSizeSM * contentLineHeightSM) / 2 - token.lineWidth, 0),
- paddingBlockLG: Math.max((token.controlHeightLG - contentFontSizeLG * contentLineHeightLG) / 2 - token.lineWidth, 0)
- });
- };
- /***/ }),
- /***/ "./components/calendar/locale/en_US.ts":
- /*!*********************************************!*\
- !*** ./components/calendar/locale/en_US.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _date_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../date-picker/locale/en_US */ "./components/date-picker/locale/en_US.ts");
- /* harmony default export */ __webpack_exports__["default"] = (_date_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_0__["default"]);
- /***/ }),
- /***/ "./components/calendar/style/index.ts":
- /*!********************************************!*\
- !*** ./components/calendar/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genCalendarStyles: function() { return /* binding */ genCalendarStyles; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _date_picker_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../date-picker/style */ "./components/date-picker/style/panel.ts");
- /* harmony import */ var _date_picker_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../date-picker/style */ "./components/date-picker/style/token.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genCalendarStyles = token => {
- const {
- calendarCls,
- componentCls,
- fullBg,
- fullPanelBg,
- itemActiveBg
- } = token;
- return {
- [calendarCls]: Object.assign(Object.assign(Object.assign({}, (0,_date_picker_style__WEBPACK_IMPORTED_MODULE_1__.genPanelStyle)(token)), (0,_style__WEBPACK_IMPORTED_MODULE_3__.resetComponent)(token)), {
- background: fullBg,
- '&-rtl': {
- direction: 'rtl'
- },
- [`${calendarCls}-header`]: {
- display: 'flex',
- justifyContent: 'flex-end',
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingSM)} 0`,
- [`${calendarCls}-year-select`]: {
- minWidth: token.yearControlWidth
- },
- [`${calendarCls}-month-select`]: {
- minWidth: token.monthControlWidth,
- marginInlineStart: token.marginXS
- },
- [`${calendarCls}-mode-switch`]: {
- marginInlineStart: token.marginXS
- }
- }
- }),
- [`${calendarCls} ${componentCls}-panel`]: {
- background: fullPanelBg,
- border: 0,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- borderRadius: 0,
- [`${componentCls}-month-panel, ${componentCls}-date-panel`]: {
- width: 'auto'
- },
- [`${componentCls}-body`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)} 0`
- },
- [`${componentCls}-content`]: {
- width: '100%'
- }
- },
- [`${calendarCls}-mini`]: {
- borderRadius: token.borderRadiusLG,
- [`${calendarCls}-header`]: {
- paddingInlineEnd: token.paddingXS,
- paddingInlineStart: token.paddingXS
- },
- [`${componentCls}-panel`]: {
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)}`
- },
- [`${componentCls}-content`]: {
- height: token.miniContentHeight,
- th: {
- height: 'auto',
- padding: 0,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.weekHeight)
- }
- },
- [`${componentCls}-cell::before`]: {
- pointerEvents: 'none'
- }
- },
- [`${calendarCls}${calendarCls}-full`]: {
- [`${componentCls}-panel`]: {
- display: 'block',
- width: '100%',
- textAlign: 'end',
- background: fullBg,
- border: 0,
- [`${componentCls}-body`]: {
- 'th, td': {
- padding: 0
- },
- th: {
- height: 'auto',
- paddingInlineEnd: token.paddingSM,
- paddingBottom: token.paddingXXS,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.weekHeight)
- }
- }
- },
- [`${componentCls}-cell-week ${componentCls}-cell-inner`]: {
- display: 'block',
- borderRadius: 0,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,
- width: '100%',
- height: token.calc(token.dateValueHeight).add(token.dateContentHeight).add(token.calc(token.paddingXS).div(2)).add(token.lineWidthBold).equal()
- },
- [`${componentCls}-cell`]: {
- '&::before': {
- display: 'none'
- },
- '&:hover': {
- [`${calendarCls}-date`]: {
- background: token.controlItemBgHover
- }
- },
- [`${calendarCls}-date-today::before`]: {
- display: 'none'
- },
- // >>> Selected
- [`&-in-view${componentCls}-cell-selected`]: {
- [`${calendarCls}-date, ${calendarCls}-date-today`]: {
- background: itemActiveBg
- }
- },
- '&-selected, &-selected:hover': {
- [`${calendarCls}-date, ${calendarCls}-date-today`]: {
- [`${calendarCls}-date-value`]: {
- color: token.colorPrimary
- }
- }
- }
- },
- [`${calendarCls}-date`]: {
- display: 'block',
- width: 'auto',
- height: 'auto',
- margin: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.marginXS).div(2).equal())}`,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.paddingXS).div(2).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)} 0`,
- border: 0,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,
- borderRadius: 0,
- transition: `background ${token.motionDurationSlow}`,
- '&-value': {
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.dateValueHeight),
- transition: `color ${token.motionDurationSlow}`
- },
- '&-content': {
- position: 'static',
- width: 'auto',
- height: token.dateContentHeight,
- overflowY: 'auto',
- color: token.colorText,
- lineHeight: token.lineHeight,
- textAlign: 'start'
- },
- '&-today': {
- borderColor: token.colorPrimary,
- [`${calendarCls}-date-value`]: {
- color: token.colorText
- }
- }
- }
- },
- [`@media only screen and (max-width: ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.screenXS)}) `]: {
- [calendarCls]: {
- [`${calendarCls}-header`]: {
- display: 'block',
- [`${calendarCls}-year-select`]: {
- width: '50%'
- },
- [`${calendarCls}-month-select`]: {
- width: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)})`
- },
- [`${calendarCls}-mode-switch`]: {
- width: '100%',
- marginTop: token.marginXS,
- marginInlineStart: 0,
- '> label': {
- width: '50%',
- textAlign: 'center'
- }
- }
- }
- }
- }
- };
- };
- const prepareComponentToken = token => Object.assign({
- fullBg: token.colorBgContainer,
- fullPanelBg: token.colorBgContainer,
- itemActiveBg: token.controlItemBgActive,
- yearControlWidth: 80,
- monthControlWidth: 70,
- miniContentHeight: 256
- }, (0,_date_picker_style__WEBPACK_IMPORTED_MODULE_2__.initPanelComponentToken)(token));
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.genStyleHooks)('Calendar', token => {
- const calendarCls = `${token.componentCls}-calendar`;
- const calendarToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.mergeToken)(token, (0,_date_picker_style__WEBPACK_IMPORTED_MODULE_2__.initPickerPanelToken)(token), {
- calendarCls,
- pickerCellInnerCls: `${token.componentCls}-cell-inner`,
- dateValueHeight: token.controlHeightSM,
- weekHeight: token.calc(token.controlHeightSM).mul(0.75).equal(),
- dateContentHeight: token.calc(token.calc(token.fontHeightSM).add(token.marginXS)).mul(3).add(token.calc(token.lineWidth).mul(2)).equal()
- });
- return genCalendarStyles(calendarToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/card/style/index.ts":
- /*!****************************************!*\
- !*** ./components/card/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Styles ==============================
- // ============================== Head ==============================
- const genCardHeadStyle = token => {
- const {
- antCls,
- componentCls,
- headerHeight,
- headerPadding,
- tabsMarginBottom
- } = token;
- return Object.assign(Object.assign({
- display: 'flex',
- justifyContent: 'center',
- flexDirection: 'column',
- minHeight: headerHeight,
- marginBottom: -1,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(headerPadding)}`,
- color: token.colorTextHeading,
- fontWeight: token.fontWeightStrong,
- fontSize: token.headerFontSize,
- background: token.headerBg,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} 0 0`
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.clearFix)()), {
- '&-wrapper': {
- width: '100%',
- display: 'flex',
- alignItems: 'center'
- },
- '&-title': Object.assign(Object.assign({
- display: 'inline-block',
- flex: 1
- }, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis), {
- [`
- > ${componentCls}-typography,
- > ${componentCls}-typography-edit-content
- `]: {
- insetInlineStart: 0,
- marginTop: 0,
- marginBottom: 0
- }
- }),
- [`${antCls}-tabs-top`]: {
- clear: 'both',
- marginBottom: tabsMarginBottom,
- color: token.colorText,
- fontWeight: 'normal',
- fontSize: token.fontSize,
- '&-bar': {
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`
- }
- }
- });
- };
- // ============================== Grid ==============================
- const genCardGridStyle = token => {
- const {
- cardPaddingBase,
- colorBorderSecondary,
- cardShadow,
- lineWidth
- } = token;
- return {
- width: '33.33%',
- padding: cardPaddingBase,
- border: 0,
- borderRadius: 0,
- boxShadow: `
- ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0 0 ${colorBorderSecondary},
- 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0 ${colorBorderSecondary},
- ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0 ${colorBorderSecondary},
- ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0 0 ${colorBorderSecondary} inset,
- 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0 ${colorBorderSecondary} inset;
- `,
- transition: `all ${token.motionDurationMid}`,
- '&-hoverable:hover': {
- position: 'relative',
- zIndex: 1,
- boxShadow: cardShadow
- }
- };
- };
- // ============================== Actions ==============================
- const genCardActionsStyle = token => {
- const {
- componentCls,
- iconCls,
- actionsLiMargin,
- cardActionsIconSize,
- colorBorderSecondary,
- actionsBg
- } = token;
- return Object.assign(Object.assign({
- margin: 0,
- padding: 0,
- listStyle: 'none',
- background: actionsBg,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
- display: 'flex',
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)}`
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.clearFix)()), {
- '& > li': {
- margin: actionsLiMargin,
- color: token.colorTextDescription,
- textAlign: 'center',
- '> span': {
- position: 'relative',
- display: 'block',
- minWidth: token.calc(token.cardActionsIconSize).mul(2).equal(),
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- cursor: 'pointer',
- '&:hover': {
- color: token.colorPrimary,
- transition: `color ${token.motionDurationMid}`
- },
- [`a:not(${componentCls}-btn), > ${iconCls}`]: {
- display: 'inline-block',
- width: '100%',
- color: token.colorIcon,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.fontHeight),
- transition: `color ${token.motionDurationMid}`,
- '&:hover': {
- color: token.colorPrimary
- }
- },
- [`> ${iconCls}`]: {
- fontSize: cardActionsIconSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(cardActionsIconSize).mul(token.lineHeight).equal())
- }
- },
- '&:not(:last-child)': {
- borderInlineEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`
- }
- }
- });
- };
- // ============================== Meta ==============================
- const genCardMetaStyle = token => Object.assign(Object.assign({
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.marginXXS).mul(-1).equal())} 0`,
- display: 'flex'
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.clearFix)()), {
- '&-avatar': {
- paddingInlineEnd: token.padding
- },
- '&-detail': {
- overflow: 'hidden',
- flex: 1,
- '> div:not(:last-child)': {
- marginBottom: token.marginXS
- }
- },
- '&-title': Object.assign({
- color: token.colorTextHeading,
- fontWeight: token.fontWeightStrong,
- fontSize: token.fontSizeLG
- }, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis),
- '&-description': {
- color: token.colorTextDescription
- }
- });
- // ============================== Inner ==============================
- const genCardTypeInnerStyle = token => {
- const {
- componentCls,
- colorFillAlter,
- headerPadding,
- bodyPadding
- } = token;
- return {
- [`${componentCls}-head`]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(headerPadding)}`,
- background: colorFillAlter,
- '&-title': {
- fontSize: token.fontSize
- }
- },
- [`${componentCls}-body`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(bodyPadding)}`
- }
- };
- };
- // ============================== Loading ==============================
- const genCardLoadingStyle = token => {
- const {
- componentCls
- } = token;
- return {
- overflow: 'hidden',
- [`${componentCls}-body`]: {
- userSelect: 'none'
- }
- };
- };
- // ============================== Basic ==============================
- const genCardStyle = token => {
- const {
- componentCls,
- cardShadow,
- cardHeadPadding,
- colorBorderSecondary,
- boxShadowTertiary,
- bodyPadding,
- extraColor
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- background: token.colorBgContainer,
- borderRadius: token.borderRadiusLG,
- [`&:not(${componentCls}-bordered)`]: {
- boxShadow: boxShadowTertiary
- },
- [`${componentCls}-head`]: genCardHeadStyle(token),
- [`${componentCls}-extra`]: {
- // https://stackoverflow.com/a/22429853/3040605
- marginInlineStart: 'auto',
- color: extraColor,
- fontWeight: 'normal',
- fontSize: token.fontSize
- },
- [`${componentCls}-body`]: Object.assign({
- padding: bodyPadding,
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)}`
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.clearFix)()),
- [`${componentCls}-grid`]: genCardGridStyle(token),
- [`${componentCls}-cover`]: {
- '> *': {
- display: 'block',
- width: '100%',
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} 0 0`
- }
- },
- [`${componentCls}-actions`]: genCardActionsStyle(token),
- [`${componentCls}-meta`]: genCardMetaStyle(token)
- }),
- [`${componentCls}-bordered`]: {
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
- [`${componentCls}-cover`]: {
- marginTop: -1,
- marginInlineStart: -1,
- marginInlineEnd: -1
- }
- },
- [`${componentCls}-hoverable`]: {
- cursor: 'pointer',
- transition: `box-shadow ${token.motionDurationMid}, border-color ${token.motionDurationMid}`,
- '&:hover': {
- borderColor: 'transparent',
- boxShadow: cardShadow
- }
- },
- [`${componentCls}-contain-grid`]: {
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.borderRadiusLG)} 0 0 `,
- [`${componentCls}-body`]: {
- display: 'flex',
- flexWrap: 'wrap'
- },
- [`&:not(${componentCls}-loading) ${componentCls}-body`]: {
- marginBlockStart: token.calc(token.lineWidth).mul(-1).equal(),
- marginInlineStart: token.calc(token.lineWidth).mul(-1).equal(),
- padding: 0
- }
- },
- [`${componentCls}-contain-tabs`]: {
- [`> div${componentCls}-head`]: {
- minHeight: 0,
- [`${componentCls}-head-title, ${componentCls}-extra`]: {
- paddingTop: cardHeadPadding
- }
- }
- },
- [`${componentCls}-type-inner`]: genCardTypeInnerStyle(token),
- [`${componentCls}-loading`]: genCardLoadingStyle(token),
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- };
- };
- // ============================== Size ==============================
- const genCardSizeStyle = token => {
- const {
- componentCls,
- bodyPaddingSM,
- headerPaddingSM,
- headerHeightSM,
- headerFontSizeSM
- } = token;
- return {
- [`${componentCls}-small`]: {
- [`> ${componentCls}-head`]: {
- minHeight: headerHeightSM,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(headerPaddingSM)}`,
- fontSize: headerFontSizeSM,
- [`> ${componentCls}-head-wrapper`]: {
- [`> ${componentCls}-extra`]: {
- fontSize: token.fontSize
- }
- }
- },
- [`> ${componentCls}-body`]: {
- padding: bodyPaddingSM
- }
- },
- [`${componentCls}-small${componentCls}-contain-tabs`]: {
- [`> ${componentCls}-head`]: {
- [`${componentCls}-head-title, ${componentCls}-extra`]: {
- paddingTop: 0,
- display: 'flex',
- alignItems: 'center'
- }
- }
- }
- };
- };
- const prepareComponentToken = token => {
- var _a, _b;
- return {
- headerBg: 'transparent',
- headerFontSize: token.fontSizeLG,
- headerFontSizeSM: token.fontSize,
- headerHeight: token.fontSizeLG * token.lineHeightLG + token.padding * 2,
- headerHeightSM: token.fontSize * token.lineHeight + token.paddingXS * 2,
- actionsBg: token.colorBgContainer,
- actionsLiMargin: `${token.paddingSM}px 0`,
- tabsMarginBottom: -token.padding - token.lineWidth,
- extraColor: token.colorText,
- bodyPaddingSM: 12,
- // Fixed padding.
- headerPaddingSM: 12,
- bodyPadding: (_a = token.bodyPadding) !== null && _a !== void 0 ? _a : token.paddingLG,
- headerPadding: (_b = token.headerPadding) !== null && _b !== void 0 ? _b : token.paddingLG
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Card', token => {
- const cardToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- cardShadow: token.boxShadowCard,
- cardHeadPadding: token.padding,
- cardPaddingBase: token.paddingLG,
- cardActionsIconSize: token.fontSize
- });
- return [
- // Style
- genCardStyle(cardToken),
- // Size
- genCardSizeStyle(cardToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/carousel/style/index.ts":
- /*!********************************************!*\
- !*** ./components/carousel/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ DotDuration: function() { return /* binding */ DotDuration; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const DotDuration = '--dot-duration';
- const genCarouselStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- '.slick-slider': {
- position: 'relative',
- display: 'block',
- boxSizing: 'border-box',
- touchAction: 'pan-y',
- WebkitTouchCallout: 'none',
- WebkitTapHighlightColor: 'transparent',
- '.slick-track, .slick-list': {
- transform: 'translate3d(0, 0, 0)',
- touchAction: 'pan-y'
- }
- },
- '.slick-list': {
- position: 'relative',
- display: 'block',
- margin: 0,
- padding: 0,
- overflow: 'hidden',
- '&:focus': {
- outline: 'none'
- },
- '&.dragging': {
- cursor: 'pointer'
- },
- '.slick-slide': {
- pointerEvents: 'none',
- // https://github.com/ant-design/ant-design/issues/23294
- [`input${antCls}-radio-input, input${antCls}-checkbox-input`]: {
- visibility: 'hidden'
- },
- '&.slick-active': {
- pointerEvents: 'auto',
- [`input${antCls}-radio-input, input${antCls}-checkbox-input`]: {
- visibility: 'visible'
- }
- },
- // fix Carousel content height not match parent node
- // when children is empty node
- // https://github.com/ant-design/ant-design/issues/25878
- '> div > div': {
- verticalAlign: 'bottom'
- }
- }
- },
- '.slick-track': {
- position: 'relative',
- top: 0,
- insetInlineStart: 0,
- display: 'block',
- '&::before, &::after': {
- display: 'table',
- content: '""'
- },
- '&::after': {
- clear: 'both'
- }
- },
- '.slick-slide': {
- display: 'none',
- float: 'left',
- height: '100%',
- minHeight: 1,
- img: {
- display: 'block'
- },
- '&.dragging img': {
- pointerEvents: 'none'
- }
- },
- '.slick-initialized .slick-slide': {
- display: 'block'
- },
- '.slick-vertical .slick-slide': {
- display: 'block',
- height: 'auto'
- }
- })
- };
- };
- const genArrowsStyle = token => {
- const {
- componentCls,
- motionDurationSlow,
- arrowSize,
- arrowOffset
- } = token;
- const arrowLength = token.calc(arrowSize).div(Math.SQRT2).equal();
- return {
- [componentCls]: {
- // Arrows
- '.slick-prev, .slick-next': {
- position: 'absolute',
- top: '50%',
- width: arrowSize,
- height: arrowSize,
- transform: 'translateY(-50%)',
- color: '#fff',
- opacity: 0.4,
- background: 'transparent',
- padding: 0,
- lineHeight: 0,
- border: 0,
- outline: 'none',
- cursor: 'pointer',
- zIndex: 1,
- transition: `opacity ${motionDurationSlow}`,
- '&:hover, &:focus': {
- opacity: 1
- },
- '&.slick-disabled': {
- pointerEvents: 'none',
- opacity: 0
- },
- '&::after': {
- boxSizing: 'border-box',
- position: 'absolute',
- top: token.calc(arrowSize).sub(arrowLength).div(2).equal(),
- insetInlineStart: token.calc(arrowSize).sub(arrowLength).div(2).equal(),
- display: 'inline-block',
- width: arrowLength,
- height: arrowLength,
- border: `0 solid currentcolor`,
- borderInlineStartWidth: 2,
- borderBlockStartWidth: 2,
- borderRadius: 1,
- content: '""'
- }
- },
- '.slick-prev': {
- insetInlineStart: arrowOffset,
- '&::after': {
- transform: 'rotate(-45deg)'
- }
- },
- '.slick-next': {
- insetInlineEnd: arrowOffset,
- '&::after': {
- transform: 'rotate(135deg)'
- }
- }
- }
- };
- };
- const genDotsStyle = token => {
- const {
- componentCls,
- dotOffset,
- dotWidth,
- dotHeight,
- dotGap,
- colorBgContainer,
- motionDurationSlow
- } = token;
- return {
- [componentCls]: {
- '.slick-dots': {
- position: 'absolute',
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- zIndex: 15,
- display: 'flex !important',
- justifyContent: 'center',
- paddingInlineStart: 0,
- margin: 0,
- listStyle: 'none',
- '&-bottom': {
- bottom: dotOffset
- },
- '&-top': {
- top: dotOffset,
- bottom: 'auto'
- },
- li: {
- position: 'relative',
- display: 'inline-block',
- flex: '0 1 auto',
- boxSizing: 'content-box',
- width: dotWidth,
- height: dotHeight,
- marginInline: dotGap,
- padding: 0,
- textAlign: 'center',
- textIndent: -999,
- verticalAlign: 'top',
- transition: `all ${motionDurationSlow}`,
- borderRadius: dotHeight,
- overflow: 'hidden',
- '&::after': {
- display: 'block',
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- width: '100%',
- height: dotHeight,
- content: '""',
- background: 'transparent',
- borderRadius: dotHeight,
- opacity: 1,
- outline: 'none',
- cursor: 'pointer',
- overflow: 'hidden',
- transform: 'translate3d(-100%, 0, 0)'
- },
- button: {
- position: 'relative',
- display: 'block',
- width: '100%',
- height: dotHeight,
- padding: 0,
- color: 'transparent',
- fontSize: 0,
- background: colorBgContainer,
- border: 0,
- borderRadius: dotHeight,
- outline: 'none',
- cursor: 'pointer',
- opacity: 0.2,
- transition: `all ${motionDurationSlow}`,
- overflow: 'hidden',
- '&:hover': {
- opacity: 0.75
- },
- '&::after': {
- position: 'absolute',
- inset: token.calc(dotGap).mul(-1).equal(),
- content: '""'
- }
- },
- '&.slick-active': {
- width: token.dotActiveWidth,
- position: 'relative',
- '&:hover': {
- opacity: 1
- },
- '&::after': {
- background: colorBgContainer,
- transform: 'translate3d(0, 0, 0)',
- transition: `transform var(${DotDuration}) ease-out`
- }
- }
- }
- }
- }
- };
- };
- const genCarouselVerticalStyle = token => {
- const {
- componentCls,
- dotOffset,
- arrowOffset,
- marginXXS
- } = token;
- const reverseSizeOfDot = {
- width: token.dotHeight,
- height: token.dotWidth
- };
- return {
- [`${componentCls}-vertical`]: {
- '.slick-prev, .slick-next': {
- insetInlineStart: '50%',
- marginBlockStart: 'unset',
- transform: 'translateX(-50%)'
- },
- '.slick-prev': {
- insetBlockStart: arrowOffset,
- insetInlineStart: '50%',
- '&::after': {
- transform: 'rotate(45deg)'
- }
- },
- '.slick-next': {
- insetBlockStart: 'auto',
- insetBlockEnd: arrowOffset,
- '&::after': {
- transform: 'rotate(-135deg)'
- }
- },
- '.slick-dots': {
- top: '50%',
- bottom: 'auto',
- flexDirection: 'column',
- width: token.dotHeight,
- height: 'auto',
- margin: 0,
- transform: 'translateY(-50%)',
- '&-left': {
- insetInlineEnd: 'auto',
- insetInlineStart: dotOffset
- },
- '&-right': {
- insetInlineEnd: dotOffset,
- insetInlineStart: 'auto'
- },
- li: Object.assign(Object.assign({}, reverseSizeOfDot), {
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginXXS)} 0`,
- verticalAlign: 'baseline',
- button: reverseSizeOfDot,
- '&::after': Object.assign(Object.assign({}, reverseSizeOfDot), {
- height: 0
- }),
- '&.slick-active': Object.assign(Object.assign({}, reverseSizeOfDot), {
- button: reverseSizeOfDot,
- '&::after': Object.assign(Object.assign({}, reverseSizeOfDot), {
- transition: `height var(${DotDuration}) ease-out`
- })
- })
- })
- }
- }
- };
- };
- const genCarouselRtlStyle = token => {
- const {
- componentCls
- } = token;
- return [{
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- }, {
- [`${componentCls}-vertical`]: {
- '.slick-dots': {
- [`${componentCls}-rtl&`]: {
- flexDirection: 'column'
- }
- }
- }
- }];
- };
- const prepareComponentToken = token => {
- const dotActiveWidth = 24;
- return {
- arrowSize: 16,
- arrowOffset: token.marginXS,
- dotWidth: 16,
- dotHeight: 3,
- dotGap: token.marginXXS,
- dotOffset: 12,
- dotWidthActive: dotActiveWidth,
- dotActiveWidth
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Carousel', token => [genCarouselStyle(token), genArrowsStyle(token), genDotsStyle(token), genCarouselVerticalStyle(token), genCarouselRtlStyle(token)], prepareComponentToken, {
- deprecatedTokens: [['dotWidthActive', 'dotActiveWidth']]
- }));
- /***/ }),
- /***/ "./components/cascader/style/columns.ts":
- /*!**********************************************!*\
- !*** ./components/cascader/style/columns.ts ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _checkbox_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../checkbox/style */ "./components/checkbox/style/index.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- const getColumnsStyle = token => {
- const {
- prefixCls,
- componentCls
- } = token;
- const cascaderMenuItemCls = `${componentCls}-menu-item`;
- const iconCls = `
- &${cascaderMenuItemCls}-expand ${cascaderMenuItemCls}-expand-icon,
- ${cascaderMenuItemCls}-loading-icon
- `;
- return [
- // ==================== Checkbox ====================
- (0,_checkbox_style__WEBPACK_IMPORTED_MODULE_1__.getStyle)(`${prefixCls}-checkbox`, token), {
- [componentCls]: {
- // ================== Checkbox ==================
- '&-checkbox': {
- top: 0,
- marginInlineEnd: token.paddingXS,
- pointerEvents: 'unset'
- },
- // ==================== Menu ====================
- // >>> Menus
- '&-menus': {
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'flex-start',
- [`&${componentCls}-menu-empty`]: {
- [`${componentCls}-menu`]: {
- width: '100%',
- height: 'auto',
- [cascaderMenuItemCls]: {
- color: token.colorTextDisabled
- }
- }
- }
- },
- // >>> Menu
- '&-menu': {
- flexGrow: 1,
- flexShrink: 0,
- minWidth: token.controlItemWidth,
- height: token.dropdownHeight,
- margin: 0,
- padding: token.menuPadding,
- overflow: 'auto',
- verticalAlign: 'top',
- listStyle: 'none',
- '-ms-overflow-style': '-ms-autohiding-scrollbar',
- // https://github.com/ant-design/ant-design/issues/11857
- '&:not(:last-child)': {
- borderInlineEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- },
- '&-item': Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_2__.textEllipsis), {
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'center',
- padding: token.optionPadding,
- lineHeight: token.lineHeight,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid}`,
- borderRadius: token.borderRadiusSM,
- '&:hover': {
- background: token.controlItemBgHover
- },
- '&-disabled': {
- color: token.colorTextDisabled,
- cursor: 'not-allowed',
- '&:hover': {
- background: 'transparent'
- },
- [iconCls]: {
- color: token.colorTextDisabled
- }
- },
- [`&-active:not(${cascaderMenuItemCls}-disabled)`]: {
- '&, &:hover': {
- color: token.optionSelectedColor,
- fontWeight: token.optionSelectedFontWeight,
- backgroundColor: token.optionSelectedBg
- }
- },
- '&-content': {
- flex: 'auto'
- },
- [iconCls]: {
- marginInlineStart: token.paddingXXS,
- color: token.colorIcon,
- fontSize: token.fontSizeIcon
- },
- '&-keyword': {
- color: token.colorHighlight
- }
- })
- }
- }
- }];
- };
- /* harmony default export */ __webpack_exports__["default"] = (getColumnsStyle);
- /***/ }),
- /***/ "./components/cascader/style/index.ts":
- /*!********************************************!*\
- !*** ./components/cascader/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _style_compact_item__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style/compact-item */ "./components/style/compact-item.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _columns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./columns */ "./components/cascader/style/columns.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- return [
- // =====================================================
- // == Control ==
- // =====================================================
- {
- [componentCls]: {
- width: token.controlWidth
- }
- },
- // =====================================================
- // == Popup ==
- // =====================================================
- {
- [`${componentCls}-dropdown`]: [{
- [`&${antCls}-select-dropdown`]: {
- padding: 0
- }
- }, (0,_columns__WEBPACK_IMPORTED_MODULE_2__["default"])(token)]
- },
- // =====================================================
- // == RTL ==
- // =====================================================
- {
- [`${componentCls}-dropdown-rtl`]: {
- direction: 'rtl'
- }
- },
- // =====================================================
- // == Space Compact ==
- // =====================================================
- (0,_style_compact_item__WEBPACK_IMPORTED_MODULE_0__.genCompactItemStyle)(token)];
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const itemPaddingVertical = Math.round((token.controlHeight - token.fontSize * token.lineHeight) / 2);
- return {
- controlWidth: 184,
- controlItemWidth: 111,
- dropdownHeight: 180,
- optionSelectedBg: token.controlItemBgActive,
- optionSelectedFontWeight: token.fontWeightStrong,
- optionPadding: `${itemPaddingVertical}px ${token.paddingSM}px`,
- menuPadding: token.paddingXXS,
- optionSelectedColor: token.colorText
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.genStyleHooks)('Cascader', genBaseStyle, prepareComponentToken, {
- unitless: {
- optionSelectedFontWeight: true
- }
- }));
- /***/ }),
- /***/ "./components/checkbox/style/index.ts":
- /*!********************************************!*\
- !*** ./components/checkbox/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genCheckboxStyle: function() { return /* binding */ genCheckboxStyle; },
- /* harmony export */ getStyle: function() { return /* binding */ getStyle; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Styles ==============================
- const genCheckboxStyle = token => {
- const {
- checkboxCls
- } = token;
- const wrapperCls = `${checkboxCls}-wrapper`;
- return [
- // ===================== Basic =====================
- {
- // Group
- [`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-flex',
- flexWrap: 'wrap',
- columnGap: token.marginXS,
- // Group > Grid
- [`> ${token.antCls}-row`]: {
- flex: 1
- }
- }),
- // Wrapper
- [wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-flex',
- alignItems: 'baseline',
- cursor: 'pointer',
- // Fix checkbox & radio in flex align #30260
- '&:after': {
- display: 'inline-block',
- width: 0,
- overflow: 'hidden',
- content: "'\\a0'"
- },
- // Checkbox near checkbox
- [`& + ${wrapperCls}`]: {
- marginInlineStart: 0
- },
- [`&${wrapperCls}-in-form-item`]: {
- 'input[type="checkbox"]': {
- width: 14,
- // FIXME: magic
- height: 14 // FIXME: magic
- }
- }
- }),
- // Wrapper > Checkbox
- [checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- whiteSpace: 'nowrap',
- lineHeight: 1,
- cursor: 'pointer',
- borderRadius: token.borderRadiusSM,
- // To make alignment right when `controlHeight` is changed
- // Ref: https://github.com/ant-design/ant-design/issues/41564
- alignSelf: 'center',
- // Wrapper > Checkbox > input
- [`${checkboxCls}-input`]: {
- position: 'absolute',
- // Since baseline align will get additional space offset,
- // we need to move input to top to make it align with text.
- // Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
- inset: 0,
- zIndex: 1,
- cursor: 'pointer',
- opacity: 0,
- margin: 0,
- [`&:focus-visible + ${checkboxCls}-inner`]: (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusOutline)(token)
- },
- // Wrapper > Checkbox > inner
- [`${checkboxCls}-inner`]: {
- boxSizing: 'border-box',
- display: 'block',
- width: token.checkboxSize,
- height: token.checkboxSize,
- direction: 'ltr',
- backgroundColor: token.colorBgContainer,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderRadius: token.borderRadiusSM,
- borderCollapse: 'separate',
- transition: `all ${token.motionDurationSlow}`,
- '&:after': {
- boxSizing: 'border-box',
- position: 'absolute',
- top: '50%',
- insetInlineStart: '25%',
- display: 'table',
- width: token.calc(token.checkboxSize).div(14).mul(5).equal(),
- height: token.calc(token.checkboxSize).div(14).mul(8).equal(),
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidthBold)} solid ${token.colorWhite}`,
- borderTop: 0,
- borderInlineStart: 0,
- transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
- opacity: 0,
- content: '""',
- transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
- }
- },
- // Wrapper > Checkbox + Text
- '& + span': {
- paddingInlineStart: token.paddingXS,
- paddingInlineEnd: token.paddingXS
- }
- })
- },
- // ===================== Hover =====================
- {
- // Wrapper & Wrapper > Checkbox
- [`
- ${wrapperCls}:not(${wrapperCls}-disabled),
- ${checkboxCls}:not(${checkboxCls}-disabled)
- `]: {
- [`&:hover ${checkboxCls}-inner`]: {
- borderColor: token.colorPrimary
- }
- },
- [`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
- [`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
- backgroundColor: token.colorPrimaryHover,
- borderColor: 'transparent'
- },
- [`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
- borderColor: token.colorPrimaryHover
- }
- }
- },
- // ==================== Checked ====================
- {
- // Wrapper > Checkbox
- [`${checkboxCls}-checked`]: {
- [`${checkboxCls}-inner`]: {
- backgroundColor: token.colorPrimary,
- borderColor: token.colorPrimary,
- '&:after': {
- opacity: 1,
- transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
- transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
- }
- }
- },
- [`
- ${wrapperCls}-checked:not(${wrapperCls}-disabled),
- ${checkboxCls}-checked:not(${checkboxCls}-disabled)
- `]: {
- [`&:hover ${checkboxCls}-inner`]: {
- backgroundColor: token.colorPrimaryHover,
- borderColor: 'transparent'
- }
- }
- },
- // ================= Indeterminate =================
- {
- [checkboxCls]: {
- '&-indeterminate': {
- '&': {
- // Wrapper > Checkbox > inner
- [`${checkboxCls}-inner`]: {
- backgroundColor: `${token.colorBgContainer}`,
- borderColor: `${token.colorBorder}`,
- '&:after': {
- top: '50%',
- insetInlineStart: '50%',
- width: token.calc(token.fontSizeLG).div(2).equal(),
- height: token.calc(token.fontSizeLG).div(2).equal(),
- backgroundColor: token.colorPrimary,
- border: 0,
- transform: 'translate(-50%, -50%) scale(1)',
- opacity: 1,
- content: '""'
- }
- },
- // https://github.com/ant-design/ant-design/issues/50074
- [`&:hover ${checkboxCls}-inner`]: {
- backgroundColor: `${token.colorBgContainer}`,
- borderColor: `${token.colorPrimary}`
- }
- }
- }
- }
- },
- // ==================== Disable ====================
- {
- // Wrapper
- [`${wrapperCls}-disabled`]: {
- cursor: 'not-allowed'
- },
- // Wrapper > Checkbox
- [`${checkboxCls}-disabled`]: {
- // Wrapper > Checkbox > input
- [`&, ${checkboxCls}-input`]: {
- cursor: 'not-allowed',
- // Disabled for native input to enable Tooltip event handler
- // ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
- pointerEvents: 'none'
- },
- // Wrapper > Checkbox > inner
- [`${checkboxCls}-inner`]: {
- background: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- '&:after': {
- borderColor: token.colorTextDisabled
- }
- },
- '&:after': {
- display: 'none'
- },
- '& + span': {
- color: token.colorTextDisabled
- },
- [`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
- background: token.colorTextDisabled
- }
- }
- }];
- };
- // ============================== Export ==============================
- function getStyle(prefixCls, token) {
- const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- checkboxCls: `.${prefixCls}`,
- checkboxSize: token.controlInteractiveSize
- });
- return genCheckboxStyle(checkboxToken);
- }
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Checkbox', (token, {
- prefixCls
- }) => [getStyle(prefixCls, token)]));
- /***/ }),
- /***/ "./components/col/style/index.ts":
- /*!***************************************!*\
- !*** ./components/col/style/index.ts ***!
- \***************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- // Compatible for babel-plugin-import
- /* istanbul ignore next */
- /* harmony default export */ __webpack_exports__["default"] = ({});
- /***/ }),
- /***/ "./components/collapse/index.tsx":
- /*!***************************************************!*\
- !*** ./components/collapse/index.tsx + 7 modules ***!
- \***************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ collapse; }
- });
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules
- var RightOutlined = __webpack_require__("./node_modules/@ant-design/icons/es/icons/RightOutlined.js");
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__("./node_modules/classnames/index.js");
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
- var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js
- var useMergedState = __webpack_require__("./node_modules/rc-util/es/hooks/useMergedState.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
- var warning = __webpack_require__("./node_modules/rc-util/es/warning.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
- var toArray = __webpack_require__("./node_modules/rc-util/es/Children/toArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/rc-motion/es/index.js + 13 modules
- var es = __webpack_require__("./node_modules/rc-motion/es/index.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
- var KeyCode = __webpack_require__("./node_modules/rc-util/es/KeyCode.js");
- ;// ./node_modules/rc-collapse/es/PanelContent.js
- var PanelContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- forceRender = props.forceRender,
- className = props.className,
- style = props.style,
- children = props.children,
- isActive = props.isActive,
- role = props.role,
- customizeClassNames = props.classNames,
- styles = props.styles;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(isActive || forceRender),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- rendered = _React$useState2[0],
- setRendered = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
- if (forceRender || isActive) {
- setRendered(true);
- }
- }, [forceRender, isActive]);
- if (!rendered) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: ref,
- className: classnames_default()("".concat(prefixCls, "-content"), (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-content-active"), isActive), "".concat(prefixCls, "-content-inactive"), !isActive), className),
- style: style,
- role: role
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content-box"), customizeClassNames === null || customizeClassNames === void 0 ? void 0 : customizeClassNames.body),
- style: styles === null || styles === void 0 ? void 0 : styles.body
- }, children));
- });
- PanelContent.displayName = 'PanelContent';
- /* harmony default export */ var es_PanelContent = (PanelContent);
- ;// ./node_modules/rc-collapse/es/Panel.js
- var _excluded = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "classNames", "styles", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"];
- var CollapsePanel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
- var _props$showArrow = props.showArrow,
- showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
- headerClass = props.headerClass,
- isActive = props.isActive,
- onItemClick = props.onItemClick,
- forceRender = props.forceRender,
- className = props.className,
- _props$classNames = props.classNames,
- customizeClassNames = _props$classNames === void 0 ? {} : _props$classNames,
- _props$styles = props.styles,
- styles = _props$styles === void 0 ? {} : _props$styles,
- prefixCls = props.prefixCls,
- collapsible = props.collapsible,
- accordion = props.accordion,
- panelKey = props.panelKey,
- extra = props.extra,
- header = props.header,
- expandIcon = props.expandIcon,
- openMotion = props.openMotion,
- destroyInactivePanel = props.destroyInactivePanel,
- children = props.children,
- resetProps = (0,objectWithoutProperties["default"])(props, _excluded);
- var disabled = collapsible === 'disabled';
- var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean';
- var collapsibleProps = (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({
- onClick: function onClick() {
- onItemClick === null || onItemClick === void 0 || onItemClick(panelKey);
- },
- onKeyDown: function onKeyDown(e) {
- if (e.key === 'Enter' || e.keyCode === KeyCode["default"].ENTER || e.which === KeyCode["default"].ENTER) {
- onItemClick === null || onItemClick === void 0 || onItemClick(panelKey);
- }
- },
- role: accordion ? 'tab' : 'button'
- }, 'aria-expanded', isActive), 'aria-disabled', disabled), "tabIndex", disabled ? -1 : 0);
- // ======================== Icon ========================
- var iconNodeInner = typeof expandIcon === 'function' ? expandIcon(props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("i", {
- className: "arrow"
- });
- var iconNode = iconNodeInner && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- className: "".concat(prefixCls, "-expand-icon")
- }, ['header', 'icon'].includes(collapsible) ? collapsibleProps : {}), iconNodeInner);
- var collapsePanelClassNames = classnames_default()("".concat(prefixCls, "-item"), (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-item-active"), isActive), "".concat(prefixCls, "-item-disabled"), disabled), className);
- var headerClassName = classnames_default()(headerClass, "".concat(prefixCls, "-header"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-collapsible-").concat(collapsible), !!collapsible), customizeClassNames.header);
- // ======================== HeaderProps ========================
- var headerProps = (0,objectSpread2["default"])({
- className: headerClassName,
- style: styles.header
- }, ['header', 'icon'].includes(collapsible) ? {} : collapsibleProps);
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({}, resetProps, {
- ref: ref,
- className: collapsePanelClassNames
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", headerProps, showArrow && iconNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", (0,esm_extends["default"])({
- className: "".concat(prefixCls, "-header-text")
- }, collapsible === 'header' ? collapsibleProps : {}), header), ifExtraExist && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-extra")
- }, extra)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es["default"], (0,esm_extends["default"])({
- visible: isActive,
- leavedClassName: "".concat(prefixCls, "-content-hidden")
- }, openMotion, {
- forceRender: forceRender,
- removeOnLeave: destroyInactivePanel
- }), function (_ref, motionRef) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_PanelContent, {
- ref: motionRef,
- prefixCls: prefixCls,
- className: motionClassName,
- classNames: customizeClassNames,
- style: motionStyle,
- styles: styles,
- isActive: isActive,
- forceRender: forceRender,
- role: accordion ? 'tabpanel' : void 0
- }, children);
- }));
- });
- /* harmony default export */ var Panel = (CollapsePanel);
- ;// ./node_modules/rc-collapse/es/hooks/useItems.js
- var useItems_excluded = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"];
- var convertItemsToNodes = function convertItemsToNodes(items, props) {
- var prefixCls = props.prefixCls,
- accordion = props.accordion,
- collapsible = props.collapsible,
- destroyInactivePanel = props.destroyInactivePanel,
- onItemClick = props.onItemClick,
- activeKey = props.activeKey,
- openMotion = props.openMotion,
- expandIcon = props.expandIcon;
- return items.map(function (item, index) {
- var children = item.children,
- label = item.label,
- rawKey = item.key,
- rawCollapsible = item.collapsible,
- rawOnItemClick = item.onItemClick,
- rawDestroyInactivePanel = item.destroyInactivePanel,
- restProps = (0,objectWithoutProperties["default"])(item, useItems_excluded);
- // You may be puzzled why you want to convert them all into strings, me too.
- // Maybe: https://github.com/react-component/collapse/blob/aac303a8b6ff30e35060b4f8fecde6f4556fcbe2/src/Collapse.tsx#L15
- var key = String(rawKey !== null && rawKey !== void 0 ? rawKey : index);
- var mergeCollapsible = rawCollapsible !== null && rawCollapsible !== void 0 ? rawCollapsible : collapsible;
- var mergeDestroyInactivePanel = rawDestroyInactivePanel !== null && rawDestroyInactivePanel !== void 0 ? rawDestroyInactivePanel : destroyInactivePanel;
- var handleItemClick = function handleItemClick(value) {
- if (mergeCollapsible === 'disabled') return;
- onItemClick(value);
- rawOnItemClick === null || rawOnItemClick === void 0 || rawOnItemClick(value);
- };
- var isActive = false;
- if (accordion) {
- isActive = activeKey[0] === key;
- } else {
- isActive = activeKey.indexOf(key) > -1;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Panel, (0,esm_extends["default"])({}, restProps, {
- prefixCls: prefixCls,
- key: key,
- panelKey: key,
- isActive: isActive,
- accordion: accordion,
- openMotion: openMotion,
- expandIcon: expandIcon,
- header: label,
- collapsible: mergeCollapsible,
- onItemClick: handleItemClick,
- destroyInactivePanel: mergeDestroyInactivePanel
- }), children);
- });
- };
- /**
- * @deprecated The next major version will be removed
- */
- var getNewChild = function getNewChild(child, index, props) {
- if (!child) return null;
- var prefixCls = props.prefixCls,
- accordion = props.accordion,
- collapsible = props.collapsible,
- destroyInactivePanel = props.destroyInactivePanel,
- onItemClick = props.onItemClick,
- activeKey = props.activeKey,
- openMotion = props.openMotion,
- expandIcon = props.expandIcon;
- var key = child.key || String(index);
- var _child$props = child.props,
- header = _child$props.header,
- headerClass = _child$props.headerClass,
- childDestroyInactivePanel = _child$props.destroyInactivePanel,
- childCollapsible = _child$props.collapsible,
- childOnItemClick = _child$props.onItemClick;
- var isActive = false;
- if (accordion) {
- isActive = activeKey[0] === key;
- } else {
- isActive = activeKey.indexOf(key) > -1;
- }
- var mergeCollapsible = childCollapsible !== null && childCollapsible !== void 0 ? childCollapsible : collapsible;
- var handleItemClick = function handleItemClick(value) {
- if (mergeCollapsible === 'disabled') return;
- onItemClick(value);
- childOnItemClick === null || childOnItemClick === void 0 || childOnItemClick(value);
- };
- var childProps = {
- key: key,
- panelKey: key,
- header: header,
- headerClass: headerClass,
- isActive: isActive,
- prefixCls: prefixCls,
- destroyInactivePanel: childDestroyInactivePanel !== null && childDestroyInactivePanel !== void 0 ? childDestroyInactivePanel : destroyInactivePanel,
- openMotion: openMotion,
- accordion: accordion,
- children: child.props.children,
- onItemClick: handleItemClick,
- expandIcon: expandIcon,
- collapsible: mergeCollapsible
- };
- // https://github.com/ant-design/ant-design/issues/20479
- if (typeof child.type === 'string') {
- return child;
- }
- Object.keys(childProps).forEach(function (propName) {
- if (typeof childProps[propName] === 'undefined') {
- delete childProps[propName];
- }
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, childProps);
- };
- function useItems(items, rawChildren, props) {
- if (Array.isArray(items)) {
- return convertItemsToNodes(items, props);
- }
- return (0,toArray["default"])(rawChildren).map(function (child, index) {
- return getNewChild(child, index, props);
- });
- }
- /* harmony default export */ var hooks_useItems = (useItems);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/pickAttrs.js
- var pickAttrs = __webpack_require__("./node_modules/rc-util/es/pickAttrs.js");
- ;// ./node_modules/rc-collapse/es/Collapse.js
- function getActiveKeysArray(activeKey) {
- var currentActiveKey = activeKey;
- if (!Array.isArray(currentActiveKey)) {
- var activeKeyType = (0,esm_typeof["default"])(currentActiveKey);
- currentActiveKey = activeKeyType === 'number' || activeKeyType === 'string' ? [currentActiveKey] : [];
- }
- return currentActiveKey.map(function (key) {
- return String(key);
- });
- }
- var Collapse = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-collapse' : _props$prefixCls,
- _props$destroyInactiv = props.destroyInactivePanel,
- destroyInactivePanel = _props$destroyInactiv === void 0 ? false : _props$destroyInactiv,
- style = props.style,
- accordion = props.accordion,
- className = props.className,
- children = props.children,
- collapsible = props.collapsible,
- openMotion = props.openMotion,
- expandIcon = props.expandIcon,
- rawActiveKey = props.activeKey,
- defaultActiveKey = props.defaultActiveKey,
- _onChange = props.onChange,
- items = props.items;
- var collapseClassName = classnames_default()(prefixCls, className);
- var _useMergedState = (0,useMergedState["default"])([], {
- value: rawActiveKey,
- onChange: function onChange(v) {
- return _onChange === null || _onChange === void 0 ? void 0 : _onChange(v);
- },
- defaultValue: defaultActiveKey,
- postState: getActiveKeysArray
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- activeKey = _useMergedState2[0],
- setActiveKey = _useMergedState2[1];
- var onItemClick = function onItemClick(key) {
- return setActiveKey(function () {
- if (accordion) {
- return activeKey[0] === key ? [] : [key];
- }
- var index = activeKey.indexOf(key);
- var isActive = index > -1;
- if (isActive) {
- return activeKey.filter(function (item) {
- return item !== key;
- });
- }
- return [].concat((0,toConsumableArray["default"])(activeKey), [key]);
- });
- };
- // ======================== Children ========================
- (0,warning["default"])(!children, '[rc-collapse] `children` will be removed in next major version. Please use `items` instead.');
- var mergedChildren = hooks_useItems(items, children, {
- prefixCls: prefixCls,
- accordion: accordion,
- openMotion: openMotion,
- expandIcon: expandIcon,
- collapsible: collapsible,
- destroyInactivePanel: destroyInactivePanel,
- onItemClick: onItemClick,
- activeKey: activeKey
- });
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- ref: ref,
- className: collapseClassName,
- style: style,
- role: accordion ? 'tablist' : undefined
- }, (0,pickAttrs["default"])(props, {
- aria: true,
- data: true
- })), mergedChildren);
- });
- /* harmony default export */ var es_Collapse = (Object.assign(Collapse, {
- /**
- * @deprecated use `items` instead, will be removed in `v4.0.0`
- */
- Panel: Panel
- }));
- ;// ./node_modules/rc-collapse/es/index.js
- /* harmony default export */ var rc_collapse_es = (es_Collapse);
- /**
- * @deprecated use `items` instead, will be removed in `v4.0.0`
- */
- var es_Panel = es_Collapse.Panel;
- // EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
- var omit = __webpack_require__("./node_modules/rc-util/es/omit.js");
- // EXTERNAL MODULE: ./components/_util/motion.ts
- var motion = __webpack_require__("./components/_util/motion.ts");
- // EXTERNAL MODULE: ./components/_util/reactNode.ts
- var reactNode = __webpack_require__("./components/_util/reactNode.ts");
- // EXTERNAL MODULE: ./components/_util/warning.ts
- var _util_warning = __webpack_require__("./components/_util/warning.ts");
- // EXTERNAL MODULE: ./components/config-provider/context.ts
- var context = __webpack_require__("./components/config-provider/context.ts");
- // EXTERNAL MODULE: ./components/config-provider/hooks/useSize.ts
- var useSize = __webpack_require__("./components/config-provider/hooks/useSize.ts");
- ;// ./components/collapse/CollapsePanel.tsx
- const CollapsePanel_CollapsePanel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Collapse.Panel');
- warning.deprecated(!('disabled' in props), 'disabled', 'collapsible="disabled"');
- }
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- className,
- showArrow = true
- } = props;
- const prefixCls = getPrefixCls('collapse', customizePrefixCls);
- const collapsePanelClassName = classnames_default()({
- [`${prefixCls}-no-arrow`]: !showArrow
- }, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_collapse_es.Panel, Object.assign({
- ref: ref
- }, props, {
- prefixCls: prefixCls,
- className: collapsePanelClassName
- }));
- });
- /* harmony default export */ var collapse_CollapsePanel = (CollapsePanel_CollapsePanel);
- // EXTERNAL MODULE: ./components/collapse/style/index.ts
- var collapse_style = __webpack_require__("./components/collapse/style/index.ts");
- ;// ./components/collapse/Collapse.tsx
- const Collapse_Collapse = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- getPrefixCls,
- direction,
- expandIcon: contextExpandIcon,
- className: contextClassName,
- style: contextStyle
- } = (0,context.useComponentConfig)('collapse');
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- bordered = true,
- ghost,
- size: customizeSize,
- expandIconPosition = 'start',
- children,
- destroyInactivePanel,
- destroyOnHidden,
- expandIcon
- } = props;
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : ctx) !== null && _a !== void 0 ? _a : 'middle';
- });
- const prefixCls = getPrefixCls('collapse', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const [wrapCSSVar, hashId, cssVarCls] = (0,collapse_style["default"])(prefixCls);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Collapse');
- // Warning if use legacy type `expandIconPosition`
- true ? warning(expandIconPosition !== 'left' && expandIconPosition !== 'right', 'deprecated', '`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.') : 0;
- warning.deprecated(!('destroyInactivePanel' in props), 'destroyInactivePanel', 'destroyOnHidden');
- }
- // Align with logic position
- const mergedExpandIconPosition = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (expandIconPosition === 'left') {
- return 'start';
- }
- return expandIconPosition === 'right' ? 'end' : expandIconPosition;
- }, [expandIconPosition]);
- const mergedExpandIcon = expandIcon !== null && expandIcon !== void 0 ? expandIcon : contextExpandIcon;
- const renderExpandIcon = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback((panelProps = {}) => {
- const icon = typeof mergedExpandIcon === 'function' ? mergedExpandIcon(panelProps) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], {
- rotate: panelProps.isActive ? direction === 'rtl' ? -90 : 90 : undefined,
- "aria-label": panelProps.isActive ? 'expanded' : 'collapsed'
- }));
- return (0,reactNode.cloneElement)(icon, () => {
- var _a;
- return {
- className: classnames_default()((_a = icon.props) === null || _a === void 0 ? void 0 : _a.className, `${prefixCls}-arrow`)
- };
- });
- }, [mergedExpandIcon, prefixCls, direction]);
- const collapseClassName = classnames_default()(`${prefixCls}-icon-position-${mergedExpandIconPosition}`, {
- [`${prefixCls}-borderless`]: !bordered,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-ghost`]: !!ghost,
- [`${prefixCls}-${mergedSize}`]: mergedSize !== 'middle'
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- const openMotion = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, (0,motion["default"])(rootPrefixCls)), {
- motionAppear: false,
- leavedClassName: `${prefixCls}-content-hidden`
- }), [rootPrefixCls, prefixCls]);
- const items = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!children) {
- return null;
- }
- return (0,toArray["default"])(children).map((child, index) => {
- var _a, _b;
- const childProps = child.props;
- if (childProps === null || childProps === void 0 ? void 0 : childProps.disabled) {
- const key = (_a = child.key) !== null && _a !== void 0 ? _a : String(index);
- const mergedChildProps = Object.assign(Object.assign({}, (0,omit["default"])(child.props, ['disabled'])), {
- key,
- collapsible: (_b = childProps.collapsible) !== null && _b !== void 0 ? _b : 'disabled'
- });
- return (0,reactNode.cloneElement)(child, mergedChildProps);
- }
- return child;
- });
- }, [children]);
- return wrapCSSVar(
- /*#__PURE__*/
- // @ts-ignore
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_collapse_es, Object.assign({
- ref: ref,
- openMotion: openMotion
- }, (0,omit["default"])(props, ['rootClassName']), {
- expandIcon: renderExpandIcon,
- prefixCls: prefixCls,
- className: collapseClassName,
- style: Object.assign(Object.assign({}, contextStyle), style),
- // TODO: In the future, destroyInactivePanel in rc-collapse needs to be upgrade to destroyOnHidden
- destroyInactivePanel: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyInactivePanel
- }), items));
- });
- if (true) {
- Collapse_Collapse.displayName = 'Collapse';
- }
- /* harmony default export */ var collapse_Collapse = (Object.assign(Collapse_Collapse, {
- Panel: collapse_CollapsePanel
- }));
- ;// ./components/collapse/index.tsx
- /* harmony default export */ var collapse = (collapse_Collapse);
- /***/ }),
- /***/ "./components/collapse/style/index.ts":
- /*!********************************************!*\
- !*** ./components/collapse/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genBaseStyle: function() { return /* binding */ genBaseStyle; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/collapse.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBaseStyle = token => {
- const {
- componentCls,
- contentBg,
- padding,
- headerBg,
- headerPadding,
- collapseHeaderPaddingSM,
- collapseHeaderPaddingLG,
- collapsePanelBorderRadius,
- lineWidth,
- lineType,
- colorBorder,
- colorText,
- colorTextHeading,
- colorTextDisabled,
- fontSizeLG,
- lineHeight,
- lineHeightLG,
- marginSM,
- paddingSM,
- paddingLG,
- paddingXS,
- motionDurationSlow,
- fontSizeIcon,
- contentPadding,
- fontHeight,
- fontHeightLG
- } = token;
- const borderBase = `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorBorder}`;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- backgroundColor: headerBg,
- border: borderBase,
- borderRadius: collapsePanelBorderRadius,
- '&-rtl': {
- direction: 'rtl'
- },
- [`& > ${componentCls}-item`]: {
- borderBottom: borderBase,
- '&:first-child': {
- [`
- &,
- & > ${componentCls}-header`]: {
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)} 0 0`
- }
- },
- '&:last-child': {
- [`
- &,
- & > ${componentCls}-header`]: {
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)}`
- }
- },
- [`> ${componentCls}-header`]: Object.assign(Object.assign({
- position: 'relative',
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'flex-start',
- padding: headerPadding,
- color: colorTextHeading,
- lineHeight,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}, visibility 0s`
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusStyle)(token)), {
- [`> ${componentCls}-header-text`]: {
- flex: 'auto'
- },
- // >>>>> Arrow
- [`${componentCls}-expand-icon`]: {
- height: fontHeight,
- display: 'flex',
- alignItems: 'center',
- paddingInlineEnd: marginSM
- },
- [`${componentCls}-arrow`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetIcon)()), {
- fontSize: fontSizeIcon,
- // when `transform: rotate()` is applied to icon's root element
- transition: `transform ${motionDurationSlow}`,
- // when `transform: rotate()` is applied to icon's child element
- svg: {
- transition: `transform ${motionDurationSlow}`
- }
- }),
- // >>>>> Text
- [`${componentCls}-header-text`]: {
- marginInlineEnd: 'auto'
- }
- }),
- [`${componentCls}-collapsible-header`]: {
- cursor: 'default',
- [`${componentCls}-header-text`]: {
- flex: 'none',
- cursor: 'pointer'
- },
- [`${componentCls}-expand-icon`]: {
- cursor: 'pointer'
- }
- },
- [`${componentCls}-collapsible-icon`]: {
- cursor: 'unset',
- [`${componentCls}-expand-icon`]: {
- cursor: 'pointer'
- }
- }
- },
- [`${componentCls}-content`]: {
- color: colorText,
- backgroundColor: contentBg,
- borderTop: borderBase,
- [`& > ${componentCls}-content-box`]: {
- padding: contentPadding
- },
- '&-hidden': {
- display: 'none'
- }
- },
- '&-small': {
- [`> ${componentCls}-item`]: {
- [`> ${componentCls}-header`]: {
- padding: collapseHeaderPaddingSM,
- paddingInlineStart: paddingXS,
- [`> ${componentCls}-expand-icon`]: {
- // Arrow offset
- marginInlineStart: token.calc(paddingSM).sub(paddingXS).equal()
- }
- },
- [`> ${componentCls}-content > ${componentCls}-content-box`]: {
- padding: paddingSM
- }
- }
- },
- '&-large': {
- [`> ${componentCls}-item`]: {
- fontSize: fontSizeLG,
- lineHeight: lineHeightLG,
- [`> ${componentCls}-header`]: {
- padding: collapseHeaderPaddingLG,
- paddingInlineStart: padding,
- [`> ${componentCls}-expand-icon`]: {
- height: fontHeightLG,
- // Arrow offset
- marginInlineStart: token.calc(paddingLG).sub(padding).equal()
- }
- },
- [`> ${componentCls}-content > ${componentCls}-content-box`]: {
- padding: paddingLG
- }
- }
- },
- [`${componentCls}-item:last-child`]: {
- borderBottom: 0,
- [`> ${componentCls}-content`]: {
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(collapsePanelBorderRadius)}`
- }
- },
- [`& ${componentCls}-item-disabled > ${componentCls}-header`]: {
- [`
- &,
- & > .arrow
- `]: {
- color: colorTextDisabled,
- cursor: 'not-allowed'
- }
- },
- // ========================== Icon Position ==========================
- [`&${componentCls}-icon-position-end`]: {
- [`& > ${componentCls}-item`]: {
- [`> ${componentCls}-header`]: {
- [`${componentCls}-expand-icon`]: {
- order: 1,
- paddingInlineEnd: 0,
- paddingInlineStart: marginSM
- }
- }
- }
- }
- })
- };
- };
- const genArrowStyle = token => {
- const {
- componentCls
- } = token;
- const fixedSelector = `> ${componentCls}-item > ${componentCls}-header ${componentCls}-arrow`;
- return {
- [`${componentCls}-rtl`]: {
- [fixedSelector]: {
- transform: `rotate(180deg)`
- }
- }
- };
- };
- const genBorderlessStyle = token => {
- const {
- componentCls,
- headerBg,
- borderlessContentPadding,
- borderlessContentBg,
- colorBorder
- } = token;
- return {
- [`${componentCls}-borderless`]: {
- backgroundColor: headerBg,
- border: 0,
- [`> ${componentCls}-item`]: {
- borderBottom: `1px solid ${colorBorder}`
- },
- [`
- > ${componentCls}-item:last-child,
- > ${componentCls}-item:last-child ${componentCls}-header
- `]: {
- borderRadius: 0
- },
- [`> ${componentCls}-item:last-child`]: {
- borderBottom: 0
- },
- [`> ${componentCls}-item > ${componentCls}-content`]: {
- backgroundColor: borderlessContentBg,
- borderTop: 0
- },
- [`> ${componentCls}-item > ${componentCls}-content > ${componentCls}-content-box`]: {
- padding: borderlessContentPadding
- }
- }
- };
- };
- const genGhostStyle = token => {
- const {
- componentCls,
- paddingSM
- } = token;
- return {
- [`${componentCls}-ghost`]: {
- backgroundColor: 'transparent',
- border: 0,
- [`> ${componentCls}-item`]: {
- borderBottom: 0,
- [`> ${componentCls}-content`]: {
- backgroundColor: 'transparent',
- border: 0,
- [`> ${componentCls}-content-box`]: {
- paddingBlock: paddingSM
- }
- }
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- headerPadding: `${token.paddingSM}px ${token.padding}px`,
- headerBg: token.colorFillAlter,
- contentPadding: `${token.padding}px 16px`,
- // Fixed Value
- contentBg: token.colorBgContainer,
- borderlessContentPadding: `${token.paddingXXS}px 16px ${token.padding}px`,
- borderlessContentBg: 'transparent'
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('Collapse', token => {
- const collapseToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- collapseHeaderPaddingSM: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingSM)}`,
- collapseHeaderPaddingLG: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingLG)}`,
- collapsePanelBorderRadius: token.borderRadiusLG
- });
- return [genBaseStyle(collapseToken), genBorderlessStyle(collapseToken), genGhostStyle(collapseToken), genArrowStyle(collapseToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_2__["default"])(collapseToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/color-picker/color.ts":
- /*!******************************************!*\
- !*** ./components/color-picker/color.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ AggregationColor: function() { return /* binding */ AggregationColor; },
- /* harmony export */ toHexFormat: function() { return /* binding */ toHexFormat; }
- /* harmony export */ });
- /* unused harmony export getHex */
- /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
- /* harmony import */ var _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rc-component/color-picker */ "./node_modules/@rc-component/color-picker/es/index.js");
- const toHexFormat = (value, alpha) => (value === null || value === void 0 ? void 0 : value.replace(/[^\w/]/g, '').slice(0, alpha ? 8 : 6)) || '';
- const getHex = (value, alpha) => value ? toHexFormat(value, alpha) : '';
- let AggregationColor = /*#__PURE__*/function () {
- function AggregationColor(color) {
- (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, AggregationColor);
- var _a;
- this.cleared = false;
- // Clone from another AggregationColor
- if (color instanceof AggregationColor) {
- this.metaColor = color.metaColor.clone();
- this.colors = (_a = color.colors) === null || _a === void 0 ? void 0 : _a.map(info => ({
- color: new AggregationColor(info.color),
- percent: info.percent
- }));
- this.cleared = color.cleared;
- return;
- }
- const isArray = Array.isArray(color);
- if (isArray && color.length) {
- this.colors = color.map(({
- color: c,
- percent
- }) => ({
- color: new AggregationColor(c),
- percent
- }));
- this.metaColor = new _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_2__.Color(this.colors[0].color.metaColor);
- } else {
- this.metaColor = new _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_2__.Color(isArray ? '' : color);
- }
- if (!color || isArray && !this.colors) {
- this.metaColor = this.metaColor.setA(0);
- this.cleared = true;
- }
- }
- return (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(AggregationColor, [{
- key: "toHsb",
- value: function toHsb() {
- return this.metaColor.toHsb();
- }
- }, {
- key: "toHsbString",
- value: function toHsbString() {
- return this.metaColor.toHsbString();
- }
- }, {
- key: "toHex",
- value: function toHex() {
- return getHex(this.toHexString(), this.metaColor.a < 1);
- }
- }, {
- key: "toHexString",
- value: function toHexString() {
- return this.metaColor.toHexString();
- }
- }, {
- key: "toRgb",
- value: function toRgb() {
- return this.metaColor.toRgb();
- }
- }, {
- key: "toRgbString",
- value: function toRgbString() {
- return this.metaColor.toRgbString();
- }
- }, {
- key: "isGradient",
- value: function isGradient() {
- return !!this.colors && !this.cleared;
- }
- }, {
- key: "getColors",
- value: function getColors() {
- return this.colors || [{
- color: this,
- percent: 0
- }];
- }
- }, {
- key: "toCssString",
- value: function toCssString() {
- const {
- colors
- } = this;
- // CSS line-gradient
- if (colors) {
- const colorsStr = colors.map(c => `${c.color.toRgbString()} ${c.percent}%`).join(', ');
- return `linear-gradient(90deg, ${colorsStr})`;
- }
- return this.metaColor.toRgbString();
- }
- }, {
- key: "equals",
- value: function equals(color) {
- if (!color || this.isGradient() !== color.isGradient()) {
- return false;
- }
- if (!this.isGradient()) {
- return this.toHexString() === color.toHexString();
- }
- return this.colors.length === color.colors.length && this.colors.every((c, i) => {
- const target = color.colors[i];
- return c.percent === target.percent && c.color.equals(target.color);
- });
- }
- }]);
- }();
- /***/ }),
- /***/ "./components/color-picker/components/ColorPresets.tsx":
- /*!*************************************************************!*\
- !*** ./components/color-picker/components/ColorPresets.tsx ***!
- \*************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ isBright: function() { return /* binding */ isBright; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rc-component/color-picker */ "./node_modules/@rc-component/color-picker/es/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rc-util/es/hooks/useMergedState */ "./node_modules/rc-util/es/hooks/useMergedState.js");
- /* harmony import */ var _collapse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../collapse */ "./components/collapse/index.tsx");
- /* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../locale */ "./components/locale/useLocale.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/useToken.ts");
- /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util */ "./components/color-picker/util.ts");
- const genPresetColor = list => list.map(value => {
- value.colors = value.colors.map(_util__WEBPACK_IMPORTED_MODULE_7__.generateColor);
- return value;
- });
- const isBright = (value, bgColorToken) => {
- const {
- r,
- g,
- b,
- a
- } = value.toRgb();
- const hsv = new _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__.Color(value.toRgbString()).onBackground(bgColorToken).toHsv();
- if (a <= 0.5) {
- // Adapted to dark mode
- return hsv.v > 0.5;
- }
- return r * 0.299 + g * 0.587 + b * 0.114 > 192;
- };
- const genCollapsePanelKey = (preset, index) => {
- var _a;
- const mergedKey = (_a = preset.key) !== null && _a !== void 0 ? _a : index;
- return `panel-${mergedKey}`;
- };
- const ColorPresets = ({
- prefixCls,
- presets,
- value: color,
- onChange
- }) => {
- const [locale] = (0,_locale__WEBPACK_IMPORTED_MODULE_5__["default"])('ColorPicker');
- const [, token] = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__["default"])();
- const [presetsValue] = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_3__["default"])(genPresetColor(presets), {
- value: genPresetColor(presets),
- postState: genPresetColor
- });
- const colorPresetsPrefixCls = `${prefixCls}-presets`;
- const activeKeys = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => presetsValue.reduce((acc, preset, index) => {
- const {
- defaultOpen = true
- } = preset;
- if (defaultOpen) {
- acc.push(genCollapsePanelKey(preset, index));
- }
- return acc;
- }, []), [presetsValue]);
- const handleClick = colorValue => {
- onChange === null || onChange === void 0 ? void 0 : onChange(colorValue);
- };
- const items = presetsValue.map((preset, index) => {
- var _a;
- return {
- key: genCollapsePanelKey(preset, index),
- label: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
- className: `${colorPresetsPrefixCls}-label`
- }, preset === null || preset === void 0 ? void 0 : preset.label),
- children: (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
- className: `${colorPresetsPrefixCls}-items`
- }, Array.isArray(preset === null || preset === void 0 ? void 0 : preset.colors) && ((_a = preset.colors) === null || _a === void 0 ? void 0 : _a.length) > 0 ? preset.colors.map((presetColor, index) => (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__.ColorBlock
- // eslint-disable-next-line react/no-array-index-key
- , {
- // eslint-disable-next-line react/no-array-index-key
- key: `preset-${index}-${presetColor.toHexString()}`,
- color: (0,_util__WEBPACK_IMPORTED_MODULE_7__.generateColor)(presetColor).toRgbString(),
- prefixCls: prefixCls,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(`${colorPresetsPrefixCls}-color`, {
- [`${colorPresetsPrefixCls}-color-checked`]: presetColor.toHexString() === (color === null || color === void 0 ? void 0 : color.toHexString()),
- [`${colorPresetsPrefixCls}-color-bright`]: isBright(presetColor, token.colorBgElevated)
- }),
- onClick: () => handleClick(presetColor)
- }))) : (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
- className: `${colorPresetsPrefixCls}-empty`
- }, locale.presetEmpty))))
- };
- });
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
- className: colorPresetsPrefixCls
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_collapse__WEBPACK_IMPORTED_MODULE_4__["default"], {
- defaultActiveKey: activeKeys,
- ghost: true,
- items: items
- }));
- };
- /* harmony default export */ __webpack_exports__["default"] = (ColorPresets);
- /***/ }),
- /***/ "./components/color-picker/style/index.ts":
- /*!************************************************************!*\
- !*** ./components/color-picker/style/index.ts + 5 modules ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ style; },
- genActiveStyle: function() { return /* binding */ genActiveStyle; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/compact-item.ts
- var compact_item = __webpack_require__("./components/style/compact-item.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/color-picker/style/color-block.ts
- /**
- * @private Internal usage only
- * see: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/conic-gradient#checkerboard
- */
- const getTransBg = (size, colorFill) => ({
- backgroundImage: `conic-gradient(${colorFill} 25%, transparent 25% 50%, ${colorFill} 50% 75%, transparent 75% 100%)`,
- backgroundSize: `${size} ${size}`
- });
- const genColorBlockStyle = (token, size) => {
- const {
- componentCls,
- borderRadiusSM,
- colorPickerInsetShadow,
- lineWidth,
- colorFillSecondary
- } = token;
- return {
- [`${componentCls}-color-block`]: Object.assign(Object.assign({
- position: 'relative',
- borderRadius: borderRadiusSM,
- width: size,
- height: size,
- boxShadow: colorPickerInsetShadow,
- flex: 'none'
- }, getTransBg('50%', token.colorFillSecondary)), {
- [`${componentCls}-color-block-inner`]: {
- width: '100%',
- height: '100%',
- boxShadow: `inset 0 0 0 ${(0,cssinjs.unit)(lineWidth)} ${colorFillSecondary}`,
- borderRadius: 'inherit'
- }
- })
- };
- };
- /* harmony default export */ var color_block = (genColorBlockStyle);
- ;// ./components/color-picker/style/input.ts
- const genInputStyle = token => {
- const {
- componentCls,
- antCls,
- fontSizeSM,
- lineHeightSM,
- colorPickerAlphaInputWidth,
- marginXXS,
- paddingXXS,
- controlHeightSM,
- marginXS,
- fontSizeIcon,
- paddingXS,
- colorTextPlaceholder,
- colorPickerInputNumberHandleWidth,
- lineWidth
- } = token;
- return {
- [`${componentCls}-input-container`]: {
- display: 'flex',
- [`${componentCls}-steppers${antCls}-input-number`]: {
- fontSize: fontSizeSM,
- lineHeight: lineHeightSM,
- [`${antCls}-input-number-input`]: {
- paddingInlineStart: paddingXXS,
- paddingInlineEnd: 0
- },
- [`${antCls}-input-number-handler-wrap`]: {
- width: colorPickerInputNumberHandleWidth
- }
- },
- [`${componentCls}-steppers${componentCls}-alpha-input`]: {
- flex: `0 0 ${(0,cssinjs.unit)(colorPickerAlphaInputWidth)}`,
- marginInlineStart: marginXXS
- },
- [`${componentCls}-format-select${antCls}-select`]: {
- marginInlineEnd: marginXS,
- width: 'auto',
- '&-single': {
- [`${antCls}-select-selector`]: {
- padding: 0,
- border: 0
- },
- [`${antCls}-select-arrow`]: {
- insetInlineEnd: 0
- },
- [`${antCls}-select-selection-item`]: {
- paddingInlineEnd: token.calc(fontSizeIcon).add(marginXXS).equal(),
- fontSize: fontSizeSM,
- lineHeight: (0,cssinjs.unit)(controlHeightSM)
- },
- [`${antCls}-select-item-option-content`]: {
- fontSize: fontSizeSM,
- lineHeight: lineHeightSM
- },
- [`${antCls}-select-dropdown`]: {
- [`${antCls}-select-item`]: {
- minHeight: 'auto'
- }
- }
- }
- },
- [`${componentCls}-input`]: {
- gap: marginXXS,
- alignItems: 'center',
- flex: 1,
- width: 0,
- [`${componentCls}-hsb-input,${componentCls}-rgb-input`]: {
- display: 'flex',
- gap: marginXXS,
- alignItems: 'center'
- },
- [`${componentCls}-steppers`]: {
- flex: 1
- },
- [`${componentCls}-hex-input${antCls}-input-affix-wrapper`]: {
- flex: 1,
- padding: `0 ${(0,cssinjs.unit)(paddingXS)}`,
- [`${antCls}-input`]: {
- fontSize: fontSizeSM,
- textTransform: 'uppercase',
- lineHeight: (0,cssinjs.unit)(token.calc(controlHeightSM).sub(token.calc(lineWidth).mul(2)).equal())
- },
- [`${antCls}-input-prefix`]: {
- color: colorTextPlaceholder
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var input = (genInputStyle);
- ;// ./components/color-picker/style/picker.ts
- const genPickerStyle = token => {
- const {
- componentCls,
- controlHeightLG,
- borderRadiusSM,
- colorPickerInsetShadow,
- marginSM,
- colorBgElevated,
- colorFillSecondary,
- lineWidthBold,
- colorPickerHandlerSize
- } = token;
- return {
- userSelect: 'none',
- [`${componentCls}-select`]: {
- [`${componentCls}-palette`]: {
- minHeight: token.calc(controlHeightLG).mul(4).equal(),
- overflow: 'hidden',
- borderRadius: borderRadiusSM
- },
- [`${componentCls}-saturation`]: {
- position: 'absolute',
- borderRadius: 'inherit',
- boxShadow: colorPickerInsetShadow,
- inset: 0
- },
- marginBottom: marginSM
- },
- // ======================== Panel =========================
- [`${componentCls}-handler`]: {
- width: colorPickerHandlerSize,
- height: colorPickerHandlerSize,
- border: `${(0,cssinjs.unit)(lineWidthBold)} solid ${colorBgElevated}`,
- position: 'relative',
- borderRadius: '50%',
- cursor: 'pointer',
- boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${colorFillSecondary}`
- }
- };
- };
- /* harmony default export */ var picker = (genPickerStyle);
- ;// ./components/color-picker/style/presets.ts
- const genPresetsStyle = token => {
- const {
- componentCls,
- antCls,
- colorTextQuaternary,
- paddingXXS,
- colorPickerPresetColorSize,
- fontSizeSM,
- colorText,
- lineHeightSM,
- lineWidth,
- borderRadius,
- colorFill,
- colorWhite,
- marginXXS,
- paddingXS,
- fontHeightSM
- } = token;
- return {
- [`${componentCls}-presets`]: {
- [`${antCls}-collapse-item > ${antCls}-collapse-header`]: {
- padding: 0,
- [`${antCls}-collapse-expand-icon`]: {
- height: fontHeightSM,
- color: colorTextQuaternary,
- paddingInlineEnd: paddingXXS
- }
- },
- [`${antCls}-collapse`]: {
- display: 'flex',
- flexDirection: 'column',
- gap: marginXXS
- },
- [`${antCls}-collapse-item > ${antCls}-collapse-content > ${antCls}-collapse-content-box`]: {
- padding: `${(0,cssinjs.unit)(paddingXS)} 0`
- },
- '&-label': {
- fontSize: fontSizeSM,
- color: colorText,
- lineHeight: lineHeightSM
- },
- '&-items': {
- display: 'flex',
- flexWrap: 'wrap',
- gap: token.calc(marginXXS).mul(1.5).equal(),
- [`${componentCls}-presets-color`]: {
- position: 'relative',
- cursor: 'pointer',
- width: colorPickerPresetColorSize,
- height: colorPickerPresetColorSize,
- '&::before': {
- content: '""',
- pointerEvents: 'none',
- width: token.calc(colorPickerPresetColorSize).add(token.calc(lineWidth).mul(4)).equal(),
- height: token.calc(colorPickerPresetColorSize).add(token.calc(lineWidth).mul(4)).equal(),
- position: 'absolute',
- top: token.calc(lineWidth).mul(-2).equal(),
- insetInlineStart: token.calc(lineWidth).mul(-2).equal(),
- borderRadius,
- border: `${(0,cssinjs.unit)(lineWidth)} solid transparent`,
- transition: `border-color ${token.motionDurationMid} ${token.motionEaseInBack}`
- },
- '&:hover::before': {
- borderColor: colorFill
- },
- '&::after': {
- boxSizing: 'border-box',
- position: 'absolute',
- top: '50%',
- insetInlineStart: '21.5%',
- display: 'table',
- width: token.calc(colorPickerPresetColorSize).div(13).mul(5).equal(),
- height: token.calc(colorPickerPresetColorSize).div(13).mul(8).equal(),
- border: `${(0,cssinjs.unit)(token.lineWidthBold)} solid ${token.colorWhite}`,
- borderTop: 0,
- borderInlineStart: 0,
- transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
- opacity: 0,
- content: '""',
- transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
- },
- [`&${componentCls}-presets-color-checked`]: {
- '&::after': {
- opacity: 1,
- borderColor: colorWhite,
- transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
- transition: `transform ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
- },
- [`&${componentCls}-presets-color-bright`]: {
- '&::after': {
- borderColor: 'rgba(0, 0, 0, 0.45)'
- }
- }
- }
- }
- },
- '&-empty': {
- fontSize: fontSizeSM,
- color: colorTextQuaternary
- }
- }
- };
- };
- /* harmony default export */ var presets = (genPresetsStyle);
- ;// ./components/color-picker/style/slider.ts
- const genSliderStyle = token => {
- const {
- componentCls,
- colorPickerInsetShadow,
- colorBgElevated,
- colorFillSecondary,
- lineWidthBold,
- colorPickerHandlerSizeSM,
- colorPickerSliderHeight,
- marginSM,
- marginXS
- } = token;
- const handleInnerSize = token.calc(colorPickerHandlerSizeSM).sub(token.calc(lineWidthBold).mul(2).equal()).equal();
- const handleHoverSize = token.calc(colorPickerHandlerSizeSM).add(token.calc(lineWidthBold).mul(2).equal()).equal();
- const activeHandleStyle = {
- '&:after': {
- transform: 'scale(1)',
- boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${token.colorPrimaryActive}`
- }
- };
- return {
- // ======================== Slider ========================
- [`${componentCls}-slider`]: [getTransBg((0,cssinjs.unit)(colorPickerSliderHeight), token.colorFillSecondary), {
- margin: 0,
- padding: 0,
- height: colorPickerSliderHeight,
- borderRadius: token.calc(colorPickerSliderHeight).div(2).equal(),
- '&-rail': {
- height: colorPickerSliderHeight,
- borderRadius: token.calc(colorPickerSliderHeight).div(2).equal(),
- boxShadow: colorPickerInsetShadow
- },
- [`& ${componentCls}-slider-handle`]: {
- width: handleInnerSize,
- height: handleInnerSize,
- top: 0,
- borderRadius: '100%',
- '&:before': {
- display: 'block',
- position: 'absolute',
- background: 'transparent',
- left: {
- _skip_check_: true,
- value: '50%'
- },
- top: '50%',
- transform: 'translate(-50%, -50%)',
- width: handleHoverSize,
- height: handleHoverSize,
- borderRadius: '100%'
- },
- '&:after': {
- width: colorPickerHandlerSizeSM,
- height: colorPickerHandlerSizeSM,
- border: `${(0,cssinjs.unit)(lineWidthBold)} solid ${colorBgElevated}`,
- boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${colorFillSecondary}`,
- outline: 'none',
- insetInlineStart: token.calc(lineWidthBold).mul(-1).equal(),
- top: token.calc(lineWidthBold).mul(-1).equal(),
- background: 'transparent',
- transition: 'none'
- },
- '&:focus': activeHandleStyle
- }
- }],
- // ======================== Layout ========================
- [`${componentCls}-slider-container`]: {
- display: 'flex',
- gap: marginSM,
- marginBottom: marginSM,
- // Group
- [`${componentCls}-slider-group`]: {
- flex: 1,
- flexDirection: 'column',
- justifyContent: 'space-between',
- display: 'flex',
- '&-disabled-alpha': {
- justifyContent: 'center'
- }
- }
- },
- [`${componentCls}-gradient-slider`]: {
- marginBottom: marginXS,
- [`& ${componentCls}-slider-handle`]: {
- '&:after': {
- transform: 'scale(0.8)'
- },
- '&-active, &:focus': activeHandleStyle
- }
- }
- };
- };
- /* harmony default export */ var slider = (genSliderStyle);
- ;// ./components/color-picker/style/index.ts
- const genActiveStyle = (token, borderColor, outlineColor) => ({
- borderInlineEndWidth: token.lineWidth,
- borderColor,
- boxShadow: `0 0 0 ${(0,cssinjs.unit)(token.controlOutlineWidth)} ${outlineColor}`,
- outline: 0
- });
- const genRtlStyle = token => {
- const {
- componentCls
- } = token;
- return {
- '&-rtl': {
- [`${componentCls}-presets-color`]: {
- '&::after': {
- direction: 'ltr'
- }
- },
- [`${componentCls}-clear`]: {
- '&::after': {
- direction: 'ltr'
- }
- }
- }
- };
- };
- const genClearStyle = (token, size, extraStyle) => {
- const {
- componentCls,
- borderRadiusSM,
- lineWidth,
- colorSplit,
- colorBorder,
- red6
- } = token;
- return {
- [`${componentCls}-clear`]: Object.assign(Object.assign({
- width: size,
- height: size,
- borderRadius: borderRadiusSM,
- border: `${(0,cssinjs.unit)(lineWidth)} solid ${colorSplit}`,
- position: 'relative',
- overflow: 'hidden',
- cursor: 'inherit',
- transition: `all ${token.motionDurationFast}`
- }, extraStyle), {
- '&::after': {
- content: '""',
- position: 'absolute',
- insetInlineEnd: token.calc(lineWidth).mul(-1).equal(),
- top: token.calc(lineWidth).mul(-1).equal(),
- display: 'block',
- width: 40,
- // maximum
- height: 2,
- // fixed
- transformOrigin: `calc(100% - 1px) 1px`,
- transform: 'rotate(-45deg)',
- backgroundColor: red6
- },
- '&:hover': {
- borderColor: colorBorder
- }
- })
- };
- };
- const genStatusStyle = token => {
- const {
- componentCls,
- colorError,
- colorWarning,
- colorErrorHover,
- colorWarningHover,
- colorErrorOutline,
- colorWarningOutline
- } = token;
- return {
- [`&${componentCls}-status-error`]: {
- borderColor: colorError,
- '&:hover': {
- borderColor: colorErrorHover
- },
- [`&${componentCls}-trigger-active`]: Object.assign({}, genActiveStyle(token, colorError, colorErrorOutline))
- },
- [`&${componentCls}-status-warning`]: {
- borderColor: colorWarning,
- '&:hover': {
- borderColor: colorWarningHover
- },
- [`&${componentCls}-trigger-active`]: Object.assign({}, genActiveStyle(token, colorWarning, colorWarningOutline))
- }
- };
- };
- const genSizeStyle = token => {
- const {
- componentCls,
- controlHeightLG,
- controlHeightSM,
- controlHeight,
- controlHeightXS,
- borderRadius,
- borderRadiusSM,
- borderRadiusXS,
- borderRadiusLG,
- fontSizeLG
- } = token;
- return {
- [`&${componentCls}-lg`]: {
- minWidth: controlHeightLG,
- minHeight: controlHeightLG,
- borderRadius: borderRadiusLG,
- [`${componentCls}-color-block, ${componentCls}-clear`]: {
- width: controlHeight,
- height: controlHeight,
- borderRadius
- },
- [`${componentCls}-trigger-text`]: {
- fontSize: fontSizeLG
- }
- },
- [`&${componentCls}-sm`]: {
- minWidth: controlHeightSM,
- minHeight: controlHeightSM,
- borderRadius: borderRadiusSM,
- [`${componentCls}-color-block, ${componentCls}-clear`]: {
- width: controlHeightXS,
- height: controlHeightXS,
- borderRadius: borderRadiusXS
- },
- [`${componentCls}-trigger-text`]: {
- lineHeight: (0,cssinjs.unit)(controlHeightXS)
- }
- }
- };
- };
- const genColorPickerStyle = token => {
- const {
- antCls,
- componentCls,
- colorPickerWidth,
- colorPrimary,
- motionDurationMid,
- colorBgElevated,
- colorTextDisabled,
- colorText,
- colorBgContainerDisabled,
- borderRadius,
- marginXS,
- marginSM,
- controlHeight,
- controlHeightSM,
- colorBgTextActive,
- colorPickerPresetColorSize,
- colorPickerPreviewSize,
- lineWidth,
- colorBorder,
- paddingXXS,
- fontSize,
- colorPrimaryHover,
- controlOutline
- } = token;
- return [{
- [componentCls]: Object.assign({
- [`${componentCls}-inner`]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- '&-content': {
- display: 'flex',
- flexDirection: 'column',
- width: colorPickerWidth,
- [`& > ${antCls}-divider`]: {
- margin: `${(0,cssinjs.unit)(marginSM)} 0 ${(0,cssinjs.unit)(marginXS)}`
- }
- },
- [`${componentCls}-panel`]: Object.assign({}, picker(token))
- }, slider(token)), color_block(token, colorPickerPreviewSize)), input(token)), presets(token)), genClearStyle(token, colorPickerPresetColorSize, {
- marginInlineStart: 'auto'
- })), {
- // Operation bar
- [`${componentCls}-operation`]: {
- display: 'flex',
- justifyContent: 'space-between',
- marginBottom: marginXS
- }
- }),
- '&-trigger': Object.assign(Object.assign(Object.assign(Object.assign({
- minWidth: controlHeight,
- minHeight: controlHeight,
- borderRadius,
- border: `${(0,cssinjs.unit)(lineWidth)} solid ${colorBorder}`,
- cursor: 'pointer',
- display: 'inline-flex',
- alignItems: 'flex-start',
- justifyContent: 'center',
- transition: `all ${motionDurationMid}`,
- background: colorBgElevated,
- padding: token.calc(paddingXXS).sub(lineWidth).equal(),
- [`${componentCls}-trigger-text`]: {
- marginInlineStart: marginXS,
- marginInlineEnd: token.calc(marginXS).sub(token.calc(paddingXXS).sub(lineWidth)).equal(),
- fontSize,
- color: colorText,
- alignSelf: 'center',
- '&-cell': {
- '&:not(:last-child):after': {
- content: '", "'
- },
- '&-inactive': {
- color: colorTextDisabled
- }
- }
- },
- '&:hover': {
- borderColor: colorPrimaryHover
- },
- [`&${componentCls}-trigger-active`]: Object.assign({}, genActiveStyle(token, colorPrimary, controlOutline)),
- '&-disabled': {
- color: colorTextDisabled,
- background: colorBgContainerDisabled,
- cursor: 'not-allowed',
- '&:hover': {
- borderColor: colorBgTextActive
- },
- [`${componentCls}-trigger-text`]: {
- color: colorTextDisabled
- }
- }
- }, genClearStyle(token, controlHeightSM)), color_block(token, controlHeightSM)), genStatusStyle(token)), genSizeStyle(token))
- }, genRtlStyle(token))
- }, (0,compact_item.genCompactItemStyle)(token, {
- focusElCls: `${componentCls}-trigger-active`
- })];
- };
- /* harmony default export */ var style = ((0,genStyleUtils.genStyleHooks)('ColorPicker', token => {
- const {
- colorTextQuaternary,
- marginSM
- } = token;
- const colorPickerSliderHeight = 8;
- const colorPickerToken = (0,es.mergeToken)(token, {
- colorPickerWidth: 234,
- colorPickerHandlerSize: 16,
- colorPickerHandlerSizeSM: 12,
- colorPickerAlphaInputWidth: 44,
- colorPickerInputNumberHandleWidth: 16,
- colorPickerPresetColorSize: 24,
- colorPickerInsetShadow: `inset 0 0 1px 0 ${colorTextQuaternary}`,
- colorPickerSliderHeight,
- colorPickerPreviewSize: token.calc(colorPickerSliderHeight).mul(2).add(marginSM).equal()
- });
- return genColorPickerStyle(colorPickerToken);
- }));
- /***/ }),
- /***/ "./components/color-picker/util.ts":
- /*!*****************************************!*\
- !*** ./components/color-picker/util.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genAlphaColor: function() { return /* binding */ genAlphaColor; },
- /* harmony export */ generateColor: function() { return /* binding */ generateColor; },
- /* harmony export */ getColorAlpha: function() { return /* binding */ getColorAlpha; },
- /* harmony export */ getGradientPercentColor: function() { return /* binding */ getGradientPercentColor; },
- /* harmony export */ getRoundNumber: function() { return /* binding */ getRoundNumber; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- /* harmony import */ var _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rc-component/color-picker */ "./node_modules/@rc-component/color-picker/es/index.js");
- /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./color */ "./components/color-picker/color.ts");
- const generateColor = color => {
- if (color instanceof _color__WEBPACK_IMPORTED_MODULE_2__.AggregationColor) {
- return color;
- }
- return new _color__WEBPACK_IMPORTED_MODULE_2__.AggregationColor(color);
- };
- const getRoundNumber = value => Math.round(Number(value || 0));
- const getColorAlpha = color => getRoundNumber(color.toHsb().a * 100);
- /** Return the color whose `alpha` is 1 */
- const genAlphaColor = (color, alpha) => {
- const rgba = color.toRgb();
- // Color from hsb input may get `rgb` is (0/0/0) when `hsb.b` is 0
- // So if rgb is empty, we should get from hsb
- if (!rgba.r && !rgba.g && !rgba.b) {
- const hsba = color.toHsb();
- hsba.a = alpha || 1;
- return generateColor(hsba);
- }
- rgba.a = alpha || 1;
- return generateColor(rgba);
- };
- /**
- * Get percent position color. e.g. [10%-#fff, 20%-#000], 15% => #888
- */
- const getGradientPercentColor = (colors, percent) => {
- const filledColors = [{
- percent: 0,
- color: colors[0].color
- }].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(colors), [{
- percent: 100,
- color: colors[colors.length - 1].color
- }]);
- for (let i = 0; i < filledColors.length - 1; i += 1) {
- const startPtg = filledColors[i].percent;
- const endPtg = filledColors[i + 1].percent;
- const startColor = filledColors[i].color;
- const endColor = filledColors[i + 1].color;
- if (startPtg <= percent && percent <= endPtg) {
- const dist = endPtg - startPtg;
- if (dist === 0) {
- return startColor;
- }
- const ratio = (percent - startPtg) / dist * 100;
- const startRcColor = new _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__.Color(startColor);
- const endRcColor = new _rc_component_color_picker__WEBPACK_IMPORTED_MODULE_1__.Color(endColor);
- return startRcColor.mix(endRcColor, ratio).toRgbString();
- }
- }
- // This will never reach
- /* istanbul ignore next */
- return '';
- };
- /***/ }),
- /***/ "./components/config-provider/SizeContext.tsx":
- /*!****************************************************!*\
- !*** ./components/config-provider/SizeContext.tsx ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ SizeContextProvider: function() { return /* binding */ SizeContextProvider; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- const SizeContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(undefined);
- const SizeContextProvider = ({
- children,
- size
- }) => {
- const originSize = react__WEBPACK_IMPORTED_MODULE_0__.useContext(SizeContext);
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(SizeContext.Provider, {
- value: size || originSize
- }, children);
- };
- /* harmony default export */ __webpack_exports__["default"] = (SizeContext);
- /***/ }),
- /***/ "./components/config-provider/context.ts":
- /*!***********************************************!*\
- !*** ./components/config-provider/context.ts ***!
- \***********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ ConfigContext: function() { return /* binding */ ConfigContext; },
- /* harmony export */ Variants: function() { return /* binding */ Variants; },
- /* harmony export */ defaultIconPrefixCls: function() { return /* binding */ defaultIconPrefixCls; },
- /* harmony export */ defaultPrefixCls: function() { return /* binding */ defaultPrefixCls; },
- /* harmony export */ useComponentConfig: function() { return /* binding */ useComponentConfig; }
- /* harmony export */ });
- /* unused harmony export ConfigConsumer */
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- const defaultPrefixCls = 'ant';
- const defaultIconPrefixCls = 'anticon';
- const Variants = ['outlined', 'borderless', 'filled', 'underlined'];
- const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
- if (customizePrefixCls) {
- return customizePrefixCls;
- }
- return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
- };
- // zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will cause circular dependency.
- const ConfigContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({
- // We provide a default function for Context without provider
- getPrefixCls: defaultGetPrefixCls,
- iconPrefixCls: defaultIconPrefixCls
- });
- const {
- Consumer: ConfigConsumer
- } = ConfigContext;
- const EMPTY_OBJECT = {};
- /**
- * Get ConfigProvider configured component props.
- * This help to reduce bundle size for saving `?.` operator.
- * Do not use as `useMemo` deps since we do not cache the object here.
- *
- * NOTE: not refactor this with `useMemo` since memo will cost another memory space,
- * which will waste both compare calculation & memory.
- */
- function useComponentConfig(propName) {
- const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ConfigContext);
- const {
- getPrefixCls,
- direction,
- getPopupContainer
- } = context;
- const propValue = context[propName];
- return Object.assign(Object.assign({
- classNames: EMPTY_OBJECT,
- styles: EMPTY_OBJECT
- }, propValue), {
- getPrefixCls,
- direction,
- getPopupContainer
- });
- }
- /***/ }),
- /***/ "./components/config-provider/hooks/useSize.ts":
- /*!*****************************************************!*\
- !*** ./components/config-provider/hooks/useSize.ts ***!
- \*****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _SizeContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SizeContext */ "./components/config-provider/SizeContext.tsx");
- const useSize = customSize => {
- const size = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(_SizeContext__WEBPACK_IMPORTED_MODULE_1__["default"]);
- const mergedSize = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
- if (!customSize) {
- return size;
- }
- if (typeof customSize === 'string') {
- return customSize !== null && customSize !== void 0 ? customSize : size;
- }
- if (typeof customSize === 'function') {
- return customSize(size);
- }
- return size;
- }, [customSize, size]);
- return mergedSize;
- };
- /* harmony default export */ __webpack_exports__["default"] = (useSize);
- /***/ }),
- /***/ "./components/config-provider/style/index.ts":
- /*!***************************************************!*\
- !*** ./components/config-provider/style/index.ts ***!
- \***************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* reexport safe */ _theme_internal__WEBPACK_IMPORTED_MODULE_0__["default"]; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/useResetIconStyle.ts");
- /***/ }),
- /***/ "./components/date-picker/locale/en_US.ts":
- /*!************************************************************!*\
- !*** ./components/date-picker/locale/en_US.ts + 1 modules ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ date_picker_locale_en_US; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/rc-picker/es/locale/common.js
- var common = __webpack_require__("./node_modules/rc-picker/es/locale/common.js");
- ;// ./node_modules/rc-picker/es/locale/en_US.js
- var locale = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, common.commonLocale), {}, {
- locale: 'en_US',
- today: 'Today',
- now: 'Now',
- backToToday: 'Back to today',
- ok: 'OK',
- clear: 'Clear',
- week: 'Week',
- month: 'Month',
- year: 'Year',
- timeSelect: 'select time',
- dateSelect: 'select date',
- weekSelect: 'Choose a week',
- monthSelect: 'Choose a month',
- yearSelect: 'Choose a year',
- decadeSelect: 'Choose a decade',
- dateFormat: 'M/D/YYYY',
- dateTimeFormat: 'M/D/YYYY HH:mm:ss',
- previousMonth: 'Previous month (PageUp)',
- nextMonth: 'Next month (PageDown)',
- previousYear: 'Last year (Control + left)',
- nextYear: 'Next year (Control + right)',
- previousDecade: 'Last decade',
- nextDecade: 'Next decade',
- previousCentury: 'Last century',
- nextCentury: 'Next century'
- });
- /* harmony default export */ var en_US = (locale);
- // EXTERNAL MODULE: ./components/time-picker/locale/en_US.ts
- var locale_en_US = __webpack_require__("./components/time-picker/locale/en_US.ts");
- ;// ./components/date-picker/locale/en_US.ts
- // Merge into a locale object
- const en_US_locale = {
- lang: Object.assign({
- placeholder: 'Select date',
- yearPlaceholder: 'Select year',
- quarterPlaceholder: 'Select quarter',
- monthPlaceholder: 'Select month',
- weekPlaceholder: 'Select week',
- rangePlaceholder: ['Start date', 'End date'],
- rangeYearPlaceholder: ['Start year', 'End year'],
- rangeQuarterPlaceholder: ['Start quarter', 'End quarter'],
- rangeMonthPlaceholder: ['Start month', 'End month'],
- rangeWeekPlaceholder: ['Start week', 'End week']
- }, en_US),
- timePickerLocale: Object.assign({}, locale_en_US["default"])
- };
- // All settings at:
- // https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
- /* harmony default export */ var date_picker_locale_en_US = (en_US_locale);
- /***/ }),
- /***/ "./components/date-picker/style/index.ts":
- /*!***********************************************************!*\
- !*** ./components/date-picker/style/index.ts + 2 modules ***!
- \***********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ date_picker_style; },
- genPanelStyle: function() { return /* reexport */ panel.genPanelStyle; },
- initPanelComponentToken: function() { return /* reexport */ date_picker_style_token.initPanelComponentToken; },
- initPickerPanelToken: function() { return /* reexport */ date_picker_style_token.initPickerPanelToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/input/style/index.ts
- var style = __webpack_require__("./components/input/style/index.ts");
- // EXTERNAL MODULE: ./components/input/style/token.ts
- var style_token = __webpack_require__("./components/input/style/token.ts");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var components_style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/compact-item.ts
- var compact_item = __webpack_require__("./components/style/compact-item.ts");
- // EXTERNAL MODULE: ./components/style/motion/slide.ts
- var slide = __webpack_require__("./components/style/motion/slide.ts");
- // EXTERNAL MODULE: ./components/style/motion/move.ts
- var move = __webpack_require__("./components/style/motion/move.ts");
- // EXTERNAL MODULE: ./components/style/roundedArrow.ts
- var roundedArrow = __webpack_require__("./components/style/roundedArrow.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/select/style/multiple.ts
- var multiple = __webpack_require__("./components/select/style/multiple.ts");
- ;// ./components/date-picker/style/multiple.ts
- const genSize = (token, suffix) => {
- const {
- componentCls,
- controlHeight
- } = token;
- const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
- const multipleSelectorUnit = (0,multiple.getMultipleSelectorUnit)(token);
- return [
- // genSelectionStyle(token, suffix),
- {
- [`${componentCls}-multiple${suffixCls}`]: {
- paddingBlock: multipleSelectorUnit.containerPadding,
- paddingInlineStart: multipleSelectorUnit.basePadding,
- minHeight: controlHeight,
- // ======================== Selections ========================
- [`${componentCls}-selection-item`]: {
- height: multipleSelectorUnit.itemHeight,
- lineHeight: (0,cssinjs.unit)(multipleSelectorUnit.itemLineHeight)
- }
- }
- }];
- };
- const genPickerMultipleStyle = token => {
- const {
- componentCls,
- calc,
- lineWidth
- } = token;
- const smallToken = (0,es.mergeToken)(token, {
- fontHeight: token.fontSize,
- selectHeight: token.controlHeightSM,
- multipleSelectItemHeight: token.multipleItemHeightSM,
- borderRadius: token.borderRadiusSM,
- borderRadiusSM: token.borderRadiusXS,
- controlHeight: token.controlHeightSM
- });
- const largeToken = (0,es.mergeToken)(token, {
- fontHeight: calc(token.multipleItemHeightLG).sub(calc(lineWidth).mul(2).equal()).equal(),
- fontSize: token.fontSizeLG,
- selectHeight: token.controlHeightLG,
- multipleSelectItemHeight: token.multipleItemHeightLG,
- borderRadius: token.borderRadiusLG,
- borderRadiusSM: token.borderRadius,
- controlHeight: token.controlHeightLG
- });
- return [
- // ======================== Size ========================
- genSize(smallToken, 'small'), genSize(token), genSize(largeToken, 'large'),
- // ====================== Selection ======================
- {
- [`${componentCls}${componentCls}-multiple`]: Object.assign(Object.assign({
- width: '100%',
- cursor: 'text',
- // ==================== Selector =====================
- [`${componentCls}-selector`]: {
- flex: 'auto',
- padding: 0,
- position: 'relative',
- '&:after': {
- margin: 0
- },
- // ================== placeholder ==================
- [`${componentCls}-selection-placeholder`]: {
- position: 'absolute',
- top: '50%',
- insetInlineStart: token.inputPaddingHorizontalBase,
- insetInlineEnd: 0,
- transform: 'translateY(-50%)',
- transition: `all ${token.motionDurationSlow}`,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis',
- flex: 1,
- color: token.colorTextPlaceholder,
- pointerEvents: 'none'
- }
- }
- }, (0,multiple.genOverflowStyle)(token)), {
- // ====================== Input ======================
- // Input is `readonly`, which is used for a11y only
- [`${componentCls}-multiple-input`]: {
- width: 0,
- height: 0,
- border: 0,
- visibility: 'hidden',
- position: 'absolute',
- zIndex: -1
- }
- })
- }];
- };
- /* harmony default export */ var style_multiple = (genPickerMultipleStyle);
- // EXTERNAL MODULE: ./components/date-picker/style/panel.ts
- var panel = __webpack_require__("./components/date-picker/style/panel.ts");
- // EXTERNAL MODULE: ./components/date-picker/style/token.ts
- var date_picker_style_token = __webpack_require__("./components/date-picker/style/token.ts");
- // EXTERNAL MODULE: ./components/input/style/variants.ts
- var variants = __webpack_require__("./components/input/style/variants.ts");
- ;// ./components/date-picker/style/variants.ts
- const genVariantsStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: [Object.assign(Object.assign(Object.assign(Object.assign({}, (0,variants.genOutlinedStyle)(token)), (0,variants.genUnderlinedStyle)(token)), (0,variants.genFilledStyle)(token)), (0,variants.genBorderlessStyle)(token)),
- // ========================= Multiple =========================
- {
- '&-outlined': {
- [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- }
- },
- '&-filled': {
- [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
- background: token.colorBgContainer,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- }
- },
- '&-borderless': {
- [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- }
- },
- '&-underlined': {
- [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- }
- }
- }]
- };
- };
- /* harmony default export */ var style_variants = (genVariantsStyle);
- ;// ./components/date-picker/style/index.ts
- const genPickerPadding = (paddingBlock, paddingInline) => {
- return {
- padding: `${(0,cssinjs.unit)(paddingBlock)} ${(0,cssinjs.unit)(paddingInline)}`
- };
- };
- const genPickerStatusStyle = token => {
- const {
- componentCls,
- colorError,
- colorWarning
- } = token;
- return {
- [`${componentCls}:not(${componentCls}-disabled):not([disabled])`]: {
- [`&${componentCls}-status-error`]: {
- [`${componentCls}-active-bar`]: {
- background: colorError
- }
- },
- [`&${componentCls}-status-warning`]: {
- [`${componentCls}-active-bar`]: {
- background: colorWarning
- }
- }
- }
- };
- };
- const genPickerStyle = token => {
- var _a;
- const {
- componentCls,
- antCls,
- paddingInline,
- lineWidth,
- lineType,
- colorBorder,
- borderRadius,
- motionDurationMid,
- colorTextDisabled,
- colorTextPlaceholder,
- fontSizeLG,
- inputFontSizeLG,
- fontSizeSM,
- inputFontSizeSM,
- controlHeightSM,
- paddingInlineSM,
- paddingXS,
- marginXS,
- colorIcon,
- lineWidthBold,
- colorPrimary,
- motionDurationSlow,
- zIndexPopup,
- paddingXXS,
- sizePopupArrow,
- colorBgElevated,
- borderRadiusLG,
- boxShadowSecondary,
- borderRadiusSM,
- colorSplit,
- cellHoverBg,
- presetsWidth,
- presetsMaxWidth,
- boxShadowPopoverArrow,
- fontHeight,
- lineHeightLG
- } = token;
- return [{
- [componentCls]: Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), genPickerPadding(token.paddingBlock, token.paddingInline)), {
- position: 'relative',
- display: 'inline-flex',
- alignItems: 'center',
- lineHeight: 1,
- borderRadius,
- transition: `border ${motionDurationMid}, box-shadow ${motionDurationMid}, background ${motionDurationMid}`,
- [`${componentCls}-prefix`]: {
- flex: '0 0 auto',
- marginInlineEnd: token.inputAffixPadding
- },
- // ======================== Input =========================
- [`${componentCls}-input`]: {
- position: 'relative',
- display: 'inline-flex',
- alignItems: 'center',
- width: '100%',
- '> input': Object.assign(Object.assign({
- position: 'relative',
- display: 'inline-block',
- width: '100%',
- color: 'inherit',
- fontSize: (_a = token.inputFontSize) !== null && _a !== void 0 ? _a : token.fontSize,
- lineHeight: token.lineHeight,
- transition: `all ${motionDurationMid}`
- }, (0,style.genPlaceholderStyle)(colorTextPlaceholder)), {
- flex: 'auto',
- // Fix Firefox flex not correct:
- // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
- minWidth: 1,
- height: 'auto',
- padding: 0,
- background: 'transparent',
- border: 0,
- fontFamily: 'inherit',
- '&:focus': {
- boxShadow: 'none',
- outline: 0
- },
- '&[disabled]': {
- background: 'transparent',
- color: colorTextDisabled,
- cursor: 'not-allowed'
- }
- }),
- '&-placeholder': {
- '> input': {
- color: colorTextPlaceholder
- }
- }
- },
- // Size
- '&-large': Object.assign(Object.assign({}, genPickerPadding(token.paddingBlockLG, token.paddingInlineLG)), {
- [`${componentCls}-input > input`]: {
- fontSize: inputFontSizeLG !== null && inputFontSizeLG !== void 0 ? inputFontSizeLG : fontSizeLG,
- lineHeight: lineHeightLG
- }
- }),
- '&-small': Object.assign(Object.assign({}, genPickerPadding(token.paddingBlockSM, token.paddingInlineSM)), {
- [`${componentCls}-input > input`]: {
- fontSize: inputFontSizeSM !== null && inputFontSizeSM !== void 0 ? inputFontSizeSM : fontSizeSM
- }
- }),
- [`${componentCls}-suffix`]: {
- display: 'flex',
- flex: 'none',
- alignSelf: 'center',
- marginInlineStart: token.calc(paddingXS).div(2).equal(),
- color: colorTextDisabled,
- lineHeight: 1,
- pointerEvents: 'none',
- transition: `opacity ${motionDurationMid}, color ${motionDurationMid}`,
- '> *': {
- verticalAlign: 'top',
- '&:not(:last-child)': {
- marginInlineEnd: marginXS
- }
- }
- },
- [`${componentCls}-clear`]: {
- position: 'absolute',
- top: '50%',
- insetInlineEnd: 0,
- color: colorTextDisabled,
- lineHeight: 1,
- transform: 'translateY(-50%)',
- cursor: 'pointer',
- opacity: 0,
- transition: `opacity ${motionDurationMid}, color ${motionDurationMid}`,
- '> *': {
- verticalAlign: 'top'
- },
- '&:hover': {
- color: colorIcon
- }
- },
- '&:hover': {
- [`${componentCls}-clear`]: {
- opacity: 1
- },
- // Should use the following selector, but since `:has` has poor compatibility,
- // we use `:not(:last-child)` instead, which may cause some problems in some cases.
- // [`${componentCls}-suffix:has(+ ${componentCls}-clear)`]: {
- [`${componentCls}-suffix:not(:last-child)`]: {
- opacity: 0
- }
- },
- [`${componentCls}-separator`]: {
- position: 'relative',
- display: 'inline-block',
- width: '1em',
- height: fontSizeLG,
- color: colorTextDisabled,
- fontSize: fontSizeLG,
- verticalAlign: 'top',
- cursor: 'default',
- [`${componentCls}-focused &`]: {
- color: colorIcon
- },
- [`${componentCls}-range-separator &`]: {
- [`${componentCls}-disabled &`]: {
- cursor: 'not-allowed'
- }
- }
- },
- // ======================== Range =========================
- '&-range': {
- position: 'relative',
- display: 'inline-flex',
- // Active bar
- [`${componentCls}-active-bar`]: {
- bottom: token.calc(lineWidth).mul(-1).equal(),
- height: lineWidthBold,
- background: colorPrimary,
- opacity: 0,
- transition: `all ${motionDurationSlow} ease-out`,
- pointerEvents: 'none'
- },
- [`&${componentCls}-focused`]: {
- [`${componentCls}-active-bar`]: {
- opacity: 1
- }
- },
- [`${componentCls}-range-separator`]: {
- alignItems: 'center',
- padding: `0 ${(0,cssinjs.unit)(paddingXS)}`,
- lineHeight: 1
- }
- },
- // ======================== Clear =========================
- '&-range, &-multiple': {
- // Clear
- [`${componentCls}-clear`]: {
- insetInlineEnd: paddingInline
- },
- [`&${componentCls}-small`]: {
- [`${componentCls}-clear`]: {
- insetInlineEnd: paddingInlineSM
- }
- }
- },
- // ======================= Dropdown =======================
- '&-dropdown': Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), (0,panel.genPanelStyle)(token)), {
- pointerEvents: 'none',
- position: 'absolute',
- // Fix incorrect position of picker popup
- // https://github.com/ant-design/ant-design/issues/35590
- top: -9999,
- left: {
- _skip_check_: true,
- value: -9999
- },
- zIndex: zIndexPopup,
- [`&${componentCls}-dropdown-hidden`]: {
- display: 'none'
- },
- '&-rtl': {
- direction: 'rtl'
- },
- [`&${componentCls}-dropdown-placement-bottomLeft,
- &${componentCls}-dropdown-placement-bottomRight`]: {
- [`${componentCls}-range-arrow`]: {
- top: 0,
- display: 'block',
- transform: 'translateY(-100%)'
- }
- },
- [`&${componentCls}-dropdown-placement-topLeft,
- &${componentCls}-dropdown-placement-topRight`]: {
- [`${componentCls}-range-arrow`]: {
- bottom: 0,
- display: 'block',
- transform: 'translateY(100%) rotate(180deg)'
- }
- },
- [`&${antCls}-slide-up-appear, &${antCls}-slide-up-enter`]: {
- [`${componentCls}-range-arrow${componentCls}-range-arrow`]: {
- transition: 'none'
- }
- },
- [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topLeft,
- &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topRight,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topLeft,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topRight`]: {
- animationName: slide.slideDownIn
- },
- [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomLeft,
- &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomRight,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomLeft,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomRight`]: {
- animationName: slide.slideUpIn
- },
- // https://github.com/ant-design/ant-design/issues/48727
- [`&${antCls}-slide-up-leave ${componentCls}-panel-container`]: {
- pointerEvents: 'none'
- },
- [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topLeft,
- &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topRight`]: {
- animationName: slide.slideDownOut
- },
- [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomLeft,
- &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomRight`]: {
- animationName: slide.slideUpOut
- },
- // Time picker with additional style
- [`${componentCls}-panel > ${componentCls}-time-panel`]: {
- paddingTop: paddingXXS
- },
- // ======================== Ranges ========================
- [`${componentCls}-range-wrapper`]: {
- display: 'flex',
- position: 'relative'
- },
- [`${componentCls}-range-arrow`]: Object.assign(Object.assign({
- position: 'absolute',
- zIndex: 1,
- display: 'none',
- paddingInline: token.calc(paddingInline).mul(1.5).equal(),
- boxSizing: 'content-box',
- transition: `all ${motionDurationSlow} ease-out`
- }, (0,roundedArrow.genRoundedArrow)(token, colorBgElevated, boxShadowPopoverArrow)), {
- '&:before': {
- insetInlineStart: token.calc(paddingInline).mul(1.5).equal()
- }
- }),
- [`${componentCls}-panel-container`]: {
- overflow: 'hidden',
- verticalAlign: 'top',
- background: colorBgElevated,
- borderRadius: borderRadiusLG,
- boxShadow: boxShadowSecondary,
- transition: `margin ${motionDurationSlow}`,
- display: 'inline-block',
- pointerEvents: 'auto',
- // ======================== Layout ========================
- [`${componentCls}-panel-layout`]: {
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'stretch'
- },
- // ======================== Preset ========================
- [`${componentCls}-presets`]: {
- display: 'flex',
- flexDirection: 'column',
- minWidth: presetsWidth,
- maxWidth: presetsMaxWidth,
- ul: {
- height: 0,
- flex: 'auto',
- listStyle: 'none',
- overflow: 'auto',
- margin: 0,
- padding: paddingXS,
- borderInlineEnd: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- li: Object.assign(Object.assign({}, components_style.textEllipsis), {
- borderRadius: borderRadiusSM,
- paddingInline: paddingXS,
- paddingBlock: token.calc(controlHeightSM).sub(fontHeight).div(2).equal(),
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- '+ li': {
- marginTop: marginXS
- },
- '&:hover': {
- background: cellHoverBg
- }
- })
- }
- },
- // ======================== Panels ========================
- [`${componentCls}-panels`]: {
- display: 'inline-flex',
- flexWrap: 'nowrap',
- // [`${componentCls}-panel`]: {
- // borderWidth: `0 0 ${unit(lineWidth)}`,
- // },
- '&:last-child': {
- [`${componentCls}-panel`]: {
- borderWidth: 0
- }
- }
- },
- [`${componentCls}-panel`]: {
- verticalAlign: 'top',
- background: 'transparent',
- borderRadius: 0,
- borderWidth: 0,
- [`${componentCls}-content, table`]: {
- textAlign: 'center'
- },
- '&-focused': {
- borderColor: colorBorder
- }
- }
- }
- }),
- '&-dropdown-range': {
- padding: `${(0,cssinjs.unit)(token.calc(sizePopupArrow).mul(2).div(3).equal())} 0`,
- '&-hidden': {
- display: 'none'
- }
- },
- '&-rtl': {
- direction: 'rtl',
- [`${componentCls}-separator`]: {
- transform: 'scale(-1, 1)'
- },
- [`${componentCls}-footer`]: {
- '&-extra': {
- direction: 'rtl'
- }
- }
- }
- })
- },
- // Follow code may reuse in other components
- (0,slide.initSlideMotion)(token, 'slide-up'), (0,slide.initSlideMotion)(token, 'slide-down'), (0,move.initMoveMotion)(token, 'move-up'), (0,move.initMoveMotion)(token, 'move-down')];
- };
- // ============================== Export ==============================
- /* harmony default export */ var date_picker_style = ((0,genStyleUtils.genStyleHooks)('DatePicker', token => {
- const pickerToken = (0,es.mergeToken)((0,style_token.initInputToken)(token), (0,date_picker_style_token.initPickerPanelToken)(token), {
- inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(1).equal(),
- multipleSelectItemHeight: token.multipleItemHeight,
- selectHeight: token.controlHeight
- });
- return [(0,panel["default"])(pickerToken), genPickerStyle(pickerToken), style_variants(pickerToken), genPickerStatusStyle(pickerToken), style_multiple(pickerToken),
- // =====================================================
- // == Space Compact ==
- // =====================================================
- (0,compact_item.genCompactItemStyle)(token, {
- focusElCls: `${token.componentCls}-focused`
- })];
- }, date_picker_style_token.prepareComponentToken));
- /***/ }),
- /***/ "./components/date-picker/style/panel.ts":
- /*!***********************************************!*\
- !*** ./components/date-picker/style/panel.ts ***!
- \***********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genPanelStyle: function() { return /* binding */ genPanelStyle; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- const genPickerCellInnerStyle = token => {
- const {
- pickerCellCls,
- pickerCellInnerCls,
- cellHeight,
- borderRadiusSM,
- motionDurationMid,
- cellHoverBg,
- lineWidth,
- lineType,
- colorPrimary,
- cellActiveWithRangeBg,
- colorTextLightSolid,
- colorTextDisabled,
- cellBgDisabled,
- colorFillSecondary
- } = token;
- return {
- '&::before': {
- position: 'absolute',
- top: '50%',
- insetInlineStart: 0,
- insetInlineEnd: 0,
- zIndex: 1,
- height: cellHeight,
- transform: 'translateY(-50%)',
- content: '""',
- pointerEvents: 'none'
- },
- // >>> Default
- [pickerCellInnerCls]: {
- position: 'relative',
- zIndex: 2,
- display: 'inline-block',
- minWidth: cellHeight,
- height: cellHeight,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(cellHeight),
- borderRadius: borderRadiusSM,
- transition: `background ${motionDurationMid}`
- },
- // >>> Hover
- [`&:hover:not(${pickerCellCls}-in-view):not(${pickerCellCls}-disabled),
- &:hover:not(${pickerCellCls}-selected):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end):not(${pickerCellCls}-disabled)`]: {
- [pickerCellInnerCls]: {
- background: cellHoverBg
- }
- },
- // >>> Today
- [`&-in-view${pickerCellCls}-today ${pickerCellInnerCls}`]: {
- '&::before': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- zIndex: 1,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorPrimary}`,
- borderRadius: borderRadiusSM,
- content: '""'
- }
- },
- // >>> In Range
- [`&-in-view${pickerCellCls}-in-range,
- &-in-view${pickerCellCls}-range-start,
- &-in-view${pickerCellCls}-range-end`]: {
- position: 'relative',
- [`&:not(${pickerCellCls}-disabled):before`]: {
- background: cellActiveWithRangeBg
- }
- },
- // >>> Selected
- [`&-in-view${pickerCellCls}-selected,
- &-in-view${pickerCellCls}-range-start,
- &-in-view${pickerCellCls}-range-end`]: {
- [`&:not(${pickerCellCls}-disabled) ${pickerCellInnerCls}`]: {
- color: colorTextLightSolid,
- background: colorPrimary
- },
- [`&${pickerCellCls}-disabled ${pickerCellInnerCls}`]: {
- background: colorFillSecondary
- }
- },
- [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-disabled):before`]: {
- insetInlineStart: '50%'
- },
- [`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-disabled):before`]: {
- insetInlineEnd: '50%'
- },
- // range start border-radius
- [`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-end) ${pickerCellInnerCls}`]: {
- borderStartStartRadius: borderRadiusSM,
- borderEndStartRadius: borderRadiusSM,
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- },
- // range end border-radius
- [`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-start) ${pickerCellInnerCls}`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0,
- borderStartEndRadius: borderRadiusSM,
- borderEndEndRadius: borderRadiusSM
- },
- // >>> Disabled
- '&-disabled': {
- color: colorTextDisabled,
- cursor: 'not-allowed',
- [pickerCellInnerCls]: {
- background: 'transparent'
- },
- '&::before': {
- background: cellBgDisabled
- }
- },
- [`&-disabled${pickerCellCls}-today ${pickerCellInnerCls}::before`]: {
- borderColor: colorTextDisabled
- }
- };
- };
- const genPanelStyle = token => {
- const {
- componentCls,
- pickerCellCls,
- pickerCellInnerCls,
- pickerYearMonthCellWidth,
- pickerControlIconSize,
- cellWidth,
- paddingSM,
- paddingXS,
- paddingXXS,
- colorBgContainer,
- lineWidth,
- lineType,
- borderRadiusLG,
- colorPrimary,
- colorTextHeading,
- colorSplit,
- pickerControlIconBorderWidth,
- colorIcon,
- textHeight,
- motionDurationMid,
- colorIconHover,
- fontWeightStrong,
- cellHeight,
- pickerCellPaddingVertical,
- colorTextDisabled,
- colorText,
- fontSize,
- motionDurationSlow,
- withoutTimeCellHeight,
- pickerQuarterPanelContentHeight,
- borderRadiusSM,
- colorTextLightSolid,
- cellHoverBg,
- timeColumnHeight,
- timeColumnWidth,
- timeCellHeight,
- controlItemBgActive,
- marginXXS,
- pickerDatePanelPaddingHorizontal,
- pickerControlIconMargin
- } = token;
- const pickerPanelWidth = token.calc(cellWidth).mul(7).add(token.calc(pickerDatePanelPaddingHorizontal).mul(2)).equal();
- return {
- [componentCls]: {
- '&-panel': {
- display: 'inline-flex',
- flexDirection: 'column',
- textAlign: 'center',
- background: colorBgContainer,
- borderRadius: borderRadiusLG,
- outline: 'none',
- '&-focused': {
- borderColor: colorPrimary
- },
- '&-rtl': {
- [`${componentCls}-prev-icon,
- ${componentCls}-super-prev-icon`]: {
- transform: 'rotate(45deg)'
- },
- [`${componentCls}-next-icon,
- ${componentCls}-super-next-icon`]: {
- transform: 'rotate(-135deg)'
- },
- [`${componentCls}-time-panel`]: {
- [`${componentCls}-content`]: {
- direction: 'ltr',
- '> *': {
- direction: 'rtl'
- }
- }
- }
- }
- },
- // ========================================================
- // = Shared Panel =
- // ========================================================
- [`&-decade-panel,
- &-year-panel,
- &-quarter-panel,
- &-month-panel,
- &-week-panel,
- &-date-panel,
- &-time-panel`]: {
- display: 'flex',
- flexDirection: 'column',
- width: pickerPanelWidth
- },
- // ======================= Header =======================
- '&-header': {
- display: 'flex',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`,
- color: colorTextHeading,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- '> *': {
- flex: 'none'
- },
- button: {
- padding: 0,
- color: colorIcon,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(textHeight),
- background: 'transparent',
- border: 0,
- cursor: 'pointer',
- transition: `color ${motionDurationMid}`,
- fontSize: 'inherit',
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center',
- '&:empty': {
- display: 'none'
- }
- },
- '> button': {
- minWidth: '1.6em',
- fontSize,
- '&:hover': {
- color: colorIconHover
- },
- '&:disabled': {
- opacity: 0.25,
- pointerEvents: 'none'
- }
- },
- '&-view': {
- flex: 'auto',
- fontWeight: fontWeightStrong,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(textHeight),
- '> button': {
- color: 'inherit',
- fontWeight: 'inherit',
- verticalAlign: 'top',
- '&:not(:first-child)': {
- marginInlineStart: paddingXS
- },
- '&:hover': {
- color: colorPrimary
- }
- }
- }
- },
- // Arrow button
- [`&-prev-icon,
- &-next-icon,
- &-super-prev-icon,
- &-super-next-icon`]: {
- position: 'relative',
- width: pickerControlIconSize,
- height: pickerControlIconSize,
- '&::before': {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- width: pickerControlIconSize,
- height: pickerControlIconSize,
- border: `0 solid currentcolor`,
- borderBlockStartWidth: pickerControlIconBorderWidth,
- borderInlineStartWidth: pickerControlIconBorderWidth,
- content: '""'
- }
- },
- [`&-super-prev-icon,
- &-super-next-icon`]: {
- '&::after': {
- position: 'absolute',
- top: pickerControlIconMargin,
- insetInlineStart: pickerControlIconMargin,
- display: 'inline-block',
- width: pickerControlIconSize,
- height: pickerControlIconSize,
- border: '0 solid currentcolor',
- borderBlockStartWidth: pickerControlIconBorderWidth,
- borderInlineStartWidth: pickerControlIconBorderWidth,
- content: '""'
- }
- },
- '&-prev-icon, &-super-prev-icon': {
- transform: 'rotate(-45deg)'
- },
- '&-next-icon, &-super-next-icon': {
- transform: 'rotate(135deg)'
- },
- // ======================== Body ========================
- '&-content': {
- width: '100%',
- tableLayout: 'fixed',
- borderCollapse: 'collapse',
- 'th, td': {
- position: 'relative',
- minWidth: cellHeight,
- fontWeight: 'normal'
- },
- th: {
- height: token.calc(cellHeight).add(token.calc(pickerCellPaddingVertical).mul(2)).equal(),
- color: colorText,
- verticalAlign: 'middle'
- }
- },
- '&-cell': Object.assign({
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(pickerCellPaddingVertical)} 0`,
- color: colorTextDisabled,
- cursor: 'pointer',
- // In view
- '&-in-view': {
- color: colorText
- }
- }, genPickerCellInnerStyle(token)),
- [`&-decade-panel,
- &-year-panel,
- &-quarter-panel,
- &-month-panel`]: {
- [`${componentCls}-content`]: {
- height: token.calc(withoutTimeCellHeight).mul(4).equal()
- },
- [pickerCellInnerCls]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`
- }
- },
- '&-quarter-panel': {
- [`${componentCls}-content`]: {
- height: pickerQuarterPanelContentHeight
- }
- },
- // ========================================================
- // = Special =
- // ========================================================
- // ===================== Decade Panel =====================
- '&-decade-panel': {
- [pickerCellInnerCls]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(paddingXS).div(2).equal())}`
- },
- [`${componentCls}-cell::before`]: {
- display: 'none'
- }
- },
- // ============= Year & Quarter & Month Panel =============
- [`&-year-panel,
- &-quarter-panel,
- &-month-panel`]: {
- [`${componentCls}-body`]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`
- },
- [pickerCellInnerCls]: {
- width: pickerYearMonthCellWidth
- }
- },
- // ====================== Date Panel ======================
- '&-date-panel': {
- [`${componentCls}-body`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(pickerDatePanelPaddingHorizontal)}`
- },
- [`${componentCls}-content th`]: {
- boxSizing: 'border-box',
- padding: 0
- }
- },
- // ====================== Week Panel ======================
- '&-week-panel-row': {
- td: {
- '&:before': {
- transition: `background ${motionDurationMid}`
- },
- '&:first-child:before': {
- borderStartStartRadius: borderRadiusSM,
- borderEndStartRadius: borderRadiusSM
- },
- '&:last-child:before': {
- borderStartEndRadius: borderRadiusSM,
- borderEndEndRadius: borderRadiusSM
- }
- },
- '&:hover td:before': {
- background: cellHoverBg
- },
- '&-range-start td, &-range-end td, &-selected td, &-hover td': {
- // Rise priority to override hover style
- [`&${pickerCellCls}`]: {
- '&:before': {
- background: colorPrimary
- },
- [`&${componentCls}-cell-week`]: {
- color: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(colorTextLightSolid).setA(0.5).toHexString()
- },
- [pickerCellInnerCls]: {
- color: colorTextLightSolid
- }
- }
- },
- '&-range-hover td:before': {
- background: controlItemBgActive
- }
- },
- // >>> ShowWeek
- '&-week-panel, &-date-panel-show-week': {
- [`${componentCls}-body`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingSM)}`
- },
- [`${componentCls}-content th`]: {
- width: 'auto'
- }
- },
- // ==================== Datetime Panel ====================
- '&-datetime-panel': {
- display: 'flex',
- [`${componentCls}-time-panel`]: {
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`
- },
- [`${componentCls}-date-panel,
- ${componentCls}-time-panel`]: {
- transition: `opacity ${motionDurationSlow}`
- },
- // Keyboard
- '&-active': {
- [`${componentCls}-date-panel,
- ${componentCls}-time-panel`]: {
- opacity: 0.3,
- '&-active': {
- opacity: 1
- }
- }
- }
- },
- // ====================== Time Panel ======================
- '&-time-panel': {
- width: 'auto',
- minWidth: 'auto',
- [`${componentCls}-content`]: {
- display: 'flex',
- flex: 'auto',
- height: timeColumnHeight
- },
- '&-column': {
- flex: '1 0 auto',
- width: timeColumnWidth,
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXXS)} 0`,
- padding: 0,
- overflowY: 'hidden',
- textAlign: 'start',
- listStyle: 'none',
- transition: `background ${motionDurationMid}`,
- overflowX: 'hidden',
- '&::-webkit-scrollbar': {
- width: 8,
- backgroundColor: 'transparent'
- },
- '&::-webkit-scrollbar-thumb': {
- backgroundColor: token.colorTextTertiary,
- borderRadius: token.borderRadiusSM
- },
- // For Firefox
- '&': {
- scrollbarWidth: 'thin',
- scrollbarColor: `${token.colorTextTertiary} transparent`
- },
- '&::after': {
- display: 'block',
- height: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(timeCellHeight)})`,
- content: '""'
- },
- '&:not(:first-child)': {
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`
- },
- '&-active': {
- background: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(controlItemBgActive).setA(0.2).toHexString()
- },
- '&:hover': {
- overflowY: 'auto'
- },
- '> li': {
- margin: 0,
- padding: 0,
- [`&${componentCls}-time-panel-cell`]: {
- marginInline: marginXXS,
- [`${componentCls}-time-panel-cell-inner`]: {
- display: 'block',
- width: token.calc(timeColumnWidth).sub(token.calc(marginXXS).mul(2)).equal(),
- height: timeCellHeight,
- margin: 0,
- paddingBlock: 0,
- paddingInlineEnd: 0,
- paddingInlineStart: token.calc(timeColumnWidth).sub(timeCellHeight).div(2).equal(),
- color: colorText,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(timeCellHeight),
- borderRadius: borderRadiusSM,
- cursor: 'pointer',
- transition: `background ${motionDurationMid}`,
- '&:hover': {
- background: cellHoverBg
- }
- },
- '&-selected': {
- [`${componentCls}-time-panel-cell-inner`]: {
- background: controlItemBgActive
- }
- },
- '&-disabled': {
- [`${componentCls}-time-panel-cell-inner`]: {
- color: colorTextDisabled,
- background: 'transparent',
- cursor: 'not-allowed'
- }
- }
- }
- }
- }
- }
- }
- };
- };
- const genPickerPanelStyle = token => {
- const {
- componentCls,
- textHeight,
- lineWidth,
- paddingSM,
- antCls,
- colorPrimary,
- cellActiveWithRangeBg,
- colorPrimaryBorder,
- lineType,
- colorSplit
- } = token;
- return {
- [`${componentCls}-dropdown`]: {
- // ======================== Footer ========================
- [`${componentCls}-footer`]: {
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- '&-extra': {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingSM)}`,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(textHeight).sub(token.calc(lineWidth).mul(2)).equal()),
- textAlign: 'start',
- '&:not(:last-child)': {
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`
- }
- }
- },
- // ==================== Footer > Ranges ===================
- [`${componentCls}-panels + ${componentCls}-footer ${componentCls}-ranges`]: {
- justifyContent: 'space-between'
- },
- [`${componentCls}-ranges`]: {
- marginBlock: 0,
- paddingInline: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingSM),
- overflow: 'hidden',
- textAlign: 'start',
- listStyle: 'none',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- '> li': {
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(textHeight).sub(token.calc(lineWidth).mul(2)).equal()),
- display: 'inline-block'
- },
- [`${componentCls}-now-btn-disabled`]: {
- pointerEvents: 'none',
- color: token.colorTextDisabled
- },
- // https://github.com/ant-design/ant-design/issues/23687
- [`${componentCls}-preset > ${antCls}-tag-blue`]: {
- color: colorPrimary,
- background: cellActiveWithRangeBg,
- borderColor: colorPrimaryBorder,
- cursor: 'pointer'
- },
- [`${componentCls}-ok`]: {
- paddingBlock: token.calc(lineWidth).mul(2).equal(),
- marginInlineStart: 'auto'
- }
- }
- }
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = (genPickerPanelStyle);
- /***/ }),
- /***/ "./components/date-picker/style/token.ts":
- /*!***********************************************!*\
- !*** ./components/date-picker/style/token.ts ***!
- \***********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initPanelComponentToken: function() { return /* binding */ initPanelComponentToken; },
- /* harmony export */ initPickerPanelToken: function() { return /* binding */ initPickerPanelToken; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _input_style_token__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../input/style/token */ "./components/input/style/token.ts");
- /* harmony import */ var _style_roundedArrow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/roundedArrow */ "./components/style/roundedArrow.ts");
- const initPickerPanelToken = token => {
- const {
- componentCls,
- controlHeightLG,
- paddingXXS,
- padding
- } = token;
- return {
- pickerCellCls: `${componentCls}-cell`,
- pickerCellInnerCls: `${componentCls}-cell-inner`,
- pickerYearMonthCellWidth: token.calc(controlHeightLG).mul(1.5).equal(),
- pickerQuarterPanelContentHeight: token.calc(controlHeightLG).mul(1.4).equal(),
- pickerCellPaddingVertical: token.calc(paddingXXS).add(token.calc(paddingXXS).div(2)).equal(),
- pickerCellBorderGap: 2,
- // Magic for gap between cells
- pickerControlIconSize: 7,
- pickerControlIconMargin: 4,
- pickerControlIconBorderWidth: 1.5,
- pickerDatePanelPaddingHorizontal: token.calc(padding).add(token.calc(paddingXXS).div(2)).equal() // 18 in normal
- };
- };
- const initPanelComponentToken = token => {
- const {
- colorBgContainerDisabled,
- controlHeight,
- controlHeightSM,
- controlHeightLG,
- paddingXXS,
- lineWidth
- } = token;
- // Item height default use `controlHeight - 2 * paddingXXS`,
- // but some case `paddingXXS=0`.
- // Let's fallback it.
- const dblPaddingXXS = paddingXXS * 2;
- const dblLineWidth = lineWidth * 2;
- const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);
- const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);
- const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);
- // FIXED_ITEM_MARGIN is a hardcode calculation since calc not support rounding
- const INTERNAL_FIXED_ITEM_MARGIN = Math.floor(paddingXXS / 2);
- const filledToken = {
- INTERNAL_FIXED_ITEM_MARGIN,
- cellHoverBg: token.controlItemBgHover,
- cellActiveWithRangeBg: token.controlItemBgActive,
- cellHoverWithRangeBg: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(token.colorPrimary).lighten(35).toHexString(),
- cellRangeBorderColor: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(token.colorPrimary).lighten(20).toHexString(),
- cellBgDisabled: colorBgContainerDisabled,
- timeColumnWidth: controlHeightLG * 1.4,
- timeColumnHeight: 28 * 8,
- timeCellHeight: 28,
- cellWidth: controlHeightSM * 1.5,
- cellHeight: controlHeightSM,
- textHeight: controlHeightLG,
- withoutTimeCellHeight: controlHeightLG * 1.65,
- multipleItemBg: token.colorFillSecondary,
- multipleItemBorderColor: 'transparent',
- multipleItemHeight,
- multipleItemHeightSM,
- multipleItemHeightLG,
- multipleSelectorBgDisabled: colorBgContainerDisabled,
- multipleItemColorDisabled: token.colorTextDisabled,
- multipleItemBorderColorDisabled: 'transparent'
- };
- return filledToken;
- };
- const prepareComponentToken = token => Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_input_style_token__WEBPACK_IMPORTED_MODULE_1__.initComponentToken)(token)), initPanelComponentToken(token)), (0,_style_roundedArrow__WEBPACK_IMPORTED_MODULE_2__.getArrowToken)(token)), {
- presetsWidth: 120,
- presetsMaxWidth: 200,
- zIndexPopup: token.zIndexPopupBase + 50
- });
- /***/ }),
- /***/ "./components/descriptions/style/index.ts":
- /*!************************************************!*\
- !*** ./components/descriptions/style/index.ts ***!
- \************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBorderedStyle = token => {
- const {
- componentCls,
- labelBg
- } = token;
- return {
- [`&${componentCls}-bordered`]: {
- [`> ${componentCls}-view`]: {
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- '> table': {
- tableLayout: 'auto'
- },
- [`${componentCls}-row`]: {
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- '&:first-child': {
- '> th:first-child, > td:first-child': {
- borderStartStartRadius: token.borderRadiusLG
- }
- },
- '&:last-child': {
- borderBottom: 'none',
- '> th:first-child, > td:first-child': {
- borderEndStartRadius: token.borderRadiusLG
- }
- },
- [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingLG)}`,
- borderInlineEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- '&:last-child': {
- borderInlineEnd: 'none'
- }
- },
- [`> ${componentCls}-item-label`]: {
- color: token.colorTextSecondary,
- backgroundColor: labelBg,
- '&::after': {
- display: 'none'
- }
- }
- }
- },
- [`&${componentCls}-middle`]: {
- [`${componentCls}-row`]: {
- [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingSM)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingLG)}`
- }
- }
- },
- [`&${componentCls}-small`]: {
- [`${componentCls}-row`]: {
- [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.padding)}`
- }
- }
- }
- }
- };
- };
- const genDescriptionStyles = token => {
- const {
- componentCls,
- extraColor,
- itemPaddingBottom,
- itemPaddingEnd,
- colonMarginRight,
- colonMarginLeft,
- titleMarginBottom
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), genBorderedStyle(token)), {
- '&-rtl': {
- direction: 'rtl'
- },
- [`${componentCls}-header`]: {
- display: 'flex',
- alignItems: 'center',
- marginBottom: titleMarginBottom
- },
- [`${componentCls}-title`]: Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis), {
- flex: 'auto',
- color: token.titleColor,
- fontWeight: token.fontWeightStrong,
- fontSize: token.fontSizeLG,
- lineHeight: token.lineHeightLG
- }),
- [`${componentCls}-extra`]: {
- marginInlineStart: 'auto',
- color: extraColor,
- fontSize: token.fontSize
- },
- [`${componentCls}-view`]: {
- width: '100%',
- borderRadius: token.borderRadiusLG,
- table: {
- width: '100%',
- tableLayout: 'fixed',
- borderCollapse: 'collapse'
- }
- },
- [`${componentCls}-row`]: {
- '> th, > td': {
- paddingBottom: itemPaddingBottom,
- paddingInlineEnd: itemPaddingEnd
- },
- '> th:last-child, > td:last-child': {
- paddingInlineEnd: 0
- },
- '&:last-child': {
- borderBottom: 'none',
- '> th, > td': {
- paddingBottom: 0
- }
- }
- },
- [`${componentCls}-item-label`]: {
- color: token.labelColor,
- fontWeight: 'normal',
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- textAlign: 'start',
- '&::after': {
- content: '":"',
- position: 'relative',
- top: -0.5,
- // magic for position
- marginInline: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(colonMarginLeft)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(colonMarginRight)}`
- },
- [`&${componentCls}-item-no-colon::after`]: {
- content: '""'
- }
- },
- [`${componentCls}-item-no-label`]: {
- '&::after': {
- margin: 0,
- content: '""'
- }
- },
- [`${componentCls}-item-content`]: {
- display: 'table-cell',
- flex: 1,
- color: token.contentColor,
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- wordBreak: 'break-word',
- overflowWrap: 'break-word'
- },
- [`${componentCls}-item`]: {
- paddingBottom: 0,
- verticalAlign: 'top',
- '&-container': {
- display: 'flex',
- [`${componentCls}-item-label`]: {
- display: 'inline-flex',
- alignItems: 'baseline'
- },
- [`${componentCls}-item-content`]: {
- display: 'inline-flex',
- alignItems: 'baseline',
- minWidth: '1em'
- }
- }
- },
- '&-middle': {
- [`${componentCls}-row`]: {
- '> th, > td': {
- paddingBottom: token.paddingSM
- }
- }
- },
- '&-small': {
- [`${componentCls}-row`]: {
- '> th, > td': {
- paddingBottom: token.paddingXS
- }
- }
- }
- })
- };
- };
- const prepareComponentToken = token => ({
- labelBg: token.colorFillAlter,
- labelColor: token.colorTextTertiary,
- titleColor: token.colorText,
- titleMarginBottom: token.fontSizeSM * token.lineHeightSM,
- itemPaddingBottom: token.padding,
- itemPaddingEnd: token.padding,
- colonMarginRight: token.marginXS,
- colonMarginLeft: token.marginXXS / 2,
- contentColor: token.colorText,
- extraColor: token.colorText
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Descriptions', token => {
- const descriptionToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {});
- return genDescriptionStyles(descriptionToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/divider/style/index.ts":
- /*!*******************************************!*\
- !*** ./components/divider/style/index.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Size ================================
- const genSizeDividerStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- '&-horizontal': {
- [`&${componentCls}`]: {
- '&-sm': {
- marginBlock: token.marginXS
- },
- '&-md': {
- marginBlock: token.margin
- }
- }
- }
- }
- };
- };
- // ============================== Shared ==============================
- const genSharedDividerStyle = token => {
- const {
- componentCls,
- sizePaddingEdgeHorizontal,
- colorSplit,
- lineWidth,
- textPaddingInline,
- orientationMargin,
- verticalMarginInline
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- borderBlockStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} solid ${colorSplit}`,
- // vertical
- '&-vertical': {
- position: 'relative',
- top: '-0.06em',
- display: 'inline-block',
- height: '0.9em',
- marginInline: verticalMarginInline,
- marginBlock: 0,
- verticalAlign: 'middle',
- borderTop: 0,
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} solid ${colorSplit}`
- },
- '&-horizontal': {
- display: 'flex',
- clear: 'both',
- width: '100%',
- minWidth: '100%',
- // Fix https://github.com/ant-design/ant-design/issues/10914
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginLG)} 0`
- },
- [`&-horizontal${componentCls}-with-text`]: {
- display: 'flex',
- alignItems: 'center',
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.dividerHorizontalWithTextGutterMargin)} 0`,
- color: token.colorTextHeading,
- fontWeight: 500,
- fontSize: token.fontSizeLG,
- whiteSpace: 'nowrap',
- textAlign: 'center',
- borderBlockStart: `0 ${colorSplit}`,
- '&::before, &::after': {
- position: 'relative',
- width: '50%',
- borderBlockStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} solid transparent`,
- // Chrome not accept `inherit` in `border-top`
- borderBlockStartColor: 'inherit',
- borderBlockEnd: 0,
- transform: 'translateY(50%)',
- content: "''"
- }
- },
- [`&-horizontal${componentCls}-with-text-start`]: {
- '&::before': {
- width: `calc(${orientationMargin} * 100%)`
- },
- '&::after': {
- width: `calc(100% - ${orientationMargin} * 100%)`
- }
- },
- [`&-horizontal${componentCls}-with-text-end`]: {
- '&::before': {
- width: `calc(100% - ${orientationMargin} * 100%)`
- },
- '&::after': {
- width: `calc(${orientationMargin} * 100%)`
- }
- },
- [`${componentCls}-inner-text`]: {
- display: 'inline-block',
- paddingBlock: 0,
- paddingInline: textPaddingInline
- },
- '&-dashed': {
- background: 'none',
- borderColor: colorSplit,
- borderStyle: 'dashed',
- borderWidth: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0`
- },
- [`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
- '&::before, &::after': {
- borderStyle: 'dashed none none'
- }
- },
- [`&-vertical${componentCls}-dashed`]: {
- borderInlineStartWidth: lineWidth,
- borderInlineEnd: 0,
- borderBlockStart: 0,
- borderBlockEnd: 0
- },
- '&-dotted': {
- background: 'none',
- borderColor: colorSplit,
- borderStyle: 'dotted',
- borderWidth: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} 0 0`
- },
- [`&-horizontal${componentCls}-with-text${componentCls}-dotted`]: {
- '&::before, &::after': {
- borderStyle: 'dotted none none'
- }
- },
- [`&-vertical${componentCls}-dotted`]: {
- borderInlineStartWidth: lineWidth,
- borderInlineEnd: 0,
- borderBlockStart: 0,
- borderBlockEnd: 0
- },
- [`&-plain${componentCls}-with-text`]: {
- color: token.colorText,
- fontWeight: 'normal',
- fontSize: token.fontSize
- },
- [`&-horizontal${componentCls}-with-text-start${componentCls}-no-default-orientation-margin-start`]: {
- '&::before': {
- width: 0
- },
- '&::after': {
- width: '100%'
- },
- [`${componentCls}-inner-text`]: {
- paddingInlineStart: sizePaddingEdgeHorizontal
- }
- },
- [`&-horizontal${componentCls}-with-text-end${componentCls}-no-default-orientation-margin-end`]: {
- '&::before': {
- width: '100%'
- },
- '&::after': {
- width: 0
- },
- [`${componentCls}-inner-text`]: {
- paddingInlineEnd: sizePaddingEdgeHorizontal
- }
- }
- })
- };
- };
- const prepareComponentToken = token => ({
- textPaddingInline: '1em',
- orientationMargin: 0.05,
- verticalMarginInline: token.marginXS
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Divider', token => {
- const dividerToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- dividerHorizontalWithTextGutterMargin: token.margin,
- sizePaddingEdgeHorizontal: 0
- });
- return [genSharedDividerStyle(dividerToken), genSizeDividerStyle(dividerToken)];
- }, prepareComponentToken, {
- unitless: {
- orientationMargin: true
- }
- }));
- /***/ }),
- /***/ "./components/drawer/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/drawer/style/index.ts + 1 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ drawer_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/drawer/style/motion.ts
- const getMoveTranslate = direction => {
- const value = '100%';
- return {
- left: `translateX(-${value})`,
- right: `translateX(${value})`,
- top: `translateY(-${value})`,
- bottom: `translateY(${value})`
- }[direction];
- };
- const getEnterLeaveStyle = (startStyle, endStyle) => ({
- '&-enter, &-appear': Object.assign(Object.assign({}, startStyle), {
- '&-active': endStyle
- }),
- '&-leave': Object.assign(Object.assign({}, endStyle), {
- '&-active': startStyle
- })
- });
- const getFadeStyle = (from, duration) => Object.assign({
- '&-enter, &-appear, &-leave': {
- '&-start': {
- transition: 'none'
- },
- '&-active': {
- transition: `all ${duration}`
- }
- }
- }, getEnterLeaveStyle({
- opacity: from
- }, {
- opacity: 1
- }));
- const getPanelMotionStyles = (direction, duration) => [getFadeStyle(0.7, duration), getEnterLeaveStyle({
- transform: getMoveTranslate(direction)
- }, {
- transform: 'none'
- })];
- const genMotionStyle = token => {
- const {
- componentCls,
- motionDurationSlow
- } = token;
- return {
- [componentCls]: {
- // ======================== Mask ========================
- [`${componentCls}-mask-motion`]: getFadeStyle(0, motionDurationSlow),
- // ======================= Panel ========================
- [`${componentCls}-panel-motion`]: ['left', 'right', 'top', 'bottom'].reduce((obj, direction) => Object.assign(Object.assign({}, obj), {
- [`&-${direction}`]: getPanelMotionStyles(direction, motionDurationSlow)
- }), {})
- }
- };
- };
- /* harmony default export */ var motion = (genMotionStyle);
- ;// ./components/drawer/style/index.ts
- // =============================== Base ===============================
- const genDrawerStyle = token => {
- const {
- borderRadiusSM,
- componentCls,
- zIndexPopup,
- colorBgMask,
- colorBgElevated,
- motionDurationSlow,
- motionDurationMid,
- paddingXS,
- padding,
- paddingLG,
- fontSizeLG,
- lineHeightLG,
- lineWidth,
- lineType,
- colorSplit,
- marginXS,
- colorIcon,
- colorIconHover,
- colorBgTextHover,
- colorBgTextActive,
- colorText,
- fontWeightStrong,
- footerPaddingBlock,
- footerPaddingInline,
- calc
- } = token;
- const wrapperCls = `${componentCls}-content-wrapper`;
- return {
- [componentCls]: {
- position: 'fixed',
- inset: 0,
- zIndex: zIndexPopup,
- pointerEvents: 'none',
- color: colorText,
- '&-pure': {
- position: 'relative',
- background: colorBgElevated,
- display: 'flex',
- flexDirection: 'column',
- [`&${componentCls}-left`]: {
- boxShadow: token.boxShadowDrawerLeft
- },
- [`&${componentCls}-right`]: {
- boxShadow: token.boxShadowDrawerRight
- },
- [`&${componentCls}-top`]: {
- boxShadow: token.boxShadowDrawerUp
- },
- [`&${componentCls}-bottom`]: {
- boxShadow: token.boxShadowDrawerDown
- }
- },
- '&-inline': {
- position: 'absolute'
- },
- // ====================== Mask ======================
- [`${componentCls}-mask`]: {
- position: 'absolute',
- inset: 0,
- zIndex: zIndexPopup,
- background: colorBgMask,
- pointerEvents: 'auto'
- },
- // ==================== Content =====================
- [wrapperCls]: {
- position: 'absolute',
- zIndex: zIndexPopup,
- maxWidth: '100vw',
- transition: `all ${motionDurationSlow}`,
- '&-hidden': {
- display: 'none'
- }
- },
- // Placement
- [`&-left > ${wrapperCls}`]: {
- top: 0,
- bottom: 0,
- left: {
- _skip_check_: true,
- value: 0
- },
- boxShadow: token.boxShadowDrawerLeft
- },
- [`&-right > ${wrapperCls}`]: {
- top: 0,
- right: {
- _skip_check_: true,
- value: 0
- },
- bottom: 0,
- boxShadow: token.boxShadowDrawerRight
- },
- [`&-top > ${wrapperCls}`]: {
- top: 0,
- insetInline: 0,
- boxShadow: token.boxShadowDrawerUp
- },
- [`&-bottom > ${wrapperCls}`]: {
- bottom: 0,
- insetInline: 0,
- boxShadow: token.boxShadowDrawerDown
- },
- [`${componentCls}-content`]: {
- display: 'flex',
- flexDirection: 'column',
- width: '100%',
- height: '100%',
- overflow: 'auto',
- background: colorBgElevated,
- pointerEvents: 'auto'
- },
- // Header
- [`${componentCls}-header`]: {
- display: 'flex',
- flex: 0,
- alignItems: 'center',
- padding: `${(0,cssinjs.unit)(padding)} ${(0,cssinjs.unit)(paddingLG)}`,
- fontSize: fontSizeLG,
- lineHeight: lineHeightLG,
- borderBottom: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- '&-title': {
- display: 'flex',
- flex: 1,
- alignItems: 'center',
- minWidth: 0,
- minHeight: 0
- }
- },
- [`${componentCls}-extra`]: {
- flex: 'none'
- },
- [`${componentCls}-close`]: Object.assign({
- display: 'inline-flex',
- width: calc(fontSizeLG).add(paddingXS).equal(),
- height: calc(fontSizeLG).add(paddingXS).equal(),
- borderRadius: borderRadiusSM,
- justifyContent: 'center',
- alignItems: 'center',
- marginInlineEnd: marginXS,
- color: colorIcon,
- fontWeight: fontWeightStrong,
- fontSize: fontSizeLG,
- fontStyle: 'normal',
- lineHeight: 1,
- textAlign: 'center',
- textTransform: 'none',
- textDecoration: 'none',
- background: 'transparent',
- border: 0,
- cursor: 'pointer',
- transition: `all ${motionDurationMid}`,
- textRendering: 'auto',
- '&:hover': {
- color: colorIconHover,
- backgroundColor: colorBgTextHover,
- textDecoration: 'none'
- },
- '&:active': {
- backgroundColor: colorBgTextActive
- }
- }, (0,style.genFocusStyle)(token)),
- [`${componentCls}-title`]: {
- flex: 1,
- margin: 0,
- fontWeight: token.fontWeightStrong,
- fontSize: fontSizeLG,
- lineHeight: lineHeightLG
- },
- // Body
- [`${componentCls}-body`]: {
- flex: 1,
- minWidth: 0,
- minHeight: 0,
- padding: paddingLG,
- overflow: 'auto',
- [`${componentCls}-body-skeleton`]: {
- width: '100%',
- height: '100%',
- display: 'flex',
- justifyContent: 'center'
- }
- },
- // Footer
- [`${componentCls}-footer`]: {
- flexShrink: 0,
- padding: `${(0,cssinjs.unit)(footerPaddingBlock)} ${(0,cssinjs.unit)(footerPaddingInline)}`,
- borderTop: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${colorSplit}`
- },
- // ====================== RTL =======================
- '&-rtl': {
- direction: 'rtl'
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexPopupBase,
- footerPaddingBlock: token.paddingXS,
- footerPaddingInline: token.padding
- });
- // ============================== Export ==============================
- /* harmony default export */ var drawer_style = ((0,genStyleUtils.genStyleHooks)('Drawer', token => {
- const drawerToken = (0,es.mergeToken)(token, {});
- return [genDrawerStyle(drawerToken), motion(drawerToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/dropdown/style/index.ts":
- /*!********************************************************!*\
- !*** ./components/dropdown/style/index.ts + 1 modules ***!
- \********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ dropdown_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/slide.ts
- var slide = __webpack_require__("./components/style/motion/slide.ts");
- // EXTERNAL MODULE: ./components/style/motion/move.ts
- var move = __webpack_require__("./components/style/motion/move.ts");
- // EXTERNAL MODULE: ./components/style/motion/zoom.ts
- var zoom = __webpack_require__("./components/style/motion/zoom.ts");
- // EXTERNAL MODULE: ./components/style/placementArrow.ts
- var placementArrow = __webpack_require__("./components/style/placementArrow.ts");
- // EXTERNAL MODULE: ./components/style/roundedArrow.ts
- var roundedArrow = __webpack_require__("./components/style/roundedArrow.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/dropdown/style/status.ts
- const genStatusStyle = token => {
- const {
- componentCls,
- menuCls,
- colorError,
- colorTextLightSolid
- } = token;
- const itemCls = `${menuCls}-item`;
- return {
- [`${componentCls}, ${componentCls}-menu-submenu`]: {
- [`${menuCls} ${itemCls}`]: {
- [`&${itemCls}-danger:not(${itemCls}-disabled)`]: {
- color: colorError,
- '&:hover': {
- color: colorTextLightSolid,
- backgroundColor: colorError
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var style_status = (genStatusStyle);
- ;// ./components/dropdown/style/index.ts
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- menuCls,
- zIndexPopup,
- dropdownArrowDistance,
- sizePopupArrow,
- antCls,
- iconCls,
- motionDurationMid,
- paddingBlock,
- fontSize,
- dropdownEdgeChildPadding,
- colorTextDisabled,
- fontSizeIcon,
- controlPaddingHorizontal,
- colorBgElevated
- } = token;
- return [{
- [componentCls]: {
- position: 'absolute',
- top: -9999,
- left: {
- _skip_check_: true,
- value: -9999
- },
- zIndex: zIndexPopup,
- display: 'block',
- // A placeholder out of dropdown visible range to avoid close when user moving
- '&::before': {
- position: 'absolute',
- insetBlock: token.calc(sizePopupArrow).div(2).sub(dropdownArrowDistance).equal(),
- // insetInlineStart: -7, // FIXME: Seems not work for hidden element
- zIndex: -9999,
- opacity: 0.0001,
- content: '""'
- },
- // Makes vertical dropdowns have a scrollbar once they become taller than the viewport.
- '&-menu-vertical': {
- maxHeight: '100vh',
- overflowY: 'auto'
- },
- [`&-trigger${antCls}-btn`]: {
- [`& > ${iconCls}-down, & > ${antCls}-btn-icon > ${iconCls}-down`]: {
- fontSize: fontSizeIcon
- }
- },
- [`${componentCls}-wrap`]: {
- position: 'relative',
- [`${antCls}-btn > ${iconCls}-down`]: {
- fontSize: fontSizeIcon
- },
- [`${iconCls}-down::before`]: {
- transition: `transform ${motionDurationMid}`
- }
- },
- [`${componentCls}-wrap-open`]: {
- [`${iconCls}-down::before`]: {
- transform: `rotate(180deg)`
- }
- },
- [`
- &-hidden,
- &-menu-hidden,
- &-menu-submenu-hidden
- `]: {
- display: 'none'
- },
- // =============================================================
- // == Motion ==
- // =============================================================
- // When position is not enough for dropdown, the placement will revert.
- // We will handle this with revert motion name.
- [`&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomLeft,
- &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomLeft,
- &${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottom,
- &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottom,
- &${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomRight,
- &${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomRight`]: {
- animationName: slide.slideUpIn
- },
- [`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topLeft,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topLeft,
- &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-top,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-top,
- &${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topRight,
- &${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topRight`]: {
- animationName: slide.slideDownIn
- },
- [`&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomLeft,
- &${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottom,
- &${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomRight`]: {
- animationName: slide.slideUpOut
- },
- [`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topLeft,
- &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-top,
- &${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topRight`]: {
- animationName: slide.slideDownOut
- }
- }
- },
- // =============================================================
- // == Arrow style ==
- // =============================================================
- (0,placementArrow["default"])(token, colorBgElevated, {
- arrowPlacement: {
- top: true,
- bottom: true
- }
- }), {
- // =============================================================
- // == Menu ==
- // =============================================================
- [`${componentCls} ${menuCls}`]: {
- position: 'relative',
- margin: 0
- },
- [`${menuCls}-submenu-popup`]: {
- position: 'absolute',
- zIndex: zIndexPopup,
- background: 'transparent',
- boxShadow: 'none',
- transformOrigin: '0 0',
- 'ul, li': {
- listStyle: 'none',
- margin: 0
- }
- },
- [`${componentCls}, ${componentCls}-menu-submenu`]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- [menuCls]: Object.assign(Object.assign({
- padding: dropdownEdgeChildPadding,
- listStyleType: 'none',
- backgroundColor: colorBgElevated,
- backgroundClip: 'padding-box',
- borderRadius: token.borderRadiusLG,
- outline: 'none',
- boxShadow: token.boxShadowSecondary
- }, (0,style.genFocusStyle)(token)), {
- '&:empty': {
- padding: 0,
- boxShadow: 'none'
- },
- [`${menuCls}-item-group-title`]: {
- padding: `${(0,cssinjs.unit)(paddingBlock)} ${(0,cssinjs.unit)(controlPaddingHorizontal)}`,
- color: token.colorTextDescription,
- transition: `all ${motionDurationMid}`
- },
- // ======================= Item Content =======================
- [`${menuCls}-item`]: {
- position: 'relative',
- display: 'flex',
- alignItems: 'center'
- },
- [`${menuCls}-item-icon`]: {
- minWidth: fontSize,
- marginInlineEnd: token.marginXS,
- fontSize: token.fontSizeSM
- },
- [`${menuCls}-title-content`]: {
- flex: 'auto',
- '&-with-extra': {
- display: 'inline-flex',
- alignItems: 'center',
- width: '100%'
- },
- '> a': {
- color: 'inherit',
- transition: `all ${motionDurationMid}`,
- '&:hover': {
- color: 'inherit'
- },
- '&::after': {
- position: 'absolute',
- inset: 0,
- content: '""'
- }
- },
- [`${menuCls}-item-extra`]: {
- paddingInlineStart: token.padding,
- marginInlineStart: 'auto',
- fontSize: token.fontSizeSM,
- color: token.colorTextDescription
- }
- },
- // =========================== Item ===========================
- [`${menuCls}-item, ${menuCls}-submenu-title`]: Object.assign(Object.assign({
- display: 'flex',
- margin: 0,
- padding: `${(0,cssinjs.unit)(paddingBlock)} ${(0,cssinjs.unit)(controlPaddingHorizontal)}`,
- color: token.colorText,
- fontWeight: 'normal',
- fontSize,
- lineHeight: token.lineHeight,
- cursor: 'pointer',
- transition: `all ${motionDurationMid}`,
- borderRadius: token.borderRadiusSM,
- '&:hover, &-active': {
- backgroundColor: token.controlItemBgHover
- }
- }, (0,style.genFocusStyle)(token)), {
- '&-selected': {
- color: token.colorPrimary,
- backgroundColor: token.controlItemBgActive,
- '&:hover, &-active': {
- backgroundColor: token.controlItemBgActiveHover
- }
- },
- '&-disabled': {
- color: colorTextDisabled,
- cursor: 'not-allowed',
- '&:hover': {
- color: colorTextDisabled,
- backgroundColor: colorBgElevated,
- cursor: 'not-allowed'
- },
- a: {
- pointerEvents: 'none'
- }
- },
- '&-divider': {
- height: 1,
- // By design
- margin: `${(0,cssinjs.unit)(token.marginXXS)} 0`,
- overflow: 'hidden',
- lineHeight: 0,
- backgroundColor: token.colorSplit
- },
- [`${componentCls}-menu-submenu-expand-icon`]: {
- position: 'absolute',
- insetInlineEnd: token.paddingXS,
- [`${componentCls}-menu-submenu-arrow-icon`]: {
- marginInlineEnd: '0 !important',
- color: token.colorIcon,
- fontSize: fontSizeIcon,
- fontStyle: 'normal'
- }
- }
- }),
- [`${menuCls}-item-group-list`]: {
- margin: `0 ${(0,cssinjs.unit)(token.marginXS)}`,
- padding: 0,
- listStyle: 'none'
- },
- [`${menuCls}-submenu-title`]: {
- paddingInlineEnd: token.calc(controlPaddingHorizontal).add(token.fontSizeSM).equal()
- },
- [`${menuCls}-submenu-vertical`]: {
- position: 'relative'
- },
- [`${menuCls}-submenu${menuCls}-submenu-disabled ${componentCls}-menu-submenu-title`]: {
- [`&, ${componentCls}-menu-submenu-arrow-icon`]: {
- color: colorTextDisabled,
- backgroundColor: colorBgElevated,
- cursor: 'not-allowed'
- }
- },
- // https://github.com/ant-design/ant-design/issues/19264
- [`${menuCls}-submenu-selected ${componentCls}-menu-submenu-title`]: {
- color: token.colorPrimary
- }
- })
- })
- },
- // Follow code may reuse in other components
- [(0,slide.initSlideMotion)(token, 'slide-up'), (0,slide.initSlideMotion)(token, 'slide-down'), (0,move.initMoveMotion)(token, 'move-up'), (0,move.initMoveMotion)(token, 'move-down'), (0,zoom.initZoomMotion)(token, 'zoom-big')]];
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => Object.assign(Object.assign({
- zIndexPopup: token.zIndexPopupBase + 50,
- paddingBlock: (token.controlHeight - token.fontSize * token.lineHeight) / 2
- }, (0,placementArrow.getArrowOffsetToken)({
- contentRadius: token.borderRadiusLG,
- limitVerticalRadius: true
- })), (0,roundedArrow.getArrowToken)(token));
- /* harmony default export */ var dropdown_style = ((0,genStyleUtils.genStyleHooks)('Dropdown', token => {
- const {
- marginXXS,
- sizePopupArrow,
- paddingXXS,
- componentCls
- } = token;
- const dropdownToken = (0,es.mergeToken)(token, {
- menuCls: `${componentCls}-menu`,
- dropdownArrowDistance: token.calc(sizePopupArrow).div(2).add(marginXXS).equal(),
- dropdownEdgeChildPadding: paddingXXS
- });
- return [genBaseStyle(dropdownToken), style_status(dropdownToken)];
- }, prepareComponentToken, {
- resetStyle: false
- }));
- /***/ }),
- /***/ "./components/empty/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/empty/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Shared ==============================
- const genSharedEmptyStyle = token => {
- const {
- componentCls,
- margin,
- marginXS,
- marginXL,
- fontSize,
- lineHeight
- } = token;
- return {
- [componentCls]: {
- marginInline: marginXS,
- fontSize,
- lineHeight,
- textAlign: 'center',
- // 原来 &-image 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
- [`${componentCls}-image`]: {
- height: token.emptyImgHeight,
- marginBottom: marginXS,
- opacity: token.opacityImage,
- img: {
- height: '100%'
- },
- svg: {
- maxWidth: '100%',
- height: '100%',
- margin: 'auto'
- }
- },
- [`${componentCls}-description`]: {
- color: token.colorTextDescription
- },
- // 原来 &-footer 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
- [`${componentCls}-footer`]: {
- marginTop: margin
- },
- '&-normal': {
- marginBlock: marginXL,
- color: token.colorTextDescription,
- [`${componentCls}-description`]: {
- color: token.colorTextDescription
- },
- [`${componentCls}-image`]: {
- height: token.emptyImgHeightMD
- }
- },
- '&-small': {
- marginBlock: marginXS,
- color: token.colorTextDescription,
- [`${componentCls}-image`]: {
- height: token.emptyImgHeightSM
- }
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.genStyleHooks)('Empty', token => {
- const {
- componentCls,
- controlHeightLG,
- calc
- } = token;
- const emptyToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.mergeToken)(token, {
- emptyImgCls: `${componentCls}-img`,
- emptyImgHeight: calc(controlHeightLG).mul(2.5).equal(),
- emptyImgHeightMD: controlHeightLG,
- emptyImgHeightSM: calc(controlHeightLG).mul(0.875).equal()
- });
- return genSharedEmptyStyle(emptyToken);
- }));
- /***/ }),
- /***/ "./components/flex/style/index.ts":
- /*!****************************************!*\
- !*** ./components/flex/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./components/flex/utils.ts");
- const genFlexStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- display: 'flex',
- margin: 0,
- padding: 0,
- '&-vertical': {
- flexDirection: 'column'
- },
- '&-rtl': {
- direction: 'rtl'
- },
- '&:empty': {
- display: 'none'
- }
- }
- };
- };
- const genFlexGapStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- '&-gap-small': {
- gap: token.flexGapSM
- },
- '&-gap-middle': {
- gap: token.flexGap
- },
- '&-gap-large': {
- gap: token.flexGapLG
- }
- }
- };
- };
- const genFlexWrapStyle = token => {
- const {
- componentCls
- } = token;
- const wrapStyle = {};
- _utils__WEBPACK_IMPORTED_MODULE_2__.flexWrapValues.forEach(value => {
- wrapStyle[`${componentCls}-wrap-${value}`] = {
- flexWrap: value
- };
- });
- return wrapStyle;
- };
- const genAlignItemsStyle = token => {
- const {
- componentCls
- } = token;
- const alignStyle = {};
- _utils__WEBPACK_IMPORTED_MODULE_2__.alignItemsValues.forEach(value => {
- alignStyle[`${componentCls}-align-${value}`] = {
- alignItems: value
- };
- });
- return alignStyle;
- };
- const genJustifyContentStyle = token => {
- const {
- componentCls
- } = token;
- const justifyStyle = {};
- _utils__WEBPACK_IMPORTED_MODULE_2__.justifyContentValues.forEach(value => {
- justifyStyle[`${componentCls}-justify-${value}`] = {
- justifyContent: value
- };
- });
- return justifyStyle;
- };
- const prepareComponentToken = () => ({});
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.genStyleHooks)('Flex', token => {
- const {
- paddingXS,
- padding,
- paddingLG
- } = token;
- const flexToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.mergeToken)(token, {
- flexGapSM: paddingXS,
- flexGap: padding,
- flexGapLG: paddingLG
- });
- return [genFlexStyle(flexToken), genFlexGapStyle(flexToken), genFlexWrapStyle(flexToken), genAlignItemsStyle(flexToken), genJustifyContentStyle(flexToken)];
- }, prepareComponentToken, {
- // Flex component don't apply extra font style
- // https://github.com/ant-design/ant-design/issues/46403
- resetStyle: false
- }));
- /***/ }),
- /***/ "./components/flex/utils.ts":
- /*!**********************************!*\
- !*** ./components/flex/utils.ts ***!
- \**********************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ alignItemsValues: function() { return /* binding */ alignItemsValues; },
- /* harmony export */ flexWrapValues: function() { return /* binding */ flexWrapValues; },
- /* harmony export */ justifyContentValues: function() { return /* binding */ justifyContentValues; }
- /* harmony export */ });
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
- const flexWrapValues = ['wrap', 'nowrap', 'wrap-reverse'];
- const justifyContentValues = ['flex-start', 'flex-end', 'start', 'end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch', 'normal', 'left', 'right'];
- const alignItemsValues = ['center', 'start', 'end', 'flex-start', 'flex-end', 'self-start', 'self-end', 'baseline', 'normal', 'stretch'];
- const genClsWrap = (prefixCls, props) => {
- const wrap = props.wrap === true ? 'wrap' : props.wrap;
- return {
- [`${prefixCls}-wrap-${wrap}`]: wrap && flexWrapValues.includes(wrap)
- };
- };
- const genClsAlign = (prefixCls, props) => {
- const alignCls = {};
- alignItemsValues.forEach(cssKey => {
- alignCls[`${prefixCls}-align-${cssKey}`] = props.align === cssKey;
- });
- alignCls[`${prefixCls}-align-stretch`] = !props.align && !!props.vertical;
- return alignCls;
- };
- const genClsJustify = (prefixCls, props) => {
- const justifyCls = {};
- justifyContentValues.forEach(cssKey => {
- justifyCls[`${prefixCls}-justify-${cssKey}`] = props.justify === cssKey;
- });
- return justifyCls;
- };
- function createFlexClassNames(prefixCls, props) {
- return classnames__WEBPACK_IMPORTED_MODULE_0___default()(Object.assign(Object.assign(Object.assign({}, genClsWrap(prefixCls, props)), genClsAlign(prefixCls, props)), genClsJustify(prefixCls, props)));
- }
- /* harmony default export */ __webpack_exports__["default"] = (createFlexClassNames);
- /***/ }),
- /***/ "./components/float-button/style/index.ts":
- /*!************************************************************!*\
- !*** ./components/float-button/style/index.ts + 2 modules ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ float_button_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/fade.ts
- var fade = __webpack_require__("./components/style/motion/fade.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/float-button/util.ts
- const getOffset = radius => {
- if (radius === 0) {
- return 0;
- }
- // 如果要考虑通用性,这里应该用三角函数 Math.sin(45)
- // 但是这个场景比较特殊,始终是等腰直角三角形,所以直接用 Math.sqrt() 开方即可
- return radius - Math.sqrt(Math.pow(radius, 2) / 2);
- };
- /* harmony default export */ var util = (getOffset);
- // EXTERNAL MODULE: ./components/style/motion/motion.ts
- var motion = __webpack_require__("./components/style/motion/motion.ts");
- ;// ./components/float-button/style/keyframes.ts
- const floatButtonGroupMotion = token => {
- const {
- componentCls,
- floatButtonSize,
- motionDurationSlow,
- motionEaseInOutCirc,
- calc
- } = token;
- const moveTopIn = new cssinjs.Keyframes('antFloatButtonMoveTopIn', {
- '0%': {
- transform: `translate3d(0, ${(0,cssinjs.unit)(floatButtonSize)}, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveTopOut = new cssinjs.Keyframes('antFloatButtonMoveTopOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: `translate3d(0, ${(0,cssinjs.unit)(floatButtonSize)}, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveRightIn = new cssinjs.Keyframes('antFloatButtonMoveRightIn', {
- '0%': {
- transform: `translate3d(${(0,cssinjs.unit)(calc(floatButtonSize).mul(-1).equal())}, 0, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveRightOut = new cssinjs.Keyframes('antFloatButtonMoveRightOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: `translate3d(${(0,cssinjs.unit)(calc(floatButtonSize).mul(-1).equal())}, 0, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveBottomIn = new cssinjs.Keyframes('antFloatButtonMoveBottomIn', {
- '0%': {
- transform: `translate3d(0, ${(0,cssinjs.unit)(calc(floatButtonSize).mul(-1).equal())}, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveBottomOut = new cssinjs.Keyframes('antFloatButtonMoveBottomOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: `translate3d(0, ${(0,cssinjs.unit)(calc(floatButtonSize).mul(-1).equal())}, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveLeftIn = new cssinjs.Keyframes('antFloatButtonMoveLeftIn', {
- '0%': {
- transform: `translate3d(${(0,cssinjs.unit)(floatButtonSize)}, 0, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveLeftOut = new cssinjs.Keyframes('antFloatButtonMoveLeftOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: `translate3d(${(0,cssinjs.unit)(floatButtonSize)}, 0, 0)`,
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const groupPrefixCls = `${componentCls}-group`;
- return [{
- [groupPrefixCls]: {
- [`&${groupPrefixCls}-top ${groupPrefixCls}-wrap`]: (0,motion.initMotion)(`${groupPrefixCls}-wrap`, moveTopIn, moveTopOut, motionDurationSlow, true),
- [`&${groupPrefixCls}-bottom ${groupPrefixCls}-wrap`]: (0,motion.initMotion)(`${groupPrefixCls}-wrap`, moveBottomIn, moveBottomOut, motionDurationSlow, true),
- [`&${groupPrefixCls}-left ${groupPrefixCls}-wrap`]: (0,motion.initMotion)(`${groupPrefixCls}-wrap`, moveLeftIn, moveLeftOut, motionDurationSlow, true),
- [`&${groupPrefixCls}-right ${groupPrefixCls}-wrap`]: (0,motion.initMotion)(`${groupPrefixCls}-wrap`, moveRightIn, moveRightOut, motionDurationSlow, true)
- }
- }, {
- [`${groupPrefixCls}-wrap`]: {
- [`&${groupPrefixCls}-wrap-enter, &${groupPrefixCls}-wrap-appear`]: {
- opacity: 0,
- animationTimingFunction: motionEaseInOutCirc
- },
- [`&${groupPrefixCls}-wrap-leave`]: {
- opacity: 1,
- animationTimingFunction: motionEaseInOutCirc
- }
- }
- }];
- };
- /* harmony default export */ var keyframes = (floatButtonGroupMotion);
- ;// ./components/float-button/style/index.ts
- // ============================== Group ==============================
- const floatButtonGroupStyle = token => {
- const {
- antCls,
- componentCls,
- floatButtonSize,
- margin,
- borderRadiusLG,
- borderRadiusSM,
- badgeOffset,
- floatButtonBodyPadding,
- zIndexPopupBase,
- calc
- } = token;
- const groupPrefixCls = `${componentCls}-group`;
- return {
- [groupPrefixCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- zIndex: zIndexPopupBase,
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- justifyContent: 'center',
- border: 'none',
- position: 'fixed',
- height: 'auto',
- boxShadow: 'none',
- minWidth: floatButtonSize,
- minHeight: floatButtonSize,
- insetInlineEnd: token.floatButtonInsetInlineEnd,
- bottom: token.floatButtonInsetBlockEnd,
- borderRadius: borderRadiusLG,
- [`${groupPrefixCls}-wrap`]: {
- zIndex: -1,
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- position: 'absolute'
- },
- [`&${groupPrefixCls}-rtl`]: {
- direction: 'rtl'
- },
- [componentCls]: {
- position: 'static'
- }
- }),
- [`${groupPrefixCls}-top > ${groupPrefixCls}-wrap`]: {
- flexDirection: 'column',
- top: 'auto',
- bottom: calc(floatButtonSize).add(margin).equal(),
- '&::after': {
- content: '""',
- position: 'absolute',
- width: '100%',
- height: margin,
- bottom: calc(margin).mul(-1).equal()
- }
- },
- [`${groupPrefixCls}-bottom > ${groupPrefixCls}-wrap`]: {
- flexDirection: 'column',
- top: calc(floatButtonSize).add(margin).equal(),
- bottom: 'auto',
- '&::after': {
- content: '""',
- position: 'absolute',
- width: '100%',
- height: margin,
- top: calc(margin).mul(-1).equal()
- }
- },
- [`${groupPrefixCls}-right > ${groupPrefixCls}-wrap`]: {
- flexDirection: 'row',
- left: {
- _skip_check_: true,
- value: calc(floatButtonSize).add(margin).equal()
- },
- right: {
- _skip_check_: true,
- value: 'auto'
- },
- '&::after': {
- content: '""',
- position: 'absolute',
- width: margin,
- height: '100%',
- left: {
- _skip_check_: true,
- value: calc(margin).mul(-1).equal()
- }
- }
- },
- [`${groupPrefixCls}-left > ${groupPrefixCls}-wrap`]: {
- flexDirection: 'row',
- left: {
- _skip_check_: true,
- value: 'auto'
- },
- right: {
- _skip_check_: true,
- value: calc(floatButtonSize).add(margin).equal()
- },
- '&::after': {
- content: '""',
- position: 'absolute',
- width: margin,
- height: '100%',
- right: {
- _skip_check_: true,
- value: calc(margin).mul(-1).equal()
- }
- }
- },
- [`${groupPrefixCls}-circle`]: {
- gap: margin,
- [`${groupPrefixCls}-wrap`]: {
- gap: margin
- }
- },
- [`${groupPrefixCls}-square`]: {
- [`${componentCls}-square`]: {
- padding: 0,
- borderRadius: 0,
- [`&${groupPrefixCls}-trigger`]: {
- borderRadius: borderRadiusLG
- },
- '&:first-child': {
- borderStartStartRadius: borderRadiusLG,
- borderStartEndRadius: borderRadiusLG
- },
- '&:last-child': {
- borderEndStartRadius: borderRadiusLG,
- borderEndEndRadius: borderRadiusLG
- },
- '&:not(:last-child)': {
- borderBottom: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- },
- [`${antCls}-badge`]: {
- [`${antCls}-badge-count`]: {
- top: calc(calc(floatButtonBodyPadding).add(badgeOffset)).mul(-1).equal(),
- insetInlineEnd: calc(calc(floatButtonBodyPadding).add(badgeOffset)).mul(-1).equal()
- }
- }
- },
- [`${groupPrefixCls}-wrap`]: {
- borderRadius: borderRadiusLG,
- boxShadow: token.boxShadowSecondary,
- [`${componentCls}-square`]: {
- boxShadow: 'none',
- borderRadius: 0,
- padding: floatButtonBodyPadding,
- [`${componentCls}-body`]: {
- width: token.floatButtonBodySize,
- height: token.floatButtonBodySize,
- borderRadius: borderRadiusSM
- }
- }
- }
- },
- [`${groupPrefixCls}-top > ${groupPrefixCls}-wrap, ${groupPrefixCls}-bottom > ${groupPrefixCls}-wrap`]: {
- [`> ${componentCls}-square`]: {
- '&:first-child': {
- borderStartStartRadius: borderRadiusLG,
- borderStartEndRadius: borderRadiusLG
- },
- '&:last-child': {
- borderEndStartRadius: borderRadiusLG,
- borderEndEndRadius: borderRadiusLG
- },
- '&:not(:last-child)': {
- borderBottom: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- }
- }
- },
- [`${groupPrefixCls}-left > ${groupPrefixCls}-wrap, ${groupPrefixCls}-right > ${groupPrefixCls}-wrap`]: {
- [`> ${componentCls}-square`]: {
- '&:first-child': {
- borderStartStartRadius: borderRadiusLG,
- borderEndStartRadius: borderRadiusLG
- },
- '&:last-child': {
- borderStartEndRadius: borderRadiusLG,
- borderEndEndRadius: borderRadiusLG
- },
- '&:not(:last-child)': {
- borderBottom: 'none',
- borderInlineEnd: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- }
- }
- },
- [`${groupPrefixCls}-circle-shadow`]: {
- boxShadow: 'none'
- },
- [`${groupPrefixCls}-square-shadow`]: {
- boxShadow: token.boxShadowSecondary,
- [`${componentCls}-square`]: {
- boxShadow: 'none',
- padding: floatButtonBodyPadding,
- [`${componentCls}-body`]: {
- width: token.floatButtonBodySize,
- height: token.floatButtonBodySize,
- borderRadius: borderRadiusSM
- }
- }
- }
- };
- };
- // ============================== Shared ==============================
- const sharedFloatButtonStyle = token => {
- const {
- antCls,
- componentCls,
- floatButtonBodyPadding,
- floatButtonIconSize,
- floatButtonSize,
- borderRadiusLG,
- badgeOffset,
- dotOffsetInSquare,
- dotOffsetInCircle,
- zIndexPopupBase,
- calc
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- border: 'none',
- position: 'fixed',
- cursor: 'pointer',
- zIndex: zIndexPopupBase,
- // Do not remove the 'display: block' here.
- // Deleting it will cause marginBottom to become ineffective.
- // Ref: https://github.com/ant-design/ant-design/issues/44700
- display: 'block',
- width: floatButtonSize,
- height: floatButtonSize,
- insetInlineEnd: token.floatButtonInsetInlineEnd,
- bottom: token.floatButtonInsetBlockEnd,
- boxShadow: token.boxShadowSecondary,
- // Pure Panel
- '&-pure': {
- position: 'relative',
- inset: 'auto'
- },
- '&:empty': {
- display: 'none'
- },
- [`${antCls}-badge`]: {
- width: '100%',
- height: '100%',
- [`${antCls}-badge-count`]: {
- transform: 'translate(0, 0)',
- transformOrigin: 'center',
- top: calc(badgeOffset).mul(-1).equal(),
- insetInlineEnd: calc(badgeOffset).mul(-1).equal()
- }
- },
- [`${componentCls}-body`]: {
- width: '100%',
- height: '100%',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- transition: `all ${token.motionDurationMid}`,
- [`${componentCls}-content`]: {
- overflow: 'hidden',
- textAlign: 'center',
- minHeight: floatButtonSize,
- display: 'flex',
- flexDirection: 'column',
- justifyContent: 'center',
- alignItems: 'center',
- padding: `${(0,cssinjs.unit)(calc(floatButtonBodyPadding).div(2).equal())} ${(0,cssinjs.unit)(floatButtonBodyPadding)}`,
- [`${componentCls}-icon`]: {
- textAlign: 'center',
- margin: 'auto',
- width: floatButtonIconSize,
- fontSize: floatButtonIconSize,
- lineHeight: 1
- }
- }
- }
- }),
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- },
- [`${componentCls}-circle`]: {
- height: floatButtonSize,
- borderRadius: '50%',
- [`${antCls}-badge`]: {
- [`${antCls}-badge-dot`]: {
- top: dotOffsetInCircle,
- insetInlineEnd: dotOffsetInCircle
- }
- },
- [`${componentCls}-body`]: {
- borderRadius: '50%'
- }
- },
- [`${componentCls}-square`]: {
- height: 'auto',
- minHeight: floatButtonSize,
- borderRadius: borderRadiusLG,
- [`${antCls}-badge`]: {
- [`${antCls}-badge-dot`]: {
- top: dotOffsetInSquare,
- insetInlineEnd: dotOffsetInSquare
- }
- },
- [`${componentCls}-body`]: {
- height: 'auto',
- borderRadius: borderRadiusLG
- }
- },
- [`${componentCls}-default`]: {
- backgroundColor: token.floatButtonBackgroundColor,
- transition: `background-color ${token.motionDurationMid}`,
- [`${componentCls}-body`]: {
- backgroundColor: token.floatButtonBackgroundColor,
- transition: `background-color ${token.motionDurationMid}`,
- '&:hover': {
- backgroundColor: token.colorFillContent
- },
- [`${componentCls}-content`]: {
- [`${componentCls}-icon`]: {
- color: token.colorText
- },
- [`${componentCls}-description`]: {
- display: 'flex',
- alignItems: 'center',
- lineHeight: (0,cssinjs.unit)(token.fontSizeLG),
- color: token.colorText,
- fontSize: token.fontSizeSM
- }
- }
- }
- },
- [`${componentCls}-primary`]: {
- backgroundColor: token.colorPrimary,
- [`${componentCls}-body`]: {
- backgroundColor: token.colorPrimary,
- transition: `background-color ${token.motionDurationMid}`,
- '&:hover': {
- backgroundColor: token.colorPrimaryHover
- },
- [`${componentCls}-content`]: {
- [`${componentCls}-icon`]: {
- color: token.colorTextLightSolid
- },
- [`${componentCls}-description`]: {
- display: 'flex',
- alignItems: 'center',
- lineHeight: (0,cssinjs.unit)(token.fontSizeLG),
- color: token.colorTextLightSolid,
- fontSize: token.fontSizeSM
- }
- }
- }
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- dotOffsetInCircle: util(token.controlHeightLG / 2),
- dotOffsetInSquare: util(token.borderRadiusLG)
- });
- /* harmony default export */ var float_button_style = ((0,genStyleUtils.genStyleHooks)('FloatButton', token => {
- const {
- colorTextLightSolid,
- colorBgElevated,
- controlHeightLG,
- marginXXL,
- marginLG,
- fontSize,
- fontSizeIcon,
- controlItemBgHover,
- paddingXXS,
- calc
- } = token;
- const floatButtonToken = (0,es.mergeToken)(token, {
- floatButtonBackgroundColor: colorBgElevated,
- floatButtonColor: colorTextLightSolid,
- floatButtonHoverBackgroundColor: controlItemBgHover,
- floatButtonFontSize: fontSize,
- floatButtonIconSize: calc(fontSizeIcon).mul(1.5).equal(),
- floatButtonSize: controlHeightLG,
- floatButtonInsetBlockEnd: marginXXL,
- floatButtonInsetInlineEnd: marginLG,
- floatButtonBodySize: calc(controlHeightLG).sub(calc(paddingXXS).mul(2)).equal(),
- // 这里的 paddingXXS 是简写,完整逻辑是 (controlHeightLG - (controlHeightLG - paddingXXS * 2)) / 2,
- floatButtonBodyPadding: paddingXXS,
- badgeOffset: calc(paddingXXS).mul(1.5).equal()
- });
- return [floatButtonGroupStyle(floatButtonToken), sharedFloatButtonStyle(floatButtonToken), (0,fade.initFadeMotion)(token), keyframes(floatButtonToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/form/style/index.ts":
- /*!****************************************************!*\
- !*** ./components/form/style/index.ts + 1 modules ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ form_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- prepareToken: function() { return /* binding */ prepareToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/zoom.ts
- var zoom = __webpack_require__("./components/style/motion/zoom.ts");
- // EXTERNAL MODULE: ./components/style/motion/collapse.ts
- var collapse = __webpack_require__("./components/style/motion/collapse.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- ;// ./components/form/style/explain.ts
- const genFormValidateMotionStyle = token => {
- const {
- componentCls
- } = token;
- const helpCls = `${componentCls}-show-help`;
- const helpItemCls = `${componentCls}-show-help-item`;
- return {
- [helpCls]: {
- // Explain holder
- transition: `opacity ${token.motionDurationFast} ${token.motionEaseInOut}`,
- '&-appear, &-enter': {
- opacity: 0,
- '&-active': {
- opacity: 1
- }
- },
- '&-leave': {
- opacity: 1,
- '&-active': {
- opacity: 0
- }
- },
- // Explain
- [helpItemCls]: {
- overflow: 'hidden',
- transition: `height ${token.motionDurationFast} ${token.motionEaseInOut},
- opacity ${token.motionDurationFast} ${token.motionEaseInOut},
- transform ${token.motionDurationFast} ${token.motionEaseInOut} !important`,
- [`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
- transform: `translateY(-5px)`,
- opacity: 0,
- '&-active': {
- transform: 'translateY(0)',
- opacity: 1
- }
- },
- [`&${helpItemCls}-leave-active`]: {
- transform: `translateY(-5px)`
- }
- }
- }
- };
- };
- /* harmony default export */ var explain = (genFormValidateMotionStyle);
- ;// ./components/form/style/index.ts
- const resetForm = token => ({
- legend: {
- display: 'block',
- width: '100%',
- marginBottom: token.marginLG,
- padding: 0,
- color: token.colorTextDescription,
- fontSize: token.fontSizeLG,
- lineHeight: 'inherit',
- border: 0,
- borderBottom: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- },
- 'input[type="search"]': {
- boxSizing: 'border-box'
- },
- // Position radios and checkboxes better
- 'input[type="radio"], input[type="checkbox"]': {
- lineHeight: 'normal'
- },
- 'input[type="file"]': {
- display: 'block'
- },
- // Make range inputs behave like textual form controls
- 'input[type="range"]': {
- display: 'block',
- width: '100%'
- },
- // Make multiple select elements height not fixed
- 'select[multiple], select[size]': {
- height: 'auto'
- },
- // Focus for file, radio, and checkbox
- [`input[type='file']:focus,
- input[type='radio']:focus,
- input[type='checkbox']:focus`]: {
- outline: 0,
- boxShadow: `0 0 0 ${(0,cssinjs.unit)(token.controlOutlineWidth)} ${token.controlOutline}`
- },
- // Adjust output element
- output: {
- display: 'block',
- paddingTop: 15,
- color: token.colorText,
- fontSize: token.fontSize,
- lineHeight: token.lineHeight
- }
- });
- const genFormSize = (token, height) => {
- const {
- formItemCls
- } = token;
- return {
- [formItemCls]: {
- [`${formItemCls}-label > label`]: {
- height
- },
- [`${formItemCls}-control-input`]: {
- minHeight: height
- }
- }
- };
- };
- const genFormStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [token.componentCls]: Object.assign(Object.assign(Object.assign({}, (0,style.resetComponent)(token)), resetForm(token)), {
- [`${componentCls}-text`]: {
- display: 'inline-block',
- paddingInlineEnd: token.paddingSM
- },
- // ================================================================
- // = Size =
- // ================================================================
- '&-small': Object.assign({}, genFormSize(token, token.controlHeightSM)),
- '&-large': Object.assign({}, genFormSize(token, token.controlHeightLG))
- })
- };
- };
- const genFormItemStyle = token => {
- const {
- formItemCls,
- iconCls,
- rootPrefixCls,
- antCls,
- labelRequiredMarkColor,
- labelColor,
- labelFontSize,
- labelHeight,
- labelColonMarginInlineStart,
- labelColonMarginInlineEnd,
- itemMarginBottom
- } = token;
- return {
- [formItemCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- marginBottom: itemMarginBottom,
- verticalAlign: 'top',
- '&-with-help': {
- transition: 'none'
- },
- [`&-hidden,
- &-hidden${antCls}-row`]: {
- // https://github.com/ant-design/ant-design/issues/26141
- display: 'none'
- },
- '&-has-warning': {
- [`${formItemCls}-split`]: {
- color: token.colorError
- }
- },
- '&-has-error': {
- [`${formItemCls}-split`]: {
- color: token.colorWarning
- }
- },
- // ==============================================================
- // = Label =
- // ==============================================================
- [`${formItemCls}-label`]: {
- flexGrow: 0,
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textAlign: 'end',
- verticalAlign: 'middle',
- '&-left': {
- textAlign: 'start'
- },
- '&-wrap': {
- overflow: 'unset',
- lineHeight: token.lineHeight,
- whiteSpace: 'unset',
- '> label': {
- verticalAlign: 'middle',
- textWrap: 'balance'
- }
- },
- '> label': {
- position: 'relative',
- display: 'inline-flex',
- alignItems: 'center',
- maxWidth: '100%',
- height: labelHeight,
- color: labelColor,
- fontSize: labelFontSize,
- [`> ${iconCls}`]: {
- fontSize: token.fontSize,
- verticalAlign: 'top'
- },
- [`&${formItemCls}-required`]: {
- '&::before': {
- display: 'inline-block',
- marginInlineEnd: token.marginXXS,
- color: labelRequiredMarkColor,
- fontSize: token.fontSize,
- fontFamily: 'SimSun, sans-serif',
- lineHeight: 1,
- content: '"*"'
- },
- [`&${formItemCls}-required-mark-hidden, &${formItemCls}-required-mark-optional`]: {
- '&::before': {
- display: 'none'
- }
- }
- },
- // Optional mark
- [`${formItemCls}-optional`]: {
- display: 'inline-block',
- marginInlineStart: token.marginXXS,
- color: token.colorTextDescription,
- [`&${formItemCls}-required-mark-hidden`]: {
- display: 'none'
- }
- },
- // Optional mark
- [`${formItemCls}-tooltip`]: {
- color: token.colorTextDescription,
- cursor: 'help',
- writingMode: 'horizontal-tb',
- marginInlineStart: token.marginXXS
- },
- '&::after': {
- content: '":"',
- position: 'relative',
- marginBlock: 0,
- marginInlineStart: labelColonMarginInlineStart,
- marginInlineEnd: labelColonMarginInlineEnd
- },
- [`&${formItemCls}-no-colon::after`]: {
- content: '"\\a0"'
- }
- }
- },
- // ==============================================================
- // = Input =
- // ==============================================================
- [`${formItemCls}-control`]: {
- ['--ant-display']: 'flex',
- flexDirection: 'column',
- flexGrow: 1,
- [`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: {
- width: '100%'
- },
- '&-input': {
- position: 'relative',
- display: 'flex',
- alignItems: 'center',
- minHeight: token.controlHeight,
- '&-content': {
- flex: 'auto',
- maxWidth: '100%',
- // Fix https://github.com/ant-design/ant-design/issues/54042
- // Remove impact of whitespaces
- [`&:has(> ${antCls}-switch:only-child, > ${antCls}-rate:only-child)`]: {
- display: 'flex',
- alignItems: 'center'
- }
- }
- }
- },
- // ==============================================================
- // = Explain =
- // ==============================================================
- [formItemCls]: {
- '&-additional': {
- display: 'flex',
- flexDirection: 'column'
- },
- '&-explain, &-extra': {
- clear: 'both',
- color: token.colorTextDescription,
- fontSize: token.fontSize,
- lineHeight: token.lineHeight
- },
- '&-explain-connected': {
- width: '100%'
- },
- '&-extra': {
- minHeight: token.controlHeightSM,
- transition: `color ${token.motionDurationMid} ${token.motionEaseOut}` // sync input color transition
- },
- '&-explain': {
- '&-error': {
- color: token.colorError
- },
- '&-warning': {
- color: token.colorWarning
- }
- }
- },
- [`&-with-help ${formItemCls}-explain`]: {
- height: 'auto',
- opacity: 1
- },
- // ==============================================================
- // = Feedback Icon =
- // ==============================================================
- [`${formItemCls}-feedback-icon`]: {
- fontSize: token.fontSize,
- textAlign: 'center',
- visibility: 'visible',
- animationName: zoom.zoomIn,
- animationDuration: token.motionDurationMid,
- animationTimingFunction: token.motionEaseOutBack,
- pointerEvents: 'none',
- '&-success': {
- color: token.colorSuccess
- },
- '&-error': {
- color: token.colorError
- },
- '&-warning': {
- color: token.colorWarning
- },
- '&-validating': {
- color: token.colorPrimary
- }
- }
- })
- };
- };
- const makeVerticalLayoutLabel = token => ({
- padding: token.verticalLabelPadding,
- margin: token.verticalLabelMargin,
- whiteSpace: 'initial',
- textAlign: 'start',
- '> label': {
- margin: 0,
- '&::after': {
- // https://github.com/ant-design/ant-design/issues/43538
- visibility: 'hidden'
- }
- }
- });
- const genHorizontalStyle = token => {
- const {
- antCls,
- formItemCls
- } = token;
- return {
- [`${formItemCls}-horizontal`]: {
- [`${formItemCls}-label`]: {
- flexGrow: 0
- },
- [`${formItemCls}-control`]: {
- flex: '1 1 0',
- // https://github.com/ant-design/ant-design/issues/32777
- // https://github.com/ant-design/ant-design/issues/33773
- minWidth: 0
- },
- // Do not change this to `ant-col-24`! `-24` match all the responsive rules
- // https://github.com/ant-design/ant-design/issues/32980
- // https://github.com/ant-design/ant-design/issues/34903
- // https://github.com/ant-design/ant-design/issues/44538
- [`${formItemCls}-label[class$='-24'], ${formItemCls}-label[class*='-24 ']`]: {
- [`& + ${formItemCls}-control`]: {
- minWidth: 'unset'
- }
- },
- [`${antCls}-col-24${formItemCls}-label,
- ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- }
- };
- };
- const genInlineStyle = token => {
- const {
- componentCls,
- formItemCls,
- inlineItemMarginBottom
- } = token;
- return {
- [`${componentCls}-inline`]: {
- display: 'flex',
- flexWrap: 'wrap',
- [`${formItemCls}-inline`]: {
- flex: 'none',
- marginInlineEnd: token.margin,
- marginBottom: inlineItemMarginBottom,
- '&-row': {
- flexWrap: 'nowrap'
- },
- [`> ${formItemCls}-label,
- > ${formItemCls}-control`]: {
- display: 'inline-block',
- verticalAlign: 'top'
- },
- [`> ${formItemCls}-label`]: {
- flex: 'none'
- },
- [`${componentCls}-text`]: {
- display: 'inline-block'
- },
- [`${formItemCls}-has-feedback`]: {
- display: 'inline-block'
- }
- }
- }
- };
- };
- const makeVerticalLayout = token => {
- const {
- componentCls,
- formItemCls,
- rootPrefixCls
- } = token;
- return {
- [`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
- // ref: https://github.com/ant-design/ant-design/issues/45122
- [`${componentCls}:not(${componentCls}-inline)`]: {
- [formItemCls]: {
- flexWrap: 'wrap',
- [`${formItemCls}-label, ${formItemCls}-control`]: {
- // When developer pass `xs: { span }`,
- // It should follow the `xs` screen config
- // ref: https://github.com/ant-design/ant-design/issues/44386
- [`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
- flex: '0 0 100%',
- maxWidth: '100%'
- }
- }
- }
- }
- };
- };
- const genVerticalStyle = token => {
- const {
- componentCls,
- formItemCls,
- antCls
- } = token;
- return {
- [`${formItemCls}-vertical`]: {
- [`${formItemCls}-row`]: {
- flexDirection: 'column'
- },
- [`${formItemCls}-label > label`]: {
- height: 'auto'
- },
- [`${formItemCls}-control`]: {
- width: '100%'
- },
- [`${formItemCls}-label,
- ${antCls}-col-24${formItemCls}-label,
- ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- },
- [`@media (max-width: ${(0,cssinjs.unit)(token.screenXSMax)})`]: [makeVerticalLayout(token), {
- [componentCls]: {
- [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
- [`${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- }
- }
- }],
- [`@media (max-width: ${(0,cssinjs.unit)(token.screenSMMax)})`]: {
- [componentCls]: {
- [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
- [`${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- }
- }
- },
- [`@media (max-width: ${(0,cssinjs.unit)(token.screenMDMax)})`]: {
- [componentCls]: {
- [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
- [`${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- }
- }
- },
- [`@media (max-width: ${(0,cssinjs.unit)(token.screenLGMax)})`]: {
- [componentCls]: {
- [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
- [`${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
- }
- }
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- labelRequiredMarkColor: token.colorError,
- labelColor: token.colorTextHeading,
- labelFontSize: token.fontSize,
- labelHeight: token.controlHeight,
- labelColonMarginInlineStart: token.marginXXS / 2,
- labelColonMarginInlineEnd: token.marginXS,
- itemMarginBottom: token.marginLG,
- verticalLabelPadding: `0 0 ${token.paddingXS}px`,
- verticalLabelMargin: 0,
- inlineItemMarginBottom: 0
- });
- const prepareToken = (token, rootPrefixCls) => {
- const formToken = (0,es.mergeToken)(token, {
- formItemCls: `${token.componentCls}-item`,
- rootPrefixCls
- });
- return formToken;
- };
- /* harmony default export */ var form_style = ((0,genStyleUtils.genStyleHooks)('Form', (token, {
- rootPrefixCls
- }) => {
- const formToken = prepareToken(token, rootPrefixCls);
- return [genFormStyle(formToken), genFormItemStyle(formToken), explain(formToken), genHorizontalStyle(formToken), genInlineStyle(formToken), genVerticalStyle(formToken), (0,collapse["default"])(formToken), zoom.zoomIn];
- }, prepareComponentToken, {
- // Let From style before the Grid
- // ref https://github.com/ant-design/ant-design/issues/44386
- order: -1000
- }));
- /***/ }),
- /***/ "./components/grid/style/index.ts":
- /*!****************************************!*\
- !*** ./components/grid/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ getMediaSize: function() { return /* binding */ getMediaSize; },
- /* harmony export */ prepareColComponentToken: function() { return /* binding */ prepareColComponentToken; },
- /* harmony export */ prepareRowComponentToken: function() { return /* binding */ prepareRowComponentToken; },
- /* harmony export */ useColStyle: function() { return /* binding */ useColStyle; },
- /* harmony export */ useRowStyle: function() { return /* binding */ useRowStyle; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Row-Shared ==============================
- const genGridRowStyle = token => {
- const {
- componentCls
- } = token;
- return {
- // Grid system
- [componentCls]: {
- display: 'flex',
- flexFlow: 'row wrap',
- minWidth: 0,
- '&::before, &::after': {
- display: 'flex'
- },
- '&-no-wrap': {
- flexWrap: 'nowrap'
- },
- // The origin of the X-axis
- '&-start': {
- justifyContent: 'flex-start'
- },
- // The center of the X-axis
- '&-center': {
- justifyContent: 'center'
- },
- // The opposite of the X-axis
- '&-end': {
- justifyContent: 'flex-end'
- },
- '&-space-between': {
- justifyContent: 'space-between'
- },
- '&-space-around': {
- justifyContent: 'space-around'
- },
- '&-space-evenly': {
- justifyContent: 'space-evenly'
- },
- // Align at the top
- '&-top': {
- alignItems: 'flex-start'
- },
- // Align at the center
- '&-middle': {
- alignItems: 'center'
- },
- '&-bottom': {
- alignItems: 'flex-end'
- }
- }
- };
- };
- // ============================== Col-Shared ==============================
- const genGridColStyle = token => {
- const {
- componentCls
- } = token;
- return {
- // Grid system
- [componentCls]: {
- position: 'relative',
- maxWidth: '100%',
- // Prevent columns from collapsing when empty
- minHeight: 1
- }
- };
- };
- const genLoopGridColumnsStyle = (token, sizeCls) => {
- const {
- prefixCls,
- componentCls,
- gridColumns
- } = token;
- const gridColumnsStyle = {};
- for (let i = gridColumns; i >= 0; i--) {
- if (i === 0) {
- gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = {
- display: 'none'
- };
- gridColumnsStyle[`${componentCls}-push-${i}`] = {
- insetInlineStart: 'auto'
- };
- gridColumnsStyle[`${componentCls}-pull-${i}`] = {
- insetInlineEnd: 'auto'
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = {
- insetInlineStart: 'auto'
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = {
- insetInlineEnd: 'auto'
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = {
- marginInlineStart: 0
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = {
- order: 0
- };
- } else {
- gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = [
- // https://github.com/ant-design/ant-design/issues/44456
- // Form set `display: flex` on Col which will override `display: block`.
- // Let's get it from css variable to support override.
- {
- ['--ant-display']: 'block',
- // Fallback to display if variable not support
- display: 'block'
- }, {
- display: 'var(--ant-display)',
- flex: `0 0 ${i / gridColumns * 100}%`,
- maxWidth: `${i / gridColumns * 100}%`
- }];
- gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = {
- insetInlineStart: `${i / gridColumns * 100}%`
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = {
- insetInlineEnd: `${i / gridColumns * 100}%`
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = {
- marginInlineStart: `${i / gridColumns * 100}%`
- };
- gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = {
- order: i
- };
- }
- }
- // Flex CSS Var
- gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = {
- flex: `var(--${prefixCls}${sizeCls}-flex)`
- };
- return gridColumnsStyle;
- };
- const genGridStyle = (token, sizeCls) => genLoopGridColumnsStyle(token, sizeCls);
- const genGridMediaStyle = (token, screenSize, sizeCls) => ({
- [`@media (min-width: ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(screenSize)})`]: Object.assign({}, genGridStyle(token, sizeCls))
- });
- const prepareRowComponentToken = () => ({});
- const prepareColComponentToken = () => ({});
- // ============================== Export ==============================
- const useRowStyle = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Grid', genGridRowStyle, prepareRowComponentToken);
- const getMediaSize = token => {
- const mediaSizesMap = {
- xs: token.screenXSMin,
- sm: token.screenSMMin,
- md: token.screenMDMin,
- lg: token.screenLGMin,
- xl: token.screenXLMin,
- xxl: token.screenXXLMin
- };
- return mediaSizesMap;
- };
- const useColStyle = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Grid', token => {
- const gridToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.mergeToken)(token, {
- gridColumns: 24 // Row is divided into 24 parts in Grid
- });
- const gridMediaSizesMap = getMediaSize(gridToken);
- delete gridMediaSizesMap.xs;
- return [genGridColStyle(gridToken), genGridStyle(gridToken, ''), genGridStyle(gridToken, '-xs'), Object.keys(gridMediaSizesMap).map(key => genGridMediaStyle(gridToken, gridMediaSizesMap[key], `-${key}`)).reduce((pre, cur) => Object.assign(Object.assign({}, pre), cur), {})];
- }, prepareColComponentToken);
- /***/ }),
- /***/ "./components/image/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/image/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genBoxStyle: function() { return /* binding */ genBoxStyle; },
- /* harmony export */ genImageMaskStyle: function() { return /* binding */ genImageMaskStyle; },
- /* harmony export */ genImagePreviewStyle: function() { return /* binding */ genImagePreviewStyle; },
- /* harmony export */ genPreviewOperationsStyle: function() { return /* binding */ genPreviewOperationsStyle; },
- /* harmony export */ genPreviewSwitchStyle: function() { return /* binding */ genPreviewSwitchStyle; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _modal_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../modal/style */ "./components/modal/style/index.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/fade.ts");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/zoom.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBoxStyle = position => ({
- position: position || 'absolute',
- inset: 0
- });
- const genImageMaskStyle = token => {
- const {
- iconCls,
- motionDurationSlow,
- paddingXXS,
- marginXXS,
- prefixCls,
- colorTextLightSolid
- } = token;
- return {
- position: 'absolute',
- inset: 0,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- color: colorTextLightSolid,
- background: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor('#000').setA(0.5).toRgbString(),
- cursor: 'pointer',
- opacity: 0,
- transition: `opacity ${motionDurationSlow}`,
- [`.${prefixCls}-mask-info`]: Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_3__.textEllipsis), {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXXS)}`,
- [iconCls]: {
- marginInlineEnd: marginXXS,
- svg: {
- verticalAlign: 'baseline'
- }
- }
- })
- };
- };
- const genPreviewOperationsStyle = token => {
- const {
- previewCls,
- modalMaskBg,
- paddingSM,
- marginXL,
- margin,
- paddingLG,
- previewOperationColorDisabled,
- previewOperationHoverColor,
- motionDurationSlow,
- iconCls,
- colorTextLightSolid
- } = token;
- const operationBg = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(modalMaskBg).setA(0.1);
- const operationBgHover = operationBg.clone().setA(0.2);
- return {
- [`${previewCls}-footer`]: {
- position: 'fixed',
- bottom: marginXL,
- left: {
- _skip_check_: true,
- value: '50%'
- },
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- color: token.previewOperationColor,
- transform: 'translateX(-50%)'
- },
- [`${previewCls}-progress`]: {
- marginBottom: margin
- },
- [`${previewCls}-close`]: {
- position: 'fixed',
- top: marginXL,
- right: {
- _skip_check_: true,
- value: marginXL
- },
- display: 'flex',
- color: colorTextLightSolid,
- backgroundColor: operationBg.toRgbString(),
- borderRadius: '50%',
- padding: paddingSM,
- outline: 0,
- border: 0,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- '&:hover': {
- backgroundColor: operationBgHover.toRgbString()
- },
- [`& > ${iconCls}`]: {
- fontSize: token.previewOperationSize
- }
- },
- [`${previewCls}-operations`]: {
- display: 'flex',
- alignItems: 'center',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingLG)}`,
- backgroundColor: operationBg.toRgbString(),
- borderRadius: 100,
- '&-operation': {
- marginInlineStart: paddingSM,
- padding: paddingSM,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- userSelect: 'none',
- [`&:not(${previewCls}-operations-operation-disabled):hover > ${iconCls}`]: {
- color: previewOperationHoverColor
- },
- '&-disabled': {
- color: previewOperationColorDisabled,
- cursor: 'not-allowed'
- },
- '&:first-of-type': {
- marginInlineStart: 0
- },
- [`& > ${iconCls}`]: {
- fontSize: token.previewOperationSize
- }
- }
- }
- };
- };
- const genPreviewSwitchStyle = token => {
- const {
- modalMaskBg,
- iconCls,
- previewOperationColorDisabled,
- previewCls,
- zIndexPopup,
- motionDurationSlow
- } = token;
- const operationBg = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(modalMaskBg).setA(0.1);
- const operationBgHover = operationBg.clone().setA(0.2);
- return {
- [`${previewCls}-switch-left, ${previewCls}-switch-right`]: {
- position: 'fixed',
- insetBlockStart: '50%',
- zIndex: token.calc(zIndexPopup).add(1).equal(),
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- width: token.imagePreviewSwitchSize,
- height: token.imagePreviewSwitchSize,
- marginTop: token.calc(token.imagePreviewSwitchSize).mul(-1).div(2).equal(),
- color: token.previewOperationColor,
- background: operationBg.toRgbString(),
- borderRadius: '50%',
- transform: `translateY(-50%)`,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- userSelect: 'none',
- '&:hover': {
- background: operationBgHover.toRgbString()
- },
- '&-disabled': {
- '&, &:hover': {
- color: previewOperationColorDisabled,
- background: 'transparent',
- cursor: 'not-allowed',
- [`> ${iconCls}`]: {
- cursor: 'not-allowed'
- }
- }
- },
- [`> ${iconCls}`]: {
- fontSize: token.previewOperationSize
- }
- },
- [`${previewCls}-switch-left`]: {
- insetInlineStart: token.marginSM
- },
- [`${previewCls}-switch-right`]: {
- insetInlineEnd: token.marginSM
- }
- };
- };
- const genImagePreviewStyle = token => {
- const {
- motionEaseOut,
- previewCls,
- motionDurationSlow,
- componentCls
- } = token;
- return [{
- [`${componentCls}-preview-root`]: {
- [previewCls]: {
- height: '100%',
- textAlign: 'center',
- pointerEvents: 'none'
- },
- [`${previewCls}-body`]: Object.assign(Object.assign({}, genBoxStyle()), {
- overflow: 'hidden'
- }),
- [`${previewCls}-img`]: {
- maxWidth: '100%',
- maxHeight: '70%',
- verticalAlign: 'middle',
- transform: 'scale3d(1, 1, 1)',
- cursor: 'grab',
- transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`,
- userSelect: 'none',
- '&-wrapper': Object.assign(Object.assign({}, genBoxStyle()), {
- transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`,
- // https://github.com/ant-design/ant-design/issues/39913
- // TailwindCSS will reset img default style.
- // Let's set back.
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- '& > *': {
- pointerEvents: 'auto'
- },
- '&::before': {
- display: 'inline-block',
- width: 1,
- height: '50%',
- marginInlineEnd: -1,
- content: '""'
- }
- })
- },
- [`${previewCls}-moving`]: {
- [`${previewCls}-preview-img`]: {
- cursor: 'grabbing',
- '&-wrapper': {
- transitionDuration: '0s'
- }
- }
- }
- }
- },
- // Override
- {
- [`${componentCls}-preview-root`]: {
- [`${previewCls}-wrap`]: {
- zIndex: token.zIndexPopup
- }
- }
- },
- // Preview operations & switch
- {
- [`${componentCls}-preview-operations-wrapper`]: {
- position: 'fixed',
- zIndex: token.calc(token.zIndexPopup).add(1).equal()
- },
- '&': [genPreviewOperationsStyle(token), genPreviewSwitchStyle(token)]
- }];
- };
- const genImageStyle = token => {
- const {
- componentCls
- } = token;
- return {
- // ============================== image ==============================
- [componentCls]: {
- position: 'relative',
- display: 'inline-block',
- [`${componentCls}-img`]: {
- width: '100%',
- height: 'auto',
- verticalAlign: 'middle'
- },
- [`${componentCls}-img-placeholder`]: {
- backgroundColor: token.colorBgContainerDisabled,
- backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
- backgroundRepeat: 'no-repeat',
- backgroundPosition: 'center center',
- backgroundSize: '30%'
- },
- [`${componentCls}-mask`]: Object.assign({}, genImageMaskStyle(token)),
- [`${componentCls}-mask:hover`]: {
- opacity: 1
- },
- [`${componentCls}-placeholder`]: Object.assign({}, genBoxStyle())
- }
- };
- };
- const genPreviewMotion = token => {
- const {
- previewCls
- } = token;
- return {
- [`${previewCls}-root`]: (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__.initZoomMotion)(token, 'zoom'),
- '&': (0,_style_motion__WEBPACK_IMPORTED_MODULE_4__.initFadeMotion)(token, true)
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexPopupBase + 80,
- previewOperationColor: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorTextLightSolid).setA(0.65).toRgbString(),
- previewOperationHoverColor: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorTextLightSolid).setA(0.85).toRgbString(),
- previewOperationColorDisabled: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorTextLightSolid).setA(0.25).toRgbString(),
- previewOperationSize: token.fontSizeIcon * 1.5 // FIXME: fontSizeIconLG
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_7__.genStyleHooks)('Image', token => {
- const previewCls = `${token.componentCls}-preview`;
- const imageToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.mergeToken)(token, {
- previewCls,
- modalMaskBg: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor('#000').setA(0.45).toRgbString(),
- // FIXME: Shared Token
- imagePreviewSwitchSize: token.controlHeightLG
- });
- return [genImageStyle(imageToken), genImagePreviewStyle(imageToken), (0,_modal_style__WEBPACK_IMPORTED_MODULE_2__.genModalMaskStyle)((0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.mergeToken)(imageToken, {
- componentCls: previewCls
- })), genPreviewMotion(imageToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/index.ts":
- /*!********************************************!*\
- !*** ./components/index.ts + 1020 modules ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- Affix: function() { return /* reexport */ components_affix; },
- Alert: function() { return /* reexport */ components_alert; },
- Anchor: function() { return /* reexport */ components_anchor; },
- App: function() { return /* reexport */ app; },
- AutoComplete: function() { return /* reexport */ auto_complete; },
- Avatar: function() { return /* reexport */ avatar; },
- BackTop: function() { return /* reexport */ back_top; },
- Badge: function() { return /* reexport */ components_badge; },
- Breadcrumb: function() { return /* reexport */ breadcrumb; },
- Button: function() { return /* reexport */ components_button; },
- Calendar: function() { return /* reexport */ calendar; },
- Card: function() { return /* reexport */ card; },
- Carousel: function() { return /* reexport */ carousel; },
- Cascader: function() { return /* reexport */ cascader; },
- Checkbox: function() { return /* reexport */ components_checkbox; },
- Col: function() { return /* reexport */ components_col; },
- Collapse: function() { return /* reexport */ collapse["default"]; },
- ColorPicker: function() { return /* reexport */ color_picker; },
- ConfigProvider: function() { return /* reexport */ config_provider; },
- DatePicker: function() { return /* reexport */ date_picker; },
- Descriptions: function() { return /* reexport */ descriptions; },
- Divider: function() { return /* reexport */ divider; },
- Drawer: function() { return /* reexport */ drawer; },
- Dropdown: function() { return /* reexport */ components_dropdown; },
- Empty: function() { return /* reexport */ components_empty; },
- Flex: function() { return /* reexport */ flex; },
- FloatButton: function() { return /* reexport */ float_button; },
- Form: function() { return /* reexport */ components_form; },
- Grid: function() { return /* reexport */ grid; },
- Image: function() { return /* reexport */ components_image; },
- Input: function() { return /* reexport */ input; },
- InputNumber: function() { return /* reexport */ input_number; },
- Layout: function() { return /* reexport */ components_layout; },
- List: function() { return /* reexport */ list; },
- Mentions: function() { return /* reexport */ mentions; },
- Menu: function() { return /* reexport */ components_menu; },
- Modal: function() { return /* reexport */ modal; },
- Pagination: function() { return /* reexport */ components_pagination; },
- Popconfirm: function() { return /* reexport */ popconfirm; },
- Popover: function() { return /* reexport */ popover; },
- Progress: function() { return /* reexport */ components_progress; },
- QRCode: function() { return /* reexport */ qr_code; },
- Radio: function() { return /* reexport */ components_radio; },
- Rate: function() { return /* reexport */ rate; },
- Result: function() { return /* reexport */ result; },
- Row: function() { return /* reexport */ components_row; },
- Segmented: function() { return /* reexport */ segmented; },
- Select: function() { return /* reexport */ components_select; },
- Skeleton: function() { return /* reexport */ skeleton; },
- Slider: function() { return /* reexport */ slider; },
- Space: function() { return /* reexport */ space; },
- Spin: function() { return /* reexport */ spin; },
- Splitter: function() { return /* reexport */ splitter; },
- Statistic: function() { return /* reexport */ statistic; },
- Steps: function() { return /* reexport */ steps; },
- Switch: function() { return /* reexport */ components_switch; },
- Table: function() { return /* reexport */ table; },
- Tabs: function() { return /* reexport */ components_tabs; },
- Tag: function() { return /* reexport */ tag; },
- TimePicker: function() { return /* reexport */ time_picker; },
- Timeline: function() { return /* reexport */ timeline; },
- Tooltip: function() { return /* reexport */ components_tooltip; },
- Tour: function() { return /* reexport */ tour; },
- Transfer: function() { return /* reexport */ transfer; },
- Tree: function() { return /* reexport */ tree; },
- TreeSelect: function() { return /* reexport */ tree_select; },
- Typography: function() { return /* reexport */ typography; },
- Upload: function() { return /* reexport */ components_upload; },
- Watermark: function() { return /* reexport */ watermark; },
- message: function() { return /* reexport */ components_message; },
- notification: function() { return /* reexport */ components_notification; },
- theme: function() { return /* reexport */ theme; },
- unstableSetRender: function() { return /* reexport */ unstableSetRender; },
- version: function() { return /* reexport */ components_version["default"]; }
- });
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__("./node_modules/classnames/index.js");
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
- var toArray = __webpack_require__("./node_modules/rc-util/es/Children/toArray.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
- var warning = __webpack_require__("./node_modules/rc-util/es/warning.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
- var findDOMNode = __webpack_require__("./node_modules/rc-util/es/Dom/findDOMNode.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
- var es_ref = __webpack_require__("./node_modules/rc-util/es/ref.js");
- ;// ./node_modules/rc-resize-observer/es/Collection.js
- var CollectionContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /**
- * Collect all the resize event from children ResizeObserver
- */
- function Collection(_ref) {
- var children = _ref.children,
- onBatchResize = _ref.onBatchResize;
- var resizeIdRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(0);
- var resizeInfosRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- var onCollectionResize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(CollectionContext);
- var onResize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (size, element, data) {
- resizeIdRef.current += 1;
- var currentId = resizeIdRef.current;
- resizeInfosRef.current.push({
- size: size,
- element: element,
- data: data
- });
- Promise.resolve().then(function () {
- if (currentId === resizeIdRef.current) {
- onBatchResize === null || onBatchResize === void 0 || onBatchResize(resizeInfosRef.current);
- resizeInfosRef.current = [];
- }
- });
- // Continue bubbling if parent exist
- onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(size, element, data);
- }, [onBatchResize, onCollectionResize]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CollectionContext.Provider, {
- value: onResize
- }, children);
- }
- ;// ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
- /**
- * A collection of shims that provide minimal functionality of the ES6 collections.
- *
- * These implementations are not meant to be used outside of the ResizeObserver
- * modules as they cover only a limited range of use cases.
- */
- /* eslint-disable require-jsdoc, valid-jsdoc */
- var MapShim = (function () {
- if (typeof Map !== 'undefined') {
- return Map;
- }
- /**
- * Returns index in provided array that matches the specified key.
- *
- * @param {Array<Array>} arr
- * @param {*} key
- * @returns {number}
- */
- function getIndex(arr, key) {
- var result = -1;
- arr.some(function (entry, index) {
- if (entry[0] === key) {
- result = index;
- return true;
- }
- return false;
- });
- return result;
- }
- return /** @class */ (function () {
- function class_1() {
- this.__entries__ = [];
- }
- Object.defineProperty(class_1.prototype, "size", {
- /**
- * @returns {boolean}
- */
- get: function () {
- return this.__entries__.length;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {*} key
- * @returns {*}
- */
- class_1.prototype.get = function (key) {
- var index = getIndex(this.__entries__, key);
- var entry = this.__entries__[index];
- return entry && entry[1];
- };
- /**
- * @param {*} key
- * @param {*} value
- * @returns {void}
- */
- class_1.prototype.set = function (key, value) {
- var index = getIndex(this.__entries__, key);
- if (~index) {
- this.__entries__[index][1] = value;
- }
- else {
- this.__entries__.push([key, value]);
- }
- };
- /**
- * @param {*} key
- * @returns {void}
- */
- class_1.prototype.delete = function (key) {
- var entries = this.__entries__;
- var index = getIndex(entries, key);
- if (~index) {
- entries.splice(index, 1);
- }
- };
- /**
- * @param {*} key
- * @returns {void}
- */
- class_1.prototype.has = function (key) {
- return !!~getIndex(this.__entries__, key);
- };
- /**
- * @returns {void}
- */
- class_1.prototype.clear = function () {
- this.__entries__.splice(0);
- };
- /**
- * @param {Function} callback
- * @param {*} [ctx=null]
- * @returns {void}
- */
- class_1.prototype.forEach = function (callback, ctx) {
- if (ctx === void 0) { ctx = null; }
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
- var entry = _a[_i];
- callback.call(ctx, entry[1], entry[0]);
- }
- };
- return class_1;
- }());
- })();
- /**
- * Detects whether window and document objects are available in current environment.
- */
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
- // Returns global object of a current environment.
- var global$1 = (function () {
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
- return __webpack_require__.g;
- }
- if (typeof self !== 'undefined' && self.Math === Math) {
- return self;
- }
- if (typeof window !== 'undefined' && window.Math === Math) {
- return window;
- }
- // eslint-disable-next-line no-new-func
- return Function('return this')();
- })();
- /**
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
- * first one is not supported.
- *
- * @returns {number} Requests' identifier.
- */
- var requestAnimationFrame$1 = (function () {
- if (typeof requestAnimationFrame === 'function') {
- // It's required to use a bounded function because IE sometimes throws
- // an "Invalid calling object" error if rAF is invoked without the global
- // object on the left hand side.
- return requestAnimationFrame.bind(global$1);
- }
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
- })();
- // Defines minimum timeout before adding a trailing call.
- var trailingTimeout = 2;
- /**
- * Creates a wrapper function which ensures that provided callback will be
- * invoked only once during the specified delay period.
- *
- * @param {Function} callback - Function to be invoked after the delay period.
- * @param {number} delay - Delay after which to invoke callback.
- * @returns {Function}
- */
- function throttle (callback, delay) {
- var leadingCall = false, trailingCall = false, lastCallTime = 0;
- /**
- * Invokes the original callback function and schedules new invocation if
- * the "proxy" was called during current request.
- *
- * @returns {void}
- */
- function resolvePending() {
- if (leadingCall) {
- leadingCall = false;
- callback();
- }
- if (trailingCall) {
- proxy();
- }
- }
- /**
- * Callback invoked after the specified delay. It will further postpone
- * invocation of the original function delegating it to the
- * requestAnimationFrame.
- *
- * @returns {void}
- */
- function timeoutCallback() {
- requestAnimationFrame$1(resolvePending);
- }
- /**
- * Schedules invocation of the original function.
- *
- * @returns {void}
- */
- function proxy() {
- var timeStamp = Date.now();
- if (leadingCall) {
- // Reject immediately following calls.
- if (timeStamp - lastCallTime < trailingTimeout) {
- return;
- }
- // Schedule new call to be in invoked when the pending one is resolved.
- // This is important for "transitions" which never actually start
- // immediately so there is a chance that we might miss one if change
- // happens amids the pending invocation.
- trailingCall = true;
- }
- else {
- leadingCall = true;
- trailingCall = false;
- setTimeout(timeoutCallback, delay);
- }
- lastCallTime = timeStamp;
- }
- return proxy;
- }
- // Minimum delay before invoking the update of observers.
- var REFRESH_DELAY = 20;
- // A list of substrings of CSS properties used to find transition events that
- // might affect dimensions of observed elements.
- var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
- // Check if MutationObserver is available.
- var mutationObserverSupported = typeof MutationObserver !== 'undefined';
- /**
- * Singleton controller class which handles updates of ResizeObserver instances.
- */
- var ResizeObserverController = /** @class */ (function () {
- /**
- * Creates a new instance of ResizeObserverController.
- *
- * @private
- */
- function ResizeObserverController() {
- /**
- * Indicates whether DOM listeners have been added.
- *
- * @private {boolean}
- */
- this.connected_ = false;
- /**
- * Tells that controller has subscribed for Mutation Events.
- *
- * @private {boolean}
- */
- this.mutationEventsAdded_ = false;
- /**
- * Keeps reference to the instance of MutationObserver.
- *
- * @private {MutationObserver}
- */
- this.mutationsObserver_ = null;
- /**
- * A list of connected observers.
- *
- * @private {Array<ResizeObserverSPI>}
- */
- this.observers_ = [];
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
- this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
- }
- /**
- * Adds observer to observers list.
- *
- * @param {ResizeObserverSPI} observer - Observer to be added.
- * @returns {void}
- */
- ResizeObserverController.prototype.addObserver = function (observer) {
- if (!~this.observers_.indexOf(observer)) {
- this.observers_.push(observer);
- }
- // Add listeners if they haven't been added yet.
- if (!this.connected_) {
- this.connect_();
- }
- };
- /**
- * Removes observer from observers list.
- *
- * @param {ResizeObserverSPI} observer - Observer to be removed.
- * @returns {void}
- */
- ResizeObserverController.prototype.removeObserver = function (observer) {
- var observers = this.observers_;
- var index = observers.indexOf(observer);
- // Remove observer if it's present in registry.
- if (~index) {
- observers.splice(index, 1);
- }
- // Remove listeners if controller has no connected observers.
- if (!observers.length && this.connected_) {
- this.disconnect_();
- }
- };
- /**
- * Invokes the update of observers. It will continue running updates insofar
- * it detects changes.
- *
- * @returns {void}
- */
- ResizeObserverController.prototype.refresh = function () {
- var changesDetected = this.updateObservers_();
- // Continue running updates if changes have been detected as there might
- // be future ones caused by CSS transitions.
- if (changesDetected) {
- this.refresh();
- }
- };
- /**
- * Updates every observer from observers list and notifies them of queued
- * entries.
- *
- * @private
- * @returns {boolean} Returns "true" if any observer has detected changes in
- * dimensions of it's elements.
- */
- ResizeObserverController.prototype.updateObservers_ = function () {
- // Collect observers that have active observations.
- var activeObservers = this.observers_.filter(function (observer) {
- return observer.gatherActive(), observer.hasActive();
- });
- // Deliver notifications in a separate cycle in order to avoid any
- // collisions between observers, e.g. when multiple instances of
- // ResizeObserver are tracking the same element and the callback of one
- // of them changes content dimensions of the observed target. Sometimes
- // this may result in notifications being blocked for the rest of observers.
- activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
- return activeObservers.length > 0;
- };
- /**
- * Initializes DOM listeners.
- *
- * @private
- * @returns {void}
- */
- ResizeObserverController.prototype.connect_ = function () {
- // Do nothing if running in a non-browser environment or if listeners
- // have been already added.
- if (!isBrowser || this.connected_) {
- return;
- }
- // Subscription to the "Transitionend" event is used as a workaround for
- // delayed transitions. This way it's possible to capture at least the
- // final state of an element.
- document.addEventListener('transitionend', this.onTransitionEnd_);
- window.addEventListener('resize', this.refresh);
- if (mutationObserverSupported) {
- this.mutationsObserver_ = new MutationObserver(this.refresh);
- this.mutationsObserver_.observe(document, {
- attributes: true,
- childList: true,
- characterData: true,
- subtree: true
- });
- }
- else {
- document.addEventListener('DOMSubtreeModified', this.refresh);
- this.mutationEventsAdded_ = true;
- }
- this.connected_ = true;
- };
- /**
- * Removes DOM listeners.
- *
- * @private
- * @returns {void}
- */
- ResizeObserverController.prototype.disconnect_ = function () {
- // Do nothing if running in a non-browser environment or if listeners
- // have been already removed.
- if (!isBrowser || !this.connected_) {
- return;
- }
- document.removeEventListener('transitionend', this.onTransitionEnd_);
- window.removeEventListener('resize', this.refresh);
- if (this.mutationsObserver_) {
- this.mutationsObserver_.disconnect();
- }
- if (this.mutationEventsAdded_) {
- document.removeEventListener('DOMSubtreeModified', this.refresh);
- }
- this.mutationsObserver_ = null;
- this.mutationEventsAdded_ = false;
- this.connected_ = false;
- };
- /**
- * "Transitionend" event handler.
- *
- * @private
- * @param {TransitionEvent} event
- * @returns {void}
- */
- ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
- var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
- // Detect whether transition may affect dimensions of an element.
- var isReflowProperty = transitionKeys.some(function (key) {
- return !!~propertyName.indexOf(key);
- });
- if (isReflowProperty) {
- this.refresh();
- }
- };
- /**
- * Returns instance of the ResizeObserverController.
- *
- * @returns {ResizeObserverController}
- */
- ResizeObserverController.getInstance = function () {
- if (!this.instance_) {
- this.instance_ = new ResizeObserverController();
- }
- return this.instance_;
- };
- /**
- * Holds reference to the controller's instance.
- *
- * @private {ResizeObserverController}
- */
- ResizeObserverController.instance_ = null;
- return ResizeObserverController;
- }());
- /**
- * Defines non-writable/enumerable properties of the provided target object.
- *
- * @param {Object} target - Object for which to define properties.
- * @param {Object} props - Properties to be defined.
- * @returns {Object} Target object.
- */
- var defineConfigurable = (function (target, props) {
- for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
- var key = _a[_i];
- Object.defineProperty(target, key, {
- value: props[key],
- enumerable: false,
- writable: false,
- configurable: true
- });
- }
- return target;
- });
- /**
- * Returns the global object associated with provided element.
- *
- * @param {Object} target
- * @returns {Object}
- */
- var getWindowOf = (function (target) {
- // Assume that the element is an instance of Node, which means that it
- // has the "ownerDocument" property from which we can retrieve a
- // corresponding global object.
- var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
- // Return the local global object if it's not possible extract one from
- // provided element.
- return ownerGlobal || global$1;
- });
- // Placeholder of an empty content rectangle.
- var emptyRect = createRectInit(0, 0, 0, 0);
- /**
- * Converts provided string to a number.
- *
- * @param {number|string} value
- * @returns {number}
- */
- function toFloat(value) {
- return parseFloat(value) || 0;
- }
- /**
- * Extracts borders size from provided styles.
- *
- * @param {CSSStyleDeclaration} styles
- * @param {...string} positions - Borders positions (top, right, ...)
- * @returns {number}
- */
- function getBordersSize(styles) {
- var positions = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- positions[_i - 1] = arguments[_i];
- }
- return positions.reduce(function (size, position) {
- var value = styles['border-' + position + '-width'];
- return size + toFloat(value);
- }, 0);
- }
- /**
- * Extracts paddings sizes from provided styles.
- *
- * @param {CSSStyleDeclaration} styles
- * @returns {Object} Paddings box.
- */
- function getPaddings(styles) {
- var positions = ['top', 'right', 'bottom', 'left'];
- var paddings = {};
- for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
- var position = positions_1[_i];
- var value = styles['padding-' + position];
- paddings[position] = toFloat(value);
- }
- return paddings;
- }
- /**
- * Calculates content rectangle of provided SVG element.
- *
- * @param {SVGGraphicsElement} target - Element content rectangle of which needs
- * to be calculated.
- * @returns {DOMRectInit}
- */
- function getSVGContentRect(target) {
- var bbox = target.getBBox();
- return createRectInit(0, 0, bbox.width, bbox.height);
- }
- /**
- * Calculates content rectangle of provided HTMLElement.
- *
- * @param {HTMLElement} target - Element for which to calculate the content rectangle.
- * @returns {DOMRectInit}
- */
- function getHTMLElementContentRect(target) {
- // Client width & height properties can't be
- // used exclusively as they provide rounded values.
- var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
- // By this condition we can catch all non-replaced inline, hidden and
- // detached elements. Though elements with width & height properties less
- // than 0.5 will be discarded as well.
- //
- // Without it we would need to implement separate methods for each of
- // those cases and it's not possible to perform a precise and performance
- // effective test for hidden elements. E.g. even jQuery's ':visible' filter
- // gives wrong results for elements with width & height less than 0.5.
- if (!clientWidth && !clientHeight) {
- return emptyRect;
- }
- var styles = getWindowOf(target).getComputedStyle(target);
- var paddings = getPaddings(styles);
- var horizPad = paddings.left + paddings.right;
- var vertPad = paddings.top + paddings.bottom;
- // Computed styles of width & height are being used because they are the
- // only dimensions available to JS that contain non-rounded values. It could
- // be possible to utilize the getBoundingClientRect if only it's data wasn't
- // affected by CSS transformations let alone paddings, borders and scroll bars.
- var width = toFloat(styles.width), height = toFloat(styles.height);
- // Width & height include paddings and borders when the 'border-box' box
- // model is applied (except for IE).
- if (styles.boxSizing === 'border-box') {
- // Following conditions are required to handle Internet Explorer which
- // doesn't include paddings and borders to computed CSS dimensions.
- //
- // We can say that if CSS dimensions + paddings are equal to the "client"
- // properties then it's either IE, and thus we don't need to subtract
- // anything, or an element merely doesn't have paddings/borders styles.
- if (Math.round(width + horizPad) !== clientWidth) {
- width -= getBordersSize(styles, 'left', 'right') + horizPad;
- }
- if (Math.round(height + vertPad) !== clientHeight) {
- height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
- }
- }
- // Following steps can't be applied to the document's root element as its
- // client[Width/Height] properties represent viewport area of the window.
- // Besides, it's as well not necessary as the <html> itself neither has
- // rendered scroll bars nor it can be clipped.
- if (!isDocumentElement(target)) {
- // In some browsers (only in Firefox, actually) CSS width & height
- // include scroll bars size which can be removed at this step as scroll
- // bars are the only difference between rounded dimensions + paddings
- // and "client" properties, though that is not always true in Chrome.
- var vertScrollbar = Math.round(width + horizPad) - clientWidth;
- var horizScrollbar = Math.round(height + vertPad) - clientHeight;
- // Chrome has a rather weird rounding of "client" properties.
- // E.g. for an element with content width of 314.2px it sometimes gives
- // the client width of 315px and for the width of 314.7px it may give
- // 314px. And it doesn't happen all the time. So just ignore this delta
- // as a non-relevant.
- if (Math.abs(vertScrollbar) !== 1) {
- width -= vertScrollbar;
- }
- if (Math.abs(horizScrollbar) !== 1) {
- height -= horizScrollbar;
- }
- }
- return createRectInit(paddings.left, paddings.top, width, height);
- }
- /**
- * Checks whether provided element is an instance of the SVGGraphicsElement.
- *
- * @param {Element} target - Element to be checked.
- * @returns {boolean}
- */
- var isSVGGraphicsElement = (function () {
- // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
- // interface.
- if (typeof SVGGraphicsElement !== 'undefined') {
- return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
- }
- // If it's so, then check that element is at least an instance of the
- // SVGElement and that it has the "getBBox" method.
- // eslint-disable-next-line no-extra-parens
- return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
- typeof target.getBBox === 'function'); };
- })();
- /**
- * Checks whether provided element is a document element (<html>).
- *
- * @param {Element} target - Element to be checked.
- * @returns {boolean}
- */
- function isDocumentElement(target) {
- return target === getWindowOf(target).document.documentElement;
- }
- /**
- * Calculates an appropriate content rectangle for provided html or svg element.
- *
- * @param {Element} target - Element content rectangle of which needs to be calculated.
- * @returns {DOMRectInit}
- */
- function getContentRect(target) {
- if (!isBrowser) {
- return emptyRect;
- }
- if (isSVGGraphicsElement(target)) {
- return getSVGContentRect(target);
- }
- return getHTMLElementContentRect(target);
- }
- /**
- * Creates rectangle with an interface of the DOMRectReadOnly.
- * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
- *
- * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
- * @returns {DOMRectReadOnly}
- */
- function createReadOnlyRect(_a) {
- var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
- // If DOMRectReadOnly is available use it as a prototype for the rectangle.
- var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
- var rect = Object.create(Constr.prototype);
- // Rectangle's properties are not writable and non-enumerable.
- defineConfigurable(rect, {
- x: x, y: y, width: width, height: height,
- top: y,
- right: x + width,
- bottom: height + y,
- left: x
- });
- return rect;
- }
- /**
- * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
- * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
- *
- * @param {number} x - X coordinate.
- * @param {number} y - Y coordinate.
- * @param {number} width - Rectangle's width.
- * @param {number} height - Rectangle's height.
- * @returns {DOMRectInit}
- */
- function createRectInit(x, y, width, height) {
- return { x: x, y: y, width: width, height: height };
- }
- /**
- * Class that is responsible for computations of the content rectangle of
- * provided DOM element and for keeping track of it's changes.
- */
- var ResizeObservation = /** @class */ (function () {
- /**
- * Creates an instance of ResizeObservation.
- *
- * @param {Element} target - Element to be observed.
- */
- function ResizeObservation(target) {
- /**
- * Broadcasted width of content rectangle.
- *
- * @type {number}
- */
- this.broadcastWidth = 0;
- /**
- * Broadcasted height of content rectangle.
- *
- * @type {number}
- */
- this.broadcastHeight = 0;
- /**
- * Reference to the last observed content rectangle.
- *
- * @private {DOMRectInit}
- */
- this.contentRect_ = createRectInit(0, 0, 0, 0);
- this.target = target;
- }
- /**
- * Updates content rectangle and tells whether it's width or height properties
- * have changed since the last broadcast.
- *
- * @returns {boolean}
- */
- ResizeObservation.prototype.isActive = function () {
- var rect = getContentRect(this.target);
- this.contentRect_ = rect;
- return (rect.width !== this.broadcastWidth ||
- rect.height !== this.broadcastHeight);
- };
- /**
- * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
- * from the corresponding properties of the last observed content rectangle.
- *
- * @returns {DOMRectInit} Last observed content rectangle.
- */
- ResizeObservation.prototype.broadcastRect = function () {
- var rect = this.contentRect_;
- this.broadcastWidth = rect.width;
- this.broadcastHeight = rect.height;
- return rect;
- };
- return ResizeObservation;
- }());
- var ResizeObserverEntry = /** @class */ (function () {
- /**
- * Creates an instance of ResizeObserverEntry.
- *
- * @param {Element} target - Element that is being observed.
- * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
- */
- function ResizeObserverEntry(target, rectInit) {
- var contentRect = createReadOnlyRect(rectInit);
- // According to the specification following properties are not writable
- // and are also not enumerable in the native implementation.
- //
- // Property accessors are not being used as they'd require to define a
- // private WeakMap storage which may cause memory leaks in browsers that
- // don't support this type of collections.
- defineConfigurable(this, { target: target, contentRect: contentRect });
- }
- return ResizeObserverEntry;
- }());
- var ResizeObserverSPI = /** @class */ (function () {
- /**
- * Creates a new instance of ResizeObserver.
- *
- * @param {ResizeObserverCallback} callback - Callback function that is invoked
- * when one of the observed elements changes it's content dimensions.
- * @param {ResizeObserverController} controller - Controller instance which
- * is responsible for the updates of observer.
- * @param {ResizeObserver} callbackCtx - Reference to the public
- * ResizeObserver instance which will be passed to callback function.
- */
- function ResizeObserverSPI(callback, controller, callbackCtx) {
- /**
- * Collection of resize observations that have detected changes in dimensions
- * of elements.
- *
- * @private {Array<ResizeObservation>}
- */
- this.activeObservations_ = [];
- /**
- * Registry of the ResizeObservation instances.
- *
- * @private {Map<Element, ResizeObservation>}
- */
- this.observations_ = new MapShim();
- if (typeof callback !== 'function') {
- throw new TypeError('The callback provided as parameter 1 is not a function.');
- }
- this.callback_ = callback;
- this.controller_ = controller;
- this.callbackCtx_ = callbackCtx;
- }
- /**
- * Starts observing provided element.
- *
- * @param {Element} target - Element to be observed.
- * @returns {void}
- */
- ResizeObserverSPI.prototype.observe = function (target) {
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
- // Do nothing if current environment doesn't have the Element interface.
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
- return;
- }
- if (!(target instanceof getWindowOf(target).Element)) {
- throw new TypeError('parameter 1 is not of type "Element".');
- }
- var observations = this.observations_;
- // Do nothing if element is already being observed.
- if (observations.has(target)) {
- return;
- }
- observations.set(target, new ResizeObservation(target));
- this.controller_.addObserver(this);
- // Force the update of observations.
- this.controller_.refresh();
- };
- /**
- * Stops observing provided element.
- *
- * @param {Element} target - Element to stop observing.
- * @returns {void}
- */
- ResizeObserverSPI.prototype.unobserve = function (target) {
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
- // Do nothing if current environment doesn't have the Element interface.
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
- return;
- }
- if (!(target instanceof getWindowOf(target).Element)) {
- throw new TypeError('parameter 1 is not of type "Element".');
- }
- var observations = this.observations_;
- // Do nothing if element is not being observed.
- if (!observations.has(target)) {
- return;
- }
- observations.delete(target);
- if (!observations.size) {
- this.controller_.removeObserver(this);
- }
- };
- /**
- * Stops observing all elements.
- *
- * @returns {void}
- */
- ResizeObserverSPI.prototype.disconnect = function () {
- this.clearActive();
- this.observations_.clear();
- this.controller_.removeObserver(this);
- };
- /**
- * Collects observation instances the associated element of which has changed
- * it's content rectangle.
- *
- * @returns {void}
- */
- ResizeObserverSPI.prototype.gatherActive = function () {
- var _this = this;
- this.clearActive();
- this.observations_.forEach(function (observation) {
- if (observation.isActive()) {
- _this.activeObservations_.push(observation);
- }
- });
- };
- /**
- * Invokes initial callback function with a list of ResizeObserverEntry
- * instances collected from active resize observations.
- *
- * @returns {void}
- */
- ResizeObserverSPI.prototype.broadcastActive = function () {
- // Do nothing if observer doesn't have active observations.
- if (!this.hasActive()) {
- return;
- }
- var ctx = this.callbackCtx_;
- // Create ResizeObserverEntry instance for every active observation.
- var entries = this.activeObservations_.map(function (observation) {
- return new ResizeObserverEntry(observation.target, observation.broadcastRect());
- });
- this.callback_.call(ctx, entries, ctx);
- this.clearActive();
- };
- /**
- * Clears the collection of active observations.
- *
- * @returns {void}
- */
- ResizeObserverSPI.prototype.clearActive = function () {
- this.activeObservations_.splice(0);
- };
- /**
- * Tells whether observer has active observations.
- *
- * @returns {boolean}
- */
- ResizeObserverSPI.prototype.hasActive = function () {
- return this.activeObservations_.length > 0;
- };
- return ResizeObserverSPI;
- }());
- // Registry of internal observers. If WeakMap is not available use current shim
- // for the Map collection as it has all required methods and because WeakMap
- // can't be fully polyfilled anyway.
- var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
- /**
- * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
- * exposing only those methods and properties that are defined in the spec.
- */
- var ResizeObserver_es_ResizeObserver = /** @class */ (function () {
- /**
- * Creates a new instance of ResizeObserver.
- *
- * @param {ResizeObserverCallback} callback - Callback that is invoked when
- * dimensions of the observed elements change.
- */
- function ResizeObserver(callback) {
- if (!(this instanceof ResizeObserver)) {
- throw new TypeError('Cannot call a class as a function.');
- }
- if (!arguments.length) {
- throw new TypeError('1 argument required, but only 0 present.');
- }
- var controller = ResizeObserverController.getInstance();
- var observer = new ResizeObserverSPI(callback, controller, this);
- observers.set(this, observer);
- }
- return ResizeObserver;
- }());
- // Expose public methods of ResizeObserver.
- [
- 'observe',
- 'unobserve',
- 'disconnect'
- ].forEach(function (method) {
- ResizeObserver_es_ResizeObserver.prototype[method] = function () {
- var _a;
- return (_a = observers.get(this))[method].apply(_a, arguments);
- };
- });
- var index = (function () {
- // Export existing implementation if available.
- if (typeof global$1.ResizeObserver !== 'undefined') {
- return global$1.ResizeObserver;
- }
- return ResizeObserver_es_ResizeObserver;
- })();
- /* harmony default export */ var ResizeObserver_es = (index);
- ;// ./node_modules/rc-resize-observer/es/utils/observerUtil.js
- // =============================== Const ===============================
- var elementListeners = new Map();
- function onResize(entities) {
- entities.forEach(function (entity) {
- var _elementListeners$get;
- var target = entity.target;
- (_elementListeners$get = elementListeners.get(target)) === null || _elementListeners$get === void 0 || _elementListeners$get.forEach(function (listener) {
- return listener(target);
- });
- });
- }
- // Note: ResizeObserver polyfill not support option to measure border-box resize
- var resizeObserver = new ResizeObserver_es(onResize);
- // Dev env only
- var _el = true ? elementListeners : 0; // eslint-disable-line
- var _rs = true ? onResize : 0; // eslint-disable-line
- // ============================== Observe ==============================
- function observe(element, callback) {
- if (!elementListeners.has(element)) {
- elementListeners.set(element, new Set());
- resizeObserver.observe(element);
- }
- elementListeners.get(element).add(callback);
- }
- function unobserve(element, callback) {
- if (elementListeners.has(element)) {
- elementListeners.get(element).delete(callback);
- if (!elementListeners.get(element).size) {
- resizeObserver.unobserve(element);
- elementListeners.delete(element);
- }
- }
- }
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
- var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/inherits.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
- var createSuper = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createSuper.js");
- ;// ./node_modules/rc-resize-observer/es/SingleObserver/DomWrapper.js
- /**
- * Fallback to findDOMNode if origin ref do not provide any dom element
- */
- var DomWrapper = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(DomWrapper, _React$Component);
- var _super = (0,createSuper["default"])(DomWrapper);
- function DomWrapper() {
- (0,classCallCheck["default"])(this, DomWrapper);
- return _super.apply(this, arguments);
- }
- (0,createClass["default"])(DomWrapper, [{
- key: "render",
- value: function render() {
- return this.props.children;
- }
- }]);
- return DomWrapper;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- ;// ./node_modules/rc-resize-observer/es/SingleObserver/index.js
- function SingleObserver(props, ref) {
- var children = props.children,
- disabled = props.disabled;
- var elementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var wrapperRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var onCollectionResize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(CollectionContext);
- // =========================== Children ===========================
- var isRenderProps = typeof children === 'function';
- var mergedChildren = isRenderProps ? children(elementRef) : children;
- // ============================= Size =============================
- var sizeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- width: -1,
- height: -1,
- offsetWidth: -1,
- offsetHeight: -1
- });
- // ============================= Ref ==============================
- var canRef = !isRenderProps && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mergedChildren) && (0,es_ref.supportRef)(mergedChildren);
- var originRef = canRef ? (0,es_ref.getNodeRef)(mergedChildren) : null;
- var mergedRef = (0,es_ref.useComposeRef)(originRef, elementRef);
- var getDom = function getDom() {
- var _elementRef$current;
- return (0,findDOMNode["default"])(elementRef.current) || (
- // Support `nativeElement` format
- elementRef.current && (0,esm_typeof["default"])(elementRef.current) === 'object' ? (0,findDOMNode["default"])((_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.nativeElement) : null) || (0,findDOMNode["default"])(wrapperRef.current);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return getDom();
- });
- // =========================== Observe ============================
- var propsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(props);
- propsRef.current = props;
- // Handler
- var onInternalResize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (target) {
- var _propsRef$current = propsRef.current,
- onResize = _propsRef$current.onResize,
- data = _propsRef$current.data;
- var _target$getBoundingCl = target.getBoundingClientRect(),
- width = _target$getBoundingCl.width,
- height = _target$getBoundingCl.height;
- var offsetWidth = target.offsetWidth,
- offsetHeight = target.offsetHeight;
- /**
- * Resize observer trigger when content size changed.
- * In most case we just care about element size,
- * let's use `boundary` instead of `contentRect` here to avoid shaking.
- */
- var fixedWidth = Math.floor(width);
- var fixedHeight = Math.floor(height);
- if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
- var size = {
- width: fixedWidth,
- height: fixedHeight,
- offsetWidth: offsetWidth,
- offsetHeight: offsetHeight
- };
- sizeRef.current = size;
- // IE is strange, right?
- var mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
- var mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
- var sizeInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, size), {}, {
- offsetWidth: mergedOffsetWidth,
- offsetHeight: mergedOffsetHeight
- });
- // Let collection know what happened
- onCollectionResize === null || onCollectionResize === void 0 || onCollectionResize(sizeInfo, target, data);
- if (onResize) {
- // defer the callback but not defer to next frame
- Promise.resolve().then(function () {
- onResize(sizeInfo, target);
- });
- }
- }
- }, []);
- // Dynamic observe
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var currentElement = getDom();
- if (currentElement && !disabled) {
- observe(currentElement, onInternalResize);
- }
- return function () {
- return unobserve(currentElement, onInternalResize);
- };
- }, [elementRef.current, disabled]);
- // ============================ Render ============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DomWrapper, {
- ref: wrapperRef
- }, canRef ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(mergedChildren, {
- ref: mergedRef
- }) : mergedChildren);
- }
- var RefSingleObserver = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SingleObserver);
- if (true) {
- RefSingleObserver.displayName = 'SingleObserver';
- }
- /* harmony default export */ var es_SingleObserver = (RefSingleObserver);
- ;// ./node_modules/rc-resize-observer/es/index.js
- var INTERNAL_PREFIX_KEY = 'rc-observer-key';
- function es_ResizeObserver(props, ref) {
- var children = props.children;
- var childNodes = typeof children === 'function' ? [children] : (0,toArray["default"])(children);
- if (true) {
- if (childNodes.length > 1) {
- (0,warning.warning)(false, 'Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.');
- } else if (childNodes.length === 0) {
- (0,warning.warning)(false, '`children` of ResizeObserver is empty. Nothing is in observe.');
- }
- }
- return childNodes.map(function (child, index) {
- var key = (child === null || child === void 0 ? void 0 : child.key) || "".concat(INTERNAL_PREFIX_KEY, "-").concat(index);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_SingleObserver, (0,esm_extends["default"])({}, props, {
- key: key,
- ref: index === 0 ? ref : undefined
- }), child);
- });
- }
- var RefResizeObserver = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(es_ResizeObserver);
- if (true) {
- RefResizeObserver.displayName = 'ResizeObserver';
- }
- RefResizeObserver.Collection = Collection;
- /* harmony default export */ var es = (RefResizeObserver);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
- var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/raf.js
- var raf = __webpack_require__("./node_modules/rc-util/es/raf.js");
- ;// ./components/_util/throttleByAnimationFrame.ts
- function throttleByAnimationFrame(fn) {
- let requestId = null;
- const later = args => () => {
- requestId = null;
- fn.apply(void 0, (0,toConsumableArray["default"])(args));
- };
- const throttled = (...args) => {
- if (requestId === null) {
- requestId = (0,raf["default"])(later(args));
- }
- };
- throttled.cancel = () => {
- raf["default"].cancel(requestId);
- requestId = null;
- };
- return throttled;
- }
- /* harmony default export */ var _util_throttleByAnimationFrame = (throttleByAnimationFrame);
- // EXTERNAL MODULE: ./components/config-provider/context.ts
- var config_provider_context = __webpack_require__("./components/config-provider/context.ts");
- // EXTERNAL MODULE: ./components/affix/style/index.ts
- var affix_style = __webpack_require__("./components/affix/style/index.ts");
- ;// ./components/affix/utils.ts
- function getTargetRect(target) {
- return target !== window ? target.getBoundingClientRect() : {
- top: 0,
- bottom: window.innerHeight
- };
- }
- function getFixedTop(placeholderRect, targetRect, offsetTop) {
- if (offsetTop !== undefined && Math.round(targetRect.top) > Math.round(placeholderRect.top) - offsetTop) {
- return offsetTop + targetRect.top;
- }
- return undefined;
- }
- function getFixedBottom(placeholderRect, targetRect, offsetBottom) {
- if (offsetBottom !== undefined && Math.round(targetRect.bottom) < Math.round(placeholderRect.bottom) + offsetBottom) {
- const targetBottomOffset = window.innerHeight - targetRect.bottom;
- return offsetBottom + targetBottomOffset;
- }
- return undefined;
- }
- ;// ./components/affix/index.tsx
- var __rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TRIGGER_EVENTS = ['resize', 'scroll', 'touchstart', 'touchmove', 'touchend', 'pageshow', 'load'];
- function getDefaultTarget() {
- return typeof window !== 'undefined' ? window : null;
- }
- const AFFIX_STATUS_NONE = 0;
- const AFFIX_STATUS_PREPARE = 1;
- const Affix = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- var _a;
- const {
- style,
- offsetTop,
- offsetBottom,
- prefixCls,
- className,
- rootClassName,
- children,
- target,
- onChange,
- onTestUpdatePosition
- } = props,
- restProps = __rest(props, ["style", "offsetTop", "offsetBottom", "prefixCls", "className", "rootClassName", "children", "target", "onChange", "onTestUpdatePosition"]);
- const {
- getPrefixCls,
- getTargetContainer
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_context.ConfigContext);
- const affixPrefixCls = getPrefixCls('affix', prefixCls);
- const [lastAffix, setLastAffix] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(false);
- const [affixStyle, setAffixStyle] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState();
- const [placeholderStyle, setPlaceholderStyle] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState();
- const status = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(AFFIX_STATUS_NONE);
- const prevTarget = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const prevListener = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const placeholderNodeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const fixedNodeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const timer = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const targetFunc = (_a = target !== null && target !== void 0 ? target : getTargetContainer) !== null && _a !== void 0 ? _a : getDefaultTarget;
- const internalOffsetTop = offsetBottom === undefined && offsetTop === undefined ? 0 : offsetTop;
- // =================== Measure ===================
- const measure = () => {
- if (status.current !== AFFIX_STATUS_PREPARE || !fixedNodeRef.current || !placeholderNodeRef.current || !targetFunc) {
- return;
- }
- const targetNode = targetFunc();
- if (targetNode) {
- const newState = {
- status: AFFIX_STATUS_NONE
- };
- const placeholderRect = getTargetRect(placeholderNodeRef.current);
- if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) {
- return;
- }
- const targetRect = getTargetRect(targetNode);
- const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop);
- const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
- if (fixedTop !== undefined) {
- newState.affixStyle = {
- position: 'fixed',
- top: fixedTop,
- width: placeholderRect.width,
- height: placeholderRect.height
- };
- newState.placeholderStyle = {
- width: placeholderRect.width,
- height: placeholderRect.height
- };
- } else if (fixedBottom !== undefined) {
- newState.affixStyle = {
- position: 'fixed',
- bottom: fixedBottom,
- width: placeholderRect.width,
- height: placeholderRect.height
- };
- newState.placeholderStyle = {
- width: placeholderRect.width,
- height: placeholderRect.height
- };
- }
- newState.lastAffix = !!newState.affixStyle;
- if (lastAffix !== newState.lastAffix) {
- onChange === null || onChange === void 0 ? void 0 : onChange(newState.lastAffix);
- }
- status.current = newState.status;
- setAffixStyle(newState.affixStyle);
- setPlaceholderStyle(newState.placeholderStyle);
- setLastAffix(newState.lastAffix);
- }
- };
- const prepareMeasure = () => {
- status.current = AFFIX_STATUS_PREPARE;
- measure();
- if (false) // removed by dead control flow
- {}
- };
- const updatePosition = _util_throttleByAnimationFrame(() => {
- prepareMeasure();
- });
- const lazyUpdatePosition = _util_throttleByAnimationFrame(() => {
- // Check position change before measure to make Safari smooth
- if (targetFunc && affixStyle) {
- const targetNode = targetFunc();
- if (targetNode && placeholderNodeRef.current) {
- const targetRect = getTargetRect(targetNode);
- const placeholderRect = getTargetRect(placeholderNodeRef.current);
- const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop);
- const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
- if (fixedTop !== undefined && affixStyle.top === fixedTop || fixedBottom !== undefined && affixStyle.bottom === fixedBottom) {
- return;
- }
- }
- }
- // Directly call prepare measure since it's already throttled.
- prepareMeasure();
- });
- const addListeners = () => {
- const listenerTarget = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
- if (!listenerTarget) {
- return;
- }
- TRIGGER_EVENTS.forEach(eventName => {
- var _a;
- if (prevListener.current) {
- (_a = prevTarget.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(eventName, prevListener.current);
- }
- listenerTarget === null || listenerTarget === void 0 ? void 0 : listenerTarget.addEventListener(eventName, lazyUpdatePosition);
- });
- prevTarget.current = listenerTarget;
- prevListener.current = lazyUpdatePosition;
- };
- const removeListeners = () => {
- if (timer.current) {
- clearTimeout(timer.current);
- timer.current = null;
- }
- const newTarget = targetFunc === null || targetFunc === void 0 ? void 0 : targetFunc();
- TRIGGER_EVENTS.forEach(eventName => {
- var _a;
- newTarget === null || newTarget === void 0 ? void 0 : newTarget.removeEventListener(eventName, lazyUpdatePosition);
- if (prevListener.current) {
- (_a = prevTarget.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(eventName, prevListener.current);
- }
- });
- updatePosition.cancel();
- lazyUpdatePosition.cancel();
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => ({
- updatePosition
- }));
- // mount & unmount
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- // [Legacy] Wait for parent component ref has its value.
- // We should use target as directly element instead of function which makes element check hard.
- timer.current = setTimeout(addListeners);
- return () => removeListeners();
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- addListeners();
- return () => removeListeners();
- }, [target, affixStyle, lastAffix, offsetTop, offsetBottom]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- updatePosition();
- }, [target, offsetTop, offsetBottom]);
- const [wrapCSSVar, hashId, cssVarCls] = (0,affix_style["default"])(affixPrefixCls);
- const rootCls = classnames_default()(rootClassName, hashId, affixPrefixCls, cssVarCls);
- const mergedCls = classnames_default()({
- [rootCls]: affixStyle
- });
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es, {
- onResize: updatePosition
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({
- style: style,
- className: className,
- ref: placeholderNodeRef
- }, restProps), affixStyle && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- style: placeholderStyle,
- "aria-hidden": "true"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: mergedCls,
- ref: fixedNodeRef,
- style: affixStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es, {
- onResize: updatePosition
- }, children)))));
- });
- if (true) {
- Affix.displayName = 'Affix';
- }
- /* harmony default export */ var components_affix = (Affix);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CheckCircleFilled.js
- // This icon file is generated automatically.
- var CheckCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
- /* harmony default export */ var asn_CheckCircleFilled = (CheckCircleFilled);
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
- var AntdIcon = __webpack_require__("./node_modules/@ant-design/icons/es/components/AntdIcon.js");
- ;// ./node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CheckCircleFilled_CheckCircleFilled = function CheckCircleFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CheckCircleFilled
- }));
- };
- /** */
- var RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CheckCircleFilled_CheckCircleFilled);
- if (true) {
- RefIcon.displayName = 'CheckCircleFilled';
- }
- /* harmony default export */ var icons_CheckCircleFilled = (RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CloseCircleFilled.js
- // This icon file is generated automatically.
- var CloseCircleFilled = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
- /* harmony default export */ var asn_CloseCircleFilled = (CloseCircleFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CloseCircleFilled_CloseCircleFilled = function CloseCircleFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CloseCircleFilled
- }));
- };
- /** */
- var CloseCircleFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CloseCircleFilled_CloseCircleFilled);
- if (true) {
- CloseCircleFilled_RefIcon.displayName = 'CloseCircleFilled';
- }
- /* harmony default export */ var icons_CloseCircleFilled = (CloseCircleFilled_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js
- // This icon file is generated automatically.
- var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
- /* harmony default export */ var asn_CloseOutlined = (CloseOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CloseOutlined_CloseOutlined = function CloseOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CloseOutlined
- }));
- };
- /** */
- var CloseOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CloseOutlined_CloseOutlined);
- if (true) {
- CloseOutlined_RefIcon.displayName = 'CloseOutlined';
- }
- /* harmony default export */ var icons_CloseOutlined = (CloseOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleFilled.js
- // This icon file is generated automatically.
- var ExclamationCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
- /* harmony default export */ var asn_ExclamationCircleFilled = (ExclamationCircleFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var ExclamationCircleFilled_ExclamationCircleFilled = function ExclamationCircleFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_ExclamationCircleFilled
- }));
- };
- /** */
- var ExclamationCircleFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ExclamationCircleFilled_ExclamationCircleFilled);
- if (true) {
- ExclamationCircleFilled_RefIcon.displayName = 'ExclamationCircleFilled';
- }
- /* harmony default export */ var icons_ExclamationCircleFilled = (ExclamationCircleFilled_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/InfoCircleFilled.js
- // This icon file is generated automatically.
- var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
- /* harmony default export */ var asn_InfoCircleFilled = (InfoCircleFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/InfoCircleFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var InfoCircleFilled_InfoCircleFilled = function InfoCircleFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_InfoCircleFilled
- }));
- };
- /** */
- var InfoCircleFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InfoCircleFilled_InfoCircleFilled);
- if (true) {
- InfoCircleFilled_RefIcon.displayName = 'InfoCircleFilled';
- }
- /* harmony default export */ var icons_InfoCircleFilled = (InfoCircleFilled_RefIcon);
- // EXTERNAL MODULE: ./node_modules/rc-motion/es/index.js + 13 modules
- var rc_motion_es = __webpack_require__("./node_modules/rc-motion/es/index.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/pickAttrs.js
- var pickAttrs = __webpack_require__("./node_modules/rc-util/es/pickAttrs.js");
- // EXTERNAL MODULE: ./components/_util/reactNode.ts
- var reactNode = __webpack_require__("./components/_util/reactNode.ts");
- // EXTERNAL MODULE: ./components/_util/warning.ts
- var _util_warning = __webpack_require__("./components/_util/warning.ts");
- // EXTERNAL MODULE: ./components/alert/style/index.ts
- var alert_style = __webpack_require__("./components/alert/style/index.ts");
- ;// ./components/alert/Alert.tsx
- var Alert_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const iconMapFilled = {
- success: icons_CheckCircleFilled,
- info: icons_InfoCircleFilled,
- error: icons_CloseCircleFilled,
- warning: icons_ExclamationCircleFilled
- };
- const IconNode = props => {
- const {
- icon,
- prefixCls,
- type
- } = props;
- const iconType = iconMapFilled[type] || null;
- if (icon) {
- return (0,reactNode.replaceElement)(icon, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-icon`
- }, icon), () => ({
- className: classnames_default()(`${prefixCls}-icon`, icon.props.className)
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(iconType, {
- className: `${prefixCls}-icon`
- });
- };
- const CloseIconNode = props => {
- const {
- isClosable,
- prefixCls,
- closeIcon,
- handleClose,
- ariaProps
- } = props;
- const mergedCloseIcon = closeIcon === true || closeIcon === undefined ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, null) : closeIcon;
- return isClosable ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", Object.assign({
- type: "button",
- onClick: handleClose,
- className: `${prefixCls}-close-icon`,
- tabIndex: 0
- }, ariaProps), mergedCloseIcon)) : null;
- };
- const Alert = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- description,
- prefixCls: customizePrefixCls,
- message,
- banner,
- className,
- rootClassName,
- style,
- onMouseEnter,
- onMouseLeave,
- onClick,
- afterClose,
- showIcon,
- closable,
- closeText,
- closeIcon,
- action,
- id
- } = props,
- otherProps = Alert_rest(props, ["description", "prefixCls", "message", "banner", "className", "rootClassName", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "id"]);
- const [closed, setClosed] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Alert');
- warning.deprecated(!closeText, 'closeText', 'closable.closeIcon');
- }
- const internalRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- nativeElement: internalRef.current
- }));
- const {
- getPrefixCls,
- direction,
- closable: contextClosable,
- closeIcon: contextCloseIcon,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('alert');
- const prefixCls = getPrefixCls('alert', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,alert_style["default"])(prefixCls);
- const handleClose = e => {
- var _a;
- setClosed(true);
- (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
- };
- const type = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (props.type !== undefined) {
- return props.type;
- }
- // banner mode defaults to 'warning'
- return banner ? 'warning' : 'info';
- }, [props.type, banner]);
- // closeable when closeText or closeIcon is assigned
- const isClosable = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (typeof closable === 'object' && closable.closeIcon) return true;
- if (closeText) {
- return true;
- }
- if (typeof closable === 'boolean') {
- return closable;
- }
- // should be true when closeIcon is 0 or ''
- if (closeIcon !== false && closeIcon !== null && closeIcon !== undefined) {
- return true;
- }
- return !!contextClosable;
- }, [closeText, closeIcon, closable, contextClosable]);
- // banner mode defaults to Icon
- const isShowIcon = banner && showIcon === undefined ? true : showIcon;
- const alertCls = classnames_default()(prefixCls, `${prefixCls}-${type}`, {
- [`${prefixCls}-with-description`]: !!description,
- [`${prefixCls}-no-icon`]: !isShowIcon,
- [`${prefixCls}-banner`]: !!banner,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, contextClassName, className, rootClassName, cssVarCls, hashId);
- const restProps = (0,pickAttrs["default"])(otherProps, {
- aria: true,
- data: true
- });
- const mergedCloseIcon = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (typeof closable === 'object' && closable.closeIcon) {
- return closable.closeIcon;
- }
- if (closeText) {
- return closeText;
- }
- if (closeIcon !== undefined) {
- return closeIcon;
- }
- if (typeof contextClosable === 'object' && contextClosable.closeIcon) {
- return contextClosable.closeIcon;
- }
- return contextCloseIcon;
- }, [closeIcon, closable, closeText, contextCloseIcon]);
- const mergedAriaProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const merged = closable !== null && closable !== void 0 ? closable : contextClosable;
- if (typeof merged === 'object') {
- const {
- closeIcon: _
- } = merged,
- ariaProps = Alert_rest(merged, ["closeIcon"]);
- return ariaProps;
- }
- return {};
- }, [closable, contextClosable]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: !closed,
- motionName: `${prefixCls}-motion`,
- motionAppear: false,
- motionEnter: false,
- onLeaveStart: node => ({
- maxHeight: node.offsetHeight
- }),
- onLeaveEnd: afterClose
- }, ({
- className: motionClassName,
- style: motionStyle
- }, setRef) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- id: id,
- ref: (0,es_ref.composeRef)(internalRef, setRef),
- "data-show": !closed,
- className: classnames_default()(alertCls, motionClassName),
- style: Object.assign(Object.assign(Object.assign({}, contextStyle), style), motionStyle),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onClick: onClick,
- role: "alert"
- }, restProps), isShowIcon ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(IconNode, {
- description: description,
- icon: props.icon,
- prefixCls: prefixCls,
- type: type
- })) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-content`
- }, message ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-message`
- }, message) : null, description ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-description`
- }, description) : null), action ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-action`
- }, action) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CloseIconNode, {
- isClosable: isClosable,
- prefixCls: prefixCls,
- closeIcon: mergedCloseIcon,
- handleClose: handleClose,
- ariaProps: mergedAriaProps
- })))));
- });
- if (true) {
- Alert.displayName = 'Alert';
- }
- /* harmony default export */ var alert_Alert = (Alert);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
- var getPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
- var isNativeReflectConstruct = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
- var possibleConstructorReturn = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/callSuper.js
- function _callSuper(t, o, e) {
- return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e));
- }
- ;// ./components/alert/ErrorBoundary.tsx
- let ErrorBoundary = /*#__PURE__*/function (_React$Component) {
- function ErrorBoundary() {
- var _this;
- (0,classCallCheck["default"])(this, ErrorBoundary);
- _this = _callSuper(this, ErrorBoundary, arguments);
- _this.state = {
- error: undefined,
- info: {
- componentStack: ''
- }
- };
- return _this;
- }
- (0,inherits["default"])(ErrorBoundary, _React$Component);
- return (0,createClass["default"])(ErrorBoundary, [{
- key: "componentDidCatch",
- value: function componentDidCatch(error, info) {
- this.setState({
- error,
- info
- });
- }
- }, {
- key: "render",
- value: function render() {
- const {
- message,
- description,
- id,
- children
- } = this.props;
- const {
- error,
- info
- } = this.state;
- const componentStack = (info === null || info === void 0 ? void 0 : info.componentStack) || null;
- const errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;
- const errorDescription = typeof description === 'undefined' ? componentStack : description;
- if (error) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(alert_Alert, {
- id: id,
- type: "error",
- message: errorMessage,
- description: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("pre", {
- style: {
- fontSize: '0.9em',
- overflowX: 'auto'
- }
- }, errorDescription)
- });
- }
- return children;
- }
- }]);
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- /* harmony default export */ var alert_ErrorBoundary = (ErrorBoundary);
- ;// ./components/alert/index.tsx
- const components_alert_Alert = alert_Alert;
- components_alert_Alert.ErrorBoundary = alert_ErrorBoundary;
- /* harmony default export */ var components_alert = (components_alert_Alert);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useEvent.js
- var useEvent = __webpack_require__("./node_modules/rc-util/es/hooks/useEvent.js");
- ;// ./node_modules/compute-scroll-into-view/dist/index.js
- const t=t=>"object"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||"hidden"!==t)&&("visible"!==t&&"clip"!==t),n=(t,n)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const o=getComputedStyle(t,null);return e(o.overflowY,n)||e(o.overflowX,n)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},o=(t,e,n,o,l,r,i,s)=>r<t&&i>e||r>t&&i<e?0:r<=t&&s<=n||i>=e&&s>=n?r-t-o:i>e&&s<n||r<t&&s>n?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},dist_r=(e,r)=>{var i,s,d,h;if("undefined"==typeof document)return[];const{scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=r,p="function"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k="start"===f||"nearest"===f?x-T:"end"===f?I+F:x+v/2-T+F,D="center"===u?R+E/2-V+B:"end"===u?C+B:R-V;const L=[];for(let t=0;t<w.length;t++){const e=w[t],{height:l,width:r,top:i,right:s,bottom:d,left:h}=e.getBoundingClientRect();if("if-needed"===c&&x>=0&&R>=0&&I<=H&&C<=b&&(e===m&&!n(e)||x>=i&&I<=d&&R>=h&&C<=s))return L;const a=getComputedStyle(e),g=parseInt(a.borderLeftWidth,10),p=parseInt(a.borderTopWidth,10),W=parseInt(a.borderRightWidth,10),T=parseInt(a.borderBottomWidth,10);let B=0,F=0;const V="offsetWidth"in e?e.offsetWidth-e.clientWidth-g-W:0,S="offsetHeight"in e?e.offsetHeight-e.clientHeight-p-T:0,X="offsetWidth"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,Y="offsetHeight"in e?0===e.offsetHeight?0:l/e.offsetHeight:0;if(m===e)B="start"===f?k:"end"===f?k-H:"nearest"===f?o(M,M+H,H,p,T,M+k,M+k+v,v):k-H/2,F="start"===u?D:"center"===u?D-b/2:"end"===u?D-b:o(y,y+b,b,g,W,y+D,y+D+E,E),B=Math.max(0,B+M),F=Math.max(0,F+y);else{B="start"===f?k-i-p:"end"===f?k-d+T+S:"nearest"===f?o(i,d,l,p,T+S,k,k+v,v):k-(i+l/2)+S/2,F="start"===u?D-h-g:"center"===u?D-(h+r/2)+V/2:"end"===u?D-s+W+V:o(h,s,r,g,W+V,D,D+E,E);const{scrollLeft:t,scrollTop:n}=e;B=0===Y?0:Math.max(0,Math.min(n+B/Y,e.scrollHeight-l/Y+S)),F=0===X?0:Math.max(0,Math.min(t+F/X,e.scrollWidth-r/X+V)),k+=n-B,D+=t-F}L.push({el:e,top:B,left:F})}return L};//# sourceMappingURL=index.js.map
- ;// ./node_modules/scroll-into-view-if-needed/dist/index.js
- const dist_o=t=>!1===t?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:"start",inline:"nearest"};function dist_e(e,r){if(!e.isConnected||!(t=>{let o=t;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1})(e))return;const n=(t=>{const o=window.getComputedStyle(t);return{top:parseFloat(o.scrollMarginTop)||0,right:parseFloat(o.scrollMarginRight)||0,bottom:parseFloat(o.scrollMarginBottom)||0,left:parseFloat(o.scrollMarginLeft)||0}})(e);if((t=>"object"==typeof t&&"function"==typeof t.behavior)(r))return r.behavior(dist_r(e,r));const l="boolean"==typeof r||null==r?void 0:r.behavior;for(const{el:a,top:i,left:s}of dist_r(e,dist_o(r))){const t=i-n.top+n.bottom,o=s-n.left+n.right;a.scroll({top:t,left:o,behavior:l})}}//# sourceMappingURL=index.js.map
- ;// ./components/_util/getScroll.ts
- function isWindow(obj) {
- return obj !== null && obj !== undefined && obj === obj.window;
- }
- const getScroll = target => {
- var _a, _b;
- if (typeof window === 'undefined') {
- /* istanbul ignore next */
- return 0;
- }
- let result = 0;
- if (isWindow(target)) {
- result = target.pageYOffset;
- } else if (target instanceof Document) {
- result = target.documentElement.scrollTop;
- } else if (target instanceof HTMLElement) {
- result = target.scrollTop;
- } else if (target) {
- // According to the type inference, the `target` is `never` type.
- // Since we configured the loose mode type checking, and supports mocking the target with such shape below::
- // `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`,
- // the program may falls into this branch.
- // Check the corresponding tests for details. Don't sure what is the real scenario this happens.
- /* biome-ignore lint/complexity/useLiteralKeys: target is a never type */ /* eslint-disable-next-line dot-notation */
- result = target['scrollTop'];
- }
- if (target && !isWindow(target) && typeof result !== 'number') {
- result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b.scrollTop;
- }
- return result;
- };
- /* harmony default export */ var _util_getScroll = (getScroll);
- ;// ./components/_util/easings.ts
- function easeInOutCubic(t, b, c, d) {
- const cc = c - b;
- t /= d / 2;
- if (t < 1) {
- return cc / 2 * t * t * t + b;
- }
- // biome-ignore lint: it is a common easing function
- return cc / 2 * ((t -= 2) * t * t + 2) + b;
- }
- ;// ./components/_util/scrollTo.ts
- function scrollTo(y, options = {}) {
- const {
- getContainer = () => window,
- callback,
- duration = 450
- } = options;
- const container = getContainer();
- const scrollTop = _util_getScroll(container);
- const startTime = Date.now();
- const frameFunc = () => {
- const timestamp = Date.now();
- const time = timestamp - startTime;
- const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
- if (isWindow(container)) {
- container.scrollTo(window.pageXOffset, nextScrollTop);
- } else if (container instanceof Document || container.constructor.name === 'HTMLDocument') {
- container.documentElement.scrollTop = nextScrollTop;
- } else {
- container.scrollTop = nextScrollTop;
- }
- if (time < duration) {
- (0,raf["default"])(frameFunc);
- } else if (typeof callback === 'function') {
- callback();
- }
- };
- (0,raf["default"])(frameFunc);
- }
- // EXTERNAL MODULE: ./components/theme/useToken.ts
- var useToken = __webpack_require__("./components/theme/useToken.ts");
- ;// ./components/config-provider/hooks/useCSSVarCls.ts
- /**
- * This hook is only for cssVar to add root className for components.
- * If root ClassName is needed, this hook could be refactored with `-root`
- * @param prefixCls
- */
- const useCSSVarCls = prefixCls => {
- const [,,,, cssVar] = (0,useToken["default"])();
- return cssVar ? `${prefixCls}-css-var` : '';
- };
- /* harmony default export */ var hooks_useCSSVarCls = (useCSSVarCls);
- ;// ./components/anchor/context.ts
- const AnchorContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(undefined);
- /* harmony default export */ var anchor_context = (AnchorContext);
- ;// ./components/anchor/AnchorLink.tsx
- const AnchorLink = props => {
- const {
- href,
- title,
- prefixCls: customizePrefixCls,
- children,
- className,
- target,
- replace
- } = props;
- const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(anchor_context);
- const {
- registerLink,
- unregisterLink,
- scrollTo,
- onClick,
- activeLink,
- direction
- } = context || {};
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- registerLink === null || registerLink === void 0 ? void 0 : registerLink(href);
- return () => {
- unregisterLink === null || unregisterLink === void 0 ? void 0 : unregisterLink(href);
- };
- }, [href]);
- const handleClick = e => {
- onClick === null || onClick === void 0 ? void 0 : onClick(e, {
- title,
- href
- });
- scrollTo === null || scrollTo === void 0 ? void 0 : scrollTo(href);
- // Support clicking on an anchor does not record history.
- if (e.defaultPrevented) {
- return;
- }
- const isExternalLink = href.startsWith('http://') || href.startsWith('https://');
- // Support external link
- if (isExternalLink) {
- if (replace) {
- e.preventDefault();
- window.location.replace(href);
- }
- return;
- }
- // Handling internal anchor link
- e.preventDefault();
- const historyMethod = replace ? 'replaceState' : 'pushState';
- window.history[historyMethod](null, '', href);
- };
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Anchor.Link');
- true ? warning(!children || direction !== 'horizontal', 'usage', '`Anchor.Link children` is not supported when `Anchor` direction is horizontal') : 0;
- }
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('anchor', customizePrefixCls);
- const active = activeLink === href;
- const wrapperClassName = classnames_default()(`${prefixCls}-link`, className, {
- [`${prefixCls}-link-active`]: active
- });
- const titleClassName = classnames_default()(`${prefixCls}-link-title`, {
- [`${prefixCls}-link-title-active`]: active
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: wrapperClassName
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- className: titleClassName,
- href: href,
- title: typeof title === 'string' ? title : '',
- target: target,
- onClick: handleClick
- }, title), direction !== 'horizontal' ? children : null);
- };
- /* harmony default export */ var anchor_AnchorLink = (AnchorLink);
- // EXTERNAL MODULE: ./components/anchor/style/index.ts
- var anchor_style = __webpack_require__("./components/anchor/style/index.ts");
- ;// ./components/anchor/Anchor.tsx
- function getDefaultContainer() {
- return window;
- }
- function getOffsetTop(element, container) {
- if (!element.getClientRects().length) {
- return 0;
- }
- const rect = element.getBoundingClientRect();
- if (rect.width || rect.height) {
- if (container === window) {
- return rect.top - element.ownerDocument.documentElement.clientTop;
- }
- return rect.top - container.getBoundingClientRect().top;
- }
- return rect.top;
- }
- const sharpMatcherRegex = /#([\S ]+)$/;
- const Anchor = props => {
- var _a;
- const {
- rootClassName,
- prefixCls: customPrefixCls,
- className,
- style,
- offsetTop,
- affix = true,
- showInkInFixed = false,
- children,
- items,
- direction: anchorDirection = 'vertical',
- bounds,
- targetOffset,
- onClick,
- onChange,
- getContainer,
- getCurrentAnchor,
- replace
- } = props;
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Anchor');
- warning.deprecated(!children, 'Anchor children', 'items');
- true ? warning(!(anchorDirection === 'horizontal' && (items === null || items === void 0 ? void 0 : items.some(n => 'children' in n))), 'usage', '`Anchor items#children` is not supported when `Anchor` direction is horizontal.') : 0;
- }
- const [links, setLinks] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const [activeLink, setActiveLink] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- const activeLinkRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(activeLink);
- const wrapperRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const spanLinkNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const animating = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- const {
- direction,
- getPrefixCls,
- className: anchorClassName,
- style: anchorStyle
- } = (0,config_provider_context.useComponentConfig)('anchor');
- const {
- getTargetContainer
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('anchor', customPrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,anchor_style["default"])(prefixCls, rootCls);
- const getCurrentContainer = (_a = getContainer !== null && getContainer !== void 0 ? getContainer : getTargetContainer) !== null && _a !== void 0 ? _a : getDefaultContainer;
- const dependencyListItem = JSON.stringify(links);
- const registerLink = (0,useEvent["default"])(link => {
- if (!links.includes(link)) {
- setLinks(prev => [].concat((0,toConsumableArray["default"])(prev), [link]));
- }
- });
- const unregisterLink = (0,useEvent["default"])(link => {
- if (links.includes(link)) {
- setLinks(prev => prev.filter(i => i !== link));
- }
- });
- const updateInk = () => {
- var _a;
- const linkNode = (_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${prefixCls}-link-title-active`);
- if (linkNode && spanLinkNode.current) {
- const {
- style: inkStyle
- } = spanLinkNode.current;
- const horizontalAnchor = anchorDirection === 'horizontal';
- inkStyle.top = horizontalAnchor ? '' : `${linkNode.offsetTop + linkNode.clientHeight / 2}px`;
- inkStyle.height = horizontalAnchor ? '' : `${linkNode.clientHeight}px`;
- inkStyle.left = horizontalAnchor ? `${linkNode.offsetLeft}px` : '';
- inkStyle.width = horizontalAnchor ? `${linkNode.clientWidth}px` : '';
- if (horizontalAnchor) {
- dist_e(linkNode, {
- scrollMode: 'if-needed',
- block: 'nearest'
- });
- }
- }
- };
- const getInternalCurrentAnchor = (_links, _offsetTop = 0, _bounds = 5) => {
- const linkSections = [];
- const container = getCurrentContainer();
- _links.forEach(link => {
- const sharpLinkMatch = sharpMatcherRegex.exec(link === null || link === void 0 ? void 0 : link.toString());
- if (!sharpLinkMatch) {
- return;
- }
- const target = document.getElementById(sharpLinkMatch[1]);
- if (target) {
- const top = getOffsetTop(target, container);
- if (top <= _offsetTop + _bounds) {
- linkSections.push({
- link,
- top
- });
- }
- }
- });
- if (linkSections.length) {
- const maxSection = linkSections.reduce((prev, curr) => curr.top > prev.top ? curr : prev);
- return maxSection.link;
- }
- return '';
- };
- const setCurrentActiveLink = (0,useEvent["default"])(link => {
- // FIXME: Seems a bug since this compare is not equals
- // `activeLinkRef` is parsed value which will always trigger `onChange` event.
- if (activeLinkRef.current === link) {
- return;
- }
- // https://github.com/ant-design/ant-design/issues/30584
- const newLink = typeof getCurrentAnchor === 'function' ? getCurrentAnchor(link) : link;
- setActiveLink(newLink);
- activeLinkRef.current = newLink;
- // onChange should respect the original link (which may caused by
- // window scroll or user click), not the new link
- onChange === null || onChange === void 0 ? void 0 : onChange(link);
- });
- const handleScroll = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(() => {
- if (animating.current) {
- return;
- }
- const currentActiveLink = getInternalCurrentAnchor(links, targetOffset !== undefined ? targetOffset : offsetTop || 0, bounds);
- setCurrentActiveLink(currentActiveLink);
- }, [dependencyListItem, targetOffset, offsetTop]);
- const handleScrollTo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(link => {
- setCurrentActiveLink(link);
- const sharpLinkMatch = sharpMatcherRegex.exec(link);
- if (!sharpLinkMatch) {
- return;
- }
- const targetElement = document.getElementById(sharpLinkMatch[1]);
- if (!targetElement) {
- return;
- }
- const container = getCurrentContainer();
- const scrollTop = _util_getScroll(container);
- const eleOffsetTop = getOffsetTop(targetElement, container);
- let y = scrollTop + eleOffsetTop;
- y -= targetOffset !== undefined ? targetOffset : offsetTop || 0;
- animating.current = true;
- scrollTo(y, {
- getContainer: getCurrentContainer,
- callback() {
- animating.current = false;
- }
- });
- }, [targetOffset, offsetTop]);
- const wrapperClass = classnames_default()(hashId, cssVarCls, rootCls, rootClassName, `${prefixCls}-wrapper`, {
- [`${prefixCls}-wrapper-horizontal`]: anchorDirection === 'horizontal',
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, anchorClassName);
- const anchorClass = classnames_default()(prefixCls, {
- [`${prefixCls}-fixed`]: !affix && !showInkInFixed
- });
- const inkClass = classnames_default()(`${prefixCls}-ink`, {
- [`${prefixCls}-ink-visible`]: activeLink
- });
- const wrapperStyle = Object.assign(Object.assign({
- maxHeight: offsetTop ? `calc(100vh - ${offsetTop}px)` : '100vh'
- }, anchorStyle), style);
- const createNestedLink = options => Array.isArray(options) ? options.map(item => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(anchor_AnchorLink, Object.assign({
- replace: replace
- }, item, {
- key: item.key
- }), anchorDirection === 'vertical' && createNestedLink(item.children)))) : null;
- const anchorContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: wrapperRef,
- className: wrapperClass,
- style: wrapperStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: anchorClass
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: inkClass,
- ref: spanLinkNode
- }), 'items' in props ? createNestedLink(items) : children));
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const scrollContainer = getCurrentContainer();
- handleScroll();
- scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.addEventListener('scroll', handleScroll);
- return () => {
- scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.removeEventListener('scroll', handleScroll);
- };
- }, [dependencyListItem]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (typeof getCurrentAnchor === 'function') {
- setCurrentActiveLink(getCurrentAnchor(activeLinkRef.current || ''));
- }
- }, [getCurrentAnchor]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- updateInk();
- }, [anchorDirection, getCurrentAnchor, dependencyListItem, activeLink]);
- const memoizedContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- registerLink,
- unregisterLink,
- scrollTo: handleScrollTo,
- activeLink,
- onClick,
- direction: anchorDirection
- }), [activeLink, onClick, handleScrollTo, anchorDirection]);
- const affixProps = affix && typeof affix === 'object' ? affix : undefined;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(anchor_context.Provider, {
- value: memoizedContextValue
- }, affix ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_affix, Object.assign({
- offsetTop: offsetTop,
- target: getCurrentContainer
- }, affixProps), anchorContent)) : anchorContent));
- };
- if (true) {
- Anchor.displayName = 'Anchor';
- }
- /* harmony default export */ var anchor_Anchor = (Anchor);
- ;// ./components/anchor/index.tsx
- const components_anchor_Anchor = anchor_Anchor;
- components_anchor_Anchor.Link = anchor_AnchorLink;
- /* harmony default export */ var components_anchor = (components_anchor_Anchor);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- // EXTERNAL MODULE: external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom"}
- var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_ = __webpack_require__("react-dom");
- var external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default = /*#__PURE__*/__webpack_require__.n(external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/KeyCode.js
- var KeyCode = __webpack_require__("./node_modules/rc-util/es/KeyCode.js");
- ;// ./node_modules/rc-notification/es/Notice.js
- var Notify = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- style = props.style,
- className = props.className,
- _props$duration = props.duration,
- duration = _props$duration === void 0 ? 4.5 : _props$duration,
- showProgress = props.showProgress,
- _props$pauseOnHover = props.pauseOnHover,
- pauseOnHover = _props$pauseOnHover === void 0 ? true : _props$pauseOnHover,
- eventKey = props.eventKey,
- content = props.content,
- closable = props.closable,
- _props$closeIcon = props.closeIcon,
- closeIcon = _props$closeIcon === void 0 ? 'x' : _props$closeIcon,
- divProps = props.props,
- onClick = props.onClick,
- onNoticeClose = props.onNoticeClose,
- times = props.times,
- forcedHovering = props.hovering;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- hovering = _React$useState2[0],
- setHovering = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- percent = _React$useState4[0],
- setPercent = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- spentTime = _React$useState6[0],
- setSpentTime = _React$useState6[1];
- var mergedHovering = forcedHovering || hovering;
- var mergedShowProgress = duration > 0 && showProgress;
- // ======================== Close =========================
- var onInternalClose = function onInternalClose() {
- onNoticeClose(eventKey);
- };
- var onCloseKeyDown = function onCloseKeyDown(e) {
- if (e.key === 'Enter' || e.code === 'Enter' || e.keyCode === KeyCode["default"].ENTER) {
- onInternalClose();
- }
- };
- // ======================== Effect ========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!mergedHovering && duration > 0) {
- var start = Date.now() - spentTime;
- var timeout = setTimeout(function () {
- onInternalClose();
- }, duration * 1000 - spentTime);
- return function () {
- if (pauseOnHover) {
- clearTimeout(timeout);
- }
- setSpentTime(Date.now() - start);
- };
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [duration, mergedHovering, times]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!mergedHovering && mergedShowProgress && (pauseOnHover || spentTime === 0)) {
- var start = performance.now();
- var animationFrame;
- var calculate = function calculate() {
- cancelAnimationFrame(animationFrame);
- animationFrame = requestAnimationFrame(function (timestamp) {
- var runtime = timestamp + spentTime - start;
- var progress = Math.min(runtime / (duration * 1000), 1);
- setPercent(progress * 100);
- if (progress < 1) {
- calculate();
- }
- });
- };
- calculate();
- return function () {
- if (pauseOnHover) {
- cancelAnimationFrame(animationFrame);
- }
- };
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [duration, spentTime, mergedHovering, mergedShowProgress, times]);
- // ======================== Closable ========================
- var closableObj = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if ((0,esm_typeof["default"])(closable) === 'object' && closable !== null) {
- return closable;
- }
- if (closable) {
- return {
- closeIcon: closeIcon
- };
- }
- return {};
- }, [closable, closeIcon]);
- var ariaProps = (0,pickAttrs["default"])(closableObj, true);
- // ======================== Progress ========================
- var validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent);
- // ======================== Render ========================
- var noticePrefixCls = "".concat(prefixCls, "-notice");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, divProps, {
- ref: ref,
- className: classnames_default()(noticePrefixCls, className, (0,defineProperty["default"])({}, "".concat(noticePrefixCls, "-closable"), closable)),
- style: style,
- onMouseEnter: function onMouseEnter(e) {
- var _divProps$onMouseEnte;
- setHovering(true);
- divProps === null || divProps === void 0 || (_divProps$onMouseEnte = divProps.onMouseEnter) === null || _divProps$onMouseEnte === void 0 || _divProps$onMouseEnte.call(divProps, e);
- },
- onMouseLeave: function onMouseLeave(e) {
- var _divProps$onMouseLeav;
- setHovering(false);
- divProps === null || divProps === void 0 || (_divProps$onMouseLeav = divProps.onMouseLeave) === null || _divProps$onMouseLeav === void 0 || _divProps$onMouseLeav.call(divProps, e);
- },
- onClick: onClick
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(noticePrefixCls, "-content")
- }, content), closable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", (0,esm_extends["default"])({
- tabIndex: 0,
- className: "".concat(noticePrefixCls, "-close"),
- onKeyDown: onCloseKeyDown,
- "aria-label": "Close"
- }, ariaProps, {
- onClick: function onClick(e) {
- e.preventDefault();
- e.stopPropagation();
- onInternalClose();
- }
- }), closableObj.closeIcon), mergedShowProgress && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("progress", {
- className: "".concat(noticePrefixCls, "-progress"),
- max: "100",
- value: validPercent
- }, validPercent + '%'));
- });
- /* harmony default export */ var Notice = (Notify);
- ;// ./node_modules/rc-notification/es/NotificationProvider.js
- var NotificationContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- var NotificationProvider = function NotificationProvider(_ref) {
- var children = _ref.children,
- classNames = _ref.classNames;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(NotificationContext.Provider, {
- value: {
- classNames: classNames
- }
- }, children);
- };
- /* harmony default export */ var es_NotificationProvider = (NotificationProvider);
- ;// ./node_modules/rc-notification/es/hooks/useStack.js
- var DEFAULT_OFFSET = 8;
- var DEFAULT_THRESHOLD = 3;
- var DEFAULT_GAP = 16;
- var useStack = function useStack(config) {
- var result = {
- offset: DEFAULT_OFFSET,
- threshold: DEFAULT_THRESHOLD,
- gap: DEFAULT_GAP
- };
- if (config && (0,esm_typeof["default"])(config) === 'object') {
- var _config$offset, _config$threshold, _config$gap;
- result.offset = (_config$offset = config.offset) !== null && _config$offset !== void 0 ? _config$offset : DEFAULT_OFFSET;
- result.threshold = (_config$threshold = config.threshold) !== null && _config$threshold !== void 0 ? _config$threshold : DEFAULT_THRESHOLD;
- result.gap = (_config$gap = config.gap) !== null && _config$gap !== void 0 ? _config$gap : DEFAULT_GAP;
- }
- return [!!config, result];
- };
- /* harmony default export */ var hooks_useStack = (useStack);
- ;// ./node_modules/rc-notification/es/NoticeList.js
- var _excluded = ["className", "style", "classNames", "styles"];
- var NoticeList = function NoticeList(props) {
- var configList = props.configList,
- placement = props.placement,
- prefixCls = props.prefixCls,
- className = props.className,
- style = props.style,
- motion = props.motion,
- onAllNoticeRemoved = props.onAllNoticeRemoved,
- onNoticeClose = props.onNoticeClose,
- stackConfig = props.stack;
- var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(NotificationContext),
- ctxCls = _useContext.classNames;
- var dictRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- latestNotice = _useState2[0],
- setLatestNotice = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- hoverKeys = _useState4[0],
- setHoverKeys = _useState4[1];
- var keys = configList.map(function (config) {
- return {
- config: config,
- key: String(config.key)
- };
- });
- var _useStack = hooks_useStack(stackConfig),
- _useStack2 = (0,slicedToArray["default"])(_useStack, 2),
- stack = _useStack2[0],
- _useStack2$ = _useStack2[1],
- offset = _useStack2$.offset,
- threshold = _useStack2$.threshold,
- gap = _useStack2$.gap;
- var expanded = stack && (hoverKeys.length > 0 || keys.length <= threshold);
- var placementMotion = typeof motion === 'function' ? motion(placement) : motion;
- // Clean hover key
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (stack && hoverKeys.length > 1) {
- setHoverKeys(function (prev) {
- return prev.filter(function (key) {
- return keys.some(function (_ref) {
- var dataKey = _ref.key;
- return key === dataKey;
- });
- });
- });
- }
- }, [hoverKeys, keys, stack]);
- // Force update latest notice
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var _keys;
- if (stack && dictRef.current[(_keys = keys[keys.length - 1]) === null || _keys === void 0 ? void 0 : _keys.key]) {
- var _keys2;
- setLatestNotice(dictRef.current[(_keys2 = keys[keys.length - 1]) === null || _keys2 === void 0 ? void 0 : _keys2.key]);
- }
- }, [keys, stack]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_motion_es.CSSMotionList, (0,esm_extends["default"])({
- key: placement,
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(placement), ctxCls === null || ctxCls === void 0 ? void 0 : ctxCls.list, className, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-stack"), !!stack), "".concat(prefixCls, "-stack-expanded"), expanded)),
- style: style,
- keys: keys,
- motionAppear: true
- }, placementMotion, {
- onAllRemoved: function onAllRemoved() {
- onAllNoticeRemoved(placement);
- }
- }), function (_ref2, nodeRef) {
- var config = _ref2.config,
- motionClassName = _ref2.className,
- motionStyle = _ref2.style,
- motionIndex = _ref2.index;
- var _ref3 = config,
- key = _ref3.key,
- times = _ref3.times;
- var strKey = String(key);
- var _ref4 = config,
- configClassName = _ref4.className,
- configStyle = _ref4.style,
- configClassNames = _ref4.classNames,
- configStyles = _ref4.styles,
- restConfig = (0,objectWithoutProperties["default"])(_ref4, _excluded);
- var dataIndex = keys.findIndex(function (item) {
- return item.key === strKey;
- });
- // If dataIndex is -1, that means this notice has been removed in data, but still in dom
- // Should minus (motionIndex - 1) to get the correct index because keys.length is not the same as dom length
- var stackStyle = {};
- if (stack) {
- var index = keys.length - 1 - (dataIndex > -1 ? dataIndex : motionIndex - 1);
- var transformX = placement === 'top' || placement === 'bottom' ? '-50%' : '0';
- if (index > 0) {
- var _dictRef$current$strK, _dictRef$current$strK2, _dictRef$current$strK3;
- stackStyle.height = expanded ? (_dictRef$current$strK = dictRef.current[strKey]) === null || _dictRef$current$strK === void 0 ? void 0 : _dictRef$current$strK.offsetHeight : latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetHeight;
- // Transform
- var verticalOffset = 0;
- for (var i = 0; i < index; i++) {
- var _dictRef$current$keys;
- verticalOffset += ((_dictRef$current$keys = dictRef.current[keys[keys.length - 1 - i].key]) === null || _dictRef$current$keys === void 0 ? void 0 : _dictRef$current$keys.offsetHeight) + gap;
- }
- var transformY = (expanded ? verticalOffset : index * offset) * (placement.startsWith('top') ? 1 : -1);
- var scaleX = !expanded && latestNotice !== null && latestNotice !== void 0 && latestNotice.offsetWidth && (_dictRef$current$strK2 = dictRef.current[strKey]) !== null && _dictRef$current$strK2 !== void 0 && _dictRef$current$strK2.offsetWidth ? ((latestNotice === null || latestNotice === void 0 ? void 0 : latestNotice.offsetWidth) - offset * 2 * (index < 3 ? index : 3)) / ((_dictRef$current$strK3 = dictRef.current[strKey]) === null || _dictRef$current$strK3 === void 0 ? void 0 : _dictRef$current$strK3.offsetWidth) : 1;
- stackStyle.transform = "translate3d(".concat(transformX, ", ").concat(transformY, "px, 0) scaleX(").concat(scaleX, ")");
- } else {
- stackStyle.transform = "translate3d(".concat(transformX, ", 0, 0)");
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: nodeRef,
- className: classnames_default()("".concat(prefixCls, "-notice-wrapper"), motionClassName, configClassNames === null || configClassNames === void 0 ? void 0 : configClassNames.wrapper),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, motionStyle), stackStyle), configStyles === null || configStyles === void 0 ? void 0 : configStyles.wrapper),
- onMouseEnter: function onMouseEnter() {
- return setHoverKeys(function (prev) {
- return prev.includes(strKey) ? prev : [].concat((0,toConsumableArray["default"])(prev), [strKey]);
- });
- },
- onMouseLeave: function onMouseLeave() {
- return setHoverKeys(function (prev) {
- return prev.filter(function (k) {
- return k !== strKey;
- });
- });
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Notice, (0,esm_extends["default"])({}, restConfig, {
- ref: function ref(node) {
- if (dataIndex > -1) {
- dictRef.current[strKey] = node;
- } else {
- delete dictRef.current[strKey];
- }
- },
- prefixCls: prefixCls,
- classNames: configClassNames,
- styles: configStyles,
- className: classnames_default()(configClassName, ctxCls === null || ctxCls === void 0 ? void 0 : ctxCls.notice),
- style: configStyle,
- times: times,
- key: key,
- eventKey: key,
- onNoticeClose: onNoticeClose,
- hovering: stack && hoverKeys.length > 0
- })));
- });
- };
- if (true) {
- NoticeList.displayName = 'NoticeList';
- }
- /* harmony default export */ var es_NoticeList = (NoticeList);
- ;// ./node_modules/rc-notification/es/Notifications.js
- // ant-notification ant-notification-topRight
- var Notifications = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-notification' : _props$prefixCls,
- container = props.container,
- motion = props.motion,
- maxCount = props.maxCount,
- className = props.className,
- style = props.style,
- onAllRemoved = props.onAllRemoved,
- stack = props.stack,
- renderNotifications = props.renderNotifications;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- configList = _React$useState2[0],
- setConfigList = _React$useState2[1];
- // ======================== Close =========================
- var onNoticeClose = function onNoticeClose(key) {
- var _config$onClose;
- // Trigger close event
- var config = configList.find(function (item) {
- return item.key === key;
- });
- config === null || config === void 0 || (_config$onClose = config.onClose) === null || _config$onClose === void 0 || _config$onClose.call(config);
- setConfigList(function (list) {
- return list.filter(function (item) {
- return item.key !== key;
- });
- });
- };
- // ========================= Refs =========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- open: function open(config) {
- setConfigList(function (list) {
- var clone = (0,toConsumableArray["default"])(list);
- // Replace if exist
- var index = clone.findIndex(function (item) {
- return item.key === config.key;
- });
- var innerConfig = (0,objectSpread2["default"])({}, config);
- if (index >= 0) {
- var _list$index;
- innerConfig.times = (((_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.times) || 0) + 1;
- clone[index] = innerConfig;
- } else {
- innerConfig.times = 0;
- clone.push(innerConfig);
- }
- if (maxCount > 0 && clone.length > maxCount) {
- clone = clone.slice(-maxCount);
- }
- return clone;
- });
- },
- close: function close(key) {
- onNoticeClose(key);
- },
- destroy: function destroy() {
- setConfigList([]);
- }
- };
- });
- // ====================== Placements ======================
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- placements = _React$useState4[0],
- setPlacements = _React$useState4[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var nextPlacements = {};
- configList.forEach(function (config) {
- var _config$placement = config.placement,
- placement = _config$placement === void 0 ? 'topRight' : _config$placement;
- if (placement) {
- nextPlacements[placement] = nextPlacements[placement] || [];
- nextPlacements[placement].push(config);
- }
- });
- // Fill exist placements to avoid empty list causing remove without motion
- Object.keys(placements).forEach(function (placement) {
- nextPlacements[placement] = nextPlacements[placement] || [];
- });
- setPlacements(nextPlacements);
- }, [configList]);
- // Clean up container if all notices fade out
- var onAllNoticeRemoved = function onAllNoticeRemoved(placement) {
- setPlacements(function (originPlacements) {
- var clone = (0,objectSpread2["default"])({}, originPlacements);
- var list = clone[placement] || [];
- if (!list.length) {
- delete clone[placement];
- }
- return clone;
- });
- };
- // Effect tell that placements is empty now
- var emptyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (Object.keys(placements).length > 0) {
- emptyRef.current = true;
- } else if (emptyRef.current) {
- // Trigger only when from exist to empty
- onAllRemoved === null || onAllRemoved === void 0 || onAllRemoved();
- emptyRef.current = false;
- }
- }, [placements]);
- // ======================== Render ========================
- if (!container) {
- return null;
- }
- var placementList = Object.keys(placements);
- return /*#__PURE__*/(0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.createPortal)( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, placementList.map(function (placement) {
- var placementConfigList = placements[placement];
- var list = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_NoticeList, {
- key: placement,
- configList: placementConfigList,
- placement: placement,
- prefixCls: prefixCls,
- className: className === null || className === void 0 ? void 0 : className(placement),
- style: style === null || style === void 0 ? void 0 : style(placement),
- motion: motion,
- onNoticeClose: onNoticeClose,
- onAllNoticeRemoved: onAllNoticeRemoved,
- stack: stack
- });
- return renderNotifications ? renderNotifications(list, {
- prefixCls: prefixCls,
- key: placement
- }) : list;
- })), container);
- });
- if (true) {
- Notifications.displayName = 'Notifications';
- }
- /* harmony default export */ var es_Notifications = (Notifications);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/index.js
- var rc_util_es = __webpack_require__("./node_modules/rc-util/es/index.js");
- ;// ./node_modules/rc-notification/es/hooks/useNotification.js
- var useNotification_excluded = ["getContainer", "motion", "prefixCls", "maxCount", "className", "style", "onAllRemoved", "stack", "renderNotifications"];
- var defaultGetContainer = function defaultGetContainer() {
- return document.body;
- };
- var uniqueKey = 0;
- function mergeConfig() {
- var clone = {};
- for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) {
- objList[_key] = arguments[_key];
- }
- objList.forEach(function (obj) {
- if (obj) {
- Object.keys(obj).forEach(function (key) {
- var val = obj[key];
- if (val !== undefined) {
- clone[key] = val;
- }
- });
- }
- });
- return clone;
- }
- function useNotification() {
- var rootConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _rootConfig$getContai = rootConfig.getContainer,
- getContainer = _rootConfig$getContai === void 0 ? defaultGetContainer : _rootConfig$getContai,
- motion = rootConfig.motion,
- prefixCls = rootConfig.prefixCls,
- maxCount = rootConfig.maxCount,
- className = rootConfig.className,
- style = rootConfig.style,
- onAllRemoved = rootConfig.onAllRemoved,
- stack = rootConfig.stack,
- renderNotifications = rootConfig.renderNotifications,
- shareConfig = (0,objectWithoutProperties["default"])(rootConfig, useNotification_excluded);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- container = _React$useState2[0],
- setContainer = _React$useState2[1];
- var notificationsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var contextHolder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Notifications, {
- container: container,
- ref: notificationsRef,
- prefixCls: prefixCls,
- motion: motion,
- maxCount: maxCount,
- className: className,
- style: style,
- onAllRemoved: onAllRemoved,
- stack: stack,
- renderNotifications: renderNotifications
- });
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- taskQueue = _React$useState4[0],
- setTaskQueue = _React$useState4[1];
- var open = (0,rc_util_es.useEvent)(function (config) {
- var mergedConfig = mergeConfig(shareConfig, config);
- if (mergedConfig.key === null || mergedConfig.key === undefined) {
- mergedConfig.key = "rc-notification-".concat(uniqueKey);
- uniqueKey += 1;
- }
- setTaskQueue(function (queue) {
- return [].concat((0,toConsumableArray["default"])(queue), [{
- type: 'open',
- config: mergedConfig
- }]);
- });
- });
- // ========================= Refs =========================
- var api = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- open: open,
- close: function close(key) {
- setTaskQueue(function (queue) {
- return [].concat((0,toConsumableArray["default"])(queue), [{
- type: 'close',
- key: key
- }]);
- });
- },
- destroy: function destroy() {
- setTaskQueue(function (queue) {
- return [].concat((0,toConsumableArray["default"])(queue), [{
- type: 'destroy'
- }]);
- });
- }
- };
- }, []);
- // ======================= Container ======================
- // React 18 should all in effect that we will check container in each render
- // Which means getContainer should be stable.
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setContainer(getContainer());
- });
- // ======================== Effect ========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // Flush task when node ready
- if (notificationsRef.current && taskQueue.length) {
- taskQueue.forEach(function (task) {
- switch (task.type) {
- case 'open':
- notificationsRef.current.open(task.config);
- break;
- case 'close':
- notificationsRef.current.close(task.key);
- break;
- case 'destroy':
- notificationsRef.current.destroy();
- break;
- }
- });
- // https://github.com/ant-design/ant-design/issues/52590
- // React `startTransition` will run once `useEffect` but many times `setState`,
- // So `setTaskQueue` with filtered array will cause infinite loop.
- // We cache the first match queue instead.
- var oriTaskQueue;
- var tgtTaskQueue;
- // React 17 will mix order of effect & setState in async
- // - open: setState[0]
- // - effect[0]
- // - open: setState[1]
- // - effect setState([]) * here will clean up [0, 1] in React 17
- setTaskQueue(function (oriQueue) {
- if (oriTaskQueue !== oriQueue || !tgtTaskQueue) {
- oriTaskQueue = oriQueue;
- tgtTaskQueue = oriQueue.filter(function (task) {
- return !taskQueue.includes(task);
- });
- }
- return tgtTaskQueue;
- });
- }
- }, [taskQueue]);
- // ======================== Return ========================
- return [api, contextHolder];
- }
- ;// ./node_modules/rc-notification/es/index.js
- ;// ./node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js
- // This icon file is generated automatically.
- var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
- /* harmony default export */ var asn_LoadingOutlined = (LoadingOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var LoadingOutlined_LoadingOutlined = function LoadingOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_LoadingOutlined
- }));
- };
- /** */
- var LoadingOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(LoadingOutlined_LoadingOutlined);
- if (true) {
- LoadingOutlined_RefIcon.displayName = 'LoadingOutlined';
- }
- /* harmony default export */ var icons_LoadingOutlined = (LoadingOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/message/style/index.ts
- var style = __webpack_require__("./components/message/style/index.ts");
- ;// ./components/message/PurePanel.tsx
- var PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TypeIcon = {
- info: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_InfoCircleFilled, null),
- success: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckCircleFilled, null),
- error: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseCircleFilled, null),
- warning: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ExclamationCircleFilled, null),
- loading: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null)
- };
- const PureContent = ({
- prefixCls,
- type,
- icon,
- children
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-custom-content`, `${prefixCls}-${type}`)
- }, icon || TypeIcon[type], /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, children)));
- /** @private Internal Component. Do not use in your production. */
- const PurePanel = props => {
- const {
- prefixCls: staticPrefixCls,
- className,
- type,
- icon,
- content
- } = props,
- restProps = PurePanel_rest(props, ["prefixCls", "className", "type", "icon", "content"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = staticPrefixCls || getPrefixCls('message');
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,style["default"])(prefixCls, rootCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Notice, Object.assign({}, restProps, {
- prefixCls: prefixCls,
- className: classnames_default()(className, hashId, `${prefixCls}-notice-pure-panel`, cssVarCls, rootCls),
- eventKey: "pure",
- duration: null,
- content: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PureContent, {
- prefixCls: prefixCls,
- type: type,
- icon: icon
- }, content)
- })));
- };
- /* harmony default export */ var message_PurePanel = (PurePanel);
- ;// ./components/message/util.ts
- function getMotion(prefixCls, transitionName) {
- return {
- motionName: transitionName !== null && transitionName !== void 0 ? transitionName : `${prefixCls}-move-up`
- };
- }
- /** Wrap message open with promise like function */
- function wrapPromiseFn(openFn) {
- let closeFn;
- const closePromise = new Promise(resolve => {
- closeFn = openFn(() => {
- resolve(true);
- });
- });
- const result = () => {
- closeFn === null || closeFn === void 0 ? void 0 : closeFn();
- };
- result.then = (filled, rejected) => closePromise.then(filled, rejected);
- result.promise = closePromise;
- return result;
- }
- ;// ./components/message/useMessage.tsx
- var useMessage_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const useMessage_DEFAULT_OFFSET = 8;
- const DEFAULT_DURATION = 3;
- const Wrapper = ({
- children,
- prefixCls
- }) => {
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,style["default"])(prefixCls, rootCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_NotificationProvider, {
- classNames: {
- list: classnames_default()(hashId, cssVarCls, rootCls)
- }
- }, children));
- };
- const renderNotifications = (node, {
- prefixCls,
- key
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Wrapper, {
- prefixCls: prefixCls,
- key: key
- }, node));
- const Holder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- top,
- prefixCls: staticPrefixCls,
- getContainer: staticGetContainer,
- maxCount,
- duration = DEFAULT_DURATION,
- rtl,
- transitionName,
- onAllRemoved
- } = props;
- const {
- getPrefixCls,
- getPopupContainer,
- message,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = staticPrefixCls || getPrefixCls('message');
- // =============================== Style ===============================
- const getStyle = () => ({
- left: '50%',
- transform: 'translateX(-50%)',
- top: top !== null && top !== void 0 ? top : useMessage_DEFAULT_OFFSET
- });
- const getClassName = () => classnames_default()({
- [`${prefixCls}-rtl`]: rtl !== null && rtl !== void 0 ? rtl : direction === 'rtl'
- });
- // ============================== Motion ===============================
- const getNotificationMotion = () => getMotion(prefixCls, transitionName);
- // ============================ Close Icon =============================
- const mergedCloseIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-close-x`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, {
- className: `${prefixCls}-close-icon`
- }));
- // ============================== Origin ===============================
- const [api, holder] = useNotification({
- prefixCls,
- style: getStyle,
- className: getClassName,
- motion: getNotificationMotion,
- closable: false,
- closeIcon: mergedCloseIcon,
- duration,
- getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,
- maxCount,
- onAllRemoved,
- renderNotifications
- });
- // ================================ Ref ================================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {
- prefixCls,
- message
- }));
- return holder;
- });
- // ==============================================================================
- // == Hook ==
- // ==============================================================================
- let keyIndex = 0;
- function useInternalMessage(messageConfig) {
- const holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const warning = (0,_util_warning.devUseWarning)('Message');
- // ================================ API ================================
- const wrapAPI = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- // Wrap with notification content
- // >>> close
- const close = key => {
- var _a;
- (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);
- };
- // >>> Open
- const open = config => {
- if (!holderRef.current) {
- true ? warning(false, 'usage', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : 0;
- const fakeResult = () => {};
- fakeResult.then = () => {};
- return fakeResult;
- }
- const {
- open: originOpen,
- prefixCls,
- message
- } = holderRef.current;
- const noticePrefixCls = `${prefixCls}-notice`;
- const {
- content,
- icon,
- type,
- key,
- className,
- style,
- onClose
- } = config,
- restConfig = useMessage_rest(config, ["content", "icon", "type", "key", "className", "style", "onClose"]);
- let mergedKey = key;
- if (mergedKey === undefined || mergedKey === null) {
- keyIndex += 1;
- mergedKey = `antd-message-${keyIndex}`;
- }
- return wrapPromiseFn(resolve => {
- originOpen(Object.assign(Object.assign({}, restConfig), {
- key: mergedKey,
- content: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PureContent, {
- prefixCls: prefixCls,
- type: type,
- icon: icon
- }, content)),
- placement: 'top',
- className: classnames_default()(type && `${noticePrefixCls}-${type}`, className, message === null || message === void 0 ? void 0 : message.className),
- style: Object.assign(Object.assign({}, message === null || message === void 0 ? void 0 : message.style), style),
- onClose: () => {
- onClose === null || onClose === void 0 ? void 0 : onClose();
- resolve();
- }
- }));
- // Return close function
- return () => {
- close(mergedKey);
- };
- });
- };
- // >>> destroy
- const destroy = key => {
- var _a;
- if (key !== undefined) {
- close(key);
- } else {
- (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
- }
- };
- const clone = {
- open,
- destroy
- };
- const keys = ['info', 'success', 'warning', 'error', 'loading'];
- keys.forEach(type => {
- const typeOpen = (jointContent, duration, onClose) => {
- let config;
- if (jointContent && typeof jointContent === 'object' && 'content' in jointContent) {
- config = jointContent;
- } else {
- config = {
- content: jointContent
- };
- }
- // Params
- let mergedDuration;
- let mergedOnClose;
- if (typeof duration === 'function') {
- mergedOnClose = duration;
- } else {
- mergedDuration = duration;
- mergedOnClose = onClose;
- }
- const mergedConfig = Object.assign(Object.assign({
- onClose: mergedOnClose,
- duration: mergedDuration
- }, config), {
- type
- });
- return open(mergedConfig);
- };
- clone[type] = typeOpen;
- });
- return clone;
- }, []);
- // ============================== Return ===============================
- return [wrapAPI, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Holder, Object.assign({
- key: "message-holder"
- }, messageConfig, {
- ref: holderRef
- }))];
- }
- function useMessage(messageConfig) {
- return useInternalMessage(messageConfig);
- }
- ;// ./components/_util/hooks/usePatchElement.ts
- function usePatchElement() {
- const [elements, setElements] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const patchElement = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(element => {
- // append a new element to elements (and create a new ref)
- setElements(originElements => [].concat((0,toConsumableArray["default"])(originElements), [element]));
- // return a function that removes the new element out of elements (and create a new ref)
- // it works a little like useEffect
- return () => {
- setElements(originElements => originElements.filter(ele => ele !== element));
- };
- }, []);
- return [elements, patchElement];
- }
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/Context.js
- var Context = __webpack_require__("./node_modules/@ant-design/icons/es/components/Context.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMemo.js
- var useMemo = __webpack_require__("./node_modules/rc-util/es/hooks/useMemo.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/utils/set.js
- var set = __webpack_require__("./node_modules/rc-util/es/utils/set.js");
- ;// ./components/form/validateMessagesContext.tsx
- // ZombieJ: We export single file here since
- // ConfigProvider use this which will make loop deps
- // to import whole `rc-field-form`
- /* harmony default export */ var validateMessagesContext = (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(undefined));
- // EXTERNAL MODULE: ./components/locale/en_US.ts
- var en_US = __webpack_require__("./components/locale/en_US.ts");
- ;// ./components/modal/locale.ts
- let runtimeLocale = Object.assign({}, en_US["default"].Modal);
- let localeList = [];
- const generateLocale = () => localeList.reduce((merged, locale) => Object.assign(Object.assign({}, merged), locale), en_US["default"].Modal);
- function changeConfirmLocale(newLocale) {
- if (newLocale) {
- const cloneLocale = Object.assign({}, newLocale);
- localeList.push(cloneLocale);
- runtimeLocale = generateLocale();
- return () => {
- localeList = localeList.filter(locale => locale !== cloneLocale);
- runtimeLocale = generateLocale();
- };
- }
- runtimeLocale = Object.assign({}, en_US["default"].Modal);
- }
- function getConfirmLocale() {
- return runtimeLocale;
- }
- // EXTERNAL MODULE: ./components/locale/context.ts
- var locale_context = __webpack_require__("./components/locale/context.ts");
- ;// ./components/locale/index.tsx
- const ANT_MARK = 'internalMark';
- const LocaleProvider = props => {
- const {
- locale = {},
- children,
- _ANT_MARK__
- } = props;
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('LocaleProvider');
- true ? warning(_ANT_MARK__ === ANT_MARK, 'deprecated', '`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale') : 0;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const clearLocale = changeConfirmLocale(locale === null || locale === void 0 ? void 0 : locale.Modal);
- return clearLocale;
- }, [locale]);
- const getMemoizedContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, locale), {
- exist: true
- }), [locale]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(locale_context["default"].Provider, {
- value: getMemoizedContextValue
- }, children);
- };
- if (true) {
- LocaleProvider.displayName = 'LocaleProvider';
- }
- /* harmony default export */ var components_locale = (LocaleProvider);
- // EXTERNAL MODULE: ./components/theme/themes/default/theme.ts
- var default_theme = __webpack_require__("./components/theme/themes/default/theme.ts");
- // EXTERNAL MODULE: ./components/theme/context.ts
- var context = __webpack_require__("./components/theme/context.ts");
- // EXTERNAL MODULE: ./components/theme/themes/seed.ts
- var seed = __webpack_require__("./components/theme/themes/seed.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/colors/es/index.js + 2 modules
- var colors_es = __webpack_require__("./node_modules/@ant-design/colors/es/index.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var fast_color_es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
- var canUseDom = __webpack_require__("./node_modules/rc-util/es/Dom/canUseDom.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/dynamicCSS.js
- var dynamicCSS = __webpack_require__("./node_modules/rc-util/es/Dom/dynamicCSS.js");
- ;// ./components/config-provider/cssVariables.ts
- const dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`;
- function getStyle(globalPrefixCls, theme) {
- const variables = {};
- const formatColor = (color, updater) => {
- let clone = color.clone();
- clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;
- return clone.toRgbString();
- };
- const fillColor = (colorVal, type) => {
- const baseColor = new fast_color_es.FastColor(colorVal);
- const colorPalettes = (0,colors_es.generate)(baseColor.toRgbString());
- variables[`${type}-color`] = formatColor(baseColor);
- variables[`${type}-color-disabled`] = colorPalettes[1];
- variables[`${type}-color-hover`] = colorPalettes[4];
- variables[`${type}-color-active`] = colorPalettes[6];
- variables[`${type}-color-outline`] = baseColor.clone().setA(0.2).toRgbString();
- variables[`${type}-color-deprecated-bg`] = colorPalettes[0];
- variables[`${type}-color-deprecated-border`] = colorPalettes[2];
- };
- // ================ Primary Color ================
- if (theme.primaryColor) {
- fillColor(theme.primaryColor, 'primary');
- const primaryColor = new fast_color_es.FastColor(theme.primaryColor);
- const primaryColors = (0,colors_es.generate)(primaryColor.toRgbString());
- // Legacy - We should use semantic naming standard
- primaryColors.forEach((color, index) => {
- variables[`primary-${index + 1}`] = color;
- });
- // Deprecated
- variables['primary-color-deprecated-l-35'] = formatColor(primaryColor, c => c.lighten(35));
- variables['primary-color-deprecated-l-20'] = formatColor(primaryColor, c => c.lighten(20));
- variables['primary-color-deprecated-t-20'] = formatColor(primaryColor, c => c.tint(20));
- variables['primary-color-deprecated-t-50'] = formatColor(primaryColor, c => c.tint(50));
- variables['primary-color-deprecated-f-12'] = formatColor(primaryColor, c => c.setA(c.a * 0.12));
- const primaryActiveColor = new fast_color_es.FastColor(primaryColors[0]);
- variables['primary-color-active-deprecated-f-30'] = formatColor(primaryActiveColor, c => c.setA(c.a * 0.3));
- variables['primary-color-active-deprecated-d-02'] = formatColor(primaryActiveColor, c => c.darken(2));
- }
- // ================ Success Color ================
- if (theme.successColor) {
- fillColor(theme.successColor, 'success');
- }
- // ================ Warning Color ================
- if (theme.warningColor) {
- fillColor(theme.warningColor, 'warning');
- }
- // ================= Error Color =================
- if (theme.errorColor) {
- fillColor(theme.errorColor, 'error');
- }
- // ================= Info Color ==================
- if (theme.infoColor) {
- fillColor(theme.infoColor, 'info');
- }
- // Convert to css variables
- const cssList = Object.keys(variables).map(key => `--${globalPrefixCls}-${key}: ${variables[key]};`);
- return `
- :root {
- ${cssList.join('\n')}
- }
- `.trim();
- }
- function registerTheme(globalPrefixCls, theme) {
- const style = getStyle(globalPrefixCls, theme);
- if ((0,canUseDom["default"])()) {
- (0,dynamicCSS.updateCSS)(style, `${dynamicStyleMark}-dynamic-theme`);
- } else {
- true ? (0,_util_warning["default"])(false, 'ConfigProvider', 'SSR do not support dynamic theme with css variables.') : 0;
- }
- }
- ;// ./components/config-provider/DisabledContext.tsx
- const DisabledContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(false);
- const DisabledContextProvider = ({
- children,
- disabled
- }) => {
- const originDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(DisabledContext);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DisabledContext.Provider, {
- value: disabled !== null && disabled !== void 0 ? disabled : originDisabled
- }, children);
- };
- /* harmony default export */ var config_provider_DisabledContext = (DisabledContext);
- // EXTERNAL MODULE: ./components/config-provider/SizeContext.tsx
- var SizeContext = __webpack_require__("./components/config-provider/SizeContext.tsx");
- ;// ./components/config-provider/hooks/useConfig.ts
- function useConfig() {
- const componentDisabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_DisabledContext);
- const componentSize = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(SizeContext["default"]);
- return {
- componentDisabled,
- componentSize
- };
- }
- /* harmony default export */ var hooks_useConfig = (useConfig);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/isEqual.js
- var isEqual = __webpack_require__("./node_modules/rc-util/es/isEqual.js");
- ;// ./components/config-provider/hooks/useThemeKey.ts
- const fullClone = Object.assign({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
- const {
- useId
- } = fullClone;
- const useEmptyId = () => '';
- const useThemeKey = typeof useId === 'undefined' ? useEmptyId : useId;
- /* harmony default export */ var hooks_useThemeKey = (useThemeKey);
- ;// ./components/config-provider/hooks/useTheme.ts
- function useTheme(theme, parentTheme, config) {
- var _a, _b;
- const warning = (0,_util_warning.devUseWarning)('ConfigProvider');
- const themeConfig = theme || {};
- const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? Object.assign(Object.assign({}, context.defaultConfig), {
- hashed: (_a = parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.hashed) !== null && _a !== void 0 ? _a : context.defaultConfig.hashed,
- cssVar: parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.cssVar
- }) : parentTheme;
- const themeKey = hooks_useThemeKey();
- if (true) {
- const cssVarEnabled = themeConfig.cssVar || parentThemeConfig.cssVar;
- const validKey = !!(typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || themeKey);
- true ? warning(!cssVarEnabled || validKey, 'breaking', 'Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.') : 0;
- }
- return (0,useMemo["default"])(() => {
- var _a, _b;
- if (!theme) {
- return parentTheme;
- }
- // Override
- const mergedComponents = Object.assign({}, parentThemeConfig.components);
- Object.keys(theme.components || {}).forEach(componentName => {
- mergedComponents[componentName] = Object.assign(Object.assign({}, mergedComponents[componentName]), theme.components[componentName]);
- });
- const cssVarKey = `css-var-${themeKey.replace(/:/g, '')}`;
- const mergedCssVar = ((_a = themeConfig.cssVar) !== null && _a !== void 0 ? _a : parentThemeConfig.cssVar) && Object.assign(Object.assign(Object.assign({
- prefix: config === null || config === void 0 ? void 0 : config.prefixCls
- }, typeof parentThemeConfig.cssVar === 'object' ? parentThemeConfig.cssVar : {}), typeof themeConfig.cssVar === 'object' ? themeConfig.cssVar : {}), {
- key: typeof themeConfig.cssVar === 'object' && ((_b = themeConfig.cssVar) === null || _b === void 0 ? void 0 : _b.key) || cssVarKey
- });
- // Base token
- return Object.assign(Object.assign(Object.assign({}, parentThemeConfig), themeConfig), {
- token: Object.assign(Object.assign({}, parentThemeConfig.token), themeConfig.token),
- components: mergedComponents,
- cssVar: mergedCssVar
- });
- }, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {
- const nextTheme = next[index];
- return !(0,isEqual["default"])(prevTheme, nextTheme, true);
- }));
- }
- ;// ./components/config-provider/MotionWrapper.tsx
- const MotionCacheContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(true);
- if (true) {
- MotionCacheContext.displayName = 'MotionCacheContext';
- }
- function MotionWrapper(props) {
- const parentMotion = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MotionCacheContext);
- const {
- children
- } = props;
- const [, token] = (0,useToken["default"])();
- const {
- motion
- } = token;
- const needWrapMotionProviderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- needWrapMotionProviderRef.current || (needWrapMotionProviderRef.current = parentMotion !== motion);
- if (needWrapMotionProviderRef.current) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MotionCacheContext.Provider, {
- value: motion
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es.Provider, {
- motion: motion
- }, children));
- }
- return children;
- }
- ;// ./components/config-provider/PropWarning.tsx
- /**
- * Warning for ConfigProviderProps.
- * This will be empty function in production.
- */
- const PropWarning = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(({
- dropdownMatchSelectWidth
- }) => {
- const warning = (0,_util_warning.devUseWarning)('ConfigProvider');
- warning.deprecated(dropdownMatchSelectWidth === undefined, 'dropdownMatchSelectWidth', 'popupMatchSelectWidth');
- return null;
- });
- if (true) {
- PropWarning.displayName = 'PropWarning';
- }
- /* harmony default export */ var config_provider_PropWarning = ( true ? PropWarning : 0);
- // EXTERNAL MODULE: ./components/theme/util/useResetIconStyle.ts
- var useResetIconStyle = __webpack_require__("./components/theme/util/useResetIconStyle.ts");
- ;// ./components/config-provider/index.tsx
- var config_provider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- /**
- * Since too many feedback using static method like `Modal.confirm` not getting theme, we record the
- * theme register info here to help developer get warning info.
- */
- let existThemeConfig = false;
- const warnContext = true ? componentName => {
- true ? (0,_util_warning["default"])(!existThemeConfig, componentName, `Static function can not consume context like dynamic theme. Please use 'App' component instead.`) : 0;
- } : /* istanbul ignore next */
- 0;
- const configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale'];
- // These props is used by `useContext` directly in sub component
- const PASSED_PROPS = ['getTargetContainer', 'getPopupContainer', 'renderEmpty', 'input', 'pagination', 'form', 'select', 'button'];
- let globalPrefixCls;
- let globalIconPrefixCls;
- let globalTheme;
- let globalHolderRender;
- function getGlobalPrefixCls() {
- return globalPrefixCls || config_provider_context.defaultPrefixCls;
- }
- function getGlobalIconPrefixCls() {
- return globalIconPrefixCls || config_provider_context.defaultIconPrefixCls;
- }
- function isLegacyTheme(theme) {
- return Object.keys(theme).some(key => key.endsWith('Color'));
- }
- const setGlobalConfig = props => {
- const {
- prefixCls,
- iconPrefixCls,
- theme,
- holderRender
- } = props;
- if (prefixCls !== undefined) {
- globalPrefixCls = prefixCls;
- }
- if (iconPrefixCls !== undefined) {
- globalIconPrefixCls = iconPrefixCls;
- }
- if ('holderRender' in props) {
- globalHolderRender = holderRender;
- }
- if (theme) {
- if (isLegacyTheme(theme)) {
- true ? (0,_util_warning["default"])(false, 'ConfigProvider', '`config` of css variable theme is not work in v5. Please use new `theme` config instead.') : 0;
- registerTheme(getGlobalPrefixCls(), theme);
- } else {
- globalTheme = theme;
- }
- }
- };
- const globalConfig = () => ({
- getPrefixCls: (suffixCls, customizePrefixCls) => {
- if (customizePrefixCls) {
- return customizePrefixCls;
- }
- return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls();
- },
- getIconPrefixCls: getGlobalIconPrefixCls,
- getRootPrefixCls: () => {
- // If Global prefixCls provided, use this
- if (globalPrefixCls) {
- return globalPrefixCls;
- }
- // Fallback to default prefixCls
- return getGlobalPrefixCls();
- },
- getTheme: () => globalTheme,
- holderRender: globalHolderRender
- });
- const ProviderChildren = props => {
- const {
- children,
- csp: customCsp,
- autoInsertSpaceInButton,
- alert,
- anchor,
- form,
- locale,
- componentSize,
- direction,
- space,
- splitter,
- virtual,
- dropdownMatchSelectWidth,
- popupMatchSelectWidth,
- popupOverflow,
- legacyLocale,
- parentContext,
- iconPrefixCls: customIconPrefixCls,
- theme,
- componentDisabled,
- segmented,
- statistic,
- spin,
- calendar,
- carousel,
- cascader,
- collapse,
- typography,
- checkbox,
- descriptions,
- divider,
- drawer,
- skeleton,
- steps,
- image,
- layout,
- list,
- mentions,
- modal,
- progress,
- result,
- slider,
- breadcrumb,
- menu,
- pagination,
- input,
- textArea,
- empty,
- badge,
- radio,
- rate,
- switch: SWITCH,
- transfer,
- avatar,
- message,
- tag,
- table,
- card,
- tabs,
- timeline,
- timePicker,
- upload,
- notification,
- tree,
- colorPicker,
- datePicker,
- rangePicker,
- flex,
- wave,
- dropdown,
- warning: warningConfig,
- tour,
- tooltip,
- popover,
- popconfirm,
- floatButton,
- floatButtonGroup,
- variant,
- inputNumber,
- treeSelect
- } = props;
- // =================================== Context ===================================
- const getPrefixCls = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback((suffixCls, customizePrefixCls) => {
- const {
- prefixCls
- } = props;
- if (customizePrefixCls) {
- return customizePrefixCls;
- }
- const mergedPrefixCls = prefixCls || parentContext.getPrefixCls('');
- return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls;
- }, [parentContext.getPrefixCls, props.prefixCls]);
- const iconPrefixCls = customIconPrefixCls || parentContext.iconPrefixCls || config_provider_context.defaultIconPrefixCls;
- const csp = customCsp || parentContext.csp;
- (0,useResetIconStyle["default"])(iconPrefixCls, csp);
- const mergedTheme = useTheme(theme, parentContext.theme, {
- prefixCls: getPrefixCls('')
- });
- if (true) {
- existThemeConfig = existThemeConfig || !!mergedTheme;
- }
- const baseConfig = {
- csp,
- autoInsertSpaceInButton,
- alert,
- anchor,
- locale: locale || legacyLocale,
- direction,
- space,
- splitter,
- virtual,
- popupMatchSelectWidth: popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth,
- popupOverflow,
- getPrefixCls,
- iconPrefixCls,
- theme: mergedTheme,
- segmented,
- statistic,
- spin,
- calendar,
- carousel,
- cascader,
- collapse,
- typography,
- checkbox,
- descriptions,
- divider,
- drawer,
- skeleton,
- steps,
- image,
- input,
- textArea,
- layout,
- list,
- mentions,
- modal,
- progress,
- result,
- slider,
- breadcrumb,
- menu,
- pagination,
- empty,
- badge,
- radio,
- rate,
- switch: SWITCH,
- transfer,
- avatar,
- message,
- tag,
- table,
- card,
- tabs,
- timeline,
- timePicker,
- upload,
- notification,
- tree,
- colorPicker,
- datePicker,
- rangePicker,
- flex,
- wave,
- dropdown,
- warning: warningConfig,
- tour,
- tooltip,
- popover,
- popconfirm,
- floatButton,
- floatButtonGroup,
- variant,
- inputNumber,
- treeSelect
- };
- if (true) {
- const warningFn = (0,_util_warning.devUseWarning)('ConfigProvider');
- warningFn(!('autoInsertSpaceInButton' in props), 'deprecated', '`autoInsertSpaceInButton` is deprecated. Please use `{ button: { autoInsertSpace: boolean }}` instead.');
- }
- const config = Object.assign({}, parentContext);
- Object.keys(baseConfig).forEach(key => {
- if (baseConfig[key] !== undefined) {
- config[key] = baseConfig[key];
- }
- });
- // Pass the props used by `useContext` directly with child component.
- // These props should merged into `config`.
- PASSED_PROPS.forEach(propName => {
- const propValue = props[propName];
- if (propValue) {
- config[propName] = propValue;
- }
- });
- if (typeof autoInsertSpaceInButton !== 'undefined') {
- // merge deprecated api
- config.button = Object.assign({
- autoInsertSpace: autoInsertSpaceInButton
- }, config.button);
- }
- // https://github.com/ant-design/ant-design/issues/27617
- const memoedConfig = (0,useMemo["default"])(() => config, config, (prevConfig, currentConfig) => {
- const prevKeys = Object.keys(prevConfig);
- const currentKeys = Object.keys(currentConfig);
- return prevKeys.length !== currentKeys.length || prevKeys.some(key => prevConfig[key] !== currentConfig[key]);
- });
- const {
- layer
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(cssinjs.StyleContext);
- const memoIconContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- prefixCls: iconPrefixCls,
- csp,
- layer: layer ? 'antd' : undefined
- }), [iconPrefixCls, csp, layer]);
- let childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider_PropWarning, {
- dropdownMatchSelectWidth: dropdownMatchSelectWidth
- }), children);
- const validateMessages = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b, _c, _d;
- return (0,set.merge)(((_a = en_US["default"].Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || {}, ((_c = (_b = memoedConfig.locale) === null || _b === void 0 ? void 0 : _b.Form) === null || _c === void 0 ? void 0 : _c.defaultValidateMessages) || {}, ((_d = memoedConfig.form) === null || _d === void 0 ? void 0 : _d.validateMessages) || {}, (form === null || form === void 0 ? void 0 : form.validateMessages) || {});
- }, [memoedConfig, form === null || form === void 0 ? void 0 : form.validateMessages]);
- if (Object.keys(validateMessages).length > 0) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(validateMessagesContext.Provider, {
- value: validateMessages
- }, childNode);
- }
- if (locale) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_locale, {
- locale: locale,
- _ANT_MARK__: ANT_MARK
- }, childNode);
- }
- if (iconPrefixCls || csp) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Context["default"].Provider, {
- value: memoIconContextValue
- }, childNode);
- }
- if (componentSize) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SizeContext.SizeContextProvider, {
- size: componentSize
- }, childNode);
- }
- // =================================== Motion ===================================
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MotionWrapper, null, childNode);
- // ================================ Dynamic theme ================================
- const memoTheme = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const _a = mergedTheme || {},
- {
- algorithm,
- token,
- components,
- cssVar
- } = _a,
- rest = config_provider_rest(_a, ["algorithm", "token", "components", "cssVar"]);
- const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? (0,cssinjs.createTheme)(algorithm) : default_theme["default"];
- const parsedComponents = {};
- Object.entries(components || {}).forEach(([componentName, componentToken]) => {
- const parsedToken = Object.assign({}, componentToken);
- if ('algorithm' in parsedToken) {
- if (parsedToken.algorithm === true) {
- parsedToken.theme = themeObj;
- } else if (Array.isArray(parsedToken.algorithm) || typeof parsedToken.algorithm === 'function') {
- parsedToken.theme = (0,cssinjs.createTheme)(parsedToken.algorithm);
- }
- delete parsedToken.algorithm;
- }
- parsedComponents[componentName] = parsedToken;
- });
- const mergedToken = Object.assign(Object.assign({}, seed["default"]), token);
- return Object.assign(Object.assign({}, rest), {
- theme: themeObj,
- token: mergedToken,
- components: parsedComponents,
- override: Object.assign({
- override: mergedToken
- }, parsedComponents),
- cssVar: cssVar
- });
- }, [mergedTheme]);
- if (theme) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context.DesignTokenContext.Provider, {
- value: memoTheme
- }, childNode);
- }
- // ================================== Warning ===================================
- if (memoedConfig.warning) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_warning.WarningContext.Provider, {
- value: memoedConfig.warning
- }, childNode);
- }
- // =================================== Render ===================================
- if (componentDisabled !== undefined) {
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DisabledContextProvider, {
- disabled: componentDisabled
- }, childNode);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider_context.ConfigContext.Provider, {
- value: memoedConfig
- }, childNode);
- };
- const ConfigProvider = props => {
- const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const antLocale = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(locale_context["default"]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ProviderChildren, Object.assign({
- parentContext: context,
- legacyLocale: antLocale
- }, props));
- };
- ConfigProvider.ConfigContext = config_provider_context.ConfigContext;
- ConfigProvider.SizeContext = SizeContext["default"];
- ConfigProvider.config = setGlobalConfig;
- ConfigProvider.useConfig = hooks_useConfig;
- Object.defineProperty(ConfigProvider, 'SizeContext', {
- get: () => {
- true ? (0,_util_warning["default"])(false, 'ConfigProvider', 'ConfigProvider.SizeContext is deprecated. Please use `ConfigProvider.useConfig().componentSize` instead.') : 0;
- return SizeContext["default"];
- }
- });
- if (true) {
- ConfigProvider.displayName = 'ConfigProvider';
- }
- /* harmony default export */ var config_provider = (ConfigProvider);
- ;// ./node_modules/@babel/runtime/helpers/esm/OverloadYield.js
- function _OverloadYield(e, d) {
- this.v = e, this.k = d;
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorDefine.js
- function _regeneratorDefine(e, r, n, t) {
- var i = Object.defineProperty;
- try {
- i({}, "", {});
- } catch (e) {
- i = 0;
- }
- _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
- function o(r, n) {
- _regeneratorDefine(e, r, function (e) {
- return this._invoke(r, n, e);
- });
- }
- r ? i ? i(e, r, {
- value: n,
- enumerable: !t,
- configurable: !t,
- writable: !t
- }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
- }, _regeneratorDefine(e, r, n, t);
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regenerator.js
- function _regenerator() {
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
- var e,
- t,
- r = "function" == typeof Symbol ? Symbol : {},
- n = r.iterator || "@@iterator",
- o = r.toStringTag || "@@toStringTag";
- function i(r, n, o, i) {
- var c = n && n.prototype instanceof Generator ? n : Generator,
- u = Object.create(c.prototype);
- return _regeneratorDefine(u, "_invoke", function (r, n, o) {
- var i,
- c,
- u,
- f = 0,
- p = o || [],
- y = !1,
- G = {
- p: 0,
- n: 0,
- v: e,
- a: d,
- f: d.bind(e, 4),
- d: function d(t, r) {
- return i = t, c = 0, u = e, G.n = r, a;
- }
- };
- function d(r, n) {
- for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
- var o,
- i = p[t],
- d = G.p,
- l = i[2];
- r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
- }
- if (o || r > 1) return a;
- throw y = !0, n;
- }
- return function (o, p, l) {
- if (f > 1) throw TypeError("Generator is already running");
- for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
- i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
- try {
- if (f = 2, i) {
- if (c || (o = "next"), t = i[o]) {
- if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
- if (!t.done) return t;
- u = t.value, c < 2 && (c = 0);
- } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
- i = e;
- } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
- } catch (t) {
- i = e, c = 1, u = t;
- } finally {
- f = 1;
- }
- }
- return {
- value: t,
- done: y
- };
- };
- }(r, o, i), !0), u;
- }
- var a = {};
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
- t = Object.getPrototypeOf;
- var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
- return this;
- }), t),
- u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
- function f(e) {
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
- }
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
- return this;
- }), _regeneratorDefine(u, "toString", function () {
- return "[object Generator]";
- }), (_regenerator = function _regenerator() {
- return {
- w: i,
- m: f
- };
- })();
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorAsyncIterator.js
- function AsyncIterator(t, e) {
- function n(r, o, i, f) {
- try {
- var c = t[r](o),
- u = c.value;
- return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
- n("next", t, i, f);
- }, function (t) {
- n("throw", t, i, f);
- }) : e.resolve(u).then(function (t) {
- c.value = t, i(c);
- }, function (t) {
- return n("throw", t, i, f);
- });
- } catch (t) {
- f(t);
- }
- }
- var r;
- this.next || (_regeneratorDefine(AsyncIterator.prototype), _regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
- return this;
- })), _regeneratorDefine(this, "_invoke", function (t, o, i) {
- function f() {
- return new e(function (e, r) {
- n(t, i, e, r);
- });
- }
- return r = r ? r.then(f, f) : f();
- }, !0);
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorAsyncGen.js
- function _regeneratorAsyncGen(r, e, t, o, n) {
- return new AsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorAsync.js
- function _regeneratorAsync(n, e, r, t, o) {
- var a = _regeneratorAsyncGen(n, e, r, t, o);
- return a.next().then(function (n) {
- return n.done ? n.value : a.next();
- });
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorKeys.js
- function _regeneratorKeys(e) {
- var n = Object(e),
- r = [];
- for (var t in n) r.unshift(t);
- return function e() {
- for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
- return e.done = !0, e;
- };
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorValues.js
- function _regeneratorValues(e) {
- if (null != e) {
- var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
- r = 0;
- if (t) return t.call(e);
- if ("function" == typeof e.next) return e;
- if (!isNaN(e.length)) return {
- next: function next() {
- return e && r >= e.length && (e = void 0), {
- value: e && e[r++],
- done: !e
- };
- }
- };
- }
- throw new TypeError((0,esm_typeof["default"])(e) + " is not iterable");
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js
- function _regeneratorRuntime() {
- "use strict";
- var r = _regenerator(),
- e = r.m(_regeneratorRuntime),
- t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
- function n(r) {
- var e = "function" == typeof r && r.constructor;
- return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
- }
- var o = {
- "throw": 1,
- "return": 2,
- "break": 3,
- "continue": 3
- };
- function a(r) {
- var e, t;
- return function (n) {
- e || (e = {
- stop: function stop() {
- return t(n.a, 2);
- },
- "catch": function _catch() {
- return n.v;
- },
- abrupt: function abrupt(r, e) {
- return t(n.a, o[r], e);
- },
- delegateYield: function delegateYield(r, o, a) {
- return e.resultName = o, t(n.d, _regeneratorValues(r), a);
- },
- finish: function finish(r) {
- return t(n.f, r);
- }
- }, t = function t(r, _t, o) {
- n.p = e.prev, n.n = e.next;
- try {
- return r(_t, o);
- } finally {
- e.next = n.n;
- }
- }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
- try {
- return r.call(this, e);
- } finally {
- n.p = e.prev, n.n = e.next;
- }
- };
- }
- return (_regeneratorRuntime = function _regeneratorRuntime() {
- return {
- wrap: function wrap(e, t, n, o) {
- return r.w(a(e), t, n, o && o.reverse());
- },
- isGeneratorFunction: n,
- mark: r.m,
- awrap: function awrap(r, e) {
- return new _OverloadYield(r, e);
- },
- AsyncIterator: AsyncIterator,
- async: function async(r, e, t, o, u) {
- return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
- },
- keys: _regeneratorKeys,
- values: _regeneratorValues
- };
- })();
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
- try {
- var i = n[a](c),
- u = i.value;
- } catch (n) {
- return void e(n);
- }
- i.done ? t(u) : Promise.resolve(u).then(r, o);
- }
- function _asyncToGenerator(n) {
- return function () {
- var t = this,
- e = arguments;
- return new Promise(function (r, o) {
- var a = n.apply(t, e);
- function _next(n) {
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
- }
- function _throw(n) {
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
- }
- _next(void 0);
- });
- };
- }
- ;// ./node_modules/rc-util/es/React/render.js
- // Let compiler not to search module usage
- var render_fullClone = (0,objectSpread2["default"])({}, external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_);
- var version = render_fullClone.version,
- reactRender = render_fullClone.render,
- unmountComponentAtNode = render_fullClone.unmountComponentAtNode;
- var createRoot;
- try {
- var mainVersion = Number((version || '').split('.')[0]);
- if (mainVersion >= 18) {
- createRoot = render_fullClone.createRoot;
- }
- } catch (e) {
- // Do nothing;
- }
- function toggleWarning(skip) {
- var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = render_fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
- if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && (0,esm_typeof["default"])(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === 'object') {
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
- }
- }
- var MARK = '__rc_react_root__';
- // ========================== Render ==========================
- function modernRender(node, container) {
- toggleWarning(true);
- var root = container[MARK] || createRoot(container);
- toggleWarning(false);
- root.render(node);
- container[MARK] = root;
- }
- function legacyRender(node, container) {
- reactRender === null || reactRender === void 0 || reactRender(node, container);
- }
- /** @private Test usage. Not work in prod */
- function _r(node, container) {
- if (true) {
- return legacyRender(node, container);
- }
- }
- function render(node, container) {
- if (createRoot) {
- modernRender(node, container);
- return;
- }
- legacyRender(node, container);
- }
- // ========================= Unmount ==========================
- function modernUnmount(_x) {
- return _modernUnmount.apply(this, arguments);
- }
- function _modernUnmount() {
- _modernUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(container) {
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- return _context.abrupt("return", Promise.resolve().then(function () {
- var _container$MARK;
- (_container$MARK = container[MARK]) === null || _container$MARK === void 0 || _container$MARK.unmount();
- delete container[MARK];
- }));
- case 1:
- case "end":
- return _context.stop();
- }
- }, _callee);
- }));
- return _modernUnmount.apply(this, arguments);
- }
- function legacyUnmount(container) {
- unmountComponentAtNode(container);
- }
- /** @private Test usage. Not work in prod */
- function _u(container) {
- if (true) {
- return legacyUnmount(container);
- }
- }
- function unmount(_x2) {
- return _unmount.apply(this, arguments);
- }
- function _unmount() {
- _unmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(container) {
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- if (!(createRoot !== undefined)) {
- _context2.next = 2;
- break;
- }
- return _context2.abrupt("return", modernUnmount(container));
- case 2:
- legacyUnmount(container);
- case 3:
- case "end":
- return _context2.stop();
- }
- }, _callee2);
- }));
- return _unmount.apply(this, arguments);
- }
- ;// ./components/config-provider/UnstableContext.tsx
- const defaultReactRender = (node, container) => {
- // TODO: Remove in v6
- // Warning for React 19
- if (true) {
- const majorVersion = parseInt(external_root_React_commonjs2_react_commonjs_react_amd_react_.version.split('.')[0], 10);
- const fullKeys = Object.keys(external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_);
- true ? (0,_util_warning["default"])(majorVersion < 19 || fullKeys.includes('createRoot'), 'compatible', 'antd v5 support React is 16 ~ 18. see https://u.ant.design/v5-for-19 for compatible.') : 0;
- }
- render(node, container);
- return () => {
- return unmount(container);
- };
- };
- let unstableRender = defaultReactRender;
- /**
- * @deprecated Set React render function for compatible usage.
- * This is internal usage only compatible with React 19.
- * And will be removed in next major version.
- */
- function unstableSetRender(render) {
- if (render) {
- unstableRender = render;
- }
- return unstableRender;
- }
- // EXTERNAL MODULE: ./components/_util/hooks/useZIndex.ts
- var useZIndex = __webpack_require__("./components/_util/hooks/useZIndex.ts");
- // EXTERNAL MODULE: ./components/_util/motion.ts
- var _util_motion = __webpack_require__("./components/_util/motion.ts");
- // EXTERNAL MODULE: ./components/locale/useLocale.ts
- var useLocale = __webpack_require__("./components/locale/useLocale.ts");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useState.js
- var useState = __webpack_require__("./node_modules/rc-util/es/hooks/useState.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/omit.js
- var omit = __webpack_require__("./node_modules/rc-util/es/omit.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useLayoutEffect.js
- var useLayoutEffect = __webpack_require__("./node_modules/rc-util/es/hooks/useLayoutEffect.js");
- ;// ./node_modules/rc-util/es/Dom/isVisible.js
- /* harmony default export */ var isVisible = (function (element) {
- if (!element) {
- return false;
- }
- if (element instanceof Element) {
- if (element.offsetParent) {
- return true;
- }
- if (element.getBBox) {
- var _getBBox = element.getBBox(),
- width = _getBBox.width,
- height = _getBBox.height;
- if (width || height) {
- return true;
- }
- }
- if (element.getBoundingClientRect) {
- var _element$getBoundingC = element.getBoundingClientRect(),
- _width = _element$getBoundingC.width,
- _height = _element$getBoundingC.height;
- if (_width || _height) {
- return true;
- }
- }
- }
- return false;
- });
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- ;// ./components/_util/wave/style.ts
- const genWaveStyle = token => {
- const {
- componentCls,
- colorPrimary
- } = token;
- return {
- [componentCls]: {
- position: 'absolute',
- background: 'transparent',
- pointerEvents: 'none',
- boxSizing: 'border-box',
- color: `var(--wave-color, ${colorPrimary})`,
- boxShadow: `0 0 0 0 currentcolor`,
- opacity: 0.2,
- // =================== Motion ===================
- '&.wave-motion-appear': {
- transition: [`box-shadow 0.4s ${token.motionEaseOutCirc}`, `opacity 2s ${token.motionEaseOutCirc}`].join(','),
- '&-active': {
- boxShadow: `0 0 0 6px currentcolor`,
- opacity: 0
- },
- '&.wave-quick': {
- transition: [`box-shadow ${token.motionDurationSlow} ${token.motionEaseInOut}`, `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`].join(',')
- }
- }
- }
- };
- };
- /* harmony default export */ var wave_style = ((0,genStyleUtils.genComponentStyleHook)('Wave', genWaveStyle));
- ;// ./components/_util/wave/interface.ts
- const TARGET_CLS = `${config_provider_context.defaultPrefixCls}-wave-target`;
- ;// ./components/_util/wave/util.ts
- function isValidWaveColor(color) {
- return color && color !== '#fff' && color !== '#ffffff' && color !== 'rgb(255, 255, 255)' && color !== 'rgba(255, 255, 255, 1)' && !/rgba\((?:\d*, ){3}0\)/.test(color) &&
- // any transparent rgba color
- color !== 'transparent' && color !== 'canvastext';
- }
- function getTargetWaveColor(node) {
- var _a;
- const {
- borderTopColor,
- borderColor,
- backgroundColor
- } = getComputedStyle(node);
- return (_a = [borderTopColor, borderColor, backgroundColor].find(isValidWaveColor)) !== null && _a !== void 0 ? _a : null;
- }
- ;// ./components/_util/wave/WaveEffect.tsx
- function validateNum(value) {
- return Number.isNaN(value) ? 0 : value;
- }
- const WaveEffect = props => {
- const {
- className,
- target,
- component,
- registerUnmount
- } = props;
- const divRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ====================== Refs ======================
- const unmountRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- unmountRef.current = registerUnmount();
- }, []);
- // ===================== Effect =====================
- const [color, setWaveColor] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- const [borderRadius, setBorderRadius] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const [left, setLeft] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [top, setTop] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [width, setWidth] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [height, setHeight] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [enabled, setEnabled] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const waveStyle = {
- left,
- top,
- width,
- height,
- borderRadius: borderRadius.map(radius => `${radius}px`).join(' ')
- };
- if (color) {
- waveStyle['--wave-color'] = color;
- }
- function syncPos() {
- const nodeStyle = getComputedStyle(target);
- // Get wave color from target
- setWaveColor(getTargetWaveColor(target));
- const isStatic = nodeStyle.position === 'static';
- // Rect
- const {
- borderLeftWidth,
- borderTopWidth
- } = nodeStyle;
- setLeft(isStatic ? target.offsetLeft : validateNum(-parseFloat(borderLeftWidth)));
- setTop(isStatic ? target.offsetTop : validateNum(-parseFloat(borderTopWidth)));
- setWidth(target.offsetWidth);
- setHeight(target.offsetHeight);
- // Get border radius
- const {
- borderTopLeftRadius,
- borderTopRightRadius,
- borderBottomLeftRadius,
- borderBottomRightRadius
- } = nodeStyle;
- setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map(radius => validateNum(parseFloat(radius))));
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (target) {
- // We need delay to check position here
- // since UI may change after click
- const id = (0,raf["default"])(() => {
- syncPos();
- setEnabled(true);
- });
- // Add resize observer to follow size
- let resizeObserver;
- if (typeof ResizeObserver !== 'undefined') {
- resizeObserver = new ResizeObserver(syncPos);
- resizeObserver.observe(target);
- }
- return () => {
- raf["default"].cancel(id);
- resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();
- };
- }
- }, []);
- if (!enabled) {
- return null;
- }
- const isSmallComponent = (component === 'Checkbox' || component === 'Radio') && (target === null || target === void 0 ? void 0 : target.classList.contains(TARGET_CLS));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: true,
- motionAppear: true,
- motionName: "wave-motion",
- motionDeadline: 5000,
- onAppearEnd: (_, event) => {
- var _a, _b;
- if (event.deadline || event.propertyName === 'opacity') {
- const holder = (_a = divRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
- (_b = unmountRef.current) === null || _b === void 0 ? void 0 : _b.call(unmountRef).then(() => {
- holder === null || holder === void 0 ? void 0 : holder.remove();
- });
- }
- return false;
- }
- }, ({
- className: motionClassName
- }, ref) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: (0,es_ref.composeRef)(divRef, ref),
- className: classnames_default()(className, motionClassName, {
- 'wave-quick': isSmallComponent
- }),
- style: waveStyle
- })));
- };
- const showWaveEffect = (target, info) => {
- var _a;
- const {
- component
- } = info;
- // Skip for unchecked checkbox
- if (component === 'Checkbox' && !((_a = target.querySelector('input')) === null || _a === void 0 ? void 0 : _a.checked)) {
- return;
- }
- // Create holder
- const holder = document.createElement('div');
- holder.style.position = 'absolute';
- holder.style.left = '0px';
- holder.style.top = '0px';
- target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
- const reactRender = unstableSetRender();
- let unmountCallback = null;
- function registerUnmount() {
- return unmountCallback;
- }
- unmountCallback = reactRender(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(WaveEffect, Object.assign({}, info, {
- target: target,
- registerUnmount: registerUnmount
- })), holder);
- };
- /* harmony default export */ var wave_WaveEffect = (showWaveEffect);
- ;// ./components/_util/wave/useWave.ts
- const useWave = (nodeRef, className, component) => {
- const {
- wave
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [, token, hashId] = (0,useToken["default"])();
- const showWave = (0,useEvent["default"])(event => {
- const node = nodeRef.current;
- if ((wave === null || wave === void 0 ? void 0 : wave.disabled) || !node) {
- return;
- }
- const targetNode = node.querySelector(`.${TARGET_CLS}`) || node;
- const {
- showEffect
- } = wave || {};
- // Customize wave effect
- (showEffect || wave_WaveEffect)(targetNode, {
- className,
- token,
- component,
- event,
- hashId
- });
- });
- const rafId = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // Merge trigger event into one for each frame
- const showDebounceWave = event => {
- raf["default"].cancel(rafId.current);
- rafId.current = (0,raf["default"])(() => {
- showWave(event);
- });
- };
- return showDebounceWave;
- };
- /* harmony default export */ var wave_useWave = (useWave);
- ;// ./components/_util/wave/index.ts
- const Wave = props => {
- const {
- children,
- disabled,
- component
- } = props;
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // ============================== Style ===============================
- const prefixCls = getPrefixCls('wave');
- const [, hashId] = wave_style(prefixCls);
- // =============================== Wave ===============================
- const showWave = wave_useWave(containerRef, classnames_default()(prefixCls, hashId), component);
- // ============================== Effect ==============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- const node = containerRef.current;
- if (!node || node.nodeType !== window.Node.ELEMENT_NODE || disabled) {
- return;
- }
- // Click handler
- const onClick = e => {
- // Fix radio button click twice
- if (!isVisible(e.target) ||
- // No need wave
- !node.getAttribute || node.getAttribute('disabled') || node.disabled || node.className.includes('disabled') && !node.className.includes('disabled:') || node.getAttribute('aria-disabled') === 'true' || node.className.includes('-leave')) {
- return;
- }
- showWave(e);
- };
- // Bind events
- node.addEventListener('click', onClick, true);
- return () => {
- node.removeEventListener('click', onClick, true);
- };
- }, [disabled]);
- // ============================== Render ==============================
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children)) {
- return children !== null && children !== void 0 ? children : null;
- }
- const ref = (0,es_ref.supportRef)(children) ? (0,es_ref.composeRef)((0,es_ref.getNodeRef)(children), containerRef) : containerRef;
- return (0,reactNode.cloneElement)(children, {
- ref
- });
- };
- if (true) {
- Wave.displayName = 'Wave';
- }
- /* harmony default export */ var wave = (Wave);
- // EXTERNAL MODULE: ./components/config-provider/hooks/useSize.ts
- var useSize = __webpack_require__("./components/config-provider/hooks/useSize.ts");
- // EXTERNAL MODULE: ./components/space/style/index.ts + 1 modules
- var space_style = __webpack_require__("./components/space/style/index.ts");
- ;// ./components/space/Compact.tsx
- var Compact_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const SpaceCompactItemContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- const useCompactItemContext = (prefixCls, direction) => {
- const compactItemContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(SpaceCompactItemContext);
- const compactItemClassnames = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!compactItemContext) {
- return '';
- }
- const {
- compactDirection,
- isFirstItem,
- isLastItem
- } = compactItemContext;
- const separator = compactDirection === 'vertical' ? '-vertical-' : '-';
- return classnames_default()(`${prefixCls}-compact${separator}item`, {
- [`${prefixCls}-compact${separator}first-item`]: isFirstItem,
- [`${prefixCls}-compact${separator}last-item`]: isLastItem,
- [`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl'
- });
- }, [prefixCls, direction, compactItemContext]);
- return {
- compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,
- compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,
- compactItemClassnames
- };
- };
- const NoCompactStyle = props => {
- const {
- children
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SpaceCompactItemContext.Provider, {
- value: null
- }, children);
- };
- const CompactItem = props => {
- const {
- children
- } = props,
- others = Compact_rest(props, ["children"]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SpaceCompactItemContext.Provider, {
- value: external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => others, [others])
- }, children);
- };
- const Compact = props => {
- const {
- getPrefixCls,
- direction: directionConfig
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- size,
- direction,
- block,
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- children
- } = props,
- restProps = Compact_rest(props, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]);
- const mergedSize = (0,useSize["default"])(ctx => size !== null && size !== void 0 ? size : ctx);
- const prefixCls = getPrefixCls('space-compact', customizePrefixCls);
- const [wrapCSSVar, hashId] = (0,space_style["default"])(prefixCls);
- const clx = classnames_default()(prefixCls, hashId, {
- [`${prefixCls}-rtl`]: directionConfig === 'rtl',
- [`${prefixCls}-block`]: block,
- [`${prefixCls}-vertical`]: direction === 'vertical'
- }, className, rootClassName);
- const compactItemContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(SpaceCompactItemContext);
- const childNodes = (0,toArray["default"])(children);
- const nodes = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => childNodes.map((child, i) => {
- const key = (child === null || child === void 0 ? void 0 : child.key) || `${prefixCls}-item-${i}`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CompactItem, {
- key: key,
- compactSize: mergedSize,
- compactDirection: direction,
- isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),
- isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))
- }, child);
- }), [size, childNodes, compactItemContext]);
- // =========================== Render ===========================
- if (childNodes.length === 0) {
- return null;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- className: clx
- }, restProps), nodes));
- };
- /* harmony default export */ var space_Compact = (Compact);
- ;// ./components/button/button-group.tsx
- var button_group_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const GroupSizeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(undefined);
- const ButtonGroup = props => {
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- size,
- className
- } = props,
- others = button_group_rest(props, ["prefixCls", "size", "className"]);
- const prefixCls = getPrefixCls('btn-group', customizePrefixCls);
- const [,, hashId] = (0,useToken["default"])();
- const sizeCls = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- switch (size) {
- case 'large':
- return 'lg';
- case 'small':
- return 'sm';
- default:
- return '';
- }
- }, [size]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Button.Group');
- warning.deprecated(false, 'Button.Group', 'Space.Compact');
- true ? warning(!size || ['large', 'small', 'middle'].includes(size), 'usage', 'Invalid prop `size`.') : 0;
- }
- const classes = classnames_default()(prefixCls, {
- [`${prefixCls}-${sizeCls}`]: sizeCls,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, hashId);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(GroupSizeContext.Provider, {
- value: size
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, others, {
- className: classes
- })));
- };
- /* harmony default export */ var button_group = (ButtonGroup);
- // EXTERNAL MODULE: ./components/theme/interface/presetColors.ts
- var presetColors = __webpack_require__("./components/theme/interface/presetColors.ts");
- ;// ./components/button/buttonHelpers.tsx
- const rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
- const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
- function convertLegacyProps(type) {
- if (type === 'danger') {
- return {
- danger: true
- };
- }
- return {
- type
- };
- }
- function isString(str) {
- return typeof str === 'string';
- }
- function isUnBorderedButtonVariant(type) {
- return type === 'text' || type === 'link';
- }
- function splitCNCharsBySpace(child, needInserted) {
- if (child === null || child === undefined) {
- return;
- }
- const SPACE = needInserted ? ' ' : '';
- if (typeof child !== 'string' && typeof child !== 'number' && isString(child.type) && isTwoCNChar(child.props.children)) {
- return (0,reactNode.cloneElement)(child, {
- children: child.props.children.split('').join(SPACE)
- });
- }
- if (isString(child)) {
- return isTwoCNChar(child) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, child.split('').join(SPACE)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, child);
- }
- if ((0,reactNode.isFragment)(child)) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, child);
- }
- return child;
- }
- function spaceChildren(children, needInserted) {
- let isPrevChildPure = false;
- const childList = [];
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.forEach(children, child => {
- const type = typeof child;
- const isCurrentChildPure = type === 'string' || type === 'number';
- if (isPrevChildPure && isCurrentChildPure) {
- const lastIndex = childList.length - 1;
- const lastChild = childList[lastIndex];
- childList[lastIndex] = `${lastChild}${child}`;
- } else {
- childList.push(child);
- }
- isPrevChildPure = isCurrentChildPure;
- });
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.map(childList, child => splitCNCharsBySpace(child, needInserted));
- }
- const _ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'];
- const _ButtonShapes = ['default', 'circle', 'round'];
- const _ButtonHTMLTypes = ['submit', 'button', 'reset'];
- const _ButtonVariantTypes = ['outlined', 'dashed', 'solid', 'filled', 'text', 'link'];
- const _ButtonColorTypes = ['default', 'primary', 'danger'].concat((0,toConsumableArray["default"])(presetColors.PresetColors));
- ;// ./components/button/IconWrapper.tsx
- const IconWrapper = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const {
- className,
- style,
- children,
- prefixCls
- } = props;
- const iconWrapperCls = classnames_default()(`${prefixCls}-icon`, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- ref: ref,
- className: iconWrapperCls,
- style: style
- }, children);
- });
- /* harmony default export */ var button_IconWrapper = (IconWrapper);
- ;// ./components/button/DefaultLoadingIcon.tsx
- const InnerLoadingIcon = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const {
- prefixCls,
- className,
- style,
- iconClassName
- } = props;
- const mergedIconCls = classnames_default()(`${prefixCls}-loading-icon`, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(button_IconWrapper, {
- prefixCls: prefixCls,
- className: mergedIconCls,
- style: style,
- ref: ref
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_LoadingOutlined, {
- className: iconClassName
- }));
- });
- const getCollapsedWidth = () => ({
- width: 0,
- opacity: 0,
- transform: 'scale(0)'
- });
- const getRealWidth = node => ({
- width: node.scrollWidth,
- opacity: 1,
- transform: 'scale(1)'
- });
- const DefaultLoadingIcon = props => {
- const {
- prefixCls,
- loading,
- existIcon,
- className,
- style,
- mount
- } = props;
- const visible = !!loading;
- if (existIcon) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(InnerLoadingIcon, {
- prefixCls: prefixCls,
- className: className,
- style: style
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_motion_es["default"], {
- visible: visible,
- // Used for minus flex gap style only
- motionName: `${prefixCls}-loading-icon-motion`,
- motionAppear: !mount,
- motionEnter: !mount,
- motionLeave: !mount,
- removeOnLeave: true,
- onAppearStart: getCollapsedWidth,
- onAppearActive: getRealWidth,
- onEnterStart: getCollapsedWidth,
- onEnterActive: getRealWidth,
- onLeaveStart: getRealWidth,
- onLeaveActive: getCollapsedWidth
- }, ({
- className: motionCls,
- style: motionStyle
- }, ref) => {
- const mergedStyle = Object.assign(Object.assign({}, style), motionStyle);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(InnerLoadingIcon, {
- prefixCls: prefixCls,
- className: classnames_default()(className, motionCls),
- style: mergedStyle,
- ref: ref
- });
- });
- };
- /* harmony default export */ var button_DefaultLoadingIcon = (DefaultLoadingIcon);
- // EXTERNAL MODULE: ./components/button/style/index.ts + 1 modules
- var button_style = __webpack_require__("./components/button/style/index.ts");
- // EXTERNAL MODULE: ./components/style/compact-item.ts
- var compact_item = __webpack_require__("./components/style/compact-item.ts");
- ;// ./components/style/compact-item-vertical.ts
- function compactItemVerticalBorder(token, parentCls, prefixCls) {
- return {
- // border collapse
- [`&-item:not(${parentCls}-last-item)`]: {
- marginBottom: token.calc(token.lineWidth).mul(-1).equal()
- },
- [`&-item:not(${prefixCls}-status-success)`]: {
- zIndex: 2
- },
- '&-item': {
- '&:hover,&:focus,&:active': {
- zIndex: 3
- },
- '&[disabled]': {
- zIndex: 0
- }
- }
- };
- }
- function compactItemBorderVerticalRadius(prefixCls, parentCls) {
- return {
- [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
- borderRadius: 0
- },
- [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
- [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
- borderEndEndRadius: 0,
- borderEndStartRadius: 0
- }
- },
- [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
- [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
- borderStartStartRadius: 0,
- borderStartEndRadius: 0
- }
- }
- };
- }
- function genCompactItemVerticalStyle(token) {
- const compactCls = `${token.componentCls}-compact-vertical`;
- return {
- [compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls, token.componentCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
- };
- }
- // EXTERNAL MODULE: ./components/button/style/token.ts
- var style_token = __webpack_require__("./components/button/style/token.ts");
- ;// ./components/button/style/compact.ts
- const genButtonCompactStyle = token => {
- const {
- componentCls,
- colorPrimaryHover,
- lineWidth,
- calc
- } = token;
- const insetOffset = calc(lineWidth).mul(-1).equal();
- const getCompactBorderStyle = vertical => {
- const selector = `${componentCls}-compact${vertical ? '-vertical' : ''}-item${componentCls}-primary:not([disabled])`;
- return {
- [`${selector} + ${selector}::before`]: {
- position: 'absolute',
- top: vertical ? insetOffset : 0,
- insetInlineStart: vertical ? 0 : insetOffset,
- backgroundColor: colorPrimaryHover,
- content: '""',
- width: vertical ? '100%' : lineWidth,
- height: vertical ? lineWidth : '100%'
- }
- };
- };
- // Special styles for Primary Button
- return Object.assign(Object.assign({}, getCompactBorderStyle()), getCompactBorderStyle(true));
- };
- // ============================== Export ==============================
- /* harmony default export */ var compact = ((0,genStyleUtils.genSubStyleComponent)(['Button', 'compact'], token => {
- const buttonToken = (0,style_token.prepareToken)(token);
- return [
- // Space Compact
- (0,compact_item.genCompactItemStyle)(buttonToken), genCompactItemVerticalStyle(buttonToken), genButtonCompactStyle(buttonToken)];
- }, style_token.prepareComponentToken));
- ;// ./components/button/button.tsx
- var button_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getLoadingConfig(loading) {
- if (typeof loading === 'object' && loading) {
- let delay = loading === null || loading === void 0 ? void 0 : loading.delay;
- delay = !Number.isNaN(delay) && typeof delay === 'number' ? delay : 0;
- return {
- loading: delay <= 0,
- delay
- };
- }
- return {
- loading: !!loading,
- delay: 0
- };
- }
- const ButtonTypeMap = {
- default: ['default', 'outlined'],
- primary: ['primary', 'solid'],
- dashed: ['default', 'dashed'],
- // `link` is not a real color but we should compatible with it
- link: ['link', 'link'],
- text: ['default', 'text']
- };
- const InternalCompoundedButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- var _a, _b;
- const {
- loading = false,
- prefixCls: customizePrefixCls,
- color,
- variant,
- type,
- danger = false,
- shape: customizeShape,
- size: customizeSize,
- styles,
- disabled: customDisabled,
- className,
- rootClassName,
- children,
- icon,
- iconPosition = 'start',
- ghost = false,
- block = false,
- // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
- htmlType = 'button',
- classNames: customClassNames,
- style: customStyle = {},
- autoInsertSpace,
- autoFocus
- } = props,
- rest = button_rest(props, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]);
- // https://github.com/ant-design/ant-design/issues/47605
- // Compatible with original `type` behavior
- const mergedType = type || 'default';
- const {
- button
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_context.ConfigContext);
- const shape = customizeShape || (button === null || button === void 0 ? void 0 : button.shape) || 'default';
- const [mergedColor, mergedVariant] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- // >>>>> Local
- // Color & Variant
- if (color && variant) {
- return [color, variant];
- }
- // Sugar syntax
- if (type || danger) {
- const colorVariantPair = ButtonTypeMap[mergedType] || [];
- if (danger) {
- return ['danger', colorVariantPair[1]];
- }
- return colorVariantPair;
- }
- // >>> Context fallback
- if ((button === null || button === void 0 ? void 0 : button.color) && (button === null || button === void 0 ? void 0 : button.variant)) {
- return [button.color, button.variant];
- }
- return ['default', 'outlined'];
- }, [type, color, variant, danger, button === null || button === void 0 ? void 0 : button.variant, button === null || button === void 0 ? void 0 : button.color]);
- const isDanger = mergedColor === 'danger';
- const mergedColorText = isDanger ? 'dangerous' : mergedColor;
- const {
- getPrefixCls,
- direction,
- autoInsertSpace: contextAutoInsertSpace,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('button');
- const mergedInsertSpace = (_a = autoInsertSpace !== null && autoInsertSpace !== void 0 ? autoInsertSpace : contextAutoInsertSpace) !== null && _a !== void 0 ? _a : true;
- const prefixCls = getPrefixCls('btn', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,button_style["default"])(prefixCls);
- const disabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const groupSize = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(GroupSizeContext);
- const loadingOrDelay = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => getLoadingConfig(loading), [loading]);
- const [innerLoading, setLoading] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(loadingOrDelay.loading);
- const [hasTwoCNChar, setHasTwoCNChar] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
- const buttonRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- const mergedRef = (0,es_ref.useComposeRef)(ref, buttonRef);
- const needInserted = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.count(children) === 1 && !icon && !isUnBorderedButtonVariant(mergedVariant);
- // ========================= Mount ==========================
- // Record for mount status.
- // This will help to no to show the animation of loading on the first mount.
- const isMountRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(true);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- isMountRef.current = false;
- return () => {
- isMountRef.current = true;
- };
- }, []);
- // ========================= Effect =========================
- // Loading. Should use `useLayoutEffect` to avoid low perf multiple click issue.
- // https://github.com/ant-design/ant-design/issues/51325
- (0,useLayoutEffect["default"])(() => {
- let delayTimer = null;
- if (loadingOrDelay.delay > 0) {
- delayTimer = setTimeout(() => {
- delayTimer = null;
- setLoading(true);
- }, loadingOrDelay.delay);
- } else {
- setLoading(loadingOrDelay.loading);
- }
- function cleanupTimer() {
- if (delayTimer) {
- clearTimeout(delayTimer);
- delayTimer = null;
- }
- }
- return cleanupTimer;
- }, [loadingOrDelay.delay, loadingOrDelay.loading]);
- // Two chinese characters check
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- // FIXME: for HOC usage like <FormatMessage />
- if (!buttonRef.current || !mergedInsertSpace) {
- return;
- }
- const buttonText = buttonRef.current.textContent || '';
- if (needInserted && isTwoCNChar(buttonText)) {
- if (!hasTwoCNChar) {
- setHasTwoCNChar(true);
- }
- } else if (hasTwoCNChar) {
- setHasTwoCNChar(false);
- }
- });
- // Auto focus
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- if (autoFocus && buttonRef.current) {
- buttonRef.current.focus();
- }
- }, []);
- // ========================= Events =========================
- const handleClick = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useCallback(e => {
- var _a;
- // FIXME: https://github.com/ant-design/ant-design/issues/30207
- if (innerLoading || mergedDisabled) {
- e.preventDefault();
- return;
- }
- (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, 'href' in props ? e : e);
- }, [props.onClick, innerLoading, mergedDisabled]);
- // ========================== Warn ==========================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Button');
- true ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : 0;
- true ? warning(!(ghost && isUnBorderedButtonVariant(mergedVariant)), 'usage', "`link` or `text` button can't be a `ghost` button.") : 0;
- }
- // ========================== Size ==========================
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const sizeClassNameMap = {
- large: 'lg',
- small: 'sm',
- middle: undefined
- };
- const sizeFullName = (0,useSize["default"])(ctxSize => {
- var _a, _b;
- return (_b = (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : groupSize) !== null && _b !== void 0 ? _b : ctxSize;
- });
- const sizeCls = sizeFullName ? (_b = sizeClassNameMap[sizeFullName]) !== null && _b !== void 0 ? _b : '' : '';
- const iconType = innerLoading ? 'loading' : icon;
- const linkButtonRestProps = (0,omit["default"])(rest, ['navigate']);
- // ========================= Render =========================
- const classes = classnames_default()(prefixCls, hashId, cssVarCls, {
- [`${prefixCls}-${shape}`]: shape !== 'default' && shape,
- // Compatible with versions earlier than 5.21.0
- [`${prefixCls}-${mergedType}`]: mergedType,
- [`${prefixCls}-dangerous`]: danger,
- [`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
- [`${prefixCls}-variant-${mergedVariant}`]: mergedVariant,
- [`${prefixCls}-${sizeCls}`]: sizeCls,
- [`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
- [`${prefixCls}-background-ghost`]: ghost && !isUnBorderedButtonVariant(mergedVariant),
- [`${prefixCls}-loading`]: innerLoading,
- [`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && mergedInsertSpace && !innerLoading,
- [`${prefixCls}-block`]: block,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-icon-end`]: iconPosition === 'end'
- }, compactItemClassnames, className, rootClassName, contextClassName);
- const fullStyle = Object.assign(Object.assign({}, contextStyle), customStyle);
- const iconClasses = classnames_default()(customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.icon, contextClassNames.icon);
- const iconStyle = Object.assign(Object.assign({}, (styles === null || styles === void 0 ? void 0 : styles.icon) || {}), contextStyles.icon || {});
- const iconNode = icon && !innerLoading ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(button_IconWrapper, {
- prefixCls: prefixCls,
- className: iconClasses,
- style: iconStyle
- }, icon)) : loading && typeof loading === 'object' && loading.icon ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(button_IconWrapper, {
- prefixCls: prefixCls,
- className: iconClasses,
- style: iconStyle
- }, loading.icon)) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(button_DefaultLoadingIcon, {
- existIcon: !!icon,
- prefixCls: prefixCls,
- loading: innerLoading,
- mount: isMountRef.current
- }));
- const kids = children || children === 0 ? spaceChildren(children, needInserted && mergedInsertSpace) : null;
- if (linkButtonRestProps.href !== undefined) {
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", Object.assign({}, linkButtonRestProps, {
- className: classnames_default()(classes, {
- [`${prefixCls}-disabled`]: mergedDisabled
- }),
- href: mergedDisabled ? undefined : linkButtonRestProps.href,
- style: fullStyle,
- onClick: handleClick,
- ref: mergedRef,
- tabIndex: mergedDisabled ? -1 : 0,
- "aria-disabled": mergedDisabled
- }), iconNode, kids));
- }
- let buttonNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", Object.assign({}, rest, {
- type: htmlType,
- className: classes,
- style: fullStyle,
- onClick: handleClick,
- disabled: mergedDisabled,
- ref: mergedRef
- }), iconNode, kids, compactItemClassnames && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(compact, {
- prefixCls: prefixCls
- }));
- if (!isUnBorderedButtonVariant(mergedVariant)) {
- buttonNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(wave, {
- component: "Button",
- disabled: innerLoading
- }, buttonNode);
- }
- return wrapCSSVar(buttonNode);
- });
- const Button = InternalCompoundedButton;
- Button.Group = button_group;
- Button.__ANT_BUTTON = true;
- if (true) {
- Button.displayName = 'Button';
- }
- /* harmony default export */ var button_button = (Button);
- ;// ./components/button/index.tsx
- /* harmony default export */ var components_button = (button_button);
- ;// ./components/_util/ActionButton.tsx
- const isThenable = thing => {
- return typeof (thing === null || thing === void 0 ? void 0 : thing.then) === 'function';
- };
- const ActionButton = props => {
- const {
- type,
- children,
- prefixCls,
- buttonProps,
- close,
- autoFocus,
- emitEvent,
- isSilent,
- quitOnNullishReturnValue,
- actionFn
- } = props;
- const clickedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- const buttonRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [loading, setLoading] = (0,useState["default"])(false);
- const onInternalClose = (...args) => {
- close === null || close === void 0 ? void 0 : close.apply(void 0, args);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- let timeoutId = null;
- if (autoFocus) {
- timeoutId = setTimeout(() => {
- var _a;
- (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus({
- preventScroll: true
- });
- });
- }
- return () => {
- if (timeoutId) {
- clearTimeout(timeoutId);
- }
- };
- }, []);
- const handlePromiseOnOk = returnValueOfOnOk => {
- if (!isThenable(returnValueOfOnOk)) {
- return;
- }
- setLoading(true);
- returnValueOfOnOk.then((...args) => {
- setLoading(false, true);
- onInternalClose.apply(void 0, args);
- clickedRef.current = false;
- }, e => {
- // See: https://github.com/ant-design/ant-design/issues/6183
- setLoading(false, true);
- clickedRef.current = false;
- // Do not throw if is `await` mode
- if (isSilent === null || isSilent === void 0 ? void 0 : isSilent()) {
- return;
- }
- return Promise.reject(e);
- });
- };
- const onClick = e => {
- if (clickedRef.current) {
- return;
- }
- clickedRef.current = true;
- if (!actionFn) {
- onInternalClose();
- return;
- }
- let returnValueOfOnOk;
- if (emitEvent) {
- returnValueOfOnOk = actionFn(e);
- if (quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) {
- clickedRef.current = false;
- onInternalClose(e);
- return;
- }
- } else if (actionFn.length) {
- returnValueOfOnOk = actionFn(close);
- // https://github.com/ant-design/ant-design/issues/23358
- clickedRef.current = false;
- } else {
- returnValueOfOnOk = actionFn();
- if (!isThenable(returnValueOfOnOk)) {
- onInternalClose();
- return;
- }
- }
- handlePromiseOnOk(returnValueOfOnOk);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, Object.assign({}, convertLegacyProps(type), {
- onClick: onClick,
- loading: loading,
- prefixCls: prefixCls
- }, buttonProps, {
- ref: buttonRef
- }), children);
- };
- /* harmony default export */ var _util_ActionButton = (ActionButton);
- ;// ./components/modal/context.ts
- const ModalContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- const {
- Provider: ModalContextProvider
- } = ModalContext;
- ;// ./components/modal/components/ConfirmCancelBtn.tsx
- const ConfirmCancelBtn = () => {
- const {
- autoFocusButton,
- cancelButtonProps,
- cancelTextLocale,
- isSilent,
- mergedOkCancel,
- rootPrefixCls,
- close,
- onCancel,
- onConfirm
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ModalContext);
- return mergedOkCancel ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ActionButton, {
- isSilent: isSilent,
- actionFn: onCancel,
- close: (...args) => {
- close === null || close === void 0 ? void 0 : close.apply(void 0, args);
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(false);
- },
- autoFocus: autoFocusButton === 'cancel',
- buttonProps: cancelButtonProps,
- prefixCls: `${rootPrefixCls}-btn`
- }, cancelTextLocale)) : null;
- };
- /* harmony default export */ var components_ConfirmCancelBtn = (ConfirmCancelBtn);
- ;// ./components/modal/components/ConfirmOkBtn.tsx
- const ConfirmOkBtn = () => {
- const {
- autoFocusButton,
- close,
- isSilent,
- okButtonProps,
- rootPrefixCls,
- okTextLocale,
- okType,
- onConfirm,
- onOk
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ModalContext);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ActionButton, {
- isSilent: isSilent,
- type: okType || 'primary',
- actionFn: onOk,
- close: (...args) => {
- close === null || close === void 0 ? void 0 : close.apply(void 0, args);
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(true);
- },
- autoFocus: autoFocusButton === 'ok',
- buttonProps: okButtonProps,
- prefixCls: `${rootPrefixCls}-btn`
- }, okTextLocale);
- };
- /* harmony default export */ var components_ConfirmOkBtn = (ConfirmOkBtn);
- ;// ./node_modules/@rc-component/portal/es/Context.js
- var OrderContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_Context = (OrderContext);
- ;// ./node_modules/@rc-component/portal/es/useDom.js
- var EMPTY_LIST = [];
- /**
- * Will add `div` to document. Nest call will keep order
- * @param render Render DOM in document
- */
- function useDom(render, debug) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- if (!(0,canUseDom["default"])()) {
- return null;
- }
- var defaultEle = document.createElement('div');
- if ( true && debug) {
- defaultEle.setAttribute('data-debug', debug);
- }
- return defaultEle;
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 1),
- ele = _React$useState2[0];
- // ========================== Order ==========================
- var appendedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var queueCreate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_Context);
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(EMPTY_LIST),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- queue = _React$useState4[0],
- setQueue = _React$useState4[1];
- var mergedQueueCreate = queueCreate || (appendedRef.current ? undefined : function (appendFn) {
- setQueue(function (origin) {
- var newQueue = [appendFn].concat((0,toConsumableArray["default"])(origin));
- return newQueue;
- });
- });
- // =========================== DOM ===========================
- function append() {
- if (!ele.parentElement) {
- document.body.appendChild(ele);
- }
- appendedRef.current = true;
- }
- function cleanup() {
- var _ele$parentElement;
- (_ele$parentElement = ele.parentElement) === null || _ele$parentElement === void 0 ? void 0 : _ele$parentElement.removeChild(ele);
- appendedRef.current = false;
- }
- (0,useLayoutEffect["default"])(function () {
- if (render) {
- if (queueCreate) {
- queueCreate(append);
- } else {
- append();
- }
- } else {
- cleanup();
- }
- return cleanup;
- }, [render]);
- (0,useLayoutEffect["default"])(function () {
- if (queue.length) {
- queue.forEach(function (appendFn) {
- return appendFn();
- });
- setQueue(EMPTY_LIST);
- }
- }, [queue]);
- return [ele, mergedQueueCreate];
- }
- ;// ./node_modules/rc-util/es/getScrollBarSize.js
- /* eslint-disable no-param-reassign */
- var cached;
- function measureScrollbarSize(ele) {
- var randomId = "rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7));
- var measureEle = document.createElement('div');
- measureEle.id = randomId;
- // Create Style
- var measureStyle = measureEle.style;
- measureStyle.position = 'absolute';
- measureStyle.left = '0';
- measureStyle.top = '0';
- measureStyle.width = '100px';
- measureStyle.height = '100px';
- measureStyle.overflow = 'scroll';
- // Clone Style if needed
- var fallbackWidth;
- var fallbackHeight;
- if (ele) {
- var targetStyle = getComputedStyle(ele);
- measureStyle.scrollbarColor = targetStyle.scrollbarColor;
- measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
- // Set Webkit style
- var webkitScrollbarStyle = getComputedStyle(ele, '::-webkit-scrollbar');
- var width = parseInt(webkitScrollbarStyle.width, 10);
- var height = parseInt(webkitScrollbarStyle.height, 10);
- // Try wrap to handle CSP case
- try {
- var widthStyle = width ? "width: ".concat(webkitScrollbarStyle.width, ";") : '';
- var heightStyle = height ? "height: ".concat(webkitScrollbarStyle.height, ";") : '';
- (0,dynamicCSS.updateCSS)("\n#".concat(randomId, "::-webkit-scrollbar {\n").concat(widthStyle, "\n").concat(heightStyle, "\n}"), randomId);
- } catch (e) {
- // Can't wrap, just log error
- console.error(e);
- // Get from style directly
- fallbackWidth = width;
- fallbackHeight = height;
- }
- }
- document.body.appendChild(measureEle);
- // Measure. Get fallback style if provided
- var scrollWidth = ele && fallbackWidth && !isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
- var scrollHeight = ele && fallbackHeight && !isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
- // Clean up
- document.body.removeChild(measureEle);
- (0,dynamicCSS.removeCSS)(randomId);
- return {
- width: scrollWidth,
- height: scrollHeight
- };
- }
- function getScrollBarSize(fresh) {
- if (typeof document === 'undefined') {
- return 0;
- }
- if (fresh || cached === undefined) {
- cached = measureScrollbarSize();
- }
- return cached.width;
- }
- function getTargetScrollBarSize(target) {
- if (typeof document === 'undefined' || !target || !(target instanceof Element)) {
- return {
- width: 0,
- height: 0
- };
- }
- return measureScrollbarSize(target);
- }
- ;// ./node_modules/@rc-component/portal/es/util.js
- /**
- * Test usage export. Do not use in your production
- */
- function isBodyOverflowing() {
- return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
- }
- ;// ./node_modules/@rc-component/portal/es/useScrollLocker.js
- var UNIQUE_ID = "rc-util-locker-".concat(Date.now());
- var uuid = 0;
- function useScrollLocker(lock) {
- var mergedLock = !!lock;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- uuid += 1;
- return "".concat(UNIQUE_ID, "_").concat(uuid);
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 1),
- id = _React$useState2[0];
- (0,useLayoutEffect["default"])(function () {
- if (mergedLock) {
- var scrollbarSize = getTargetScrollBarSize(document.body).width;
- var isOverflow = isBodyOverflowing();
- (0,dynamicCSS.updateCSS)("\nhtml body {\n overflow-y: hidden;\n ".concat(isOverflow ? "width: calc(100% - ".concat(scrollbarSize, "px);") : '', "\n}"), id);
- } else {
- (0,dynamicCSS.removeCSS)(id);
- }
- return function () {
- (0,dynamicCSS.removeCSS)(id);
- };
- }, [mergedLock, id]);
- }
- ;// ./node_modules/@rc-component/portal/es/mock.js
- var inline = false;
- function inlineMock(nextInline) {
- if (typeof nextInline === 'boolean') {
- inline = nextInline;
- }
- return inline;
- }
- ;// ./node_modules/@rc-component/portal/es/Portal.js
- var getPortalContainer = function getPortalContainer(getContainer) {
- if (getContainer === false) {
- return false;
- }
- if (!(0,canUseDom["default"])() || !getContainer) {
- return null;
- }
- if (typeof getContainer === 'string') {
- return document.querySelector(getContainer);
- }
- if (typeof getContainer === 'function') {
- return getContainer();
- }
- return getContainer;
- };
- var Portal = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var open = props.open,
- autoLock = props.autoLock,
- getContainer = props.getContainer,
- debug = props.debug,
- _props$autoDestroy = props.autoDestroy,
- autoDestroy = _props$autoDestroy === void 0 ? true : _props$autoDestroy,
- children = props.children;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(open),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- shouldRender = _React$useState2[0],
- setShouldRender = _React$useState2[1];
- var mergedRender = shouldRender || open;
- // ========================= Warning =========================
- if (true) {
- (0,warning["default"])((0,canUseDom["default"])() || !open, "Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR.");
- }
- // ====================== Should Render ======================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (autoDestroy || open) {
- setShouldRender(open);
- }
- }, [open, autoDestroy]);
- // ======================== Container ========================
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- return getPortalContainer(getContainer);
- }),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- innerContainer = _React$useState4[0],
- setInnerContainer = _React$useState4[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var customizeContainer = getPortalContainer(getContainer);
- // Tell component that we check this in effect which is safe to be `null`
- setInnerContainer(customizeContainer !== null && customizeContainer !== void 0 ? customizeContainer : null);
- });
- var _useDom = useDom(mergedRender && !innerContainer, debug),
- _useDom2 = (0,slicedToArray["default"])(_useDom, 2),
- defaultContainer = _useDom2[0],
- queueCreate = _useDom2[1];
- var mergedContainer = innerContainer !== null && innerContainer !== void 0 ? innerContainer : defaultContainer;
- // ========================= Locker ==========================
- useScrollLocker(autoLock && open && (0,canUseDom["default"])() && (mergedContainer === defaultContainer || mergedContainer === document.body));
- // =========================== Ref ===========================
- var childRef = null;
- if (children && (0,es_ref.supportRef)(children) && ref) {
- var _ref = children;
- childRef = _ref.ref;
- }
- var mergedRef = (0,es_ref.useComposeRef)(childRef, ref);
- // ========================= Render ==========================
- // Do not render when nothing need render
- // When innerContainer is `undefined`, it may not ready since user use ref in the same render
- if (!mergedRender || !(0,canUseDom["default"])() || innerContainer === undefined) {
- return null;
- }
- // Render inline
- var renderInline = mergedContainer === false || inlineMock();
- var reffedChildren = children;
- if (ref) {
- reffedChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
- ref: mergedRef
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Context.Provider, {
- value: queueCreate
- }, renderInline ? reffedChildren : /*#__PURE__*/(0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.createPortal)(reffedChildren, mergedContainer));
- });
- if (true) {
- Portal.displayName = 'Portal';
- }
- /* harmony default export */ var es_Portal = (Portal);
- ;// ./node_modules/@rc-component/portal/es/index.js
- /* harmony default export */ var portal_es = (es_Portal);
- ;// ./node_modules/rc-dialog/es/context.js
- var RefContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/contains.js
- var contains = __webpack_require__("./node_modules/rc-util/es/Dom/contains.js");
- ;// ./node_modules/rc-util/es/hooks/useId.js
- function getUseId() {
- // We need fully clone React function here to avoid webpack warning React 17 do not export `useId`
- var fullClone = (0,objectSpread2["default"])({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
- return fullClone.useId;
- }
- var useId_uuid = 0;
- /** @private Note only worked in develop env. Not work in production. */
- function resetUuid() {
- if (true) {
- useId_uuid = 0;
- }
- }
- var useOriginId = getUseId();
- /* harmony default export */ var hooks_useId = (useOriginId ?
- // Use React `useId`
- function useId(id) {
- var reactId = useOriginId();
- // Developer passed id is single source of truth
- if (id) {
- return id;
- }
- // Test env always return mock id
- if (false) // removed by dead control flow
- {}
- return reactId;
- } :
- // Use compatible of `useId`
- function useCompatId(id) {
- // Inner id for accessibility usage. Only work in client side
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState('ssr-id'),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- innerId = _React$useState2[0],
- setInnerId = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var nextId = useId_uuid;
- useId_uuid += 1;
- setInnerId("rc_unique_".concat(nextId));
- }, []);
- // Developer passed id is single source of truth
- if (id) {
- return id;
- }
- // Test env always return mock id
- if (false) // removed by dead control flow
- {}
- // Return react native id or inner id
- return innerId;
- });
- ;// ./node_modules/rc-dialog/es/util.js
- // =============================== Motion ===============================
- function getMotionName(prefixCls, transitionName, animationName) {
- var motionName = transitionName;
- if (!motionName && animationName) {
- motionName = "".concat(prefixCls, "-").concat(animationName);
- }
- return motionName;
- }
- // =============================== Offset ===============================
- function util_getScroll(w, top) {
- var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
- var method = "scroll".concat(top ? 'Top' : 'Left');
- if (typeof ret !== 'number') {
- var d = w.document;
- ret = d.documentElement[method];
- if (typeof ret !== 'number') {
- ret = d.body[method];
- }
- }
- return ret;
- }
- function offset(el) {
- var rect = el.getBoundingClientRect();
- var pos = {
- left: rect.left,
- top: rect.top
- };
- var doc = el.ownerDocument;
- var w = doc.defaultView || doc.parentWindow;
- pos.left += util_getScroll(w);
- pos.top += util_getScroll(w, true);
- return pos;
- }
- ;// ./node_modules/rc-dialog/es/Dialog/Content/MemoChildren.js
- /* harmony default export */ var MemoChildren = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(function (_ref) {
- var children = _ref.children;
- return children;
- }, function (_, _ref2) {
- var shouldUpdate = _ref2.shouldUpdate;
- return !shouldUpdate;
- }));
- ;// ./node_modules/rc-dialog/es/Dialog/Content/Panel.js
- var sentinelStyle = {
- width: 0,
- height: 0,
- overflow: 'hidden',
- outline: 'none'
- };
- var entityStyle = {
- outline: 'none'
- };
- var Panel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- className = props.className,
- style = props.style,
- title = props.title,
- ariaId = props.ariaId,
- footer = props.footer,
- closable = props.closable,
- closeIcon = props.closeIcon,
- onClose = props.onClose,
- children = props.children,
- bodyStyle = props.bodyStyle,
- bodyProps = props.bodyProps,
- modalRender = props.modalRender,
- onMouseDown = props.onMouseDown,
- onMouseUp = props.onMouseUp,
- holderRef = props.holderRef,
- visible = props.visible,
- forceRender = props.forceRender,
- width = props.width,
- height = props.height,
- modalClassNames = props.classNames,
- modalStyles = props.styles;
- // ================================= Refs =================================
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(RefContext),
- panelRef = _React$useContext.panel;
- var mergedRef = (0,es_ref.useComposeRef)(holderRef, panelRef);
- var sentinelStartRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var sentinelEndRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, function () {
- return {
- focus: function focus() {
- var _sentinelStartRef$cur;
- (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
- preventScroll: true
- });
- },
- changeActive: function changeActive(next) {
- var _document = document,
- activeElement = _document.activeElement;
- if (next && activeElement === sentinelEndRef.current) {
- sentinelStartRef.current.focus({
- preventScroll: true
- });
- } else if (!next && activeElement === sentinelStartRef.current) {
- sentinelEndRef.current.focus({
- preventScroll: true
- });
- }
- }
- };
- });
- // ================================ Style =================================
- var contentStyle = {};
- if (width !== undefined) {
- contentStyle.width = width;
- }
- if (height !== undefined) {
- contentStyle.height = height;
- }
- // ================================ Render ================================
- var footerNode = footer ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-footer"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.footer),
- style: (0,objectSpread2["default"])({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.footer)
- }, footer) : null;
- var headerNode = title ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-header"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.header),
- style: (0,objectSpread2["default"])({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-title"),
- id: ariaId
- }, title)) : null;
- var closableObj = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if ((0,esm_typeof["default"])(closable) === 'object' && closable !== null) {
- return closable;
- }
- if (closable) {
- return {
- closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: "".concat(prefixCls, "-close-x")
- })
- };
- }
- return {};
- }, [closable, closeIcon, prefixCls]);
- var ariaProps = (0,pickAttrs["default"])(closableObj, true);
- var closeBtnIsDisabled = (0,esm_typeof["default"])(closable) === 'object' && closable.disabled;
- var closerNode = closable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", (0,esm_extends["default"])({
- type: "button",
- onClick: onClose,
- "aria-label": "Close"
- }, ariaProps, {
- className: "".concat(prefixCls, "-close"),
- disabled: closeBtnIsDisabled
- }), closableObj.closeIcon) : null;
- var content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.content),
- style: modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.content
- }, closerNode, headerNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-body"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.body),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, bodyStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
- }, bodyProps), children), footerNode);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- key: "dialog-element",
- role: "dialog",
- "aria-labelledby": title ? ariaId : null,
- "aria-modal": "true",
- ref: mergedRef,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), contentStyle),
- className: classnames_default()(prefixCls, className),
- onMouseDown: onMouseDown,
- onMouseUp: onMouseUp
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: sentinelStartRef,
- tabIndex: 0,
- style: entityStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(MemoChildren, {
- shouldUpdate: visible || forceRender
- }, modalRender ? modalRender(content) : content)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- tabIndex: 0,
- ref: sentinelEndRef,
- style: sentinelStyle
- }));
- });
- if (true) {
- Panel.displayName = 'Panel';
- }
- /* harmony default export */ var Content_Panel = (Panel);
- ;// ./node_modules/rc-dialog/es/Dialog/Content/index.js
- var Content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- title = props.title,
- style = props.style,
- className = props.className,
- visible = props.visible,
- forceRender = props.forceRender,
- destroyOnClose = props.destroyOnClose,
- motionName = props.motionName,
- ariaId = props.ariaId,
- onVisibleChanged = props.onVisibleChanged,
- mousePosition = props.mousePosition;
- var dialogRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // ============================= Style ==============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- transformOrigin = _React$useState2[0],
- setTransformOrigin = _React$useState2[1];
- var contentStyle = {};
- if (transformOrigin) {
- contentStyle.transformOrigin = transformOrigin;
- }
- function onPrepare() {
- var elementOffset = offset(dialogRef.current);
- setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
- }
- // ============================= Render =============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: visible,
- onVisibleChanged: onVisibleChanged,
- onAppearPrepare: onPrepare,
- onEnterPrepare: onPrepare,
- forceRender: forceRender,
- motionName: motionName,
- removeOnLeave: destroyOnClose,
- ref: dialogRef
- }, function (_ref, motionRef) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Content_Panel, (0,esm_extends["default"])({}, props, {
- ref: ref,
- title: title,
- ariaId: ariaId,
- prefixCls: prefixCls,
- holderRef: motionRef,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, motionStyle), style), contentStyle),
- className: classnames_default()(className, motionClassName)
- }));
- });
- });
- Content.displayName = 'Content';
- /* harmony default export */ var Dialog_Content = (Content);
- ;// ./node_modules/rc-dialog/es/Dialog/Mask.js
- var Mask = function Mask(props) {
- var prefixCls = props.prefixCls,
- style = props.style,
- visible = props.visible,
- maskProps = props.maskProps,
- motionName = props.motionName,
- className = props.className;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- key: "mask",
- visible: visible,
- motionName: motionName,
- leavedClassName: "".concat(prefixCls, "-mask-hidden")
- }, function (_ref, ref) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- ref: ref,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, motionStyle), style),
- className: classnames_default()("".concat(prefixCls, "-mask"), motionClassName, className)
- }, maskProps));
- });
- };
- /* harmony default export */ var Dialog_Mask = (Mask);
- ;// ./node_modules/rc-dialog/es/Dialog/index.js
- var Dialog = function Dialog(props) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-dialog' : _props$prefixCls,
- zIndex = props.zIndex,
- _props$visible = props.visible,
- visible = _props$visible === void 0 ? false : _props$visible,
- _props$keyboard = props.keyboard,
- keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
- _props$focusTriggerAf = props.focusTriggerAfterClose,
- focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
- wrapStyle = props.wrapStyle,
- wrapClassName = props.wrapClassName,
- wrapProps = props.wrapProps,
- onClose = props.onClose,
- afterOpenChange = props.afterOpenChange,
- afterClose = props.afterClose,
- transitionName = props.transitionName,
- animation = props.animation,
- _props$closable = props.closable,
- closable = _props$closable === void 0 ? true : _props$closable,
- _props$mask = props.mask,
- mask = _props$mask === void 0 ? true : _props$mask,
- maskTransitionName = props.maskTransitionName,
- maskAnimation = props.maskAnimation,
- _props$maskClosable = props.maskClosable,
- maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
- maskStyle = props.maskStyle,
- maskProps = props.maskProps,
- rootClassName = props.rootClassName,
- modalClassNames = props.classNames,
- modalStyles = props.styles;
- if (true) {
- ['wrapStyle', 'bodyStyle', 'maskStyle'].forEach(function (prop) {
- // (prop in props) && console.error(`Warning: ${prop} is deprecated, please use styles instead.`)
- (0,warning.warning)(!(prop in props), "".concat(prop, " is deprecated, please use styles instead."));
- });
- if ('wrapClassName' in props) {
- (0,warning.warning)(false, "wrapClassName is deprecated, please use classNames instead.");
- }
- }
- var lastOutSideActiveElementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var contentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(visible),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- animatedVisible = _React$useState2[0],
- setAnimatedVisible = _React$useState2[1];
- // ========================== Init ==========================
- var ariaId = hooks_useId();
- function saveLastOutSideActiveElementRef() {
- if (!(0,contains["default"])(wrapperRef.current, document.activeElement)) {
- lastOutSideActiveElementRef.current = document.activeElement;
- }
- }
- function focusDialogContent() {
- if (!(0,contains["default"])(wrapperRef.current, document.activeElement)) {
- var _contentRef$current;
- (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();
- }
- }
- // ========================= Events =========================
- function onDialogVisibleChanged(newVisible) {
- // Try to focus
- if (newVisible) {
- focusDialogContent();
- } else {
- // Clean up scroll bar & focus back
- setAnimatedVisible(false);
- if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
- try {
- lastOutSideActiveElementRef.current.focus({
- preventScroll: true
- });
- } catch (e) {
- // Do nothing
- }
- lastOutSideActiveElementRef.current = null;
- }
- // Trigger afterClose only when change visible from true to false
- if (animatedVisible) {
- afterClose === null || afterClose === void 0 || afterClose();
- }
- }
- afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(newVisible);
- }
- function onInternalClose(e) {
- onClose === null || onClose === void 0 || onClose(e);
- }
- // >>> Content
- var contentClickRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var contentTimeoutRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // We need record content click incase content popup out of dialog
- var onContentMouseDown = function onContentMouseDown() {
- clearTimeout(contentTimeoutRef.current);
- contentClickRef.current = true;
- };
- var onContentMouseUp = function onContentMouseUp() {
- contentTimeoutRef.current = setTimeout(function () {
- contentClickRef.current = false;
- });
- };
- // >>> Wrapper
- // Close only when element not on dialog
- var onWrapperClick = null;
- if (maskClosable) {
- onWrapperClick = function onWrapperClick(e) {
- if (contentClickRef.current) {
- contentClickRef.current = false;
- } else if (wrapperRef.current === e.target) {
- onInternalClose(e);
- }
- };
- }
- function onWrapperKeyDown(e) {
- if (keyboard && e.keyCode === KeyCode["default"].ESC) {
- e.stopPropagation();
- onInternalClose(e);
- return;
- }
- // keep focus inside dialog
- if (visible && e.keyCode === KeyCode["default"].TAB) {
- contentRef.current.changeActive(!e.shiftKey);
- }
- }
- // ========================= Effect =========================
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (visible) {
- setAnimatedVisible(true);
- saveLastOutSideActiveElementRef();
- }
- }, [visible]);
- // Remove direct should also check the scroll bar update
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return function () {
- clearTimeout(contentTimeoutRef.current);
- };
- }, []);
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({
- zIndex: zIndex
- }, wrapStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.wrapper), {}, {
- display: !animatedVisible ? 'none' : null
- });
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-root"), rootClassName)
- }, (0,pickAttrs["default"])(props, {
- data: true
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Dialog_Mask, {
- prefixCls: prefixCls,
- visible: mask && visible,
- motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({
- zIndex: zIndex
- }, maskStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.mask),
- maskProps: maskProps,
- className: modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.mask
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- tabIndex: -1,
- onKeyDown: onWrapperKeyDown,
- className: classnames_default()("".concat(prefixCls, "-wrap"), wrapClassName, modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.wrapper),
- ref: wrapperRef,
- onClick: onWrapperClick,
- style: mergedStyle
- }, wrapProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Dialog_Content, (0,esm_extends["default"])({}, props, {
- onMouseDown: onContentMouseDown,
- onMouseUp: onContentMouseUp,
- ref: contentRef,
- closable: closable,
- ariaId: ariaId,
- prefixCls: prefixCls,
- visible: visible && animatedVisible,
- onClose: onInternalClose,
- onVisibleChanged: onDialogVisibleChanged,
- motionName: getMotionName(prefixCls, transitionName, animation)
- }))));
- };
- /* harmony default export */ var es_Dialog = (Dialog);
- ;// ./node_modules/rc-dialog/es/DialogWrap.js
- // fix issue #10656
- /*
- * getContainer remarks
- * Custom container should not be return, because in the Portal component, it will remove the
- * return container element here, if the custom container is the only child of it's component,
- * like issue #10656, It will has a conflict with removeChild method in react-dom.
- * So here should add a child (div element) to custom container.
- * */
- var DialogWrap = function DialogWrap(props) {
- var visible = props.visible,
- getContainer = props.getContainer,
- forceRender = props.forceRender,
- _props$destroyOnClose = props.destroyOnClose,
- destroyOnClose = _props$destroyOnClose === void 0 ? false : _props$destroyOnClose,
- _afterClose = props.afterClose,
- panelRef = props.panelRef;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(visible),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- animatedVisible = _React$useState2[0],
- setAnimatedVisible = _React$useState2[1];
- var refContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- panel: panelRef
- };
- }, [panelRef]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (visible) {
- setAnimatedVisible(true);
- }
- }, [visible]);
- // Destroy on close will remove wrapped div
- if (!forceRender && destroyOnClose && !animatedVisible) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RefContext.Provider, {
- value: refContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(portal_es, {
- open: visible || forceRender || animatedVisible,
- autoDestroy: false,
- getContainer: getContainer,
- autoLock: visible || animatedVisible
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Dialog, (0,esm_extends["default"])({}, props, {
- destroyOnClose: destroyOnClose,
- afterClose: function afterClose() {
- _afterClose === null || _afterClose === void 0 || _afterClose();
- setAnimatedVisible(false);
- }
- }))));
- };
- DialogWrap.displayName = 'Dialog';
- /* harmony default export */ var es_DialogWrap = (DialogWrap);
- ;// ./node_modules/rc-dialog/es/index.js
- /* harmony default export */ var rc_dialog_es = (es_DialogWrap);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
- var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
- ;// ./node_modules/rc-field-form/es/FieldContext.js
- var HOOK_MARK = 'RC_FORM_INTERNAL_HOOKS';
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- var warningFunc = function warningFunc() {
- (0,warning["default"])(false, 'Can not find FormContext. Please make sure you wrap Field under Form.');
- };
- var FieldContext_Context = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- getFieldValue: warningFunc,
- getFieldsValue: warningFunc,
- getFieldError: warningFunc,
- getFieldWarning: warningFunc,
- getFieldsError: warningFunc,
- isFieldsTouched: warningFunc,
- isFieldTouched: warningFunc,
- isFieldValidating: warningFunc,
- isFieldsValidating: warningFunc,
- resetFields: warningFunc,
- setFields: warningFunc,
- setFieldValue: warningFunc,
- setFieldsValue: warningFunc,
- validateFields: warningFunc,
- submit: warningFunc,
- getInternalHooks: function getInternalHooks() {
- warningFunc();
- return {
- dispatch: warningFunc,
- initEntityValue: warningFunc,
- registerField: warningFunc,
- useSubscribe: warningFunc,
- setInitialValues: warningFunc,
- destroyForm: warningFunc,
- setCallbacks: warningFunc,
- registerWatch: warningFunc,
- getFields: warningFunc,
- setValidateMessages: warningFunc,
- setPreserve: warningFunc,
- getInitialValue: warningFunc
- };
- }
- });
- /* harmony default export */ var FieldContext = (FieldContext_Context);
- ;// ./node_modules/rc-field-form/es/ListContext.js
- var ListContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_ListContext = (ListContext);
- ;// ./node_modules/rc-field-form/es/utils/typeUtil.js
- function typeUtil_toArray(value) {
- if (value === undefined || value === null) {
- return [];
- }
- return Array.isArray(value) ? value : [value];
- }
- function isFormInstance(form) {
- return form && !!form._init;
- }
- ;// ./node_modules/@rc-component/async-validator/es/messages.js
- function newMessages() {
- return {
- default: 'Validation error on field %s',
- required: '%s is required',
- enum: '%s must be one of %s',
- whitespace: '%s cannot be empty',
- date: {
- format: '%s date %s is invalid for format %s',
- parse: '%s date could not be parsed, %s is invalid ',
- invalid: '%s date %s is invalid'
- },
- types: {
- string: '%s is not a %s',
- method: '%s is not a %s (function)',
- array: '%s is not an %s',
- object: '%s is not an %s',
- number: '%s is not a %s',
- date: '%s is not a %s',
- boolean: '%s is not a %s',
- integer: '%s is not an %s',
- float: '%s is not a %s',
- regexp: '%s is not a valid %s',
- email: '%s is not a valid %s',
- url: '%s is not a valid %s',
- hex: '%s is not a valid %s'
- },
- string: {
- len: '%s must be exactly %s characters',
- min: '%s must be at least %s characters',
- max: '%s cannot be longer than %s characters',
- range: '%s must be between %s and %s characters'
- },
- number: {
- len: '%s must equal %s',
- min: '%s cannot be less than %s',
- max: '%s cannot be greater than %s',
- range: '%s must be between %s and %s'
- },
- array: {
- len: '%s must be exactly %s in length',
- min: '%s cannot be less than %s in length',
- max: '%s cannot be greater than %s in length',
- range: '%s must be between %s and %s in length'
- },
- pattern: {
- mismatch: '%s value %s does not match pattern %s'
- },
- clone: function clone() {
- var cloned = JSON.parse(JSON.stringify(this));
- cloned.clone = this.clone;
- return cloned;
- }
- };
- }
- var messages_messages = newMessages();
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
- var setPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
- function _isNativeFunction(t) {
- try {
- return -1 !== Function.toString.call(t).indexOf("[native code]");
- } catch (n) {
- return "function" == typeof t;
- }
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/construct.js
- function _construct(t, e, r) {
- if ((0,isNativeReflectConstruct["default"])()) return Reflect.construct.apply(null, arguments);
- var o = [null];
- o.push.apply(o, e);
- var p = new (t.bind.apply(t, o))();
- return r && (0,setPrototypeOf["default"])(p, r.prototype), p;
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
- function _wrapNativeSuper(t) {
- var r = "function" == typeof Map ? new Map() : void 0;
- return _wrapNativeSuper = function _wrapNativeSuper(t) {
- if (null === t || !_isNativeFunction(t)) return t;
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
- if (void 0 !== r) {
- if (r.has(t)) return r.get(t);
- r.set(t, Wrapper);
- }
- function Wrapper() {
- return _construct(t, arguments, (0,getPrototypeOf["default"])(this).constructor);
- }
- return Wrapper.prototype = Object.create(t.prototype, {
- constructor: {
- value: Wrapper,
- enumerable: !1,
- writable: !0,
- configurable: !0
- }
- }), (0,setPrototypeOf["default"])(Wrapper, t);
- }, _wrapNativeSuper(t);
- }
- ;// ./node_modules/@rc-component/async-validator/es/util.js
- /* eslint no-console:0 */
- var formatRegExp = /%[sdj%]/g;
- var util_warning = function warning() {};
- // don't print warning message when in production env or node runtime
- if (typeof process !== 'undefined' && process.env && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
- util_warning = function warning(type, errors) {
- if (typeof console !== 'undefined' && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === 'undefined') {
- if (errors.every(function (e) {
- return typeof e === 'string';
- })) {
- console.warn(type, errors);
- }
- }
- };
- }
- function convertFieldsError(errors) {
- if (!errors || !errors.length) return null;
- var fields = {};
- errors.forEach(function (error) {
- var field = error.field;
- fields[field] = fields[field] || [];
- fields[field].push(error);
- });
- return fields;
- }
- function format(template) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- var i = 0;
- var len = args.length;
- if (typeof template === 'function') {
- // eslint-disable-next-line prefer-spread
- return template.apply(null, args);
- }
- if (typeof template === 'string') {
- var str = template.replace(formatRegExp, function (x) {
- if (x === '%%') {
- return '%';
- }
- if (i >= len) {
- return x;
- }
- switch (x) {
- case '%s':
- return String(args[i++]);
- case '%d':
- return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- // removed by dead control flow
- default:
- return x;
- }
- });
- return str;
- }
- return template;
- }
- function isNativeStringType(type) {
- return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'date' || type === 'pattern';
- }
- function isEmptyValue(value, type) {
- if (value === undefined || value === null) {
- return true;
- }
- if (type === 'array' && Array.isArray(value) && !value.length) {
- return true;
- }
- if (isNativeStringType(type) && typeof value === 'string' && !value) {
- return true;
- }
- return false;
- }
- function isEmptyObject(obj) {
- return Object.keys(obj).length === 0;
- }
- function asyncParallelArray(arr, func, callback) {
- var results = [];
- var total = 0;
- var arrLength = arr.length;
- function count(errors) {
- results.push.apply(results, (0,toConsumableArray["default"])(errors || []));
- total++;
- if (total === arrLength) {
- callback(results);
- }
- }
- arr.forEach(function (a) {
- func(a, count);
- });
- }
- function asyncSerialArray(arr, func, callback) {
- var index = 0;
- var arrLength = arr.length;
- function next(errors) {
- if (errors && errors.length) {
- callback(errors);
- return;
- }
- var original = index;
- index = index + 1;
- if (original < arrLength) {
- func(arr[original], next);
- } else {
- callback([]);
- }
- }
- next([]);
- }
- function flattenObjArr(objArr) {
- var ret = [];
- Object.keys(objArr).forEach(function (k) {
- ret.push.apply(ret, (0,toConsumableArray["default"])(objArr[k] || []));
- });
- return ret;
- }
- var AsyncValidationError = /*#__PURE__*/function (_Error) {
- (0,inherits["default"])(AsyncValidationError, _Error);
- var _super = (0,createSuper["default"])(AsyncValidationError);
- function AsyncValidationError(errors, fields) {
- var _this;
- (0,classCallCheck["default"])(this, AsyncValidationError);
- _this = _super.call(this, 'Async Validation Error');
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "errors", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "fields", void 0);
- _this.errors = errors;
- _this.fields = fields;
- return _this;
- }
- return (0,createClass["default"])(AsyncValidationError);
- }( /*#__PURE__*/_wrapNativeSuper(Error));
- function asyncMap(objArr, option, func, callback, source) {
- if (option.first) {
- var _pending = new Promise(function (resolve, reject) {
- var next = function next(errors) {
- callback(errors);
- return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
- };
- var flattenArr = flattenObjArr(objArr);
- asyncSerialArray(flattenArr, func, next);
- });
- _pending.catch(function (e) {
- return e;
- });
- return _pending;
- }
- var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
- var objArrKeys = Object.keys(objArr);
- var objArrLength = objArrKeys.length;
- var total = 0;
- var results = [];
- var pending = new Promise(function (resolve, reject) {
- var next = function next(errors) {
- // eslint-disable-next-line prefer-spread
- results.push.apply(results, errors);
- total++;
- if (total === objArrLength) {
- callback(results);
- return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
- }
- };
- if (!objArrKeys.length) {
- callback(results);
- resolve(source);
- }
- objArrKeys.forEach(function (key) {
- var arr = objArr[key];
- if (firstFields.indexOf(key) !== -1) {
- asyncSerialArray(arr, func, next);
- } else {
- asyncParallelArray(arr, func, next);
- }
- });
- });
- pending.catch(function (e) {
- return e;
- });
- return pending;
- }
- function isErrorObj(obj) {
- return !!(obj && obj.message !== undefined);
- }
- function getValue(value, path) {
- var v = value;
- for (var i = 0; i < path.length; i++) {
- if (v == undefined) {
- return v;
- }
- v = v[path[i]];
- }
- return v;
- }
- function complementError(rule, source) {
- return function (oe) {
- var fieldValue;
- if (rule.fullFields) {
- fieldValue = getValue(source, rule.fullFields);
- } else {
- fieldValue = source[oe.field || rule.fullField];
- }
- if (isErrorObj(oe)) {
- oe.field = oe.field || rule.fullField;
- oe.fieldValue = fieldValue;
- return oe;
- }
- return {
- message: typeof oe === 'function' ? oe() : oe,
- fieldValue: fieldValue,
- field: oe.field || rule.fullField
- };
- };
- }
- function deepMerge(target, source) {
- if (source) {
- for (var s in source) {
- if (source.hasOwnProperty(s)) {
- var value = source[s];
- if ((0,esm_typeof["default"])(value) === 'object' && (0,esm_typeof["default"])(target[s]) === 'object') {
- target[s] = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, target[s]), value);
- } else {
- target[s] = value;
- }
- }
- }
- }
- return target;
- }
- ;// ./node_modules/@rc-component/async-validator/es/rule/enum.js
- var ENUM = 'enum';
- var enumerable = function enumerable(rule, value, source, errors, options) {
- rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
- if (rule[ENUM].indexOf(value) === -1) {
- errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
- }
- };
- /* harmony default export */ var rule_enum = (enumerable);
- ;// ./node_modules/@rc-component/async-validator/es/rule/pattern.js
- var pattern = function pattern(rule, value, source, errors, options) {
- if (rule.pattern) {
- if (rule.pattern instanceof RegExp) {
- // if a RegExp instance is passed, reset `lastIndex` in case its `global`
- // flag is accidentally set to `true`, which in a validation scenario
- // is not necessary and the result might be misleading
- rule.pattern.lastIndex = 0;
- if (!rule.pattern.test(value)) {
- errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
- }
- } else if (typeof rule.pattern === 'string') {
- var _pattern = new RegExp(rule.pattern);
- if (!_pattern.test(value)) {
- errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
- }
- }
- }
- };
- /* harmony default export */ var rule_pattern = (pattern);
- ;// ./node_modules/@rc-component/async-validator/es/rule/range.js
- var range = function range(rule, value, source, errors, options) {
- var len = typeof rule.len === 'number';
- var min = typeof rule.min === 'number';
- var max = typeof rule.max === 'number';
- // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
- var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var val = value;
- var key = null;
- var num = typeof value === 'number';
- var str = typeof value === 'string';
- var arr = Array.isArray(value);
- if (num) {
- key = 'number';
- } else if (str) {
- key = 'string';
- } else if (arr) {
- key = 'array';
- }
- // if the value is not of a supported type for range validation
- // the validation rule rule should use the
- // type property to also test for a particular type
- if (!key) {
- return false;
- }
- if (arr) {
- val = value.length;
- }
- if (str) {
- // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".length !== 3
- val = value.replace(spRegexp, '_').length;
- }
- if (len) {
- if (val !== rule.len) {
- errors.push(format(options.messages[key].len, rule.fullField, rule.len));
- }
- } else if (min && !max && val < rule.min) {
- errors.push(format(options.messages[key].min, rule.fullField, rule.min));
- } else if (max && !min && val > rule.max) {
- errors.push(format(options.messages[key].max, rule.fullField, rule.max));
- } else if (min && max && (val < rule.min || val > rule.max)) {
- errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
- }
- };
- /* harmony default export */ var rule_range = (range);
- ;// ./node_modules/@rc-component/async-validator/es/rule/required.js
- var required = function required(rule, value, source, errors, options, type) {
- if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
- errors.push(format(options.messages.required, rule.fullField));
- }
- };
- /* harmony default export */ var rule_required = (required);
- ;// ./node_modules/@rc-component/async-validator/es/rule/url.js
- // https://github.com/kevva/url-regex/blob/master/index.js
- var urlReg;
- /* harmony default export */ var rule_url = (function () {
- if (urlReg) {
- return urlReg;
- }
- var word = '[a-fA-F\\d:]';
- var b = function b(options) {
- return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=".concat(word, ")|(?<=").concat(word, ")(?=\\s|$))") : '';
- };
- var v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
- var v6seg = '[a-fA-F\\d]{1,4}';
- var v6List = ["(?:".concat(v6seg, ":){7}(?:").concat(v6seg, "|:)"), // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
- "(?:".concat(v6seg, ":){6}(?:").concat(v4, "|:").concat(v6seg, "|:)"), // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::
- "(?:".concat(v6seg, ":){5}(?::").concat(v4, "|(?::").concat(v6seg, "){1,2}|:)"), // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::
- "(?:".concat(v6seg, ":){4}(?:(?::").concat(v6seg, "){0,1}:").concat(v4, "|(?::").concat(v6seg, "){1,3}|:)"), // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::
- "(?:".concat(v6seg, ":){3}(?:(?::").concat(v6seg, "){0,2}:").concat(v4, "|(?::").concat(v6seg, "){1,4}|:)"), // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::
- "(?:".concat(v6seg, ":){2}(?:(?::").concat(v6seg, "){0,3}:").concat(v4, "|(?::").concat(v6seg, "){1,5}|:)"), // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::
- "(?:".concat(v6seg, ":){1}(?:(?::").concat(v6seg, "){0,4}:").concat(v4, "|(?::").concat(v6seg, "){1,6}|:)"), // 1:: 1::3:4:5:6:7:8 1::8 1::
- "(?::(?:(?::".concat(v6seg, "){0,5}:").concat(v4, "|(?::").concat(v6seg, "){1,7}|:))") // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::
- ];
- var v6Eth0 = "(?:%[0-9a-zA-Z]{1,})?"; // %eth0 %1
- var v6 = "(?:".concat(v6List.join('|'), ")").concat(v6Eth0);
- // Pre-compile only the exact regexes because adding a global flag make regexes stateful
- var v46Exact = new RegExp("(?:^".concat(v4, "$)|(?:^").concat(v6, "$)"));
- var v4exact = new RegExp("^".concat(v4, "$"));
- var v6exact = new RegExp("^".concat(v6, "$"));
- var ip = function ip(options) {
- return options && options.exact ? v46Exact : new RegExp("(?:".concat(b(options)).concat(v4).concat(b(options), ")|(?:").concat(b(options)).concat(v6).concat(b(options), ")"), 'g');
- };
- ip.v4 = function (options) {
- return options && options.exact ? v4exact : new RegExp("".concat(b(options)).concat(v4).concat(b(options)), 'g');
- };
- ip.v6 = function (options) {
- return options && options.exact ? v6exact : new RegExp("".concat(b(options)).concat(v6).concat(b(options)), 'g');
- };
- var protocol = "(?:(?:[a-z]+:)?//)";
- var auth = '(?:\\S+(?::\\S*)?@)?';
- var ipv4 = ip.v4().source;
- var ipv6 = ip.v6().source;
- var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
- var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
- var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
- var port = '(?::\\d{2,5})?';
- var path = '(?:[/?#][^\\s"]*)?';
- var regex = "(?:".concat(protocol, "|www\\.)").concat(auth, "(?:localhost|").concat(ipv4, "|").concat(ipv6, "|").concat(host).concat(domain).concat(tld, ")").concat(port).concat(path);
- urlReg = new RegExp("(?:^".concat(regex, "$)"), 'i');
- return urlReg;
- });
- ;// ./node_modules/@rc-component/async-validator/es/rule/type.js
- /* eslint max-len:0 */
- var type_pattern = {
- // http://emailregex.com/
- email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
- // url: new RegExp(
- // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
- // 'i',
- // ),
- hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
- };
- var types = {
- integer: function integer(value) {
- return types.number(value) && parseInt(value, 10) === value;
- },
- float: function float(value) {
- return types.number(value) && !types.integer(value);
- },
- array: function array(value) {
- return Array.isArray(value);
- },
- regexp: function regexp(value) {
- if (value instanceof RegExp) {
- return true;
- }
- try {
- return !!new RegExp(value);
- } catch (e) {
- return false;
- }
- },
- date: function date(value) {
- return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function' && !isNaN(value.getTime());
- },
- number: function number(value) {
- if (isNaN(value)) {
- return false;
- }
- return typeof value === 'number';
- },
- object: function object(value) {
- return (0,esm_typeof["default"])(value) === 'object' && !types.array(value);
- },
- method: function method(value) {
- return typeof value === 'function';
- },
- email: function email(value) {
- return typeof value === 'string' && value.length <= 320 && !!value.match(type_pattern.email);
- },
- url: function url(value) {
- return typeof value === 'string' && value.length <= 2048 && !!value.match(rule_url());
- },
- hex: function hex(value) {
- return typeof value === 'string' && !!value.match(type_pattern.hex);
- }
- };
- var type = function type(rule, value, source, errors, options) {
- if (rule.required && value === undefined) {
- rule_required(rule, value, source, errors, options);
- return;
- }
- var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
- var ruleType = rule.type;
- if (custom.indexOf(ruleType) > -1) {
- if (!types[ruleType](value)) {
- errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
- }
- // straight typeof check
- } else if (ruleType && (0,esm_typeof["default"])(value) !== rule.type) {
- errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
- }
- };
- /* harmony default export */ var rule_type = (type);
- ;// ./node_modules/@rc-component/async-validator/es/rule/whitespace.js
- /**
- * Rule for validating whitespace.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- var whitespace = function whitespace(rule, value, source, errors, options) {
- if (/^\s+$/.test(value) || value === '') {
- errors.push(format(options.messages.whitespace, rule.fullField));
- }
- };
- /* harmony default export */ var rule_whitespace = (whitespace);
- ;// ./node_modules/@rc-component/async-validator/es/rule/index.js
- /* harmony default export */ var es_rule = ({
- required: rule_required,
- whitespace: rule_whitespace,
- type: rule_type,
- range: rule_range,
- enum: rule_enum,
- pattern: rule_pattern
- });
- ;// ./node_modules/@rc-component/async-validator/es/validator/any.js
- var any = function any(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- }
- callback(errors);
- };
- /* harmony default export */ var validator_any = (any);
- ;// ./node_modules/@rc-component/async-validator/es/validator/array.js
- var array = function array(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if ((value === undefined || value === null) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options, 'array');
- if (value !== undefined && value !== null) {
- es_rule.type(rule, value, source, errors, options);
- es_rule.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_array = (array);
- ;// ./node_modules/@rc-component/async-validator/es/validator/boolean.js
- var boolean_boolean = function boolean(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_boolean = (boolean_boolean);
- ;// ./node_modules/@rc-component/async-validator/es/validator/date.js
- var date = function date(rule, value, callback, source, options) {
- // console.log('integer rule called %j', rule);
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- // console.log('validate on %s value', value);
- if (validate) {
- if (isEmptyValue(value, 'date') && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (!isEmptyValue(value, 'date')) {
- var dateObject;
- if (value instanceof Date) {
- dateObject = value;
- } else {
- dateObject = new Date(value);
- }
- es_rule.type(rule, dateObject, source, errors, options);
- if (dateObject) {
- es_rule.range(rule, dateObject.getTime(), source, errors, options);
- }
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_date = (date);
- ;// ./node_modules/@rc-component/async-validator/es/validator/enum.js
- var enum_ENUM = 'enum';
- var enum_enumerable = function enumerable(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule[enum_ENUM](rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_enum = (enum_enumerable);
- ;// ./node_modules/@rc-component/async-validator/es/validator/float.js
- var floatFn = function floatFn(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- es_rule.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_float = (floatFn);
- ;// ./node_modules/@rc-component/async-validator/es/validator/integer.js
- var integer = function integer(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- es_rule.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_integer = (integer);
- ;// ./node_modules/@rc-component/async-validator/es/validator/method.js
- var method = function method(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_method = (method);
- ;// ./node_modules/@rc-component/async-validator/es/validator/number.js
- var number = function number(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (value === '') {
- // eslint-disable-next-line no-param-reassign
- value = undefined;
- }
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- es_rule.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_number = (number);
- ;// ./node_modules/@rc-component/async-validator/es/validator/object.js
- var object = function object(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (value !== undefined) {
- es_rule.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_object = (object);
- ;// ./node_modules/@rc-component/async-validator/es/validator/pattern.js
- var pattern_pattern = function pattern(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, 'string') && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (!isEmptyValue(value, 'string')) {
- es_rule.pattern(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_pattern = (pattern_pattern);
- ;// ./node_modules/@rc-component/async-validator/es/validator/regexp.js
- var regexp = function regexp(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options);
- if (!isEmptyValue(value)) {
- es_rule.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_regexp = (regexp);
- ;// ./node_modules/@rc-component/async-validator/es/validator/required.js
- var required_required = function required(rule, value, callback, source, options) {
- var errors = [];
- var type = Array.isArray(value) ? 'array' : (0,esm_typeof["default"])(value);
- es_rule.required(rule, value, source, errors, options, type);
- callback(errors);
- };
- /* harmony default export */ var validator_required = (required_required);
- ;// ./node_modules/@rc-component/async-validator/es/validator/string.js
- var string = function string(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, 'string') && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options, 'string');
- if (!isEmptyValue(value, 'string')) {
- es_rule.type(rule, value, source, errors, options);
- es_rule.range(rule, value, source, errors, options);
- es_rule.pattern(rule, value, source, errors, options);
- if (rule.whitespace === true) {
- es_rule.whitespace(rule, value, source, errors, options);
- }
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_string = (string);
- ;// ./node_modules/@rc-component/async-validator/es/validator/type.js
- var type_type = function type(rule, value, callback, source, options) {
- var ruleType = rule.type;
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, ruleType) && !rule.required) {
- return callback();
- }
- es_rule.required(rule, value, source, errors, options, ruleType);
- if (!isEmptyValue(value, ruleType)) {
- es_rule.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- };
- /* harmony default export */ var validator_type = (type_type);
- ;// ./node_modules/@rc-component/async-validator/es/validator/index.js
- /* harmony default export */ var es_validator = ({
- string: validator_string,
- method: validator_method,
- number: validator_number,
- boolean: validator_boolean,
- regexp: validator_regexp,
- integer: validator_integer,
- float: validator_float,
- array: validator_array,
- object: validator_object,
- enum: validator_enum,
- pattern: validator_pattern,
- date: validator_date,
- url: validator_type,
- hex: validator_type,
- email: validator_type,
- required: validator_required,
- any: validator_any
- });
- ;// ./node_modules/@rc-component/async-validator/es/interface.js
- ;// ./node_modules/@rc-component/async-validator/es/index.js
- /**
- * Encapsulates a validation schema.
- *
- * @param descriptor An object declaring validation rules
- * for this schema.
- */
- var Schema = /*#__PURE__*/function () {
- function Schema(descriptor) {
- (0,classCallCheck["default"])(this, Schema);
- // ======================== Instance ========================
- (0,defineProperty["default"])(this, "rules", null);
- (0,defineProperty["default"])(this, "_messages", messages_messages);
- this.define(descriptor);
- }
- (0,createClass["default"])(Schema, [{
- key: "define",
- value: function define(rules) {
- var _this = this;
- if (!rules) {
- throw new Error('Cannot configure a schema with no rules');
- }
- if ((0,esm_typeof["default"])(rules) !== 'object' || Array.isArray(rules)) {
- throw new Error('Rules must be an object');
- }
- this.rules = {};
- Object.keys(rules).forEach(function (name) {
- var item = rules[name];
- _this.rules[name] = Array.isArray(item) ? item : [item];
- });
- }
- }, {
- key: "messages",
- value: function messages(_messages) {
- if (_messages) {
- this._messages = deepMerge(newMessages(), _messages);
- }
- return this._messages;
- }
- }, {
- key: "validate",
- value: function validate(source_) {
- var _this2 = this;
- var o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var oc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
- var source = source_;
- var options = o;
- var callback = oc;
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- if (!this.rules || Object.keys(this.rules).length === 0) {
- if (callback) {
- callback(null, source);
- }
- return Promise.resolve(source);
- }
- function complete(results) {
- var errors = [];
- var fields = {};
- function add(e) {
- if (Array.isArray(e)) {
- var _errors;
- errors = (_errors = errors).concat.apply(_errors, (0,toConsumableArray["default"])(e));
- } else {
- errors.push(e);
- }
- }
- for (var i = 0; i < results.length; i++) {
- add(results[i]);
- }
- if (!errors.length) {
- callback(null, source);
- } else {
- fields = convertFieldsError(errors);
- callback(errors, fields);
- }
- }
- if (options.messages) {
- var messages = this.messages();
- if (messages === messages_messages) {
- messages = newMessages();
- }
- deepMerge(messages, options.messages);
- options.messages = messages;
- } else {
- options.messages = this.messages();
- }
- var series = {};
- var keys = options.keys || Object.keys(this.rules);
- keys.forEach(function (z) {
- var arr = _this2.rules[z];
- var value = source[z];
- arr.forEach(function (r) {
- var rule = r;
- if (typeof rule.transform === 'function') {
- if (source === source_) {
- source = (0,objectSpread2["default"])({}, source);
- }
- value = source[z] = rule.transform(value);
- if (value !== undefined && value !== null) {
- rule.type = rule.type || (Array.isArray(value) ? 'array' : (0,esm_typeof["default"])(value));
- }
- }
- if (typeof rule === 'function') {
- rule = {
- validator: rule
- };
- } else {
- rule = (0,objectSpread2["default"])({}, rule);
- }
- // Fill validator. Skip if nothing need to validate
- rule.validator = _this2.getValidationMethod(rule);
- if (!rule.validator) {
- return;
- }
- rule.field = z;
- rule.fullField = rule.fullField || z;
- rule.type = _this2.getType(rule);
- series[z] = series[z] || [];
- series[z].push({
- rule: rule,
- value: value,
- source: source,
- field: z
- });
- });
- });
- var errorFields = {};
- return asyncMap(series, options, function (data, doIt) {
- var rule = data.rule;
- var deep = (rule.type === 'object' || rule.type === 'array') && ((0,esm_typeof["default"])(rule.fields) === 'object' || (0,esm_typeof["default"])(rule.defaultField) === 'object');
- deep = deep && (rule.required || !rule.required && data.value);
- rule.field = data.field;
- function addFullField(key, schema) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, schema), {}, {
- fullField: "".concat(rule.fullField, ".").concat(key),
- fullFields: rule.fullFields ? [].concat((0,toConsumableArray["default"])(rule.fullFields), [key]) : [key]
- });
- }
- function cb() {
- var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var errorList = Array.isArray(e) ? e : [e];
- if (!options.suppressWarning && errorList.length) {
- Schema.warning('async-validator:', errorList);
- }
- if (errorList.length && rule.message !== undefined) {
- errorList = [].concat(rule.message);
- }
- // Fill error info
- var filledErrors = errorList.map(complementError(rule, source));
- if (options.first && filledErrors.length) {
- errorFields[rule.field] = 1;
- return doIt(filledErrors);
- }
- if (!deep) {
- doIt(filledErrors);
- } else {
- // if rule is required but the target object
- // does not exist fail at the rule level and don't
- // go deeper
- if (rule.required && !data.value) {
- if (rule.message !== undefined) {
- filledErrors = [].concat(rule.message).map(complementError(rule, source));
- } else if (options.error) {
- filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
- }
- return doIt(filledErrors);
- }
- var fieldsSchema = {};
- if (rule.defaultField) {
- Object.keys(data.value).map(function (key) {
- fieldsSchema[key] = rule.defaultField;
- });
- }
- fieldsSchema = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, fieldsSchema), data.rule.fields);
- var paredFieldsSchema = {};
- Object.keys(fieldsSchema).forEach(function (field) {
- var fieldSchema = fieldsSchema[field];
- var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
- paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
- });
- var schema = new Schema(paredFieldsSchema);
- schema.messages(options.messages);
- if (data.rule.options) {
- data.rule.options.messages = options.messages;
- data.rule.options.error = options.error;
- }
- schema.validate(data.value, data.rule.options || options, function (errs) {
- var finalErrors = [];
- if (filledErrors && filledErrors.length) {
- finalErrors.push.apply(finalErrors, (0,toConsumableArray["default"])(filledErrors));
- }
- if (errs && errs.length) {
- finalErrors.push.apply(finalErrors, (0,toConsumableArray["default"])(errs));
- }
- doIt(finalErrors.length ? finalErrors : null);
- });
- }
- }
- var res;
- if (rule.asyncValidator) {
- res = rule.asyncValidator(rule, data.value, cb, data.source, options);
- } else if (rule.validator) {
- try {
- res = rule.validator(rule, data.value, cb, data.source, options);
- } catch (error) {
- var _console$error, _console;
- (_console$error = (_console = console).error) === null || _console$error === void 0 || _console$error.call(_console, error);
- // rethrow to report error
- if (!options.suppressValidatorError) {
- setTimeout(function () {
- throw error;
- }, 0);
- }
- cb(error.message);
- }
- if (res === true) {
- cb();
- } else if (res === false) {
- cb(typeof rule.message === 'function' ? rule.message(rule.fullField || rule.field) : rule.message || "".concat(rule.fullField || rule.field, " fails"));
- } else if (res instanceof Array) {
- cb(res);
- } else if (res instanceof Error) {
- cb(res.message);
- }
- }
- if (res && res.then) {
- res.then(function () {
- return cb();
- }, function (e) {
- return cb(e);
- });
- }
- }, function (results) {
- complete(results);
- }, source);
- }
- }, {
- key: "getType",
- value: function getType(rule) {
- if (rule.type === undefined && rule.pattern instanceof RegExp) {
- rule.type = 'pattern';
- }
- if (typeof rule.validator !== 'function' && rule.type && !es_validator.hasOwnProperty(rule.type)) {
- throw new Error(format('Unknown rule type %s', rule.type));
- }
- return rule.type || 'string';
- }
- }, {
- key: "getValidationMethod",
- value: function getValidationMethod(rule) {
- if (typeof rule.validator === 'function') {
- return rule.validator;
- }
- var keys = Object.keys(rule);
- var messageIndex = keys.indexOf('message');
- if (messageIndex !== -1) {
- keys.splice(messageIndex, 1);
- }
- if (keys.length === 1 && keys[0] === 'required') {
- return es_validator.required;
- }
- return es_validator[this.getType(rule)] || undefined;
- }
- }]);
- return Schema;
- }();
- // ========================= Static =========================
- (0,defineProperty["default"])(Schema, "register", function register(type, validator) {
- if (typeof validator !== 'function') {
- throw new Error('Cannot register a validator by type, validator is not a function');
- }
- es_validator[type] = validator;
- });
- (0,defineProperty["default"])(Schema, "warning", util_warning);
- (0,defineProperty["default"])(Schema, "messages", messages_messages);
- (0,defineProperty["default"])(Schema, "validators", es_validator);
- /* harmony default export */ var async_validator_es = (Schema);
- ;// ./node_modules/rc-field-form/es/utils/messages.js
- var typeTemplate = "'${name}' is not a valid ${type}";
- var defaultValidateMessages = {
- default: "Validation error on field '${name}'",
- required: "'${name}' is required",
- enum: "'${name}' must be one of [${enum}]",
- whitespace: "'${name}' cannot be empty",
- date: {
- format: "'${name}' is invalid for format date",
- parse: "'${name}' could not be parsed as date",
- invalid: "'${name}' is invalid date"
- },
- types: {
- string: typeTemplate,
- method: typeTemplate,
- array: typeTemplate,
- object: typeTemplate,
- number: typeTemplate,
- date: typeTemplate,
- boolean: typeTemplate,
- integer: typeTemplate,
- float: typeTemplate,
- regexp: typeTemplate,
- email: typeTemplate,
- url: typeTemplate,
- hex: typeTemplate
- },
- string: {
- len: "'${name}' must be exactly ${len} characters",
- min: "'${name}' must be at least ${min} characters",
- max: "'${name}' cannot be longer than ${max} characters",
- range: "'${name}' must be between ${min} and ${max} characters"
- },
- number: {
- len: "'${name}' must equal ${len}",
- min: "'${name}' cannot be less than ${min}",
- max: "'${name}' cannot be greater than ${max}",
- range: "'${name}' must be between ${min} and ${max}"
- },
- array: {
- len: "'${name}' must be exactly ${len} in length",
- min: "'${name}' cannot be less than ${min} in length",
- max: "'${name}' cannot be greater than ${max} in length",
- range: "'${name}' must be between ${min} and ${max} in length"
- },
- pattern: {
- mismatch: "'${name}' does not match pattern ${pattern}"
- }
- };
- ;// ./node_modules/rc-field-form/es/utils/validateUtil.js
- // Remove incorrect original ts define
- var AsyncValidator = async_validator_es;
- /**
- * Replace with template.
- * `I'm ${name}` + { name: 'bamboo' } = I'm bamboo
- */
- function replaceMessage(template, kv) {
- return template.replace(/\\?\$\{\w+\}/g, function (str) {
- if (str.startsWith('\\')) {
- return str.slice(1);
- }
- var key = str.slice(2, -1);
- return kv[key];
- });
- }
- var CODE_LOGIC_ERROR = 'CODE_LOGIC_ERROR';
- function validateRule(_x, _x2, _x3, _x4, _x5) {
- return _validateRule.apply(this, arguments);
- }
- /**
- * We use `async-validator` to validate the value.
- * But only check one value in a time to avoid namePath validate issue.
- */
- function _validateRule() {
- _validateRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(name, value, rule, options, messageVariables) {
- var cloneRule, originValidator, subRuleField, validator, messages, result, subResults, kv, fillVariableResult;
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- cloneRule = (0,objectSpread2["default"])({}, rule); // Bug of `async-validator`
- // https://github.com/react-component/field-form/issues/316
- // https://github.com/react-component/field-form/issues/313
- delete cloneRule.ruleIndex;
- // https://github.com/ant-design/ant-design/issues/40497#issuecomment-1422282378
- AsyncValidator.warning = function () {
- return void 0;
- };
- if (cloneRule.validator) {
- originValidator = cloneRule.validator;
- cloneRule.validator = function () {
- try {
- return originValidator.apply(void 0, arguments);
- } catch (error) {
- console.error(error);
- return Promise.reject(CODE_LOGIC_ERROR);
- }
- };
- }
- // We should special handle array validate
- subRuleField = null;
- if (cloneRule && cloneRule.type === 'array' && cloneRule.defaultField) {
- subRuleField = cloneRule.defaultField;
- delete cloneRule.defaultField;
- }
- validator = new AsyncValidator((0,defineProperty["default"])({}, name, [cloneRule]));
- messages = (0,set.merge)(defaultValidateMessages, options.validateMessages);
- validator.messages(messages);
- result = [];
- _context2.prev = 10;
- _context2.next = 13;
- return Promise.resolve(validator.validate((0,defineProperty["default"])({}, name, value), (0,objectSpread2["default"])({}, options)));
- case 13:
- _context2.next = 18;
- break;
- case 15:
- _context2.prev = 15;
- _context2.t0 = _context2["catch"](10);
- if (_context2.t0.errors) {
- result = _context2.t0.errors.map(function (_ref4, index) {
- var message = _ref4.message;
- var mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mergedMessage) ?
- /*#__PURE__*/
- // Wrap ReactNode with `key`
- external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(mergedMessage, {
- key: "error_".concat(index)
- }) : mergedMessage;
- });
- }
- case 18:
- if (!(!result.length && subRuleField)) {
- _context2.next = 23;
- break;
- }
- _context2.next = 21;
- return Promise.all(value.map(function (subValue, i) {
- return validateRule("".concat(name, ".").concat(i), subValue, subRuleField, options, messageVariables);
- }));
- case 21:
- subResults = _context2.sent;
- return _context2.abrupt("return", subResults.reduce(function (prev, errors) {
- return [].concat((0,toConsumableArray["default"])(prev), (0,toConsumableArray["default"])(errors));
- }, []));
- case 23:
- // Replace message with variables
- kv = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, rule), {}, {
- name: name,
- enum: (rule.enum || []).join(', ')
- }, messageVariables);
- fillVariableResult = result.map(function (error) {
- if (typeof error === 'string') {
- return replaceMessage(error, kv);
- }
- return error;
- });
- return _context2.abrupt("return", fillVariableResult);
- case 26:
- case "end":
- return _context2.stop();
- }
- }, _callee2, null, [[10, 15]]);
- }));
- return _validateRule.apply(this, arguments);
- }
- function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {
- var name = namePath.join('.');
- // Fill rule with context
- var filledRules = rules.map(function (currentRule, ruleIndex) {
- var originValidatorFunc = currentRule.validator;
- var cloneRule = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, currentRule), {}, {
- ruleIndex: ruleIndex
- });
- // Replace validator if needed
- if (originValidatorFunc) {
- cloneRule.validator = function (rule, val, callback) {
- var hasPromise = false;
- // Wrap callback only accept when promise not provided
- var wrappedCallback = function wrappedCallback() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- // Wait a tick to make sure return type is a promise
- Promise.resolve().then(function () {
- (0,warning["default"])(!hasPromise, 'Your validator function has already return a promise. `callback` will be ignored.');
- if (!hasPromise) {
- callback.apply(void 0, args);
- }
- });
- };
- // Get promise
- var promise = originValidatorFunc(rule, val, wrappedCallback);
- hasPromise = promise && typeof promise.then === 'function' && typeof promise.catch === 'function';
- /**
- * 1. Use promise as the first priority.
- * 2. If promise not exist, use callback with warning instead
- */
- (0,warning["default"])(hasPromise, '`callback` is deprecated. Please return a promise instead.');
- if (hasPromise) {
- promise.then(function () {
- callback();
- }).catch(function (err) {
- callback(err || ' ');
- });
- }
- };
- }
- return cloneRule;
- }).sort(function (_ref, _ref2) {
- var w1 = _ref.warningOnly,
- i1 = _ref.ruleIndex;
- var w2 = _ref2.warningOnly,
- i2 = _ref2.ruleIndex;
- if (!!w1 === !!w2) {
- // Let keep origin order
- return i1 - i2;
- }
- if (w1) {
- return 1;
- }
- return -1;
- });
- // Do validate rules
- var summaryPromise;
- if (validateFirst === true) {
- // >>>>> Validate by serialization
- summaryPromise = new Promise( /*#__PURE__*/function () {
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
- var i, rule, errors;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- i = 0;
- case 1:
- if (!(i < filledRules.length)) {
- _context.next = 12;
- break;
- }
- rule = filledRules[i];
- _context.next = 5;
- return validateRule(name, value, rule, options, messageVariables);
- case 5:
- errors = _context.sent;
- if (!errors.length) {
- _context.next = 9;
- break;
- }
- reject([{
- errors: errors,
- rule: rule
- }]);
- return _context.abrupt("return");
- case 9:
- i += 1;
- _context.next = 1;
- break;
- case 12:
- /* eslint-enable */
- resolve([]);
- case 13:
- case "end":
- return _context.stop();
- }
- }, _callee);
- }));
- return function (_x6, _x7) {
- return _ref3.apply(this, arguments);
- };
- }());
- } else {
- // >>>>> Validate by parallel
- var rulePromises = filledRules.map(function (rule) {
- return validateRule(name, value, rule, options, messageVariables).then(function (errors) {
- return {
- errors: errors,
- rule: rule
- };
- });
- });
- summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function (errors) {
- // Always change to rejection for Field to catch
- return Promise.reject(errors);
- });
- }
- // Internal catch error to avoid console error log.
- summaryPromise.catch(function (e) {
- return e;
- });
- return summaryPromise;
- }
- function finishOnAllFailed(_x8) {
- return _finishOnAllFailed.apply(this, arguments);
- }
- function _finishOnAllFailed() {
- _finishOnAllFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(rulePromises) {
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
- while (1) switch (_context3.prev = _context3.next) {
- case 0:
- return _context3.abrupt("return", Promise.all(rulePromises).then(function (errorsList) {
- var _ref5;
- var errors = (_ref5 = []).concat.apply(_ref5, (0,toConsumableArray["default"])(errorsList));
- return errors;
- }));
- case 1:
- case "end":
- return _context3.stop();
- }
- }, _callee3);
- }));
- return _finishOnAllFailed.apply(this, arguments);
- }
- function finishOnFirstFailed(_x9) {
- return _finishOnFirstFailed.apply(this, arguments);
- }
- function _finishOnFirstFailed() {
- _finishOnFirstFailed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(rulePromises) {
- var count;
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
- while (1) switch (_context4.prev = _context4.next) {
- case 0:
- count = 0;
- return _context4.abrupt("return", new Promise(function (resolve) {
- rulePromises.forEach(function (promise) {
- promise.then(function (ruleError) {
- if (ruleError.errors.length) {
- resolve([ruleError]);
- }
- count += 1;
- if (count === rulePromises.length) {
- resolve([]);
- }
- });
- });
- }));
- case 2:
- case "end":
- return _context4.stop();
- }
- }, _callee4);
- }));
- return _finishOnFirstFailed.apply(this, arguments);
- }
- // EXTERNAL MODULE: ./node_modules/rc-util/es/utils/get.js
- var get = __webpack_require__("./node_modules/rc-util/es/utils/get.js");
- ;// ./node_modules/rc-field-form/es/utils/valueUtil.js
- /**
- * Convert name to internal supported format.
- * This function should keep since we still thinking if need support like `a.b.c` format.
- * 'a' => ['a']
- * 123 => [123]
- * ['a', 123] => ['a', 123]
- */
- function getNamePath(path) {
- return typeUtil_toArray(path);
- }
- function cloneByNamePathList(store, namePathList) {
- var newStore = {};
- namePathList.forEach(function (namePath) {
- var value = (0,get["default"])(store, namePath);
- newStore = (0,set["default"])(newStore, namePath, value);
- });
- return newStore;
- }
- /**
- * Check if `namePathList` includes `namePath`.
- * @param namePathList A list of `InternalNamePath[]`
- * @param namePath Compare `InternalNamePath`
- * @param partialMatch True will make `[a, b]` match `[a, b, c]`
- */
- function containsNamePath(namePathList, namePath) {
- var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- return namePathList && namePathList.some(function (path) {
- return matchNamePath(namePath, path, partialMatch);
- });
- }
- /**
- * Check if `namePath` is super set or equal of `subNamePath`.
- * @param namePath A list of `InternalNamePath[]`
- * @param subNamePath Compare `InternalNamePath`
- * @param partialMatch True will make `[a, b]` match `[a, b, c]`
- */
- function matchNamePath(namePath, subNamePath) {
- var partialMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- if (!namePath || !subNamePath) {
- return false;
- }
- if (!partialMatch && namePath.length !== subNamePath.length) {
- return false;
- }
- return subNamePath.every(function (nameUnit, i) {
- return namePath[i] === nameUnit;
- });
- }
- // Like `shallowEqual`, but we not check the data which may cause re-render
- function isSimilar(source, target) {
- if (source === target) {
- return true;
- }
- if (!source && target || source && !target) {
- return false;
- }
- if (!source || !target || (0,esm_typeof["default"])(source) !== 'object' || (0,esm_typeof["default"])(target) !== 'object') {
- return false;
- }
- var sourceKeys = Object.keys(source);
- var targetKeys = Object.keys(target);
- var keys = new Set([].concat(sourceKeys, targetKeys));
- return (0,toConsumableArray["default"])(keys).every(function (key) {
- var sourceValue = source[key];
- var targetValue = target[key];
- if (typeof sourceValue === 'function' && typeof targetValue === 'function') {
- return true;
- }
- return sourceValue === targetValue;
- });
- }
- function defaultGetValueFromEvent(valuePropName) {
- var event = arguments.length <= 1 ? undefined : arguments[1];
- if (event && event.target && (0,esm_typeof["default"])(event.target) === 'object' && valuePropName in event.target) {
- return event.target[valuePropName];
- }
- return event;
- }
- /**
- * Moves an array item from one position in an array to another.
- *
- * Note: This is a pure function so a new array will be returned, instead
- * of altering the array argument.
- *
- * @param array Array in which to move an item. (required)
- * @param moveIndex The index of the item to move. (required)
- * @param toIndex The index to move item at moveIndex to. (required)
- */
- function valueUtil_move(array, moveIndex, toIndex) {
- var length = array.length;
- if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) {
- return array;
- }
- var item = array[moveIndex];
- var diff = moveIndex - toIndex;
- if (diff > 0) {
- // move left
- return [].concat((0,toConsumableArray["default"])(array.slice(0, toIndex)), [item], (0,toConsumableArray["default"])(array.slice(toIndex, moveIndex)), (0,toConsumableArray["default"])(array.slice(moveIndex + 1, length)));
- }
- if (diff < 0) {
- // move right
- return [].concat((0,toConsumableArray["default"])(array.slice(0, moveIndex)), (0,toConsumableArray["default"])(array.slice(moveIndex + 1, toIndex + 1)), [item], (0,toConsumableArray["default"])(array.slice(toIndex + 1, length)));
- }
- return array;
- }
- ;// ./node_modules/rc-field-form/es/Field.js
- var Field_excluded = ["name"];
- var EMPTY_ERRORS = [];
- function requireUpdate(shouldUpdate, prev, next, prevValue, nextValue, info) {
- if (typeof shouldUpdate === 'function') {
- return shouldUpdate(prev, next, 'source' in info ? {
- source: info.source
- } : {});
- }
- return prevValue !== nextValue;
- }
- // eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style
- // We use Class instead of Hooks here since it will cost much code by using Hooks.
- var Field = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(Field, _React$Component);
- var _super = (0,createSuper["default"])(Field);
- // ============================== Subscriptions ==============================
- function Field(props) {
- var _this;
- (0,classCallCheck["default"])(this, Field);
- _this = _super.call(this, props);
- // Register on init
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "state", {
- resetCount: 0
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "cancelRegisterFunc", null);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "mounted", false);
- /**
- * Follow state should not management in State since it will async update by React.
- * This makes first render of form can not get correct state value.
- */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "touched", false);
- /**
- * Mark when touched & validated. Currently only used for `dependencies`.
- * Note that we do not think field with `initialValue` is dirty
- * but this will be by `isFieldDirty` func.
- */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "dirty", false);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "validatePromise", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "prevValidating", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "errors", EMPTY_ERRORS);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "warnings", EMPTY_ERRORS);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "cancelRegister", function () {
- var _this$props = _this.props,
- preserve = _this$props.preserve,
- isListField = _this$props.isListField,
- name = _this$props.name;
- if (_this.cancelRegisterFunc) {
- _this.cancelRegisterFunc(isListField, preserve, getNamePath(name));
- }
- _this.cancelRegisterFunc = null;
- });
- // ================================== Utils ==================================
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getNamePath", function () {
- var _this$props2 = _this.props,
- name = _this$props2.name,
- fieldContext = _this$props2.fieldContext;
- var _fieldContext$prefixN = fieldContext.prefixName,
- prefixName = _fieldContext$prefixN === void 0 ? [] : _fieldContext$prefixN;
- return name !== undefined ? [].concat((0,toConsumableArray["default"])(prefixName), (0,toConsumableArray["default"])(name)) : [];
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getRules", function () {
- var _this$props3 = _this.props,
- _this$props3$rules = _this$props3.rules,
- rules = _this$props3$rules === void 0 ? [] : _this$props3$rules,
- fieldContext = _this$props3.fieldContext;
- return rules.map(function (rule) {
- if (typeof rule === 'function') {
- return rule(fieldContext);
- }
- return rule;
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "refresh", function () {
- if (!_this.mounted) return;
- /**
- * Clean up current node.
- */
- _this.setState(function (_ref) {
- var resetCount = _ref.resetCount;
- return {
- resetCount: resetCount + 1
- };
- });
- });
- // Event should only trigger when meta changed
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "metaCache", null);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "triggerMetaEvent", function (destroy) {
- var onMetaChange = _this.props.onMetaChange;
- if (onMetaChange) {
- var _meta = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.getMeta()), {}, {
- destroy: destroy
- });
- if (!(0,isEqual["default"])(_this.metaCache, _meta)) {
- onMetaChange(_meta);
- }
- _this.metaCache = _meta;
- } else {
- _this.metaCache = null;
- }
- });
- // ========================= Field Entity Interfaces =========================
- // Trigger by store update. Check if need update the component
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onStoreChange", function (prevStore, namePathList, info) {
- var _this$props4 = _this.props,
- shouldUpdate = _this$props4.shouldUpdate,
- _this$props4$dependen = _this$props4.dependencies,
- dependencies = _this$props4$dependen === void 0 ? [] : _this$props4$dependen,
- onReset = _this$props4.onReset;
- var store = info.store;
- var namePath = _this.getNamePath();
- var prevValue = _this.getValue(prevStore);
- var curValue = _this.getValue(store);
- var namePathMatch = namePathList && containsNamePath(namePathList, namePath);
- // `setFieldsValue` is a quick access to update related status
- if (info.type === 'valueUpdate' && info.source === 'external' && !(0,isEqual["default"])(prevValue, curValue)) {
- _this.touched = true;
- _this.dirty = true;
- _this.validatePromise = null;
- _this.errors = EMPTY_ERRORS;
- _this.warnings = EMPTY_ERRORS;
- _this.triggerMetaEvent();
- }
- switch (info.type) {
- case 'reset':
- if (!namePathList || namePathMatch) {
- // Clean up state
- _this.touched = false;
- _this.dirty = false;
- _this.validatePromise = undefined;
- _this.errors = EMPTY_ERRORS;
- _this.warnings = EMPTY_ERRORS;
- _this.triggerMetaEvent();
- onReset === null || onReset === void 0 || onReset();
- _this.refresh();
- return;
- }
- break;
- /**
- * In case field with `preserve = false` nest deps like:
- * - A = 1 => show B
- * - B = 1 => show C
- * - Reset A, need clean B, C
- */
- case 'remove':
- {
- if (shouldUpdate && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
- _this.reRender();
- return;
- }
- break;
- }
- case 'setField':
- {
- var data = info.data;
- if (namePathMatch) {
- if ('touched' in data) {
- _this.touched = data.touched;
- }
- if ('validating' in data && !('originRCField' in data)) {
- _this.validatePromise = data.validating ? Promise.resolve([]) : null;
- }
- if ('errors' in data) {
- _this.errors = data.errors || EMPTY_ERRORS;
- }
- if ('warnings' in data) {
- _this.warnings = data.warnings || EMPTY_ERRORS;
- }
- _this.dirty = true;
- _this.triggerMetaEvent();
- _this.reRender();
- return;
- } else if ('value' in data && containsNamePath(namePathList, namePath, true)) {
- // Contains path with value should also check
- _this.reRender();
- return;
- }
- // Handle update by `setField` with `shouldUpdate`
- if (shouldUpdate && !namePath.length && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
- _this.reRender();
- return;
- }
- break;
- }
- case 'dependenciesUpdate':
- {
- /**
- * Trigger when marked `dependencies` updated. Related fields will all update
- */
- var dependencyList = dependencies.map(getNamePath);
- // No need for `namePathMath` check and `shouldUpdate` check, since `valueUpdate` will be
- // emitted earlier and they will work there
- // If set it may cause unnecessary twice rerendering
- if (dependencyList.some(function (dependency) {
- return containsNamePath(info.relatedFields, dependency);
- })) {
- _this.reRender();
- return;
- }
- break;
- }
- default:
- // 1. If `namePath` exists in `namePathList`, means it's related value and should update
- // For example <List name="list"><Field name={['list', 0]}></List>
- // If `namePathList` is [['list']] (List value update), Field should be updated
- // If `namePathList` is [['list', 0]] (Field value update), List shouldn't be updated
- // 2.
- // 2.1 If `dependencies` is set, `name` is not set and `shouldUpdate` is not set,
- // don't use `shouldUpdate`. `dependencies` is view as a shortcut if `shouldUpdate`
- // is not provided
- // 2.2 If `shouldUpdate` provided, use customize logic to update the field
- // else to check if value changed
- if (namePathMatch || (!dependencies.length || namePath.length || shouldUpdate) && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
- _this.reRender();
- return;
- }
- break;
- }
- if (shouldUpdate === true) {
- _this.reRender();
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "validateRules", function (options) {
- // We should fixed namePath & value to avoid developer change then by form function
- var namePath = _this.getNamePath();
- var currentValue = _this.getValue();
- var _ref2 = options || {},
- triggerName = _ref2.triggerName,
- _ref2$validateOnly = _ref2.validateOnly,
- validateOnly = _ref2$validateOnly === void 0 ? false : _ref2$validateOnly;
- // Force change to async to avoid rule OOD under renderProps field
- var rootPromise = Promise.resolve().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
- var _this$props5, _this$props5$validate, validateFirst, messageVariables, validateDebounce, filteredRules, promise;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- if (_this.mounted) {
- _context.next = 2;
- break;
- }
- return _context.abrupt("return", []);
- case 2:
- _this$props5 = _this.props, _this$props5$validate = _this$props5.validateFirst, validateFirst = _this$props5$validate === void 0 ? false : _this$props5$validate, messageVariables = _this$props5.messageVariables, validateDebounce = _this$props5.validateDebounce; // Start validate
- filteredRules = _this.getRules();
- if (triggerName) {
- filteredRules = filteredRules.filter(function (rule) {
- return rule;
- }).filter(function (rule) {
- var validateTrigger = rule.validateTrigger;
- if (!validateTrigger) {
- return true;
- }
- var triggerList = typeUtil_toArray(validateTrigger);
- return triggerList.includes(triggerName);
- });
- }
- // Wait for debounce. Skip if no `triggerName` since its from `validateFields / submit`
- if (!(validateDebounce && triggerName)) {
- _context.next = 10;
- break;
- }
- _context.next = 8;
- return new Promise(function (resolve) {
- setTimeout(resolve, validateDebounce);
- });
- case 8:
- if (!(_this.validatePromise !== rootPromise)) {
- _context.next = 10;
- break;
- }
- return _context.abrupt("return", []);
- case 10:
- promise = validateRules(namePath, currentValue, filteredRules, options, validateFirst, messageVariables);
- promise.catch(function (e) {
- return e;
- }).then(function () {
- var ruleErrors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EMPTY_ERRORS;
- if (_this.validatePromise === rootPromise) {
- var _ruleErrors$forEach;
- _this.validatePromise = null;
- // Get errors & warnings
- var nextErrors = [];
- var nextWarnings = [];
- (_ruleErrors$forEach = ruleErrors.forEach) === null || _ruleErrors$forEach === void 0 || _ruleErrors$forEach.call(ruleErrors, function (_ref4) {
- var warningOnly = _ref4.rule.warningOnly,
- _ref4$errors = _ref4.errors,
- errors = _ref4$errors === void 0 ? EMPTY_ERRORS : _ref4$errors;
- if (warningOnly) {
- nextWarnings.push.apply(nextWarnings, (0,toConsumableArray["default"])(errors));
- } else {
- nextErrors.push.apply(nextErrors, (0,toConsumableArray["default"])(errors));
- }
- });
- _this.errors = nextErrors;
- _this.warnings = nextWarnings;
- _this.triggerMetaEvent();
- _this.reRender();
- }
- });
- return _context.abrupt("return", promise);
- case 13:
- case "end":
- return _context.stop();
- }
- }, _callee);
- })));
- if (validateOnly) {
- return rootPromise;
- }
- _this.validatePromise = rootPromise;
- _this.dirty = true;
- _this.errors = EMPTY_ERRORS;
- _this.warnings = EMPTY_ERRORS;
- _this.triggerMetaEvent();
- // Force trigger re-render since we need sync renderProps with new meta
- _this.reRender();
- return rootPromise;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isFieldValidating", function () {
- return !!_this.validatePromise;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isFieldTouched", function () {
- return _this.touched;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isFieldDirty", function () {
- // Touched or validate or has initialValue
- if (_this.dirty || _this.props.initialValue !== undefined) {
- return true;
- }
- // Form set initialValue
- var fieldContext = _this.props.fieldContext;
- var _fieldContext$getInte = fieldContext.getInternalHooks(HOOK_MARK),
- getInitialValue = _fieldContext$getInte.getInitialValue;
- if (getInitialValue(_this.getNamePath()) !== undefined) {
- return true;
- }
- return false;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getErrors", function () {
- return _this.errors;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getWarnings", function () {
- return _this.warnings;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isListField", function () {
- return _this.props.isListField;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isList", function () {
- return _this.props.isList;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "isPreserve", function () {
- return _this.props.preserve;
- });
- // ============================= Child Component =============================
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getMeta", function () {
- // Make error & validating in cache to save perf
- _this.prevValidating = _this.isFieldValidating();
- var meta = {
- touched: _this.isFieldTouched(),
- validating: _this.prevValidating,
- errors: _this.errors,
- warnings: _this.warnings,
- name: _this.getNamePath(),
- validated: _this.validatePromise === null
- };
- return meta;
- });
- // Only return validate child node. If invalidate, will do nothing about field.
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getOnlyChild", function (children) {
- // Support render props
- if (typeof children === 'function') {
- var _meta2 = _this.getMeta();
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.getOnlyChild(children(_this.getControlled(), _meta2, _this.props.fieldContext))), {}, {
- isFunction: true
- });
- }
- // Filed element only
- var childList = (0,toArray["default"])(children);
- if (childList.length !== 1 || ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(childList[0])) {
- return {
- child: childList,
- isFunction: false
- };
- }
- return {
- child: childList[0],
- isFunction: false
- };
- });
- // ============================== Field Control ==============================
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getValue", function (store) {
- var getFieldsValue = _this.props.fieldContext.getFieldsValue;
- var namePath = _this.getNamePath();
- return (0,get["default"])(store || getFieldsValue(true), namePath);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getControlled", function () {
- var childProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _this$props6 = _this.props,
- name = _this$props6.name,
- trigger = _this$props6.trigger,
- validateTrigger = _this$props6.validateTrigger,
- getValueFromEvent = _this$props6.getValueFromEvent,
- normalize = _this$props6.normalize,
- valuePropName = _this$props6.valuePropName,
- getValueProps = _this$props6.getValueProps,
- fieldContext = _this$props6.fieldContext;
- var mergedValidateTrigger = validateTrigger !== undefined ? validateTrigger : fieldContext.validateTrigger;
- var namePath = _this.getNamePath();
- var getInternalHooks = fieldContext.getInternalHooks,
- getFieldsValue = fieldContext.getFieldsValue;
- var _getInternalHooks = getInternalHooks(HOOK_MARK),
- dispatch = _getInternalHooks.dispatch;
- var value = _this.getValue();
- var mergedGetValueProps = getValueProps || function (val) {
- return (0,defineProperty["default"])({}, valuePropName, val);
- };
- var originTriggerFunc = childProps[trigger];
- var valueProps = name !== undefined ? mergedGetValueProps(value) : {};
- // warning when prop value is function
- if ( true && valueProps) {
- Object.keys(valueProps).forEach(function (key) {
- (0,warning["default"])(typeof valueProps[key] !== 'function', "It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(key, ")"));
- });
- }
- var control = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, childProps), valueProps);
- // Add trigger
- control[trigger] = function () {
- // Mark as touched
- _this.touched = true;
- _this.dirty = true;
- _this.triggerMetaEvent();
- var newValue;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- if (getValueFromEvent) {
- newValue = getValueFromEvent.apply(void 0, args);
- } else {
- newValue = defaultGetValueFromEvent.apply(void 0, [valuePropName].concat(args));
- }
- if (normalize) {
- newValue = normalize(newValue, value, getFieldsValue(true));
- }
- if (newValue !== value) {
- dispatch({
- type: 'updateValue',
- namePath: namePath,
- value: newValue
- });
- }
- if (originTriggerFunc) {
- originTriggerFunc.apply(void 0, args);
- }
- };
- // Add validateTrigger
- var validateTriggerList = typeUtil_toArray(mergedValidateTrigger || []);
- validateTriggerList.forEach(function (triggerName) {
- // Wrap additional function of component, so that we can get latest value from store
- var originTrigger = control[triggerName];
- control[triggerName] = function () {
- if (originTrigger) {
- originTrigger.apply(void 0, arguments);
- }
- // Always use latest rules
- var rules = _this.props.rules;
- if (rules && rules.length) {
- // We dispatch validate to root,
- // since it will update related data with other field with same name
- dispatch({
- type: 'validateField',
- namePath: namePath,
- triggerName: triggerName
- });
- }
- };
- });
- return control;
- });
- if (props.fieldContext) {
- var getInternalHooks = props.fieldContext.getInternalHooks;
- var _getInternalHooks2 = getInternalHooks(HOOK_MARK),
- initEntityValue = _getInternalHooks2.initEntityValue;
- initEntityValue((0,assertThisInitialized["default"])(_this));
- }
- return _this;
- }
- (0,createClass["default"])(Field, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var _this$props7 = this.props,
- shouldUpdate = _this$props7.shouldUpdate,
- fieldContext = _this$props7.fieldContext;
- this.mounted = true;
- // Register on init
- if (fieldContext) {
- var getInternalHooks = fieldContext.getInternalHooks;
- var _getInternalHooks3 = getInternalHooks(HOOK_MARK),
- registerField = _getInternalHooks3.registerField;
- this.cancelRegisterFunc = registerField(this);
- }
- // One more render for component in case fields not ready
- if (shouldUpdate === true) {
- this.reRender();
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this.cancelRegister();
- this.triggerMetaEvent(true);
- this.mounted = false;
- }
- }, {
- key: "reRender",
- value: function reRender() {
- if (!this.mounted) return;
- this.forceUpdate();
- }
- }, {
- key: "render",
- value: function render() {
- var resetCount = this.state.resetCount;
- var children = this.props.children;
- var _this$getOnlyChild = this.getOnlyChild(children),
- child = _this$getOnlyChild.child,
- isFunction = _this$getOnlyChild.isFunction;
- // Not need to `cloneElement` since user can handle this in render function self
- var returnChildNode;
- if (isFunction) {
- returnChildNode = child;
- } else if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child)) {
- returnChildNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, this.getControlled(child.props));
- } else {
- (0,warning["default"])(!child, '`children` of Field is not validate ReactElement.');
- returnChildNode = child;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
- key: resetCount
- }, returnChildNode);
- }
- }]);
- return Field;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- (0,defineProperty["default"])(Field, "contextType", FieldContext);
- (0,defineProperty["default"])(Field, "defaultProps", {
- trigger: 'onChange',
- valuePropName: 'value'
- });
- function WrapperField(_ref6) {
- var _restProps$isListFiel;
- var name = _ref6.name,
- restProps = (0,objectWithoutProperties["default"])(_ref6, Field_excluded);
- var fieldContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FieldContext);
- var listContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_ListContext);
- var namePath = name !== undefined ? getNamePath(name) : undefined;
- var isMergedListField = (_restProps$isListFiel = restProps.isListField) !== null && _restProps$isListFiel !== void 0 ? _restProps$isListFiel : !!listContext;
- var key = 'keep';
- if (!isMergedListField) {
- key = "_".concat((namePath || []).join('_'));
- }
- // Warning if it's a directly list field.
- // We can still support multiple level field preserve.
- if ( true && restProps.preserve === false && isMergedListField && namePath.length <= 1) {
- (0,warning["default"])(false, '`preserve` should not apply on Form.List fields.');
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Field, (0,esm_extends["default"])({
- key: key,
- name: namePath,
- isListField: isMergedListField
- }, restProps, {
- fieldContext: fieldContext
- }));
- }
- /* harmony default export */ var es_Field = (WrapperField);
- ;// ./node_modules/rc-field-form/es/List.js
- function List(_ref) {
- var name = _ref.name,
- initialValue = _ref.initialValue,
- children = _ref.children,
- rules = _ref.rules,
- validateTrigger = _ref.validateTrigger,
- isListField = _ref.isListField;
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FieldContext);
- var wrapperListContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_ListContext);
- var keyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- keys: [],
- id: 0
- });
- var keyManager = keyRef.current;
- var prefixName = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var parentPrefixName = getNamePath(context.prefixName) || [];
- return [].concat((0,toConsumableArray["default"])(parentPrefixName), (0,toConsumableArray["default"])(getNamePath(name)));
- }, [context.prefixName, name]);
- var fieldContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, context), {}, {
- prefixName: prefixName
- });
- }, [context, prefixName]);
- // List context
- var listContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- getKey: function getKey(namePath) {
- var len = prefixName.length;
- var pathName = namePath[len];
- return [keyManager.keys[pathName], namePath.slice(len + 1)];
- }
- };
- }, [prefixName]);
- // User should not pass `children` as other type.
- if (typeof children !== 'function') {
- (0,warning["default"])(false, 'Form.List only accepts function as children.');
- return null;
- }
- var shouldUpdate = function shouldUpdate(prevValue, nextValue, _ref2) {
- var source = _ref2.source;
- if (source === 'internal') {
- return false;
- }
- return prevValue !== nextValue;
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ListContext.Provider, {
- value: listContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FieldContext.Provider, {
- value: fieldContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Field, {
- name: [],
- shouldUpdate: shouldUpdate,
- rules: rules,
- validateTrigger: validateTrigger,
- initialValue: initialValue,
- isList: true,
- isListField: isListField !== null && isListField !== void 0 ? isListField : !!wrapperListContext
- }, function (_ref3, meta) {
- var _ref3$value = _ref3.value,
- value = _ref3$value === void 0 ? [] : _ref3$value,
- onChange = _ref3.onChange;
- var getFieldValue = context.getFieldValue;
- var getNewValue = function getNewValue() {
- var values = getFieldValue(prefixName || []);
- return values || [];
- };
- /**
- * Always get latest value in case user update fields by `form` api.
- */
- var operations = {
- add: function add(defaultValue, index) {
- // Mapping keys
- var newValue = getNewValue();
- if (index >= 0 && index <= newValue.length) {
- keyManager.keys = [].concat((0,toConsumableArray["default"])(keyManager.keys.slice(0, index)), [keyManager.id], (0,toConsumableArray["default"])(keyManager.keys.slice(index)));
- onChange([].concat((0,toConsumableArray["default"])(newValue.slice(0, index)), [defaultValue], (0,toConsumableArray["default"])(newValue.slice(index))));
- } else {
- if ( true && (index < 0 || index > newValue.length)) {
- (0,warning["default"])(false, 'The second parameter of the add function should be a valid positive number.');
- }
- keyManager.keys = [].concat((0,toConsumableArray["default"])(keyManager.keys), [keyManager.id]);
- onChange([].concat((0,toConsumableArray["default"])(newValue), [defaultValue]));
- }
- keyManager.id += 1;
- },
- remove: function remove(index) {
- var newValue = getNewValue();
- var indexSet = new Set(Array.isArray(index) ? index : [index]);
- if (indexSet.size <= 0) {
- return;
- }
- keyManager.keys = keyManager.keys.filter(function (_, keysIndex) {
- return !indexSet.has(keysIndex);
- });
- // Trigger store change
- onChange(newValue.filter(function (_, valueIndex) {
- return !indexSet.has(valueIndex);
- }));
- },
- move: function move(from, to) {
- if (from === to) {
- return;
- }
- var newValue = getNewValue();
- // Do not handle out of range
- if (from < 0 || from >= newValue.length || to < 0 || to >= newValue.length) {
- return;
- }
- keyManager.keys = valueUtil_move(keyManager.keys, from, to);
- // Trigger store change
- onChange(valueUtil_move(newValue, from, to));
- }
- };
- var listValue = value || [];
- if (!Array.isArray(listValue)) {
- listValue = [];
- if (true) {
- (0,warning["default"])(false, "Current value of '".concat(prefixName.join(' > '), "' is not an array type."));
- }
- }
- return children(listValue.map(function (__, index) {
- var key = keyManager.keys[index];
- if (key === undefined) {
- keyManager.keys[index] = keyManager.id;
- key = keyManager.keys[index];
- keyManager.id += 1;
- }
- return {
- name: index,
- key: key,
- isListField: true
- };
- }), operations, meta);
- })));
- }
- /* harmony default export */ var es_List = (List);
- ;// ./node_modules/rc-field-form/es/utils/asyncUtil.js
- function allPromiseFinish(promiseList) {
- var hasError = false;
- var count = promiseList.length;
- var results = [];
- if (!promiseList.length) {
- return Promise.resolve([]);
- }
- return new Promise(function (resolve, reject) {
- promiseList.forEach(function (promise, index) {
- promise.catch(function (e) {
- hasError = true;
- return e;
- }).then(function (result) {
- count -= 1;
- results[index] = result;
- if (count > 0) {
- return;
- }
- if (hasError) {
- reject(results);
- }
- resolve(results);
- });
- });
- });
- }
- ;// ./node_modules/rc-field-form/es/utils/NameMap.js
- var SPLIT = '__@field_split__';
- /**
- * Convert name path into string to fast the fetch speed of Map.
- */
- function normalize(namePath) {
- return namePath.map(function (cell) {
- return "".concat((0,esm_typeof["default"])(cell), ":").concat(cell);
- })
- // Magic split
- .join(SPLIT);
- }
- /**
- * NameMap like a `Map` but accepts `string[]` as key.
- */
- var NameMap = /*#__PURE__*/function () {
- function NameMap() {
- (0,classCallCheck["default"])(this, NameMap);
- (0,defineProperty["default"])(this, "kvs", new Map());
- }
- (0,createClass["default"])(NameMap, [{
- key: "set",
- value: function set(key, value) {
- this.kvs.set(normalize(key), value);
- }
- }, {
- key: "get",
- value: function get(key) {
- return this.kvs.get(normalize(key));
- }
- }, {
- key: "update",
- value: function update(key, updater) {
- var origin = this.get(key);
- var next = updater(origin);
- if (!next) {
- this.delete(key);
- } else {
- this.set(key, next);
- }
- }
- }, {
- key: "delete",
- value: function _delete(key) {
- this.kvs.delete(normalize(key));
- }
- // Since we only use this in test, let simply realize this
- }, {
- key: "map",
- value: function map(callback) {
- return (0,toConsumableArray["default"])(this.kvs.entries()).map(function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
- var cells = key.split(SPLIT);
- return callback({
- key: cells.map(function (cell) {
- var _cell$match = cell.match(/^([^:]*):(.*)$/),
- _cell$match2 = (0,slicedToArray["default"])(_cell$match, 3),
- type = _cell$match2[1],
- unit = _cell$match2[2];
- return type === 'number' ? Number(unit) : unit;
- }),
- value: value
- });
- });
- }
- }, {
- key: "toJSON",
- value: function toJSON() {
- var json = {};
- this.map(function (_ref3) {
- var key = _ref3.key,
- value = _ref3.value;
- json[key.join('.')] = value;
- return null;
- });
- return json;
- }
- }]);
- return NameMap;
- }();
- /* harmony default export */ var utils_NameMap = (NameMap);
- ;// ./node_modules/rc-field-form/es/useForm.js
- var useForm_excluded = ["name"];
- var FormStore = /*#__PURE__*/(0,createClass["default"])(function FormStore(forceRootUpdate) {
- var _this = this;
- (0,classCallCheck["default"])(this, FormStore);
- (0,defineProperty["default"])(this, "formHooked", false);
- (0,defineProperty["default"])(this, "forceRootUpdate", void 0);
- (0,defineProperty["default"])(this, "subscribable", true);
- (0,defineProperty["default"])(this, "store", {});
- (0,defineProperty["default"])(this, "fieldEntities", []);
- (0,defineProperty["default"])(this, "initialValues", {});
- (0,defineProperty["default"])(this, "callbacks", {});
- (0,defineProperty["default"])(this, "validateMessages", null);
- (0,defineProperty["default"])(this, "preserve", null);
- (0,defineProperty["default"])(this, "lastValidatePromise", null);
- (0,defineProperty["default"])(this, "getForm", function () {
- return {
- getFieldValue: _this.getFieldValue,
- getFieldsValue: _this.getFieldsValue,
- getFieldError: _this.getFieldError,
- getFieldWarning: _this.getFieldWarning,
- getFieldsError: _this.getFieldsError,
- isFieldsTouched: _this.isFieldsTouched,
- isFieldTouched: _this.isFieldTouched,
- isFieldValidating: _this.isFieldValidating,
- isFieldsValidating: _this.isFieldsValidating,
- resetFields: _this.resetFields,
- setFields: _this.setFields,
- setFieldValue: _this.setFieldValue,
- setFieldsValue: _this.setFieldsValue,
- validateFields: _this.validateFields,
- submit: _this.submit,
- _init: true,
- getInternalHooks: _this.getInternalHooks
- };
- });
- // ======================== Internal Hooks ========================
- (0,defineProperty["default"])(this, "getInternalHooks", function (key) {
- if (key === HOOK_MARK) {
- _this.formHooked = true;
- return {
- dispatch: _this.dispatch,
- initEntityValue: _this.initEntityValue,
- registerField: _this.registerField,
- useSubscribe: _this.useSubscribe,
- setInitialValues: _this.setInitialValues,
- destroyForm: _this.destroyForm,
- setCallbacks: _this.setCallbacks,
- setValidateMessages: _this.setValidateMessages,
- getFields: _this.getFields,
- setPreserve: _this.setPreserve,
- getInitialValue: _this.getInitialValue,
- registerWatch: _this.registerWatch
- };
- }
- (0,warning["default"])(false, '`getInternalHooks` is internal usage. Should not call directly.');
- return null;
- });
- (0,defineProperty["default"])(this, "useSubscribe", function (subscribable) {
- _this.subscribable = subscribable;
- });
- /**
- * Record prev Form unmount fieldEntities which config preserve false.
- * This need to be refill with initialValues instead of store value.
- */
- (0,defineProperty["default"])(this, "prevWithoutPreserves", null);
- /**
- * First time `setInitialValues` should update store with initial value
- */
- (0,defineProperty["default"])(this, "setInitialValues", function (initialValues, init) {
- _this.initialValues = initialValues || {};
- if (init) {
- var _this$prevWithoutPres;
- var nextStore = (0,set.merge)(initialValues, _this.store);
- // We will take consider prev form unmount fields.
- // When the field is not `preserve`, we need fill this with initialValues instead of store.
- // eslint-disable-next-line array-callback-return
- (_this$prevWithoutPres = _this.prevWithoutPreserves) === null || _this$prevWithoutPres === void 0 || _this$prevWithoutPres.map(function (_ref) {
- var namePath = _ref.key;
- nextStore = (0,set["default"])(nextStore, namePath, (0,get["default"])(initialValues, namePath));
- });
- _this.prevWithoutPreserves = null;
- _this.updateStore(nextStore);
- }
- });
- (0,defineProperty["default"])(this, "destroyForm", function (clearOnDestroy) {
- if (clearOnDestroy) {
- // destroy form reset store
- _this.updateStore({});
- } else {
- // Fill preserve fields
- var prevWithoutPreserves = new utils_NameMap();
- _this.getFieldEntities(true).forEach(function (entity) {
- if (!_this.isMergedPreserve(entity.isPreserve())) {
- prevWithoutPreserves.set(entity.getNamePath(), true);
- }
- });
- _this.prevWithoutPreserves = prevWithoutPreserves;
- }
- });
- (0,defineProperty["default"])(this, "getInitialValue", function (namePath) {
- var initValue = (0,get["default"])(_this.initialValues, namePath);
- // Not cloneDeep when without `namePath`
- return namePath.length ? (0,set.merge)(initValue) : initValue;
- });
- (0,defineProperty["default"])(this, "setCallbacks", function (callbacks) {
- _this.callbacks = callbacks;
- });
- (0,defineProperty["default"])(this, "setValidateMessages", function (validateMessages) {
- _this.validateMessages = validateMessages;
- });
- (0,defineProperty["default"])(this, "setPreserve", function (preserve) {
- _this.preserve = preserve;
- });
- // ============================= Watch ============================
- (0,defineProperty["default"])(this, "watchList", []);
- (0,defineProperty["default"])(this, "registerWatch", function (callback) {
- _this.watchList.push(callback);
- return function () {
- _this.watchList = _this.watchList.filter(function (fn) {
- return fn !== callback;
- });
- };
- });
- (0,defineProperty["default"])(this, "notifyWatch", function () {
- var namePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- // No need to cost perf when nothing need to watch
- if (_this.watchList.length) {
- var values = _this.getFieldsValue();
- var allValues = _this.getFieldsValue(true);
- _this.watchList.forEach(function (callback) {
- callback(values, allValues, namePath);
- });
- }
- });
- // ========================== Dev Warning =========================
- (0,defineProperty["default"])(this, "timeoutId", null);
- (0,defineProperty["default"])(this, "warningUnhooked", function () {
- if ( true && !_this.timeoutId && typeof window !== 'undefined') {
- _this.timeoutId = setTimeout(function () {
- _this.timeoutId = null;
- if (!_this.formHooked) {
- (0,warning["default"])(false, 'Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?');
- }
- });
- }
- });
- // ============================ Store =============================
- (0,defineProperty["default"])(this, "updateStore", function (nextStore) {
- _this.store = nextStore;
- });
- // ============================ Fields ============================
- /**
- * Get registered field entities.
- * @param pure Only return field which has a `name`. Default: false
- */
- (0,defineProperty["default"])(this, "getFieldEntities", function () {
- var pure = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- if (!pure) {
- return _this.fieldEntities;
- }
- return _this.fieldEntities.filter(function (field) {
- return field.getNamePath().length;
- });
- });
- (0,defineProperty["default"])(this, "getFieldsMap", function () {
- var pure = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var cache = new utils_NameMap();
- _this.getFieldEntities(pure).forEach(function (field) {
- var namePath = field.getNamePath();
- cache.set(namePath, field);
- });
- return cache;
- });
- (0,defineProperty["default"])(this, "getFieldEntitiesForNamePathList", function (nameList) {
- if (!nameList) {
- return _this.getFieldEntities(true);
- }
- var cache = _this.getFieldsMap(true);
- return nameList.map(function (name) {
- var namePath = getNamePath(name);
- return cache.get(namePath) || {
- INVALIDATE_NAME_PATH: getNamePath(name)
- };
- });
- });
- (0,defineProperty["default"])(this, "getFieldsValue", function (nameList, filterFunc) {
- _this.warningUnhooked();
- // Fill args
- var mergedNameList;
- var mergedFilterFunc;
- var mergedStrict;
- if (nameList === true || Array.isArray(nameList)) {
- mergedNameList = nameList;
- mergedFilterFunc = filterFunc;
- } else if (nameList && (0,esm_typeof["default"])(nameList) === 'object') {
- mergedStrict = nameList.strict;
- mergedFilterFunc = nameList.filter;
- }
- if (mergedNameList === true && !mergedFilterFunc) {
- return _this.store;
- }
- var fieldEntities = _this.getFieldEntitiesForNamePathList(Array.isArray(mergedNameList) ? mergedNameList : null);
- var filteredNameList = [];
- fieldEntities.forEach(function (entity) {
- var _isListField, _ref3;
- var namePath = 'INVALIDATE_NAME_PATH' in entity ? entity.INVALIDATE_NAME_PATH : entity.getNamePath();
- // Ignore when it's a list item and not specific the namePath,
- // since parent field is already take in count
- if (mergedStrict) {
- var _isList, _ref2;
- if ((_isList = (_ref2 = entity).isList) !== null && _isList !== void 0 && _isList.call(_ref2)) {
- return;
- }
- } else if (!mergedNameList && (_isListField = (_ref3 = entity).isListField) !== null && _isListField !== void 0 && _isListField.call(_ref3)) {
- return;
- }
- if (!mergedFilterFunc) {
- filteredNameList.push(namePath);
- } else {
- var meta = 'getMeta' in entity ? entity.getMeta() : null;
- if (mergedFilterFunc(meta)) {
- filteredNameList.push(namePath);
- }
- }
- });
- return cloneByNamePathList(_this.store, filteredNameList.map(getNamePath));
- });
- (0,defineProperty["default"])(this, "getFieldValue", function (name) {
- _this.warningUnhooked();
- var namePath = getNamePath(name);
- return (0,get["default"])(_this.store, namePath);
- });
- (0,defineProperty["default"])(this, "getFieldsError", function (nameList) {
- _this.warningUnhooked();
- var fieldEntities = _this.getFieldEntitiesForNamePathList(nameList);
- return fieldEntities.map(function (entity, index) {
- if (entity && !('INVALIDATE_NAME_PATH' in entity)) {
- return {
- name: entity.getNamePath(),
- errors: entity.getErrors(),
- warnings: entity.getWarnings()
- };
- }
- return {
- name: getNamePath(nameList[index]),
- errors: [],
- warnings: []
- };
- });
- });
- (0,defineProperty["default"])(this, "getFieldError", function (name) {
- _this.warningUnhooked();
- var namePath = getNamePath(name);
- var fieldError = _this.getFieldsError([namePath])[0];
- return fieldError.errors;
- });
- (0,defineProperty["default"])(this, "getFieldWarning", function (name) {
- _this.warningUnhooked();
- var namePath = getNamePath(name);
- var fieldError = _this.getFieldsError([namePath])[0];
- return fieldError.warnings;
- });
- (0,defineProperty["default"])(this, "isFieldsTouched", function () {
- _this.warningUnhooked();
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var arg0 = args[0],
- arg1 = args[1];
- var namePathList;
- var isAllFieldsTouched = false;
- if (args.length === 0) {
- namePathList = null;
- } else if (args.length === 1) {
- if (Array.isArray(arg0)) {
- namePathList = arg0.map(getNamePath);
- isAllFieldsTouched = false;
- } else {
- namePathList = null;
- isAllFieldsTouched = arg0;
- }
- } else {
- namePathList = arg0.map(getNamePath);
- isAllFieldsTouched = arg1;
- }
- var fieldEntities = _this.getFieldEntities(true);
- var isFieldTouched = function isFieldTouched(field) {
- return field.isFieldTouched();
- };
- // ===== Will get fully compare when not config namePathList =====
- if (!namePathList) {
- return isAllFieldsTouched ? fieldEntities.every(function (entity) {
- return isFieldTouched(entity) || entity.isList();
- }) : fieldEntities.some(isFieldTouched);
- }
- // Generate a nest tree for validate
- var map = new utils_NameMap();
- namePathList.forEach(function (shortNamePath) {
- map.set(shortNamePath, []);
- });
- fieldEntities.forEach(function (field) {
- var fieldNamePath = field.getNamePath();
- // Find matched entity and put into list
- namePathList.forEach(function (shortNamePath) {
- if (shortNamePath.every(function (nameUnit, i) {
- return fieldNamePath[i] === nameUnit;
- })) {
- map.update(shortNamePath, function (list) {
- return [].concat((0,toConsumableArray["default"])(list), [field]);
- });
- }
- });
- });
- // Check if NameMap value is touched
- var isNamePathListTouched = function isNamePathListTouched(entities) {
- return entities.some(isFieldTouched);
- };
- var namePathListEntities = map.map(function (_ref4) {
- var value = _ref4.value;
- return value;
- });
- return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched);
- });
- (0,defineProperty["default"])(this, "isFieldTouched", function (name) {
- _this.warningUnhooked();
- return _this.isFieldsTouched([name]);
- });
- (0,defineProperty["default"])(this, "isFieldsValidating", function (nameList) {
- _this.warningUnhooked();
- var fieldEntities = _this.getFieldEntities();
- if (!nameList) {
- return fieldEntities.some(function (testField) {
- return testField.isFieldValidating();
- });
- }
- var namePathList = nameList.map(getNamePath);
- return fieldEntities.some(function (testField) {
- var fieldNamePath = testField.getNamePath();
- return containsNamePath(namePathList, fieldNamePath) && testField.isFieldValidating();
- });
- });
- (0,defineProperty["default"])(this, "isFieldValidating", function (name) {
- _this.warningUnhooked();
- return _this.isFieldsValidating([name]);
- });
- /**
- * Reset Field with field `initialValue` prop.
- * Can pass `entities` or `namePathList` or just nothing.
- */
- (0,defineProperty["default"])(this, "resetWithFieldInitialValue", function () {
- var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- // Create cache
- var cache = new utils_NameMap();
- var fieldEntities = _this.getFieldEntities(true);
- fieldEntities.forEach(function (field) {
- var initialValue = field.props.initialValue;
- var namePath = field.getNamePath();
- // Record only if has `initialValue`
- if (initialValue !== undefined) {
- var records = cache.get(namePath) || new Set();
- records.add({
- entity: field,
- value: initialValue
- });
- cache.set(namePath, records);
- }
- });
- // Reset
- var resetWithFields = function resetWithFields(entities) {
- entities.forEach(function (field) {
- var initialValue = field.props.initialValue;
- if (initialValue !== undefined) {
- var namePath = field.getNamePath();
- var formInitialValue = _this.getInitialValue(namePath);
- if (formInitialValue !== undefined) {
- // Warning if conflict with form initialValues and do not modify value
- (0,warning["default"])(false, "Form already set 'initialValues' with path '".concat(namePath.join('.'), "'. Field can not overwrite it."));
- } else {
- var records = cache.get(namePath);
- if (records && records.size > 1) {
- // Warning if multiple field set `initialValue`and do not modify value
- (0,warning["default"])(false, "Multiple Field with path '".concat(namePath.join('.'), "' set 'initialValue'. Can not decide which one to pick."));
- } else if (records) {
- var originValue = _this.getFieldValue(namePath);
- var isListField = field.isListField();
- // Set `initialValue`
- if (!isListField && (!info.skipExist || originValue === undefined)) {
- _this.updateStore((0,set["default"])(_this.store, namePath, (0,toConsumableArray["default"])(records)[0].value));
- }
- }
- }
- }
- });
- };
- var requiredFieldEntities;
- if (info.entities) {
- requiredFieldEntities = info.entities;
- } else if (info.namePathList) {
- requiredFieldEntities = [];
- info.namePathList.forEach(function (namePath) {
- var records = cache.get(namePath);
- if (records) {
- var _requiredFieldEntitie;
- (_requiredFieldEntitie = requiredFieldEntities).push.apply(_requiredFieldEntitie, (0,toConsumableArray["default"])((0,toConsumableArray["default"])(records).map(function (r) {
- return r.entity;
- })));
- }
- });
- } else {
- requiredFieldEntities = fieldEntities;
- }
- resetWithFields(requiredFieldEntities);
- });
- (0,defineProperty["default"])(this, "resetFields", function (nameList) {
- _this.warningUnhooked();
- var prevStore = _this.store;
- if (!nameList) {
- _this.updateStore((0,set.merge)(_this.initialValues));
- _this.resetWithFieldInitialValue();
- _this.notifyObservers(prevStore, null, {
- type: 'reset'
- });
- _this.notifyWatch();
- return;
- }
- // Reset by `nameList`
- var namePathList = nameList.map(getNamePath);
- namePathList.forEach(function (namePath) {
- var initialValue = _this.getInitialValue(namePath);
- _this.updateStore((0,set["default"])(_this.store, namePath, initialValue));
- });
- _this.resetWithFieldInitialValue({
- namePathList: namePathList
- });
- _this.notifyObservers(prevStore, namePathList, {
- type: 'reset'
- });
- _this.notifyWatch(namePathList);
- });
- (0,defineProperty["default"])(this, "setFields", function (fields) {
- _this.warningUnhooked();
- var prevStore = _this.store;
- var namePathList = [];
- fields.forEach(function (fieldData) {
- var name = fieldData.name,
- data = (0,objectWithoutProperties["default"])(fieldData, useForm_excluded);
- var namePath = getNamePath(name);
- namePathList.push(namePath);
- // Value
- if ('value' in data) {
- _this.updateStore((0,set["default"])(_this.store, namePath, data.value));
- }
- _this.notifyObservers(prevStore, [namePath], {
- type: 'setField',
- data: fieldData
- });
- });
- _this.notifyWatch(namePathList);
- });
- (0,defineProperty["default"])(this, "getFields", function () {
- var entities = _this.getFieldEntities(true);
- var fields = entities.map(function (field) {
- var namePath = field.getNamePath();
- var meta = field.getMeta();
- var fieldData = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, meta), {}, {
- name: namePath,
- value: _this.getFieldValue(namePath)
- });
- Object.defineProperty(fieldData, 'originRCField', {
- value: true
- });
- return fieldData;
- });
- return fields;
- });
- // =========================== Observer ===========================
- /**
- * This only trigger when a field is on constructor to avoid we get initialValue too late
- */
- (0,defineProperty["default"])(this, "initEntityValue", function (entity) {
- var initialValue = entity.props.initialValue;
- if (initialValue !== undefined) {
- var namePath = entity.getNamePath();
- var prevValue = (0,get["default"])(_this.store, namePath);
- if (prevValue === undefined) {
- _this.updateStore((0,set["default"])(_this.store, namePath, initialValue));
- }
- }
- });
- (0,defineProperty["default"])(this, "isMergedPreserve", function (fieldPreserve) {
- var mergedPreserve = fieldPreserve !== undefined ? fieldPreserve : _this.preserve;
- return mergedPreserve !== null && mergedPreserve !== void 0 ? mergedPreserve : true;
- });
- (0,defineProperty["default"])(this, "registerField", function (entity) {
- _this.fieldEntities.push(entity);
- var namePath = entity.getNamePath();
- _this.notifyWatch([namePath]);
- // Set initial values
- if (entity.props.initialValue !== undefined) {
- var prevStore = _this.store;
- _this.resetWithFieldInitialValue({
- entities: [entity],
- skipExist: true
- });
- _this.notifyObservers(prevStore, [entity.getNamePath()], {
- type: 'valueUpdate',
- source: 'internal'
- });
- }
- // un-register field callback
- return function (isListField, preserve) {
- var subNamePath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- _this.fieldEntities = _this.fieldEntities.filter(function (item) {
- return item !== entity;
- });
- // Clean up store value if not preserve
- if (!_this.isMergedPreserve(preserve) && (!isListField || subNamePath.length > 1)) {
- var defaultValue = isListField ? undefined : _this.getInitialValue(namePath);
- if (namePath.length && _this.getFieldValue(namePath) !== defaultValue && _this.fieldEntities.every(function (field) {
- return (
- // Only reset when no namePath exist
- !matchNamePath(field.getNamePath(), namePath)
- );
- })) {
- var _prevStore = _this.store;
- _this.updateStore((0,set["default"])(_prevStore, namePath, defaultValue, true));
- // Notify that field is unmount
- _this.notifyObservers(_prevStore, [namePath], {
- type: 'remove'
- });
- // Dependencies update
- _this.triggerDependenciesUpdate(_prevStore, namePath);
- }
- }
- _this.notifyWatch([namePath]);
- };
- });
- (0,defineProperty["default"])(this, "dispatch", function (action) {
- switch (action.type) {
- case 'updateValue':
- {
- var namePath = action.namePath,
- value = action.value;
- _this.updateValue(namePath, value);
- break;
- }
- case 'validateField':
- {
- var _namePath = action.namePath,
- triggerName = action.triggerName;
- _this.validateFields([_namePath], {
- triggerName: triggerName
- });
- break;
- }
- default:
- // Currently we don't have other action. Do nothing.
- }
- });
- (0,defineProperty["default"])(this, "notifyObservers", function (prevStore, namePathList, info) {
- if (_this.subscribable) {
- var mergedInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, info), {}, {
- store: _this.getFieldsValue(true)
- });
- _this.getFieldEntities().forEach(function (_ref5) {
- var onStoreChange = _ref5.onStoreChange;
- onStoreChange(prevStore, namePathList, mergedInfo);
- });
- } else {
- _this.forceRootUpdate();
- }
- });
- /**
- * Notify dependencies children with parent update
- * We need delay to trigger validate in case Field is under render props
- */
- (0,defineProperty["default"])(this, "triggerDependenciesUpdate", function (prevStore, namePath) {
- var childrenFields = _this.getDependencyChildrenFields(namePath);
- if (childrenFields.length) {
- _this.validateFields(childrenFields);
- }
- _this.notifyObservers(prevStore, childrenFields, {
- type: 'dependenciesUpdate',
- relatedFields: [namePath].concat((0,toConsumableArray["default"])(childrenFields))
- });
- return childrenFields;
- });
- (0,defineProperty["default"])(this, "updateValue", function (name, value) {
- var namePath = getNamePath(name);
- var prevStore = _this.store;
- _this.updateStore((0,set["default"])(_this.store, namePath, value));
- _this.notifyObservers(prevStore, [namePath], {
- type: 'valueUpdate',
- source: 'internal'
- });
- _this.notifyWatch([namePath]);
- // Dependencies update
- var childrenFields = _this.triggerDependenciesUpdate(prevStore, namePath);
- // trigger callback function
- var onValuesChange = _this.callbacks.onValuesChange;
- if (onValuesChange) {
- var changedValues = cloneByNamePathList(_this.store, [namePath]);
- onValuesChange(changedValues, _this.getFieldsValue());
- }
- _this.triggerOnFieldsChange([namePath].concat((0,toConsumableArray["default"])(childrenFields)));
- });
- // Let all child Field get update.
- (0,defineProperty["default"])(this, "setFieldsValue", function (store) {
- _this.warningUnhooked();
- var prevStore = _this.store;
- if (store) {
- var nextStore = (0,set.merge)(_this.store, store);
- _this.updateStore(nextStore);
- }
- _this.notifyObservers(prevStore, null, {
- type: 'valueUpdate',
- source: 'external'
- });
- _this.notifyWatch();
- });
- (0,defineProperty["default"])(this, "setFieldValue", function (name, value) {
- _this.setFields([{
- name: name,
- value: value,
- errors: [],
- warnings: []
- }]);
- });
- (0,defineProperty["default"])(this, "getDependencyChildrenFields", function (rootNamePath) {
- var children = new Set();
- var childrenFields = [];
- var dependencies2fields = new utils_NameMap();
- /**
- * Generate maps
- * Can use cache to save perf if user report performance issue with this
- */
- _this.getFieldEntities().forEach(function (field) {
- var dependencies = field.props.dependencies;
- (dependencies || []).forEach(function (dependency) {
- var dependencyNamePath = getNamePath(dependency);
- dependencies2fields.update(dependencyNamePath, function () {
- var fields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Set();
- fields.add(field);
- return fields;
- });
- });
- });
- var fillChildren = function fillChildren(namePath) {
- var fields = dependencies2fields.get(namePath) || new Set();
- fields.forEach(function (field) {
- if (!children.has(field)) {
- children.add(field);
- var fieldNamePath = field.getNamePath();
- if (field.isFieldDirty() && fieldNamePath.length) {
- childrenFields.push(fieldNamePath);
- fillChildren(fieldNamePath);
- }
- }
- });
- };
- fillChildren(rootNamePath);
- return childrenFields;
- });
- (0,defineProperty["default"])(this, "triggerOnFieldsChange", function (namePathList, filedErrors) {
- var onFieldsChange = _this.callbacks.onFieldsChange;
- if (onFieldsChange) {
- var fields = _this.getFields();
- /**
- * Fill errors since `fields` may be replaced by controlled fields
- */
- if (filedErrors) {
- var cache = new utils_NameMap();
- filedErrors.forEach(function (_ref6) {
- var name = _ref6.name,
- errors = _ref6.errors;
- cache.set(name, errors);
- });
- fields.forEach(function (field) {
- // eslint-disable-next-line no-param-reassign
- field.errors = cache.get(field.name) || field.errors;
- });
- }
- var changedFields = fields.filter(function (_ref7) {
- var fieldName = _ref7.name;
- return containsNamePath(namePathList, fieldName);
- });
- if (changedFields.length) {
- onFieldsChange(changedFields, fields);
- }
- }
- });
- // =========================== Validate ===========================
- (0,defineProperty["default"])(this, "validateFields", function (arg1, arg2) {
- _this.warningUnhooked();
- var nameList;
- var options;
- if (Array.isArray(arg1) || typeof arg1 === 'string' || typeof arg2 === 'string') {
- nameList = arg1;
- options = arg2;
- } else {
- options = arg1;
- }
- var provideNameList = !!nameList;
- var namePathList = provideNameList ? nameList.map(getNamePath) : [];
- // Collect result in promise list
- var promiseList = [];
- // We temp save the path which need trigger for `onFieldsChange`
- var TMP_SPLIT = String(Date.now());
- var validateNamePathList = new Set();
- var _ref8 = options || {},
- recursive = _ref8.recursive,
- dirty = _ref8.dirty;
- _this.getFieldEntities(true).forEach(function (field) {
- // Add field if not provide `nameList`
- if (!provideNameList) {
- namePathList.push(field.getNamePath());
- }
- // Skip if without rule
- if (!field.props.rules || !field.props.rules.length) {
- return;
- }
- // Skip if only validate dirty field
- if (dirty && !field.isFieldDirty()) {
- return;
- }
- var fieldNamePath = field.getNamePath();
- validateNamePathList.add(fieldNamePath.join(TMP_SPLIT));
- // Add field validate rule in to promise list
- if (!provideNameList || containsNamePath(namePathList, fieldNamePath, recursive)) {
- var promise = field.validateRules((0,objectSpread2["default"])({
- validateMessages: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, defaultValidateMessages), _this.validateMessages)
- }, options));
- // Wrap promise with field
- promiseList.push(promise.then(function () {
- return {
- name: fieldNamePath,
- errors: [],
- warnings: []
- };
- }).catch(function (ruleErrors) {
- var _ruleErrors$forEach;
- var mergedErrors = [];
- var mergedWarnings = [];
- (_ruleErrors$forEach = ruleErrors.forEach) === null || _ruleErrors$forEach === void 0 || _ruleErrors$forEach.call(ruleErrors, function (_ref9) {
- var warningOnly = _ref9.rule.warningOnly,
- errors = _ref9.errors;
- if (warningOnly) {
- mergedWarnings.push.apply(mergedWarnings, (0,toConsumableArray["default"])(errors));
- } else {
- mergedErrors.push.apply(mergedErrors, (0,toConsumableArray["default"])(errors));
- }
- });
- if (mergedErrors.length) {
- return Promise.reject({
- name: fieldNamePath,
- errors: mergedErrors,
- warnings: mergedWarnings
- });
- }
- return {
- name: fieldNamePath,
- errors: mergedErrors,
- warnings: mergedWarnings
- };
- }));
- }
- });
- var summaryPromise = allPromiseFinish(promiseList);
- _this.lastValidatePromise = summaryPromise;
- // Notify fields with rule that validate has finished and need update
- summaryPromise.catch(function (results) {
- return results;
- }).then(function (results) {
- var resultNamePathList = results.map(function (_ref10) {
- var name = _ref10.name;
- return name;
- });
- _this.notifyObservers(_this.store, resultNamePathList, {
- type: 'validateFinish'
- });
- _this.triggerOnFieldsChange(resultNamePathList, results);
- });
- var returnPromise = summaryPromise.then(function () {
- if (_this.lastValidatePromise === summaryPromise) {
- return Promise.resolve(_this.getFieldsValue(namePathList));
- }
- return Promise.reject([]);
- }).catch(function (results) {
- var errorList = results.filter(function (result) {
- return result && result.errors.length;
- });
- return Promise.reject({
- values: _this.getFieldsValue(namePathList),
- errorFields: errorList,
- outOfDate: _this.lastValidatePromise !== summaryPromise
- });
- });
- // Do not throw in console
- returnPromise.catch(function (e) {
- return e;
- });
- // `validating` changed. Trigger `onFieldsChange`
- var triggerNamePathList = namePathList.filter(function (namePath) {
- return validateNamePathList.has(namePath.join(TMP_SPLIT));
- });
- _this.triggerOnFieldsChange(triggerNamePathList);
- return returnPromise;
- });
- // ============================ Submit ============================
- (0,defineProperty["default"])(this, "submit", function () {
- _this.warningUnhooked();
- _this.validateFields().then(function (values) {
- var onFinish = _this.callbacks.onFinish;
- if (onFinish) {
- try {
- onFinish(values);
- } catch (err) {
- // Should print error if user `onFinish` callback failed
- console.error(err);
- }
- }
- }).catch(function (e) {
- var onFinishFailed = _this.callbacks.onFinishFailed;
- if (onFinishFailed) {
- onFinishFailed(e);
- }
- });
- });
- this.forceRootUpdate = forceRootUpdate;
- });
- function useForm(form) {
- var formRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- forceUpdate = _React$useState2[1];
- if (!formRef.current) {
- if (form) {
- formRef.current = form;
- } else {
- // Create a new FormStore if not provided
- var forceReRender = function forceReRender() {
- forceUpdate({});
- };
- var formStore = new FormStore(forceReRender);
- formRef.current = formStore.getForm();
- }
- }
- return [formRef.current];
- }
- /* harmony default export */ var es_useForm = (useForm);
- ;// ./node_modules/rc-field-form/es/FormContext.js
- var FormContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- triggerFormChange: function triggerFormChange() {},
- triggerFormFinish: function triggerFormFinish() {},
- registerForm: function registerForm() {},
- unregisterForm: function unregisterForm() {}
- });
- var FormProvider = function FormProvider(_ref) {
- var validateMessages = _ref.validateMessages,
- onFormChange = _ref.onFormChange,
- onFormFinish = _ref.onFormFinish,
- children = _ref.children;
- var formContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormContext);
- var formsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormContext.Provider, {
- value: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, formContext), {}, {
- validateMessages: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, formContext.validateMessages), validateMessages),
- // =========================================================
- // = Global Form Control =
- // =========================================================
- triggerFormChange: function triggerFormChange(name, changedFields) {
- if (onFormChange) {
- onFormChange(name, {
- changedFields: changedFields,
- forms: formsRef.current
- });
- }
- formContext.triggerFormChange(name, changedFields);
- },
- triggerFormFinish: function triggerFormFinish(name, values) {
- if (onFormFinish) {
- onFormFinish(name, {
- values: values,
- forms: formsRef.current
- });
- }
- formContext.triggerFormFinish(name, values);
- },
- registerForm: function registerForm(name, form) {
- if (name) {
- formsRef.current = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, formsRef.current), {}, (0,defineProperty["default"])({}, name, form));
- }
- formContext.registerForm(name, form);
- },
- unregisterForm: function unregisterForm(name) {
- var newForms = (0,objectSpread2["default"])({}, formsRef.current);
- delete newForms[name];
- formsRef.current = newForms;
- formContext.unregisterForm(name);
- }
- })
- }, children);
- };
- /* harmony default export */ var es_FormContext = (FormContext);
- ;// ./node_modules/rc-field-form/es/Form.js
- var Form_excluded = ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "clearOnDestroy"];
- var Form = function Form(_ref, ref) {
- var name = _ref.name,
- initialValues = _ref.initialValues,
- fields = _ref.fields,
- form = _ref.form,
- preserve = _ref.preserve,
- children = _ref.children,
- _ref$component = _ref.component,
- Component = _ref$component === void 0 ? 'form' : _ref$component,
- validateMessages = _ref.validateMessages,
- _ref$validateTrigger = _ref.validateTrigger,
- validateTrigger = _ref$validateTrigger === void 0 ? 'onChange' : _ref$validateTrigger,
- onValuesChange = _ref.onValuesChange,
- _onFieldsChange = _ref.onFieldsChange,
- _onFinish = _ref.onFinish,
- onFinishFailed = _ref.onFinishFailed,
- clearOnDestroy = _ref.clearOnDestroy,
- restProps = (0,objectWithoutProperties["default"])(_ref, Form_excluded);
- var nativeElementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var formContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_FormContext);
- // We customize handle event since Context will makes all the consumer re-render:
- // https://reactjs.org/docs/context.html#contextprovider
- var _useForm = es_useForm(form),
- _useForm2 = (0,slicedToArray["default"])(_useForm, 1),
- formInstance = _useForm2[0];
- var _getInternalHooks = formInstance.getInternalHooks(HOOK_MARK),
- useSubscribe = _getInternalHooks.useSubscribe,
- setInitialValues = _getInternalHooks.setInitialValues,
- setCallbacks = _getInternalHooks.setCallbacks,
- setValidateMessages = _getInternalHooks.setValidateMessages,
- setPreserve = _getInternalHooks.setPreserve,
- destroyForm = _getInternalHooks.destroyForm;
- // Pass ref with form instance
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, formInstance), {}, {
- nativeElement: nativeElementRef.current
- });
- });
- // Register form into Context
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- formContext.registerForm(name, formInstance);
- return function () {
- formContext.unregisterForm(name);
- };
- }, [formContext, formInstance, name]);
- // Pass props to store
- setValidateMessages((0,objectSpread2["default"])((0,objectSpread2["default"])({}, formContext.validateMessages), validateMessages));
- setCallbacks({
- onValuesChange: onValuesChange,
- onFieldsChange: function onFieldsChange(changedFields) {
- formContext.triggerFormChange(name, changedFields);
- if (_onFieldsChange) {
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- rest[_key - 1] = arguments[_key];
- }
- _onFieldsChange.apply(void 0, [changedFields].concat(rest));
- }
- },
- onFinish: function onFinish(values) {
- formContext.triggerFormFinish(name, values);
- if (_onFinish) {
- _onFinish(values);
- }
- },
- onFinishFailed: onFinishFailed
- });
- setPreserve(preserve);
- // Set initial value, init store value when first mount
- var mountRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- setInitialValues(initialValues, !mountRef.current);
- if (!mountRef.current) {
- mountRef.current = true;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- return destroyForm(clearOnDestroy);
- };
- },
- // eslint-disable-next-line react-hooks/exhaustive-deps
- []);
- // Prepare children by `children` type
- var childrenNode;
- var childrenRenderProps = typeof children === 'function';
- if (childrenRenderProps) {
- var _values = formInstance.getFieldsValue(true);
- childrenNode = children(_values, formInstance);
- } else {
- childrenNode = children;
- }
- // Not use subscribe when using render props
- useSubscribe(!childrenRenderProps);
- // Listen if fields provided. We use ref to save prev data here to avoid additional render
- var prevFieldsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!isSimilar(prevFieldsRef.current || [], fields || [])) {
- formInstance.setFields(fields || []);
- }
- prevFieldsRef.current = fields;
- }, [fields, formInstance]);
- var formContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, formInstance), {}, {
- validateTrigger: validateTrigger
- });
- }, [formInstance, validateTrigger]);
- var wrapperNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ListContext.Provider, {
- value: null
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FieldContext.Provider, {
- value: formContextValue
- }, childrenNode));
- if (Component === false) {
- return wrapperNode;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, restProps, {
- ref: nativeElementRef,
- onSubmit: function onSubmit(event) {
- event.preventDefault();
- event.stopPropagation();
- formInstance.submit();
- },
- onReset: function onReset(event) {
- var _restProps$onReset;
- event.preventDefault();
- formInstance.resetFields();
- (_restProps$onReset = restProps.onReset) === null || _restProps$onReset === void 0 || _restProps$onReset.call(restProps, event);
- }
- }), wrapperNode);
- };
- /* harmony default export */ var es_Form = (Form);
- ;// ./node_modules/rc-field-form/es/useWatch.js
- function stringify(value) {
- try {
- return JSON.stringify(value);
- } catch (err) {
- return Math.random();
- }
- }
- var useWatchWarning = true ? function (namePath) {
- var fullyStr = namePath.join('__RC_FIELD_FORM_SPLIT__');
- var nameStrRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(fullyStr);
- (0,warning["default"])(nameStrRef.current === fullyStr, '`useWatch` is not support dynamic `namePath`. Please provide static instead.');
- } : 0;
- // ------- selector type -------
- // ------- selector type end -------
- function useWatch() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var dependencies = args[0],
- _args$ = args[1],
- _form = _args$ === void 0 ? {} : _args$;
- var options = isFormInstance(_form) ? {
- form: _form
- } : _form;
- var form = options.form;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- value = _useState2[0],
- setValue = _useState2[1];
- var valueStr = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return stringify(value);
- }, [value]);
- var valueStrRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(valueStr);
- valueStrRef.current = valueStr;
- var fieldContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FieldContext);
- var formInstance = form || fieldContext;
- var isValidForm = formInstance && formInstance._init;
- // Warning if not exist form instance
- if (true) {
- (0,warning["default"])(args.length === 2 ? form ? isValidForm : true : isValidForm, 'useWatch requires a form instance since it can not auto detect from context.');
- }
- var namePath = getNamePath(dependencies);
- var namePathRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(namePath);
- namePathRef.current = namePath;
- useWatchWarning(namePath);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- // Skip if not exist form instance
- if (!isValidForm) {
- return;
- }
- var getFieldsValue = formInstance.getFieldsValue,
- getInternalHooks = formInstance.getInternalHooks;
- var _getInternalHooks = getInternalHooks(HOOK_MARK),
- registerWatch = _getInternalHooks.registerWatch;
- var getWatchValue = function getWatchValue(values, allValues) {
- var watchValue = options.preserve ? allValues : values;
- return typeof dependencies === 'function' ? dependencies(watchValue) : (0,get["default"])(watchValue, namePathRef.current);
- };
- var cancelRegister = registerWatch(function (values, allValues) {
- var newValue = getWatchValue(values, allValues);
- var nextValueStr = stringify(newValue);
- // Compare stringify in case it's nest object
- if (valueStrRef.current !== nextValueStr) {
- valueStrRef.current = nextValueStr;
- setValue(newValue);
- }
- });
- // TODO: We can improve this perf in future
- var initialValue = getWatchValue(getFieldsValue(), getFieldsValue(true));
- // React 18 has the bug that will queue update twice even the value is not changed
- // ref: https://github.com/facebook/react/issues/27213
- if (value !== initialValue) {
- setValue(initialValue);
- }
- return cancelRegister;
- },
- // We do not need re-register since namePath content is the same
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [isValidForm]);
- return value;
- }
- /* harmony default export */ var es_useWatch = (useWatch);
- ;// ./node_modules/rc-field-form/es/index.js
- var InternalForm = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(es_Form);
- var RefForm = InternalForm;
- RefForm.FormProvider = FormProvider;
- RefForm.Field = es_Field;
- RefForm.List = es_List;
- RefForm.useForm = es_useForm;
- RefForm.useWatch = es_useWatch;
- /* harmony default export */ var rc_field_form_es = (RefForm);
- ;// ./components/form/context.tsx
- const context_FormContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- labelAlign: 'right',
- layout: 'horizontal',
- itemRef: () => {}
- });
- const NoStyleItemContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- const context_FormProvider = props => {
- const providerProps = (0,omit["default"])(props, ['prefixCls']);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormProvider, Object.assign({}, providerProps));
- };
- const FormItemPrefixContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- prefixCls: ''
- });
- const FormItemInputContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- if (true) {
- FormItemInputContext.displayName = 'FormItemInputContext';
- }
- const NoFormStyle = ({
- children,
- status,
- override
- }) => {
- const formItemInputContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const newFormItemInputContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const newContext = Object.assign({}, formItemInputContext);
- if (override) {
- delete newContext.isFormItemInput;
- }
- if (status) {
- delete newContext.status;
- delete newContext.hasFeedback;
- delete newContext.feedbackIcon;
- }
- return newContext;
- }, [status, override, formItemInputContext]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemInputContext.Provider, {
- value: newFormItemInputContext
- }, children);
- };
- const VariantContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(undefined);
- ;// ./components/_util/ContextIsolator.tsx
- const ContextIsolator = props => {
- const {
- space,
- form,
- children
- } = props;
- if (children === undefined || children === null) {
- return null;
- }
- let result = children;
- if (form) {
- result = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(NoFormStyle, {
- override: true,
- status: true
- }, result);
- }
- if (space) {
- result = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(NoCompactStyle, null, result);
- }
- return result;
- };
- /* harmony default export */ var _util_ContextIsolator = (ContextIsolator);
- ;// ./components/_util/extendsObject.ts
- function mergeProps(...items) {
- const ret = {};
- items.forEach(item => {
- if (item) {
- Object.keys(item).forEach(key => {
- if (item[key] !== undefined) {
- ret[key] = item[key];
- }
- });
- }
- });
- return ret;
- }
- /* harmony default export */ var extendsObject = (mergeProps);
- ;// ./components/_util/hooks/useClosable.tsx
- function pickClosable(context) {
- if (!context) {
- return undefined;
- }
- const {
- closable,
- closeIcon
- } = context;
- return {
- closable,
- closeIcon
- };
- }
- /** Convert `closable` and `closeIcon` to config object */
- function useClosableConfig(closableCollection) {
- const {
- closable,
- closeIcon
- } = closableCollection || {};
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- if (
- // If `closable`, whatever rest be should be true
- !closable && (closable === false || closeIcon === false || closeIcon === null)) {
- return false;
- }
- if (closable === undefined && closeIcon === undefined) {
- return null;
- }
- let closableConfig = {
- closeIcon: typeof closeIcon !== 'boolean' && closeIcon !== null ? closeIcon : undefined
- };
- if (closable && typeof closable === 'object') {
- closableConfig = Object.assign(Object.assign({}, closableConfig), closable);
- }
- return closableConfig;
- }, [closable, closeIcon]);
- }
- /** Use same object to support `useMemo` optimization */
- const EmptyFallbackCloseCollection = {};
- function useClosable(propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection) {
- // Align the `props`, `context` `fallback` to config object first
- const propCloseConfig = useClosableConfig(propCloseCollection);
- const contextCloseConfig = useClosableConfig(contextCloseCollection);
- const [contextLocale] = (0,useLocale["default"])('global', en_US["default"].global);
- const closeBtnIsDisabled = typeof propCloseConfig !== 'boolean' ? !!(propCloseConfig === null || propCloseConfig === void 0 ? void 0 : propCloseConfig.disabled) : false;
- const mergedFallbackCloseCollection = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => Object.assign({
- closeIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_CloseOutlined, null)
- }, fallbackCloseCollection), [fallbackCloseCollection]);
- // Use fallback logic to fill the config
- const mergedClosableConfig = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- // ================ Props First ================
- // Skip if prop is disabled
- if (propCloseConfig === false) {
- return false;
- }
- if (propCloseConfig) {
- return extendsObject(mergedFallbackCloseCollection, contextCloseConfig, propCloseConfig);
- }
- // =============== Context Second ==============
- // Skip if context is disabled
- if (contextCloseConfig === false) {
- return false;
- }
- if (contextCloseConfig) {
- return extendsObject(mergedFallbackCloseCollection, contextCloseConfig);
- }
- // ============= Fallback Default ==============
- return !mergedFallbackCloseCollection.closable ? false : mergedFallbackCloseCollection;
- }, [propCloseConfig, contextCloseConfig, mergedFallbackCloseCollection]);
- // Calculate the final closeIcon
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- var _a, _b;
- if (mergedClosableConfig === false) {
- return [false, null, closeBtnIsDisabled, {}];
- }
- const {
- closeIconRender
- } = mergedFallbackCloseCollection;
- const {
- closeIcon
- } = mergedClosableConfig;
- let mergedCloseIcon = closeIcon;
- // Wrap the closeIcon with aria props
- const ariaOrDataProps = (0,pickAttrs["default"])(mergedClosableConfig, true);
- if (mergedCloseIcon !== null && mergedCloseIcon !== undefined) {
- // Wrap the closeIcon if needed
- if (closeIconRender) {
- mergedCloseIcon = closeIconRender(closeIcon);
- }
- mergedCloseIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(mergedCloseIcon) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(mergedCloseIcon, Object.assign(Object.assign(Object.assign({}, mergedCloseIcon.props), {
- 'aria-label': (_b = (_a = mergedCloseIcon.props) === null || _a === void 0 ? void 0 : _a['aria-label']) !== null && _b !== void 0 ? _b : contextLocale.close
- }), ariaOrDataProps))) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", Object.assign({
- "aria-label": contextLocale.close
- }, ariaOrDataProps), mergedCloseIcon));
- }
- return [true, mergedCloseIcon, closeBtnIsDisabled, ariaOrDataProps];
- }, [mergedClosableConfig, mergedFallbackCloseCollection]);
- }
- ;// ./node_modules/rc-util/es/Dom/styleChecker.js
- var isStyleNameSupport = function isStyleNameSupport(styleName) {
- if ((0,canUseDom["default"])() && window.document.documentElement) {
- var styleNameList = Array.isArray(styleName) ? styleName : [styleName];
- var documentElement = window.document.documentElement;
- return styleNameList.some(function (name) {
- return name in documentElement.style;
- });
- }
- return false;
- };
- var isStyleValueSupport = function isStyleValueSupport(styleName, value) {
- if (!isStyleNameSupport(styleName)) {
- return false;
- }
- var ele = document.createElement('div');
- var origin = ele.style[styleName];
- ele.style[styleName] = value;
- return ele.style[styleName] !== origin;
- };
- function isStyleSupport(styleName, styleValue) {
- if (!Array.isArray(styleName) && styleValue !== undefined) {
- return isStyleValueSupport(styleName, styleValue);
- }
- return isStyleNameSupport(styleName);
- }
- ;// ./components/_util/styleChecker.ts
- const canUseDocElement = () => (0,canUseDom["default"])() && window.document.documentElement;
- // EXTERNAL MODULE: ./components/_util/zindexContext.ts
- var zindexContext = __webpack_require__("./components/_util/zindexContext.ts");
- ;// ./components/skeleton/Element.tsx
- const Element_Element = props => {
- const {
- prefixCls,
- className,
- style,
- size,
- shape
- } = props;
- const sizeCls = classnames_default()({
- [`${prefixCls}-lg`]: size === 'large',
- [`${prefixCls}-sm`]: size === 'small'
- });
- const shapeCls = classnames_default()({
- [`${prefixCls}-circle`]: shape === 'circle',
- [`${prefixCls}-square`]: shape === 'square',
- [`${prefixCls}-round`]: shape === 'round'
- });
- const sizeStyle = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => typeof size === 'number' ? {
- width: size,
- height: size,
- lineHeight: `${size}px`
- } : {}, [size]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(prefixCls, sizeCls, shapeCls, className),
- style: Object.assign(Object.assign({}, sizeStyle), style)
- });
- };
- /* harmony default export */ var skeleton_Element = (Element_Element);
- // EXTERNAL MODULE: ./components/skeleton/style/index.ts
- var skeleton_style = __webpack_require__("./components/skeleton/style/index.ts");
- ;// ./components/skeleton/Avatar.tsx
- const SkeletonAvatar = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- active,
- shape = 'circle',
- size = 'default'
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- const otherProps = (0,omit["default"])(props, ['prefixCls', 'className']);
- const cls = classnames_default()(prefixCls, `${prefixCls}-element`, {
- [`${prefixCls}-active`]: active
- }, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Element, Object.assign({
- prefixCls: `${prefixCls}-avatar`,
- shape: shape,
- size: size
- }, otherProps))));
- };
- /* harmony default export */ var Avatar = (SkeletonAvatar);
- ;// ./components/skeleton/Button.tsx
- const SkeletonButton = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- active,
- block = false,
- size = 'default'
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- const otherProps = (0,omit["default"])(props, ['prefixCls']);
- const cls = classnames_default()(prefixCls, `${prefixCls}-element`, {
- [`${prefixCls}-active`]: active,
- [`${prefixCls}-block`]: block
- }, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Element, Object.assign({
- prefixCls: `${prefixCls}-button`,
- size: size
- }, otherProps))));
- };
- /* harmony default export */ var skeleton_Button = (SkeletonButton);
- ;// ./components/skeleton/Image.tsx
- const path = 'M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z';
- const SkeletonImage = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- active
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- const cls = classnames_default()(prefixCls, `${prefixCls}-element`, {
- [`${prefixCls}-active`]: active
- }, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-image`, className),
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- viewBox: "0 0 1098 1024",
- xmlns: "http://www.w3.org/2000/svg",
- className: `${prefixCls}-image-svg`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, "Image placeholder"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: path,
- className: `${prefixCls}-image-path`
- })))));
- };
- /* harmony default export */ var skeleton_Image = (SkeletonImage);
- ;// ./components/skeleton/Input.tsx
- const SkeletonInput = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- active,
- block,
- size = 'default'
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- const otherProps = (0,omit["default"])(props, ['prefixCls']);
- const cls = classnames_default()(prefixCls, `${prefixCls}-element`, {
- [`${prefixCls}-active`]: active,
- [`${prefixCls}-block`]: block
- }, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Element, Object.assign({
- prefixCls: `${prefixCls}-input`,
- size: size
- }, otherProps))));
- };
- /* harmony default export */ var Input = (SkeletonInput);
- ;// ./components/skeleton/Node.tsx
- const SkeletonNode = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- active,
- children
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- const cls = classnames_default()(prefixCls, `${prefixCls}-element`, {
- [`${prefixCls}-active`]: active
- }, hashId, className, rootClassName, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-image`, className),
- style: style
- }, children)));
- };
- /* harmony default export */ var Node = (SkeletonNode);
- ;// ./components/skeleton/Paragraph.tsx
- const getWidth = (index, props) => {
- const {
- width,
- rows = 2
- } = props;
- if (Array.isArray(width)) {
- return width[index];
- }
- // last paragraph
- if (rows - 1 === index) {
- return width;
- }
- return undefined;
- };
- const Paragraph = props => {
- const {
- prefixCls,
- className,
- style,
- rows = 0
- } = props;
- const rowList = Array.from({
- length: rows
- }).map((_, index) => (
- /*#__PURE__*/
- // eslint-disable-next-line react/no-array-index-key
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- key: index,
- style: {
- width: getWidth(index, props)
- }
- })));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: classnames_default()(prefixCls, className),
- style: style
- }, rowList);
- };
- /* harmony default export */ var skeleton_Paragraph = (Paragraph);
- ;// ./components/skeleton/Title.tsx
- /* eslint-disable jsx-a11y/heading-has-content */
- const Title = ({
- prefixCls,
- className,
- width,
- style
- }) => (
- /*#__PURE__*/
- // biome-ignore lint/a11y/useHeadingContent: HOC here
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("h3", {
- className: classnames_default()(prefixCls, className),
- style: Object.assign({
- width
- }, style)
- }));
- /* harmony default export */ var skeleton_Title = (Title);
- ;// ./components/skeleton/Skeleton.tsx
- function getComponentProps(prop) {
- if (prop && typeof prop === 'object') {
- return prop;
- }
- return {};
- }
- function getAvatarBasicProps(hasTitle, hasParagraph) {
- if (hasTitle && !hasParagraph) {
- // Square avatar
- return {
- size: 'large',
- shape: 'square'
- };
- }
- return {
- size: 'large',
- shape: 'circle'
- };
- }
- function getTitleBasicProps(hasAvatar, hasParagraph) {
- if (!hasAvatar && hasParagraph) {
- return {
- width: '38%'
- };
- }
- if (hasAvatar && hasParagraph) {
- return {
- width: '50%'
- };
- }
- return {};
- }
- function getParagraphBasicProps(hasAvatar, hasTitle) {
- const basicProps = {};
- // Width
- if (!hasAvatar || !hasTitle) {
- basicProps.width = '61%';
- }
- // Rows
- if (!hasAvatar && hasTitle) {
- basicProps.rows = 3;
- } else {
- basicProps.rows = 2;
- }
- return basicProps;
- }
- const Skeleton = props => {
- const {
- prefixCls: customizePrefixCls,
- loading,
- className,
- rootClassName,
- style,
- children,
- avatar = false,
- title = true,
- paragraph = true,
- active,
- round
- } = props;
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('skeleton');
- const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,skeleton_style["default"])(prefixCls);
- if (loading || !('loading' in props)) {
- const hasAvatar = !!avatar;
- const hasTitle = !!title;
- const hasParagraph = !!paragraph;
- // Avatar
- let avatarNode;
- if (hasAvatar) {
- const avatarProps = Object.assign(Object.assign({
- prefixCls: `${prefixCls}-avatar`
- }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));
- // We direct use SkeletonElement as avatar in skeleton internal.
- avatarNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-header`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Element, Object.assign({}, avatarProps)));
- }
- let contentNode;
- if (hasTitle || hasParagraph) {
- // Title
- let $title;
- if (hasTitle) {
- const titleProps = Object.assign(Object.assign({
- prefixCls: `${prefixCls}-title`
- }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));
- $title = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Title, Object.assign({}, titleProps));
- }
- // Paragraph
- let paragraphNode;
- if (hasParagraph) {
- const paragraphProps = Object.assign(Object.assign({
- prefixCls: `${prefixCls}-paragraph`
- }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));
- paragraphNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton_Paragraph, Object.assign({}, paragraphProps));
- }
- contentNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-content`
- }, $title, paragraphNode);
- }
- const cls = classnames_default()(prefixCls, {
- [`${prefixCls}-with-avatar`]: hasAvatar,
- [`${prefixCls}-active`]: active,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-round`]: round
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: Object.assign(Object.assign({}, contextStyle), style)
- }, avatarNode, contentNode));
- }
- return children !== null && children !== void 0 ? children : null;
- };
- Skeleton.Button = skeleton_Button;
- Skeleton.Avatar = Avatar;
- Skeleton.Input = Input;
- Skeleton.Image = skeleton_Image;
- Skeleton.Node = Node;
- if (true) {
- Skeleton.displayName = 'Skeleton';
- }
- /* harmony default export */ var skeleton_Skeleton = (Skeleton);
- ;// ./components/skeleton/index.tsx
- /* harmony default export */ var skeleton = (skeleton_Skeleton);
- ;// ./components/watermark/context.ts
- function voidFunc() {}
- const WatermarkContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- add: voidFunc,
- remove: voidFunc
- });
- function usePanelRef(panelSelector) {
- const watermark = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(WatermarkContext);
- const panelEleRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const panelRef = (0,useEvent["default"])(ele => {
- if (ele) {
- const innerContentEle = panelSelector ? ele.querySelector(panelSelector) : ele;
- watermark.add(innerContentEle);
- panelEleRef.current = innerContentEle;
- } else {
- watermark.remove(panelEleRef.current);
- }
- });
- return panelRef;
- }
- /* harmony default export */ var watermark_context = (WatermarkContext);
- ;// ./components/modal/components/NormalCancelBtn.tsx
- const NormalCancelBtn = () => {
- const {
- cancelButtonProps,
- cancelTextLocale,
- onCancel
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ModalContext);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_button, Object.assign({
- onClick: onCancel
- }, cancelButtonProps), cancelTextLocale);
- };
- /* harmony default export */ var components_NormalCancelBtn = (NormalCancelBtn);
- ;// ./components/modal/components/NormalOkBtn.tsx
- const NormalOkBtn = () => {
- const {
- confirmLoading,
- okButtonProps,
- okType,
- okTextLocale,
- onOk
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(ModalContext);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_button, Object.assign({}, convertLegacyProps(okType), {
- loading: confirmLoading,
- onClick: onOk
- }, okButtonProps), okTextLocale);
- };
- /* harmony default export */ var components_NormalOkBtn = (NormalOkBtn);
- ;// ./components/modal/shared.tsx
- function renderCloseIcon(prefixCls, closeIcon) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: `${prefixCls}-close-x`
- }, closeIcon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_CloseOutlined, {
- className: `${prefixCls}-close-icon`
- }));
- }
- const Footer = props => {
- const {
- okText,
- okType = 'primary',
- cancelText,
- confirmLoading,
- onOk,
- onCancel,
- okButtonProps,
- cancelButtonProps,
- footer
- } = props;
- const [locale] = (0,useLocale["default"])('Modal', getConfirmLocale());
- // ================== Locale Text ==================
- const okTextLocale = okText || (locale === null || locale === void 0 ? void 0 : locale.okText);
- const cancelTextLocale = cancelText || (locale === null || locale === void 0 ? void 0 : locale.cancelText);
- // ================= Context Value =================
- const btnCtxValue = {
- confirmLoading,
- okButtonProps,
- cancelButtonProps,
- okTextLocale,
- cancelTextLocale,
- okType,
- onOk,
- onCancel
- };
- const btnCtxValueMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => btnCtxValue, (0,toConsumableArray["default"])(Object.values(btnCtxValue)));
- let footerNode;
- if (typeof footer === 'function' || typeof footer === 'undefined') {
- footerNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_NormalCancelBtn, null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_NormalOkBtn, null));
- if (typeof footer === 'function') {
- footerNode = footer(footerNode, {
- OkBtn: components_NormalOkBtn,
- CancelBtn: components_NormalCancelBtn
- });
- }
- footerNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ModalContextProvider, {
- value: btnCtxValueMemo
- }, footerNode);
- } else {
- footerNode = footer;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(DisabledContextProvider, {
- disabled: false
- }, footerNode);
- };
- // EXTERNAL MODULE: ./components/modal/style/index.ts
- var modal_style = __webpack_require__("./components/modal/style/index.ts");
- ;// ./components/modal/Modal.tsx
- var Modal_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- let mousePosition;
- // ref: https://github.com/ant-design/ant-design/issues/15795
- const getClickPosition = e => {
- mousePosition = {
- x: e.pageX,
- y: e.pageY
- };
- // 100ms 内发生过点击事件,则从点击位置动画展示
- // 否则直接 zoom 展示
- // 这样可以兼容非点击方式展开
- setTimeout(() => {
- mousePosition = null;
- }, 100);
- };
- // 只有点击事件支持从鼠标位置动画展开
- if (canUseDocElement()) {
- document.documentElement.addEventListener('click', getClickPosition, true);
- }
- const Modal = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- open,
- wrapClassName,
- centered,
- getContainer,
- focusTriggerAfterClose = true,
- style,
- // Deprecated
- visible,
- width = 520,
- footer,
- classNames: modalClassNames,
- styles: modalStyles,
- children,
- loading,
- confirmLoading,
- zIndex: customizeZIndex,
- mousePosition: customizeMousePosition,
- onOk,
- onCancel,
- destroyOnHidden,
- destroyOnClose,
- panelRef = null
- } = props,
- restProps = Modal_rest(props, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading", "confirmLoading", "zIndex", "mousePosition", "onOk", "onCancel", "destroyOnHidden", "destroyOnClose", "panelRef"]);
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- direction,
- modal: modalContext
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const handleCancel = e => {
- if (confirmLoading) {
- return;
- }
- onCancel === null || onCancel === void 0 ? void 0 : onCancel(e);
- };
- const handleOk = e => {
- onOk === null || onOk === void 0 ? void 0 : onOk(e);
- };
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Modal');
- [['visible', 'open'], ['bodyStyle', 'styles.body'], ['maskStyle', 'styles.mask'], ['destroyOnClose', 'destroyOnHidden']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- const prefixCls = getPrefixCls('modal', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,modal_style["default"])(prefixCls, rootCls);
- const wrapClassNameExtended = classnames_default()(wrapClassName, {
- [`${prefixCls}-centered`]: centered !== null && centered !== void 0 ? centered : modalContext === null || modalContext === void 0 ? void 0 : modalContext.centered,
- [`${prefixCls}-wrap-rtl`]: direction === 'rtl'
- });
- const dialogFooter = footer !== null && !loading ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Footer, Object.assign({}, props, {
- onOk: handleOk,
- onCancel: handleCancel
- }))) : null;
- const [mergedClosable, mergedCloseIcon, closeBtnIsDisabled, ariaProps] = useClosable(pickClosable(props), pickClosable(modalContext), {
- closable: true,
- closeIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, {
- className: `${prefixCls}-close-icon`
- }),
- closeIconRender: icon => renderCloseIcon(prefixCls, icon)
- });
- // ============================ Refs ============================
- // Select `ant-modal-content` by `panelRef`
- const innerPanelRef = usePanelRef(`.${prefixCls}-content`);
- const mergedPanelRef = (0,es_ref.composeRef)(panelRef, innerPanelRef);
- // ============================ zIndex ============================
- const [zIndex, contextZIndex] = (0,useZIndex.useZIndex)('Modal', customizeZIndex);
- // =========================== Width ============================
- const [numWidth, responsiveWidth] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (width && typeof width === 'object') {
- return [undefined, width];
- }
- return [width, undefined];
- }, [width]);
- const responsiveWidthVars = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const vars = {};
- if (responsiveWidth) {
- Object.keys(responsiveWidth).forEach(breakpoint => {
- const breakpointWidth = responsiveWidth[breakpoint];
- if (breakpointWidth !== undefined) {
- vars[`--${prefixCls}-${breakpoint}-width`] = typeof breakpointWidth === 'number' ? `${breakpointWidth}px` : breakpointWidth;
- }
- });
- }
- return vars;
- }, [responsiveWidth]);
- // =========================== Render ===========================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(zindexContext["default"].Provider, {
- value: contextZIndex
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_dialog_es, Object.assign({
- width: numWidth
- }, restProps, {
- zIndex: zIndex,
- getContainer: getContainer === undefined ? getContextPopupContainer : getContainer,
- prefixCls: prefixCls,
- rootClassName: classnames_default()(hashId, rootClassName, cssVarCls, rootCls),
- footer: dialogFooter,
- visible: open !== null && open !== void 0 ? open : visible,
- mousePosition: customizeMousePosition !== null && customizeMousePosition !== void 0 ? customizeMousePosition : mousePosition,
- onClose: handleCancel,
- closable: mergedClosable ? Object.assign({
- disabled: closeBtnIsDisabled,
- closeIcon: mergedCloseIcon
- }, ariaProps) : mergedClosable,
- closeIcon: mergedCloseIcon,
- focusTriggerAfterClose: focusTriggerAfterClose,
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'zoom', props.transitionName),
- maskTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'fade', props.maskTransitionName),
- className: classnames_default()(hashId, className, modalContext === null || modalContext === void 0 ? void 0 : modalContext.className),
- style: Object.assign(Object.assign(Object.assign({}, modalContext === null || modalContext === void 0 ? void 0 : modalContext.style), style), responsiveWidthVars),
- classNames: Object.assign(Object.assign(Object.assign({}, modalContext === null || modalContext === void 0 ? void 0 : modalContext.classNames), modalClassNames), {
- wrapper: classnames_default()(wrapClassNameExtended, modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.wrapper)
- }),
- styles: Object.assign(Object.assign({}, modalContext === null || modalContext === void 0 ? void 0 : modalContext.styles), modalStyles),
- panelRef: mergedPanelRef,
- // TODO: In the future, destroyOnClose in rc-dialog needs to be upgrade to destroyOnHidden
- destroyOnClose: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyOnClose
- }), loading ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton, {
- active: true,
- title: false,
- paragraph: {
- rows: 4
- },
- className: `${prefixCls}-body-skeleton`
- })) : children))));
- };
- /* harmony default export */ var modal_Modal = (Modal);
- // EXTERNAL MODULE: ./components/style/index.tsx
- var components_style = __webpack_require__("./components/style/index.tsx");
- ;// ./components/modal/style/confirm.ts
- // Style as confirm component
- // ============================= Confirm ==============================
- const genModalConfirmStyle = token => {
- const {
- componentCls,
- titleFontSize,
- titleLineHeight,
- modalConfirmIconSize,
- fontSize,
- lineHeight,
- modalTitleHeight,
- fontHeight,
- confirmBodyPadding
- } = token;
- const confirmComponentCls = `${componentCls}-confirm`;
- return {
- [confirmComponentCls]: {
- '&-rtl': {
- direction: 'rtl'
- },
- [`${token.antCls}-modal-header`]: {
- display: 'none'
- },
- [`${confirmComponentCls}-body-wrapper`]: Object.assign({}, (0,components_style.clearFix)()),
- [`&${componentCls} ${componentCls}-body`]: {
- padding: confirmBodyPadding
- },
- // ====================== Body ======================
- [`${confirmComponentCls}-body`]: {
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'start',
- [`> ${token.iconCls}`]: {
- flex: 'none',
- fontSize: modalConfirmIconSize,
- marginInlineEnd: token.confirmIconMarginInlineEnd,
- marginTop: token.calc(token.calc(fontHeight).sub(modalConfirmIconSize).equal()).div(2).equal()
- },
- [`&-has-title > ${token.iconCls}`]: {
- marginTop: token.calc(token.calc(modalTitleHeight).sub(modalConfirmIconSize).equal()).div(2).equal()
- }
- },
- [`${confirmComponentCls}-paragraph`]: {
- display: 'flex',
- flexDirection: 'column',
- flex: 'auto',
- rowGap: token.marginXS,
- // https://github.com/ant-design/ant-design/issues/51912
- maxWidth: `calc(100% - ${(0,cssinjs.unit)(token.marginSM)})`
- },
- // https://github.com/ant-design/ant-design/issues/48159
- [`${token.iconCls} + ${confirmComponentCls}-paragraph`]: {
- maxWidth: `calc(100% - ${(0,cssinjs.unit)(token.calc(token.modalConfirmIconSize).add(token.marginSM).equal())})`
- },
- [`${confirmComponentCls}-title`]: {
- color: token.colorTextHeading,
- fontWeight: token.fontWeightStrong,
- fontSize: titleFontSize,
- lineHeight: titleLineHeight
- },
- [`${confirmComponentCls}-content`]: {
- color: token.colorText,
- fontSize,
- lineHeight
- },
- // ===================== Footer =====================
- [`${confirmComponentCls}-btns`]: {
- textAlign: 'end',
- marginTop: token.confirmBtnsMarginTop,
- [`${token.antCls}-btn + ${token.antCls}-btn`]: {
- marginBottom: 0,
- marginInlineStart: token.marginXS
- }
- }
- },
- [`${confirmComponentCls}-error ${confirmComponentCls}-body > ${token.iconCls}`]: {
- color: token.colorError
- },
- [`${confirmComponentCls}-warning ${confirmComponentCls}-body > ${token.iconCls},
- ${confirmComponentCls}-confirm ${confirmComponentCls}-body > ${token.iconCls}`]: {
- color: token.colorWarning
- },
- [`${confirmComponentCls}-info ${confirmComponentCls}-body > ${token.iconCls}`]: {
- color: token.colorInfo
- },
- [`${confirmComponentCls}-success ${confirmComponentCls}-body > ${token.iconCls}`]: {
- color: token.colorSuccess
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var style_confirm = ((0,genStyleUtils.genSubStyleComponent)(['Modal', 'confirm'], token => {
- const modalToken = (0,modal_style.prepareToken)(token);
- return genModalConfirmStyle(modalToken);
- }, modal_style.prepareComponentToken, {
- // confirm is weak than modal since no conflict here
- order: -1000
- }));
- ;// ./components/modal/ConfirmDialog.tsx
- var ConfirmDialog_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function ConfirmContent(props) {
- const {
- prefixCls,
- icon,
- okText,
- cancelText,
- confirmPrefixCls,
- type,
- okCancel,
- footer,
- // Legacy for static function usage
- locale: staticLocale
- } = props,
- resetProps = ConfirmDialog_rest(props, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Modal');
- true ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : 0;
- }
- // Icon
- let mergedIcon = icon;
- // 支持传入{ icon: null }来隐藏`Modal.confirm`默认的Icon
- if (!icon && icon !== null) {
- switch (type) {
- case 'info':
- mergedIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_InfoCircleFilled, null);
- break;
- case 'success':
- mergedIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckCircleFilled, null);
- break;
- case 'error':
- mergedIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseCircleFilled, null);
- break;
- default:
- mergedIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ExclamationCircleFilled, null);
- }
- }
- // 默认为 true,保持向下兼容
- const mergedOkCancel = okCancel !== null && okCancel !== void 0 ? okCancel : type === 'confirm';
- const autoFocusButton = props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';
- const [locale] = (0,useLocale["default"])('Modal');
- const mergedLocale = staticLocale || locale;
- // ================== Locale Text ==================
- const okTextLocale = okText || (mergedOkCancel ? mergedLocale === null || mergedLocale === void 0 ? void 0 : mergedLocale.okText : mergedLocale === null || mergedLocale === void 0 ? void 0 : mergedLocale.justOkText);
- const cancelTextLocale = cancelText || (mergedLocale === null || mergedLocale === void 0 ? void 0 : mergedLocale.cancelText);
- // ================= Context Value =================
- const btnCtxValue = Object.assign({
- autoFocusButton,
- cancelTextLocale,
- okTextLocale,
- mergedOkCancel
- }, resetProps);
- const btnCtxValueMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => btnCtxValue, (0,toConsumableArray["default"])(Object.values(btnCtxValue)));
- // ====================== Footer Origin Node ======================
- const footerOriginNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_ConfirmCancelBtn, null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_ConfirmOkBtn, null));
- const hasTitle = props.title !== undefined && props.title !== null;
- const bodyCls = `${confirmPrefixCls}-body`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${confirmPrefixCls}-body-wrapper`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(bodyCls, {
- [`${bodyCls}-has-title`]: hasTitle
- })
- }, mergedIcon, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${confirmPrefixCls}-paragraph`
- }, hasTitle && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${confirmPrefixCls}-title`
- }, props.title), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${confirmPrefixCls}-content`
- }, props.content))), footer === undefined || typeof footer === 'function' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ModalContextProvider, {
- value: btnCtxValueMemo
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${confirmPrefixCls}-btns`
- }, typeof footer === 'function' ? footer(footerOriginNode, {
- OkBtn: components_ConfirmOkBtn,
- CancelBtn: components_ConfirmCancelBtn
- }) : footerOriginNode))) : footer, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(style_confirm, {
- prefixCls: prefixCls
- }));
- }
- const ConfirmDialog = props => {
- const {
- close,
- zIndex,
- maskStyle,
- direction,
- prefixCls,
- wrapClassName,
- rootPrefixCls,
- bodyStyle,
- closable = false,
- onConfirm,
- styles
- } = props;
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Modal');
- [['visible', 'open'], ['bodyStyle', 'styles.body'], ['maskStyle', 'styles.mask']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- const confirmPrefixCls = `${prefixCls}-confirm`;
- const width = props.width || 416;
- const style = props.style || {};
- const mask = props.mask === undefined ? true : props.mask;
- // 默认为 false,保持旧版默认行为
- const maskClosable = props.maskClosable === undefined ? false : props.maskClosable;
- const classString = classnames_default()(confirmPrefixCls, `${confirmPrefixCls}-${props.type}`, {
- [`${confirmPrefixCls}-rtl`]: direction === 'rtl'
- }, props.className);
- // ========================= zIndex =========================
- const [, token] = (0,useToken["default"])();
- const mergedZIndex = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (zIndex !== undefined) {
- return zIndex;
- }
- // Static always use max zIndex
- return token.zIndexPopupBase + useZIndex.CONTAINER_MAX_OFFSET;
- }, [zIndex, token]);
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(modal_Modal, Object.assign({}, props, {
- className: classString,
- wrapClassName: classnames_default()({
- [`${confirmPrefixCls}-centered`]: !!props.centered
- }, wrapClassName),
- onCancel: () => {
- close === null || close === void 0 ? void 0 : close({
- triggerCancel: true
- });
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(false);
- },
- title: "",
- footer: null,
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls || '', 'zoom', props.transitionName),
- maskTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls || '', 'fade', props.maskTransitionName),
- mask: mask,
- maskClosable: maskClosable,
- style: style,
- styles: Object.assign({
- body: bodyStyle,
- mask: maskStyle
- }, styles),
- width: width,
- zIndex: mergedZIndex,
- closable: closable
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ConfirmContent, Object.assign({}, props, {
- confirmPrefixCls: confirmPrefixCls
- })));
- };
- const ConfirmDialogWrapper = props => {
- const {
- rootPrefixCls,
- iconPrefixCls,
- direction,
- theme
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider, {
- prefixCls: rootPrefixCls,
- iconPrefixCls: iconPrefixCls,
- direction: direction,
- theme: theme
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ConfirmDialog, Object.assign({}, props)));
- };
- if (true) {
- ConfirmDialog.displayName = 'ConfirmDialog';
- ConfirmDialogWrapper.displayName = 'ConfirmDialogWrapper';
- }
- /* harmony default export */ var modal_ConfirmDialog = (ConfirmDialogWrapper);
- ;// ./components/modal/destroyFns.ts
- const destroyFns = [];
- /* harmony default export */ var modal_destroyFns = (destroyFns);
- ;// ./components/modal/confirm.tsx
- let defaultRootPrefixCls = '';
- function getRootPrefixCls() {
- return defaultRootPrefixCls;
- }
- const confirm_ConfirmDialogWrapper = props => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- getContainer,
- direction
- } = props;
- const runtimeLocale = getConfirmLocale();
- const config = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const rootPrefixCls = getRootPrefixCls() || config.getPrefixCls();
- // because Modal.config set rootPrefixCls, which is different from other components
- const prefixCls = customizePrefixCls || `${rootPrefixCls}-modal`;
- let mergedGetContainer = getContainer;
- if (mergedGetContainer === false) {
- mergedGetContainer = undefined;
- if (true) {
- true ? (0,_util_warning["default"])(false, 'Modal', 'Static method not support `getContainer` to be `false` since it do not have context env.') : 0;
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(modal_ConfirmDialog, Object.assign({}, props, {
- rootPrefixCls: rootPrefixCls,
- prefixCls: prefixCls,
- iconPrefixCls: config.iconPrefixCls,
- theme: config.theme,
- direction: direction !== null && direction !== void 0 ? direction : config.direction,
- locale: (_b = (_a = config.locale) === null || _a === void 0 ? void 0 : _a.Modal) !== null && _b !== void 0 ? _b : runtimeLocale,
- getContainer: mergedGetContainer
- }));
- };
- function confirm_confirm(config) {
- const global = globalConfig();
- if ( true && !global.holderRender) {
- warnContext('Modal');
- }
- const container = document.createDocumentFragment();
- let currentConfig = Object.assign(Object.assign({}, config), {
- close,
- open: true
- });
- let timeoutId;
- let reactUnmount;
- function destroy(...args) {
- var _a;
- const triggerCancel = args.some(param => param === null || param === void 0 ? void 0 : param.triggerCancel);
- if (triggerCancel) {
- var _a2;
- (_a = config.onCancel) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [config, () => {}].concat((0,toConsumableArray["default"])(args.slice(1))));
- }
- for (let i = 0; i < modal_destroyFns.length; i++) {
- const fn = modal_destroyFns[i];
- if (fn === close) {
- modal_destroyFns.splice(i, 1);
- break;
- }
- }
- reactUnmount();
- }
- function render(props) {
- clearTimeout(timeoutId);
- /**
- * https://github.com/ant-design/ant-design/issues/23623
- *
- * Sync render blocks React event. Let's make this async.
- */
- timeoutId = setTimeout(() => {
- const rootPrefixCls = global.getPrefixCls(undefined, getRootPrefixCls());
- const iconPrefixCls = global.getIconPrefixCls();
- const theme = global.getTheme();
- const dom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(confirm_ConfirmDialogWrapper, Object.assign({}, props));
- const reactRender = unstableSetRender();
- reactUnmount = reactRender(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(config_provider, {
- prefixCls: rootPrefixCls,
- iconPrefixCls: iconPrefixCls,
- theme: theme
- }, global.holderRender ? global.holderRender(dom) : dom), container);
- });
- }
- function close(...args) {
- currentConfig = Object.assign(Object.assign({}, currentConfig), {
- open: false,
- afterClose: () => {
- if (typeof config.afterClose === 'function') {
- config.afterClose();
- }
- // @ts-ignore
- destroy.apply(this, args);
- }
- });
- // Legacy support
- if (currentConfig.visible) {
- delete currentConfig.visible;
- }
- render(currentConfig);
- }
- function update(configUpdate) {
- if (typeof configUpdate === 'function') {
- currentConfig = configUpdate(currentConfig);
- } else {
- currentConfig = Object.assign(Object.assign({}, currentConfig), configUpdate);
- }
- render(currentConfig);
- }
- render(currentConfig);
- modal_destroyFns.push(close);
- return {
- destroy: close,
- update
- };
- }
- function withWarn(props) {
- return Object.assign(Object.assign({}, props), {
- type: 'warning'
- });
- }
- function withInfo(props) {
- return Object.assign(Object.assign({}, props), {
- type: 'info'
- });
- }
- function withSuccess(props) {
- return Object.assign(Object.assign({}, props), {
- type: 'success'
- });
- }
- function withError(props) {
- return Object.assign(Object.assign({}, props), {
- type: 'error'
- });
- }
- function withConfirm(props) {
- return Object.assign(Object.assign({}, props), {
- type: 'confirm'
- });
- }
- function modalGlobalConfig({
- rootPrefixCls
- }) {
- true ? (0,_util_warning["default"])(false, 'Modal', 'Modal.config is deprecated. Please use ConfigProvider.config instead.') : 0;
- defaultRootPrefixCls = rootPrefixCls;
- }
- ;// ./components/modal/useModal/HookModal.tsx
- var HookModal_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const HookModal = (_a, ref) => {
- var _b;
- var {
- afterClose: hookAfterClose,
- config
- } = _a,
- restProps = HookModal_rest(_a, ["afterClose", "config"]);
- const [open, setOpen] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true);
- const [innerConfig, setInnerConfig] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(config);
- const {
- direction,
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('modal');
- const rootPrefixCls = getPrefixCls();
- const afterClose = () => {
- var _a;
- hookAfterClose();
- (_a = innerConfig.afterClose) === null || _a === void 0 ? void 0 : _a.call(innerConfig);
- };
- const close = (...args) => {
- var _a;
- setOpen(false);
- const triggerCancel = args.some(param => param === null || param === void 0 ? void 0 : param.triggerCancel);
- if (triggerCancel) {
- var _a2;
- (_a = innerConfig.onCancel) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [innerConfig, () => {}].concat((0,toConsumableArray["default"])(args.slice(1))));
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- destroy: close,
- update: newConfig => {
- setInnerConfig(originConfig => {
- const nextConfig = typeof newConfig === 'function' ? newConfig(originConfig) : newConfig;
- return Object.assign(Object.assign({}, originConfig), nextConfig);
- });
- }
- }));
- const mergedOkCancel = (_b = innerConfig.okCancel) !== null && _b !== void 0 ? _b : innerConfig.type === 'confirm';
- const [contextLocale] = (0,useLocale["default"])('Modal', en_US["default"].Modal);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(modal_ConfirmDialog, Object.assign({
- prefixCls: prefixCls,
- rootPrefixCls: rootPrefixCls
- }, innerConfig, {
- close: close,
- open: open,
- afterClose: afterClose,
- okText: innerConfig.okText || (mergedOkCancel ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.okText : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.justOkText),
- direction: innerConfig.direction || direction,
- cancelText: innerConfig.cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.cancelText)
- }, restProps));
- };
- /* harmony default export */ var useModal_HookModal = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(HookModal));
- ;// ./components/modal/useModal/index.tsx
- let useModal_uuid = 0;
- const ElementsHolder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_props, ref) => {
- const [elements, patchElement] = usePatchElement();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- patchElement
- }), []);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, elements);
- }));
- function useModal() {
- const holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ========================== Effect ==========================
- const [actionQueue, setActionQueue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (actionQueue.length) {
- const cloneQueue = (0,toConsumableArray["default"])(actionQueue);
- cloneQueue.forEach(action => {
- action();
- });
- setActionQueue([]);
- }
- }, [actionQueue]);
- // =========================== Hook ===========================
- const getConfirmFunc = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(withFunc => function hookConfirm(config) {
- var _a;
- useModal_uuid += 1;
- const modalRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createRef();
- // Proxy to promise with `onClose`
- let resolvePromise;
- const promise = new Promise(resolve => {
- resolvePromise = resolve;
- });
- let silent = false;
- let closeFunc;
- const modal = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(useModal_HookModal, {
- key: `modal-${useModal_uuid}`,
- config: withFunc(config),
- ref: modalRef,
- afterClose: () => {
- closeFunc === null || closeFunc === void 0 ? void 0 : closeFunc();
- },
- isSilent: () => silent,
- onConfirm: confirmed => {
- resolvePromise(confirmed);
- }
- });
- closeFunc = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.patchElement(modal);
- if (closeFunc) {
- modal_destroyFns.push(closeFunc);
- }
- const instance = {
- destroy: () => {
- function destroyAction() {
- var _a;
- (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
- }
- if (modalRef.current) {
- destroyAction();
- } else {
- setActionQueue(prev => [].concat((0,toConsumableArray["default"])(prev), [destroyAction]));
- }
- },
- update: newConfig => {
- function updateAction() {
- var _a;
- (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.update(newConfig);
- }
- if (modalRef.current) {
- updateAction();
- } else {
- setActionQueue(prev => [].concat((0,toConsumableArray["default"])(prev), [updateAction]));
- }
- },
- then: resolve => {
- silent = true;
- return promise.then(resolve);
- }
- };
- return instance;
- }, []);
- const fns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- info: getConfirmFunc(withInfo),
- success: getConfirmFunc(withSuccess),
- error: getConfirmFunc(withError),
- warning: getConfirmFunc(withWarn),
- confirm: getConfirmFunc(withConfirm)
- }), []);
- return [fns, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ElementsHolder, {
- key: "modal-holder",
- ref: holderRef
- })];
- }
- /* harmony default export */ var modal_useModal = (useModal);
- // EXTERNAL MODULE: ./components/notification/style/index.ts + 3 modules
- var notification_style = __webpack_require__("./components/notification/style/index.ts");
- ;// ./components/notification/style/pure-panel.ts
- /* harmony default export */ var pure_panel = ((0,genStyleUtils.genSubStyleComponent)(['Notification', 'PurePanel'], token => {
- const noticeCls = `${token.componentCls}-notice`;
- const notificationToken = (0,notification_style.prepareNotificationToken)(token);
- return {
- [`${noticeCls}-pure-panel`]: Object.assign(Object.assign({}, (0,notification_style.genNoticeStyle)(notificationToken)), {
- width: notificationToken.width,
- maxWidth: `calc(100vw - ${(0,cssinjs.unit)(token.calc(notificationToken.notificationMarginEdge).mul(2).equal())})`,
- margin: 0
- })
- };
- }, notification_style.prepareComponentToken));
- ;// ./components/notification/PurePanel.tsx
- var notification_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const PurePanel_TypeIcon = {
- info: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_InfoCircleFilled, null),
- success: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckCircleFilled, null),
- error: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseCircleFilled, null),
- warning: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ExclamationCircleFilled, null),
- loading: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null)
- };
- function getCloseIcon(prefixCls, closeIcon) {
- if (closeIcon === null || closeIcon === false) {
- return null;
- }
- return closeIcon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, {
- className: `${prefixCls}-close-icon`
- });
- }
- const typeToIcon = {
- success: icons_CheckCircleFilled,
- info: icons_InfoCircleFilled,
- error: icons_CloseCircleFilled,
- warning: icons_ExclamationCircleFilled
- };
- const PurePanel_PureContent = props => {
- const {
- prefixCls,
- icon,
- type,
- message,
- description,
- actions,
- role = 'alert'
- } = props;
- let iconNode = null;
- if (icon) {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-icon`
- }, icon);
- } else if (type) {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typeToIcon[type] || null, {
- className: classnames_default()(`${prefixCls}-icon`, `${prefixCls}-icon-${type}`)
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()({
- [`${prefixCls}-with-icon`]: iconNode
- }),
- role: role
- }, iconNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-message`
- }, message), description && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-description`
- }, description), actions && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-actions`
- }, actions));
- };
- /** @private Internal Component. Do not use in your production. */
- const PurePanel_PurePanel = props => {
- const {
- prefixCls: staticPrefixCls,
- className,
- icon,
- type,
- message,
- description,
- btn,
- actions,
- closable = true,
- closeIcon,
- className: notificationClassName
- } = props,
- restProps = notification_PurePanel_rest(props, ["prefixCls", "className", "icon", "type", "message", "description", "btn", "actions", "closable", "closeIcon", "className"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Notification');
- warning.deprecated(!btn, 'btn', 'actions');
- }
- const prefixCls = staticPrefixCls || getPrefixCls('notification');
- const noticePrefixCls = `${prefixCls}-notice`;
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,notification_style["default"])(prefixCls, rootCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${noticePrefixCls}-pure-panel`, hashId, className, cssVarCls, rootCls)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(pure_panel, {
- prefixCls: prefixCls
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Notice, Object.assign({}, restProps, {
- prefixCls: prefixCls,
- eventKey: "pure",
- duration: null,
- closable: closable,
- className: classnames_default()({
- notificationClassName
- }),
- closeIcon: getCloseIcon(prefixCls, closeIcon),
- content: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PurePanel_PureContent, {
- prefixCls: noticePrefixCls,
- icon: icon,
- type: type,
- message: message,
- description: description,
- actions: mergedActions
- })
- }))));
- };
- /* harmony default export */ var notification_PurePanel = (PurePanel_PurePanel);
- ;// ./components/notification/util.ts
- function getPlacementStyle(placement, top, bottom) {
- let style;
- switch (placement) {
- case 'top':
- style = {
- left: '50%',
- transform: 'translateX(-50%)',
- right: 'auto',
- top,
- bottom: 'auto'
- };
- break;
- case 'topLeft':
- style = {
- left: 0,
- top,
- bottom: 'auto'
- };
- break;
- case 'topRight':
- style = {
- right: 0,
- top,
- bottom: 'auto'
- };
- break;
- case 'bottom':
- style = {
- left: '50%',
- transform: 'translateX(-50%)',
- right: 'auto',
- top: 'auto',
- bottom
- };
- break;
- case 'bottomLeft':
- style = {
- left: 0,
- top: 'auto',
- bottom
- };
- break;
- default:
- style = {
- right: 0,
- top: 'auto',
- bottom
- };
- break;
- }
- return style;
- }
- function util_getMotion(prefixCls) {
- return {
- motionName: `${prefixCls}-fade`
- };
- }
- function getCloseIconConfig(closeIcon, notificationConfig, notification) {
- if (typeof closeIcon !== 'undefined') {
- return closeIcon;
- }
- if (typeof (notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.closeIcon) !== 'undefined') {
- return notificationConfig.closeIcon;
- }
- return notification === null || notification === void 0 ? void 0 : notification.closeIcon;
- }
- ;// ./components/notification/useNotification.tsx
- var useNotification_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const useNotification_DEFAULT_OFFSET = 24;
- const useNotification_DEFAULT_DURATION = 4.5;
- const DEFAULT_PLACEMENT = 'topRight';
- const useNotification_Wrapper = ({
- children,
- prefixCls
- }) => {
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,notification_style["default"])(prefixCls, rootCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_NotificationProvider, {
- classNames: {
- list: classnames_default()(hashId, cssVarCls, rootCls)
- }
- }, children));
- };
- const useNotification_renderNotifications = (node, {
- prefixCls,
- key
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(useNotification_Wrapper, {
- prefixCls: prefixCls,
- key: key
- }, node));
- const useNotification_Holder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- top,
- bottom,
- prefixCls: staticPrefixCls,
- getContainer: staticGetContainer,
- maxCount,
- rtl,
- onAllRemoved,
- stack,
- duration,
- pauseOnHover = true,
- showProgress
- } = props;
- const {
- getPrefixCls,
- getPopupContainer,
- notification,
- direction
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const [, token] = (0,useToken["default"])();
- const prefixCls = staticPrefixCls || getPrefixCls('notification');
- // =============================== Style ===============================
- const getStyle = placement => getPlacementStyle(placement, top !== null && top !== void 0 ? top : useNotification_DEFAULT_OFFSET, bottom !== null && bottom !== void 0 ? bottom : useNotification_DEFAULT_OFFSET);
- const getClassName = () => classnames_default()({
- [`${prefixCls}-rtl`]: rtl !== null && rtl !== void 0 ? rtl : direction === 'rtl'
- });
- // ============================== Motion ===============================
- const getNotificationMotion = () => util_getMotion(prefixCls);
- // ============================== Origin ===============================
- const [api, holder] = useNotification({
- prefixCls,
- style: getStyle,
- className: getClassName,
- motion: getNotificationMotion,
- closable: true,
- closeIcon: getCloseIcon(prefixCls),
- duration: duration !== null && duration !== void 0 ? duration : useNotification_DEFAULT_DURATION,
- getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,
- maxCount,
- pauseOnHover,
- showProgress,
- onAllRemoved,
- renderNotifications: useNotification_renderNotifications,
- stack: stack === false ? false : {
- threshold: typeof stack === 'object' ? stack === null || stack === void 0 ? void 0 : stack.threshold : undefined,
- offset: 8,
- gap: token.margin
- }
- });
- // ================================ Ref ================================
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {
- prefixCls,
- notification
- }));
- return holder;
- });
- // ==============================================================================
- // == Hook ==
- // ==============================================================================
- function useInternalNotification(notificationConfig) {
- const holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const warning = (0,_util_warning.devUseWarning)('Notification');
- // ================================ API ================================
- const wrapAPI = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- // Wrap with notification content
- // >>> Open
- const open = config => {
- var _a;
- if (!holderRef.current) {
- true ? warning(false, 'usage', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : 0;
- return;
- }
- const {
- open: originOpen,
- prefixCls,
- notification
- } = holderRef.current;
- const noticePrefixCls = `${prefixCls}-notice`;
- const {
- message,
- description,
- icon,
- type,
- btn,
- actions,
- className,
- style,
- role = 'alert',
- closeIcon,
- closable
- } = config,
- restConfig = useNotification_rest(config, ["message", "description", "icon", "type", "btn", "actions", "className", "style", "role", "closeIcon", "closable"]);
- if (true) {
- warning.deprecated(!btn, 'btn', 'actions');
- }
- const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
- const realCloseIcon = getCloseIcon(noticePrefixCls, getCloseIconConfig(closeIcon, notificationConfig, notification));
- return originOpen(Object.assign(Object.assign({
- // use placement from props instead of hard-coding "topRight"
- placement: (_a = notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.placement) !== null && _a !== void 0 ? _a : DEFAULT_PLACEMENT
- }, restConfig), {
- content: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PurePanel_PureContent, {
- prefixCls: noticePrefixCls,
- icon: icon,
- type: type,
- message: message,
- description: description,
- actions: mergedActions,
- role: role
- })),
- className: classnames_default()(type && `${noticePrefixCls}-${type}`, className, notification === null || notification === void 0 ? void 0 : notification.className),
- style: Object.assign(Object.assign({}, notification === null || notification === void 0 ? void 0 : notification.style), style),
- closeIcon: realCloseIcon,
- closable: closable !== null && closable !== void 0 ? closable : !!realCloseIcon
- }));
- };
- // >>> destroy
- const destroy = key => {
- var _a, _b;
- if (key !== undefined) {
- (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);
- } else {
- (_b = holderRef.current) === null || _b === void 0 ? void 0 : _b.destroy();
- }
- };
- const clone = {
- open,
- destroy
- };
- const keys = ['success', 'info', 'warning', 'error'];
- keys.forEach(type => {
- clone[type] = config => open(Object.assign(Object.assign({}, config), {
- type
- }));
- });
- return clone;
- }, []);
- // ============================== Return ===============================
- return [wrapAPI, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(useNotification_Holder, Object.assign({
- key: "notification-holder"
- }, notificationConfig, {
- ref: holderRef
- }))];
- }
- function useNotification_useNotification(notificationConfig) {
- return useInternalNotification(notificationConfig);
- }
- ;// ./components/app/context.ts
- const AppConfigContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- const AppContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({
- message: {},
- notification: {},
- modal: {}
- });
- /* harmony default export */ var app_context = (AppContext);
- // EXTERNAL MODULE: ./components/app/style/index.ts
- var app_style = __webpack_require__("./components/app/style/index.ts");
- ;// ./components/app/App.tsx
- const App = props => {
- const {
- prefixCls: customizePrefixCls,
- children,
- className,
- rootClassName,
- message,
- notification,
- style,
- component = 'div'
- } = props;
- const {
- direction,
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('app', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,app_style["default"])(prefixCls);
- const customClassName = classnames_default()(hashId, prefixCls, className, rootClassName, cssVarCls, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- });
- const appConfig = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AppConfigContext);
- const mergedAppConfig = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => ({
- message: Object.assign(Object.assign({}, appConfig.message), message),
- notification: Object.assign(Object.assign({}, appConfig.notification), notification)
- }), [message, notification, appConfig.message, appConfig.notification]);
- const [messageApi, messageContextHolder] = useMessage(mergedAppConfig.message);
- const [notificationApi, notificationContextHolder] = useNotification_useNotification(mergedAppConfig.notification);
- const [ModalApi, ModalContextHolder] = modal_useModal();
- const memoizedContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => ({
- message: messageApi,
- notification: notificationApi,
- modal: ModalApi
- }), [messageApi, notificationApi, ModalApi]);
- // https://github.com/ant-design/ant-design/issues/48802#issuecomment-2097813526
- (0,_util_warning.devUseWarning)('App')(!(cssVarCls && component === false), 'usage', 'When using cssVar, ensure `component` is assigned a valid React component string.');
- // ============================ Render ============================
- const Component = component === false ? (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment : component;
- const rootProps = {
- className: customClassName,
- style
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(app_context.Provider, {
- value: memoizedContextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(AppConfigContext.Provider, {
- value: mergedAppConfig
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Component, Object.assign({}, component === false ? undefined : rootProps), ModalContextHolder, messageContextHolder, notificationContextHolder, children))));
- };
- if (true) {
- App.displayName = 'App';
- }
- /* harmony default export */ var app_App = (App);
- ;// ./components/app/useApp.ts
- const useApp = () => external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(app_context);
- /* harmony default export */ var app_useApp = (useApp);
- ;// ./components/app/index.tsx
- const components_app_App = app_App;
- components_app_App.useApp = app_useApp;
- /* harmony default export */ var app = (components_app_App);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMergedState.js
- var useMergedState = __webpack_require__("./node_modules/rc-util/es/hooks/useMergedState.js");
- ;// ./components/_util/PurePanel.tsx
- function withPureRenderTheme(Component) {
- return props => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider, {
- theme: {
- token: {
- motion: false,
- zIndexPopupBase: 0
- }
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, Object.assign({}, props))));
- }
- /* istanbul ignore next */
- const genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls, getDropdownCls) => {
- const PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- style
- } = props;
- const holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [popupHeight, setPopupHeight] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [popupWidth, setPopupWidth] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [open, setOpen] = (0,useMergedState["default"])(false, {
- value: props.open
- });
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- // We do not care about ssr
- setOpen(true);
- if (typeof ResizeObserver !== 'undefined') {
- const resizeObserver = new ResizeObserver(entries => {
- const element = entries[0].target;
- setPopupHeight(element.offsetHeight + 8);
- setPopupWidth(element.offsetWidth);
- });
- const interval = setInterval(() => {
- var _a;
- const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;
- const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);
- if (popup) {
- clearInterval(interval);
- resizeObserver.observe(popup);
- }
- }, 10);
- return () => {
- clearInterval(interval);
- resizeObserver.disconnect();
- };
- }
- }, []);
- let mergedProps = Object.assign(Object.assign({}, props), {
- style: Object.assign(Object.assign({}, style), {
- margin: 0
- }),
- open,
- visible: open,
- getPopupContainer: () => holderRef.current
- });
- if (postProps) {
- mergedProps = postProps(mergedProps);
- }
- if (alignPropName) {
- Object.assign(mergedProps, {
- [alignPropName]: {
- overflow: {
- adjustX: false,
- adjustY: false
- }
- }
- });
- }
- const mergedStyle = {
- paddingBottom: popupHeight,
- position: 'relative',
- minWidth: popupWidth
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: holderRef,
- style: mergedStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, Object.assign({}, mergedProps)));
- };
- return withPureRenderTheme(PurePanel);
- };
- /* harmony default export */ var _util_PurePanel = (genPurePanel);
- ;// ./node_modules/rc-util/es/isMobile.js
- /* harmony default export */ var isMobile = (function () {
- if (typeof navigator === 'undefined' || typeof window === 'undefined') {
- return false;
- }
- var agent = navigator.userAgent || navigator.vendor || window.opera;
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4));
- });
- ;// ./node_modules/rc-select/es/TransBtn.js
- var TransBtn = function TransBtn(props) {
- var className = props.className,
- customizeIcon = props.customizeIcon,
- customizeIconProps = props.customizeIconProps,
- children = props.children,
- _onMouseDown = props.onMouseDown,
- onClick = props.onClick;
- var icon = typeof customizeIcon === 'function' ? customizeIcon(customizeIconProps) : customizeIcon;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: className,
- onMouseDown: function onMouseDown(event) {
- event.preventDefault();
- _onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(event);
- },
- style: {
- userSelect: 'none',
- WebkitUserSelect: 'none'
- },
- unselectable: "on",
- onClick: onClick,
- "aria-hidden": true
- }, icon !== undefined ? icon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(className.split(/\s+/).map(function (cls) {
- return "".concat(cls, "-icon");
- }))
- }, children));
- };
- /* harmony default export */ var es_TransBtn = (TransBtn);
- ;// ./node_modules/rc-select/es/hooks/useAllowClear.js
- var useAllowClear = function useAllowClear(prefixCls, onClearMouseDown, displayValues, allowClear, clearIcon) {
- var disabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
- var mergedSearchValue = arguments.length > 6 ? arguments[6] : undefined;
- var mode = arguments.length > 7 ? arguments[7] : undefined;
- var mergedClearIcon = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if ((0,esm_typeof["default"])(allowClear) === 'object') {
- return allowClear.clearIcon;
- }
- if (clearIcon) {
- return clearIcon;
- }
- }, [allowClear, clearIcon]);
- var mergedAllowClear = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (!disabled && !!allowClear && (displayValues.length || mergedSearchValue) && !(mode === 'combobox' && mergedSearchValue === '')) {
- return true;
- }
- return false;
- }, [allowClear, disabled, displayValues.length, mergedSearchValue, mode]);
- return {
- allowClear: mergedAllowClear,
- clearIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_TransBtn, {
- className: "".concat(prefixCls, "-clear"),
- onMouseDown: onClearMouseDown,
- customizeIcon: mergedClearIcon
- }, "\xD7")
- };
- };
- ;// ./node_modules/rc-select/es/hooks/useBaseProps.js
- /**
- * BaseSelect provide some parsed data into context.
- * You can use this hooks to get them.
- */
- var BaseSelectContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- function useBaseProps() {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(BaseSelectContext);
- }
- ;// ./node_modules/rc-select/es/hooks/useDelayReset.js
- /**
- * Similar with `useLock`, but this hook will always execute last value.
- * When set to `true`, it will keep `true` for a short time even if `false` is set.
- */
- function useDelayReset() {
- var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- bool = _React$useState2[0],
- setBool = _React$useState2[1];
- var delayRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var cancelLatest = function cancelLatest() {
- window.clearTimeout(delayRef.current);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return cancelLatest;
- }, []);
- var delaySetBool = function delaySetBool(value, callback) {
- cancelLatest();
- delayRef.current = window.setTimeout(function () {
- setBool(value);
- if (callback) {
- callback();
- }
- }, timeout);
- };
- return [bool, delaySetBool, cancelLatest];
- }
- ;// ./node_modules/rc-select/es/hooks/useLock.js
- /**
- * Locker return cached mark.
- * If set to `true`, will return `true` in a short time even if set `false`.
- * If set to `false` and then set to `true`, will change to `true`.
- * And after time duration, it will back to `null` automatically.
- */
- function useLock() {
- var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 250;
- var lockRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var timeoutRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // Clean up
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- window.clearTimeout(timeoutRef.current);
- };
- }, []);
- function doLock(locked) {
- if (locked || lockRef.current === null) {
- lockRef.current = locked;
- }
- window.clearTimeout(timeoutRef.current);
- timeoutRef.current = window.setTimeout(function () {
- lockRef.current = null;
- }, duration);
- }
- return [function () {
- return lockRef.current;
- }, doLock];
- }
- ;// ./node_modules/rc-select/es/hooks/useSelectTriggerControl.js
- function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
- var propsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- propsRef.current = {
- open: open,
- triggerOpen: triggerOpen,
- customizedTrigger: customizedTrigger
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- function onGlobalMouseDown(event) {
- var _propsRef$current;
- // If trigger is customized, Trigger will take control of popupVisible
- if ((_propsRef$current = propsRef.current) !== null && _propsRef$current !== void 0 && _propsRef$current.customizedTrigger) {
- return;
- }
- var target = event.target;
- if (target.shadowRoot && event.composed) {
- target = event.composedPath()[0] || target;
- }
- if (propsRef.current.open && elements().filter(function (element) {
- return element;
- }).every(function (element) {
- return !element.contains(target) && element !== target;
- })) {
- // Should trigger close
- propsRef.current.triggerOpen(false);
- }
- }
- window.addEventListener('mousedown', onGlobalMouseDown);
- return function () {
- return window.removeEventListener('mousedown', onGlobalMouseDown);
- };
- }, []);
- }
- ;// ./node_modules/rc-select/es/utils/keyUtil.js
- /** keyCode Judgment function */
- function isValidateOpenKey(currentKeyCode) {
- return (
- // Undefined for Edge bug:
- // https://github.com/ant-design/ant-design/issues/51292
- currentKeyCode &&
- // Other keys
- ![
- // System function button
- KeyCode["default"].ESC, KeyCode["default"].SHIFT, KeyCode["default"].BACKSPACE, KeyCode["default"].TAB, KeyCode["default"].WIN_KEY, KeyCode["default"].ALT, KeyCode["default"].META, KeyCode["default"].WIN_KEY_RIGHT, KeyCode["default"].CTRL, KeyCode["default"].SEMICOLON, KeyCode["default"].EQUALS, KeyCode["default"].CAPS_LOCK, KeyCode["default"].CONTEXT_MENU,
- // F1-F12
- KeyCode["default"].F1, KeyCode["default"].F2, KeyCode["default"].F3, KeyCode["default"].F4, KeyCode["default"].F5, KeyCode["default"].F6, KeyCode["default"].F7, KeyCode["default"].F8, KeyCode["default"].F9, KeyCode["default"].F10, KeyCode["default"].F11, KeyCode["default"].F12].includes(currentKeyCode)
- );
- }
- ;// ./node_modules/rc-overflow/es/Item.js
- var Item_excluded = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"];
- // Use shared variable to save bundle size
- var UNDEFINED = undefined;
- function InternalItem(props, ref) {
- var prefixCls = props.prefixCls,
- invalidate = props.invalidate,
- item = props.item,
- renderItem = props.renderItem,
- responsive = props.responsive,
- responsiveDisabled = props.responsiveDisabled,
- registerSize = props.registerSize,
- itemKey = props.itemKey,
- className = props.className,
- style = props.style,
- children = props.children,
- display = props.display,
- order = props.order,
- _props$component = props.component,
- Component = _props$component === void 0 ? 'div' : _props$component,
- restProps = (0,objectWithoutProperties["default"])(props, Item_excluded);
- var mergedHidden = responsive && !display;
- // ================================ Effect ================================
- function internalRegisterSize(width) {
- registerSize(itemKey, width);
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- internalRegisterSize(null);
- };
- }, []);
- // ================================ Render ================================
- var childNode = renderItem && item !== UNDEFINED ? renderItem(item, {
- index: order
- }) : children;
- var overflowStyle;
- if (!invalidate) {
- overflowStyle = {
- opacity: mergedHidden ? 0 : 1,
- height: mergedHidden ? 0 : UNDEFINED,
- overflowY: mergedHidden ? 'hidden' : UNDEFINED,
- order: responsive ? order : UNDEFINED,
- pointerEvents: mergedHidden ? 'none' : UNDEFINED,
- position: mergedHidden ? 'absolute' : UNDEFINED
- };
- }
- var overflowProps = {};
- if (mergedHidden) {
- overflowProps['aria-hidden'] = true;
- }
- var itemNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({
- className: classnames_default()(!invalidate && prefixCls, className),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, overflowStyle), style)
- }, overflowProps, restProps, {
- ref: ref
- }), childNode);
- if (responsive) {
- itemNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: function onResize(_ref) {
- var offsetWidth = _ref.offsetWidth;
- internalRegisterSize(offsetWidth);
- },
- disabled: responsiveDisabled
- }, itemNode);
- }
- return itemNode;
- }
- var Item = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalItem);
- Item.displayName = 'Item';
- /* harmony default export */ var es_Item = (Item);
- ;// ./node_modules/rc-overflow/es/hooks/channelUpdate.js
- function channelUpdate(callback) {
- if (typeof MessageChannel === 'undefined') {
- (0,raf["default"])(callback);
- } else {
- var channel = new MessageChannel();
- channel.port1.onmessage = function () {
- return callback();
- };
- channel.port2.postMessage(undefined);
- }
- }
- ;// ./node_modules/rc-overflow/es/hooks/useEffectState.js
- /**
- * Batcher for record any `useEffectState` need update.
- */
- function useBatcher() {
- // Updater Trigger
- var updateFuncRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // Notify update
- var notifyEffectUpdate = function notifyEffectUpdate(callback) {
- if (!updateFuncRef.current) {
- updateFuncRef.current = [];
- channelUpdate(function () {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.unstable_batchedUpdates)(function () {
- updateFuncRef.current.forEach(function (fn) {
- fn();
- });
- updateFuncRef.current = null;
- });
- });
- }
- updateFuncRef.current.push(callback);
- };
- return notifyEffectUpdate;
- }
- /**
- * Trigger state update by `useLayoutEffect` to save perf.
- */
- function useEffectState(notifyEffectUpdate, defaultValue) {
- // Value
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(defaultValue),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- stateValue = _React$useState2[0],
- setStateValue = _React$useState2[1];
- // Set State
- var setEffectVal = (0,useEvent["default"])(function (nextValue) {
- notifyEffectUpdate(function () {
- setStateValue(nextValue);
- });
- });
- return [stateValue, setEffectVal];
- }
- ;// ./node_modules/rc-overflow/es/context.js
- var OverflowContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(null);
- ;// ./node_modules/rc-overflow/es/RawItem.js
- var RawItem_excluded = ["component"],
- _excluded2 = ["className"],
- _excluded3 = ["className"];
- var InternalRawItem = function InternalRawItem(props, ref) {
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(OverflowContext);
- // Render directly when context not provided
- if (!context) {
- var _props$component = props.component,
- Component = _props$component === void 0 ? 'div' : _props$component,
- _restProps = (0,objectWithoutProperties["default"])(props, RawItem_excluded);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, _restProps, {
- ref: ref
- }));
- }
- var contextClassName = context.className,
- restContext = (0,objectWithoutProperties["default"])(context, _excluded2);
- var className = props.className,
- restProps = (0,objectWithoutProperties["default"])(props, _excluded3);
- // Do not pass context to sub item to avoid multiple measure
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverflowContext.Provider, {
- value: null
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Item, (0,esm_extends["default"])({
- ref: ref,
- className: classnames_default()(contextClassName, className)
- }, restContext, restProps)));
- };
- var RawItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalRawItem);
- RawItem.displayName = 'RawItem';
- /* harmony default export */ var es_RawItem = (RawItem);
- ;// ./node_modules/rc-overflow/es/Overflow.js
- var Overflow_excluded = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"];
- var RESPONSIVE = 'responsive';
- var INVALIDATE = 'invalidate';
- function defaultRenderRest(omittedItems) {
- return "+ ".concat(omittedItems.length, " ...");
- }
- function Overflow(props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-overflow' : _props$prefixCls,
- _props$data = props.data,
- data = _props$data === void 0 ? [] : _props$data,
- renderItem = props.renderItem,
- renderRawItem = props.renderRawItem,
- itemKey = props.itemKey,
- _props$itemWidth = props.itemWidth,
- itemWidth = _props$itemWidth === void 0 ? 10 : _props$itemWidth,
- ssr = props.ssr,
- style = props.style,
- className = props.className,
- maxCount = props.maxCount,
- renderRest = props.renderRest,
- renderRawRest = props.renderRawRest,
- suffix = props.suffix,
- _props$component = props.component,
- Component = _props$component === void 0 ? 'div' : _props$component,
- itemComponent = props.itemComponent,
- onVisibleChange = props.onVisibleChange,
- restProps = (0,objectWithoutProperties["default"])(props, Overflow_excluded);
- var fullySSR = ssr === 'full';
- var notifyEffectUpdate = useBatcher();
- var _useEffectState = useEffectState(notifyEffectUpdate, null),
- _useEffectState2 = (0,slicedToArray["default"])(_useEffectState, 2),
- containerWidth = _useEffectState2[0],
- setContainerWidth = _useEffectState2[1];
- var mergedContainerWidth = containerWidth || 0;
- var _useEffectState3 = useEffectState(notifyEffectUpdate, new Map()),
- _useEffectState4 = (0,slicedToArray["default"])(_useEffectState3, 2),
- itemWidths = _useEffectState4[0],
- setItemWidths = _useEffectState4[1];
- var _useEffectState5 = useEffectState(notifyEffectUpdate, 0),
- _useEffectState6 = (0,slicedToArray["default"])(_useEffectState5, 2),
- prevRestWidth = _useEffectState6[0],
- setPrevRestWidth = _useEffectState6[1];
- var _useEffectState7 = useEffectState(notifyEffectUpdate, 0),
- _useEffectState8 = (0,slicedToArray["default"])(_useEffectState7, 2),
- restWidth = _useEffectState8[0],
- setRestWidth = _useEffectState8[1];
- var _useEffectState9 = useEffectState(notifyEffectUpdate, 0),
- _useEffectState10 = (0,slicedToArray["default"])(_useEffectState9, 2),
- suffixWidth = _useEffectState10[0],
- setSuffixWidth = _useEffectState10[1];
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- suffixFixedStart = _useState2[0],
- setSuffixFixedStart = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- displayCount = _useState4[0],
- setDisplayCount = _useState4[1];
- var mergedDisplayCount = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (displayCount === null && fullySSR) {
- return Number.MAX_SAFE_INTEGER;
- }
- return displayCount || 0;
- }, [displayCount, containerWidth]);
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState6 = (0,slicedToArray["default"])(_useState5, 2),
- restReady = _useState6[0],
- setRestReady = _useState6[1];
- var itemPrefixCls = "".concat(prefixCls, "-item");
- // Always use the max width to avoid blink
- var mergedRestWidth = Math.max(prevRestWidth, restWidth);
- // ================================= Data =================================
- var isResponsive = maxCount === RESPONSIVE;
- var shouldResponsive = data.length && isResponsive;
- var invalidate = maxCount === INVALIDATE;
- /**
- * When is `responsive`, we will always render rest node to get the real width of it for calculation
- */
- var showRest = shouldResponsive || typeof maxCount === 'number' && data.length > maxCount;
- var mergedData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var items = data;
- if (shouldResponsive) {
- if (containerWidth === null && fullySSR) {
- items = data;
- } else {
- items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
- }
- } else if (typeof maxCount === 'number') {
- items = data.slice(0, maxCount);
- }
- return items;
- }, [data, itemWidth, containerWidth, maxCount, shouldResponsive]);
- var omittedItems = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if (shouldResponsive) {
- return data.slice(mergedDisplayCount + 1);
- }
- return data.slice(mergedData.length);
- }, [data, mergedData, shouldResponsive, mergedDisplayCount]);
- // ================================= Item =================================
- var getKey = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (item, index) {
- var _ref;
- if (typeof itemKey === 'function') {
- return itemKey(item);
- }
- return (_ref = itemKey && (item === null || item === void 0 ? void 0 : item[itemKey])) !== null && _ref !== void 0 ? _ref : index;
- }, [itemKey]);
- var mergedRenderItem = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(renderItem || function (item) {
- return item;
- }, [renderItem]);
- function updateDisplayCount(count, suffixFixedStartVal, notReady) {
- // React 18 will sync render even when the value is same in some case.
- // We take `mergedData` as deps which may cause dead loop if it's dynamic generate.
- // ref: https://github.com/ant-design/ant-design/issues/36559
- if (displayCount === count && (suffixFixedStartVal === undefined || suffixFixedStartVal === suffixFixedStart)) {
- return;
- }
- setDisplayCount(count);
- if (!notReady) {
- setRestReady(count < data.length - 1);
- onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(count);
- }
- if (suffixFixedStartVal !== undefined) {
- setSuffixFixedStart(suffixFixedStartVal);
- }
- }
- // ================================= Size =================================
- function onOverflowResize(_, element) {
- setContainerWidth(element.clientWidth);
- }
- function registerSize(key, width) {
- setItemWidths(function (origin) {
- var clone = new Map(origin);
- if (width === null) {
- clone.delete(key);
- } else {
- clone.set(key, width);
- }
- return clone;
- });
- }
- function registerOverflowSize(_, width) {
- setRestWidth(width);
- setPrevRestWidth(restWidth);
- }
- function registerSuffixSize(_, width) {
- setSuffixWidth(width);
- }
- // ================================ Effect ================================
- function getItemWidth(index) {
- return itemWidths.get(getKey(mergedData[index], index));
- }
- (0,useLayoutEffect["default"])(function () {
- if (mergedContainerWidth && typeof mergedRestWidth === 'number' && mergedData) {
- var totalWidth = suffixWidth;
- var len = mergedData.length;
- var lastIndex = len - 1;
- // When data count change to 0, reset this since not loop will reach
- if (!len) {
- updateDisplayCount(0, null);
- return;
- }
- for (var i = 0; i < len; i += 1) {
- var currentItemWidth = getItemWidth(i);
- // Fully will always render
- if (fullySSR) {
- currentItemWidth = currentItemWidth || 0;
- }
- // Break since data not ready
- if (currentItemWidth === undefined) {
- updateDisplayCount(i - 1, undefined, true);
- break;
- }
- // Find best match
- totalWidth += currentItemWidth;
- if (
- // Only one means `totalWidth` is the final width
- lastIndex === 0 && totalWidth <= mergedContainerWidth ||
- // Last two width will be the final width
- i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
- // Additional check if match the end
- updateDisplayCount(lastIndex, null);
- break;
- } else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
- // Can not hold all the content to show rest
- updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
- break;
- }
- }
- if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) {
- setSuffixFixedStart(null);
- }
- }
- }, [mergedContainerWidth, itemWidths, restWidth, suffixWidth, getKey, mergedData]);
- // ================================ Render ================================
- var displayRest = restReady && !!omittedItems.length;
- var suffixStyle = {};
- if (suffixFixedStart !== null && shouldResponsive) {
- suffixStyle = {
- position: 'absolute',
- left: suffixFixedStart,
- top: 0
- };
- }
- var itemSharedProps = {
- prefixCls: itemPrefixCls,
- responsive: shouldResponsive,
- component: itemComponent,
- invalidate: invalidate
- };
- // >>>>> Choice render fun by `renderRawItem`
- var internalRenderItemNode = renderRawItem ? function (item, index) {
- var key = getKey(item, index);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverflowContext.Provider, {
- key: key,
- value: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, itemSharedProps), {}, {
- order: index,
- item: item,
- itemKey: key,
- registerSize: registerSize,
- display: index <= mergedDisplayCount
- })
- }, renderRawItem(item, index));
- } : function (item, index) {
- var key = getKey(item, index);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Item, (0,esm_extends["default"])({}, itemSharedProps, {
- order: index,
- key: key,
- item: item,
- renderItem: mergedRenderItem,
- itemKey: key,
- registerSize: registerSize,
- display: index <= mergedDisplayCount
- }));
- };
- // >>>>> Rest node
- var restContextProps = {
- order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
- className: "".concat(itemPrefixCls, "-rest"),
- registerSize: registerOverflowSize,
- display: displayRest
- };
- var mergedRenderRest = renderRest || defaultRenderRest;
- var restNode = renderRawRest ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverflowContext.Provider, {
- value: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, itemSharedProps), restContextProps)
- }, renderRawRest(omittedItems)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Item, (0,esm_extends["default"])({}, itemSharedProps, restContextProps), typeof mergedRenderRest === 'function' ? mergedRenderRest(omittedItems) : mergedRenderRest);
- var overflowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({
- className: classnames_default()(!invalidate && prefixCls, className),
- style: style,
- ref: ref
- }, restProps), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Item, (0,esm_extends["default"])({}, itemSharedProps, {
- responsive: isResponsive,
- responsiveDisabled: !shouldResponsive,
- order: mergedDisplayCount,
- className: "".concat(itemPrefixCls, "-suffix"),
- registerSize: registerSuffixSize,
- display: true,
- style: suffixStyle
- }), suffix));
- return isResponsive ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onOverflowResize,
- disabled: !shouldResponsive
- }, overflowNode) : overflowNode;
- }
- var ForwardOverflow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Overflow);
- ForwardOverflow.displayName = 'Overflow';
- ForwardOverflow.Item = es_RawItem;
- ForwardOverflow.RESPONSIVE = RESPONSIVE;
- ForwardOverflow.INVALIDATE = INVALIDATE;
- // Convert to generic type
- /* harmony default export */ var es_Overflow = (ForwardOverflow);
- ;// ./node_modules/rc-overflow/es/index.js
- /* harmony default export */ var rc_overflow_es = (es_Overflow);
- ;// ./node_modules/rc-util/es/composeProps.js
- function composeProps(originProps, patchProps, isAll) {
- var composedProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, originProps), isAll ? patchProps : {});
- Object.keys(patchProps).forEach(function (key) {
- var func = patchProps[key];
- if (typeof func === 'function') {
- composedProps[key] = function () {
- var _originProps$key;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- func.apply(void 0, args);
- return (_originProps$key = originProps[key]) === null || _originProps$key === void 0 ? void 0 : _originProps$key.call.apply(_originProps$key, [originProps].concat(args));
- };
- }
- });
- return composedProps;
- }
- /* harmony default export */ var es_composeProps = (composeProps);
- ;// ./node_modules/rc-select/es/Selector/Input.js
- var Input_excluded = ["prefixCls", "id", "inputElement", "autoFocus", "autoComplete", "editable", "activeDescendantId", "value", "open", "attrs"];
- var Input_Input = function Input(props, ref) {
- var prefixCls = props.prefixCls,
- id = props.id,
- inputElement = props.inputElement,
- autoFocus = props.autoFocus,
- autoComplete = props.autoComplete,
- editable = props.editable,
- activeDescendantId = props.activeDescendantId,
- value = props.value,
- open = props.open,
- attrs = props.attrs,
- restProps = (0,objectWithoutProperties["default"])(props, Input_excluded);
- var inputNode = inputElement || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", null);
- var _inputNode = inputNode,
- originRef = _inputNode.ref,
- originProps = _inputNode.props;
- (0,warning.warning)(!('maxLength' in inputNode.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled.");
- inputNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(inputNode, (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({
- type: 'search'
- }, es_composeProps(restProps, originProps, true)), {}, {
- // Override over origin props
- id: id,
- ref: (0,es_ref.composeRef)(ref, originRef),
- autoComplete: autoComplete || 'off',
- autoFocus: autoFocus,
- className: classnames_default()("".concat(prefixCls, "-selection-search-input"), originProps === null || originProps === void 0 ? void 0 : originProps.className),
- role: 'combobox',
- 'aria-expanded': open || false,
- 'aria-haspopup': 'listbox',
- 'aria-owns': "".concat(id, "_list"),
- 'aria-autocomplete': 'list',
- 'aria-controls': "".concat(id, "_list"),
- 'aria-activedescendant': open ? activeDescendantId : undefined
- }, attrs), {}, {
- value: editable ? value : '',
- readOnly: !editable,
- unselectable: !editable ? 'on' : null,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, originProps.style), {}, {
- opacity: editable ? null : 0
- })
- }));
- return inputNode;
- };
- var RefInput = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Input_Input);
- if (true) {
- RefInput.displayName = 'Input';
- }
- /* harmony default export */ var Selector_Input = (RefInput);
- ;// ./node_modules/rc-select/es/utils/commonUtil.js
- function commonUtil_toArray(value) {
- if (Array.isArray(value)) {
- return value;
- }
- return value !== undefined ? [value] : [];
- }
- var isClient = typeof window !== 'undefined' && window.document && window.document.documentElement;
- /** Is client side and not jsdom */
- var isBrowserClient = true && isClient;
- function hasValue(value) {
- return value !== undefined && value !== null;
- }
- /** combo mode no value judgment function */
- function isComboNoValue(value) {
- return !value && value !== 0;
- }
- function isTitleType(title) {
- return ['string', 'number'].includes((0,esm_typeof["default"])(title));
- }
- function getTitle(item) {
- var title = undefined;
- if (item) {
- if (isTitleType(item.title)) {
- title = item.title.toString();
- } else if (isTitleType(item.label)) {
- title = item.label.toString();
- }
- }
- return title;
- }
- ;// ./node_modules/rc-select/es/hooks/useLayoutEffect.js
- /* eslint-disable react-hooks/rules-of-hooks */
- /**
- * Wrap `React.useLayoutEffect` which will not throw warning message in test env
- */
- function useLayoutEffect_useLayoutEffect(effect, deps) {
- // Never happen in test env
- if (isBrowserClient) {
- /* istanbul ignore next */
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect(effect, deps);
- } else {
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(effect, deps);
- }
- }
- /* eslint-enable */
- ;// ./node_modules/rc-select/es/Selector/MultipleSelector.js
- function itemKey(value) {
- var _value$key;
- return (_value$key = value.key) !== null && _value$key !== void 0 ? _value$key : value.value;
- }
- var onPreventMouseDown = function onPreventMouseDown(event) {
- event.preventDefault();
- event.stopPropagation();
- };
- var SelectSelector = function SelectSelector(props) {
- var id = props.id,
- prefixCls = props.prefixCls,
- values = props.values,
- open = props.open,
- searchValue = props.searchValue,
- autoClearSearchValue = props.autoClearSearchValue,
- inputRef = props.inputRef,
- placeholder = props.placeholder,
- disabled = props.disabled,
- mode = props.mode,
- showSearch = props.showSearch,
- autoFocus = props.autoFocus,
- autoComplete = props.autoComplete,
- activeDescendantId = props.activeDescendantId,
- tabIndex = props.tabIndex,
- removeIcon = props.removeIcon,
- maxTagCount = props.maxTagCount,
- maxTagTextLength = props.maxTagTextLength,
- _props$maxTagPlacehol = props.maxTagPlaceholder,
- maxTagPlaceholder = _props$maxTagPlacehol === void 0 ? function (omittedValues) {
- return "+ ".concat(omittedValues.length, " ...");
- } : _props$maxTagPlacehol,
- tagRender = props.tagRender,
- onToggleOpen = props.onToggleOpen,
- onRemove = props.onRemove,
- onInputChange = props.onInputChange,
- onInputPaste = props.onInputPaste,
- onInputKeyDown = props.onInputKeyDown,
- onInputMouseDown = props.onInputMouseDown,
- onInputCompositionStart = props.onInputCompositionStart,
- onInputCompositionEnd = props.onInputCompositionEnd,
- onInputBlur = props.onInputBlur;
- var measureRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- inputWidth = _useState2[0],
- setInputWidth = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- focused = _useState4[0],
- setFocused = _useState4[1];
- var selectionPrefixCls = "".concat(prefixCls, "-selection");
- // ===================== Search ======================
- var inputValue = open || mode === 'multiple' && autoClearSearchValue === false || mode === 'tags' ? searchValue : '';
- var inputEditable = mode === 'tags' || mode === 'multiple' && autoClearSearchValue === false || showSearch && (open || focused);
- // We measure width and set to the input immediately
- useLayoutEffect_useLayoutEffect(function () {
- setInputWidth(measureRef.current.scrollWidth);
- }, [inputValue]);
- // ===================== Render ======================
- // >>> Render Selector Node. Includes Item & Rest
- var defaultRenderSelector = function defaultRenderSelector(item, content, itemDisabled, closable, onClose) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- title: getTitle(item),
- className: classnames_default()("".concat(selectionPrefixCls, "-item"), (0,defineProperty["default"])({}, "".concat(selectionPrefixCls, "-item-disabled"), itemDisabled))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(selectionPrefixCls, "-item-content")
- }, content), closable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TransBtn, {
- className: "".concat(selectionPrefixCls, "-item-remove"),
- onMouseDown: onPreventMouseDown,
- onClick: onClose,
- customizeIcon: removeIcon
- }, "\xD7"));
- };
- var customizeRenderSelector = function customizeRenderSelector(value, content, itemDisabled, closable, onClose, isMaxTag) {
- var onMouseDown = function onMouseDown(e) {
- onPreventMouseDown(e);
- onToggleOpen(!open);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- onMouseDown: onMouseDown
- }, tagRender({
- label: content,
- value: value,
- disabled: itemDisabled,
- closable: closable,
- onClose: onClose,
- isMaxTag: !!isMaxTag
- }));
- };
- var renderItem = function renderItem(valueItem) {
- var itemDisabled = valueItem.disabled,
- label = valueItem.label,
- value = valueItem.value;
- var closable = !disabled && !itemDisabled;
- var displayLabel = label;
- if (typeof maxTagTextLength === 'number') {
- if (typeof label === 'string' || typeof label === 'number') {
- var strLabel = String(displayLabel);
- if (strLabel.length > maxTagTextLength) {
- displayLabel = "".concat(strLabel.slice(0, maxTagTextLength), "...");
- }
- }
- }
- var onClose = function onClose(event) {
- if (event) {
- event.stopPropagation();
- }
- onRemove(valueItem);
- };
- return typeof tagRender === 'function' ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);
- };
- var renderRest = function renderRest(omittedValues) {
- // https://github.com/ant-design/ant-design/issues/48930
- if (!values.length) {
- return null;
- }
- var content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
- return typeof tagRender === 'function' ? customizeRenderSelector(undefined, content, false, false, undefined, true) : defaultRenderSelector({
- title: content
- }, content, false);
- };
- // >>> Input Node
- var inputNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(selectionPrefixCls, "-search"),
- style: {
- width: inputWidth
- },
- onFocus: function onFocus() {
- setFocused(true);
- },
- onBlur: function onBlur() {
- setFocused(false);
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Selector_Input, {
- ref: inputRef,
- open: open,
- prefixCls: prefixCls,
- id: id,
- inputElement: null,
- disabled: disabled,
- autoFocus: autoFocus,
- autoComplete: autoComplete,
- editable: inputEditable,
- activeDescendantId: activeDescendantId,
- value: inputValue,
- onKeyDown: onInputKeyDown,
- onMouseDown: onInputMouseDown,
- onChange: onInputChange,
- onPaste: onInputPaste,
- onCompositionStart: onInputCompositionStart,
- onCompositionEnd: onInputCompositionEnd,
- onBlur: onInputBlur,
- tabIndex: tabIndex,
- attrs: (0,pickAttrs["default"])(props, true)
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- ref: measureRef,
- className: "".concat(selectionPrefixCls, "-search-mirror"),
- "aria-hidden": true
- }, inputValue, "\xA0"));
- // >>> Selections
- var selectionNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_overflow_es, {
- prefixCls: "".concat(selectionPrefixCls, "-overflow"),
- data: values,
- renderItem: renderItem,
- renderRest: renderRest,
- suffix: inputNode,
- itemKey: itemKey,
- maxCount: maxTagCount
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(selectionPrefixCls, "-wrap")
- }, selectionNode, !values.length && !inputValue && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(selectionPrefixCls, "-placeholder")
- }, placeholder));
- };
- /* harmony default export */ var MultipleSelector = (SelectSelector);
- ;// ./node_modules/rc-select/es/Selector/SingleSelector.js
- var SingleSelector = function SingleSelector(props) {
- var inputElement = props.inputElement,
- prefixCls = props.prefixCls,
- id = props.id,
- inputRef = props.inputRef,
- disabled = props.disabled,
- autoFocus = props.autoFocus,
- autoComplete = props.autoComplete,
- activeDescendantId = props.activeDescendantId,
- mode = props.mode,
- open = props.open,
- values = props.values,
- placeholder = props.placeholder,
- tabIndex = props.tabIndex,
- showSearch = props.showSearch,
- searchValue = props.searchValue,
- activeValue = props.activeValue,
- maxLength = props.maxLength,
- onInputKeyDown = props.onInputKeyDown,
- onInputMouseDown = props.onInputMouseDown,
- onInputChange = props.onInputChange,
- onInputPaste = props.onInputPaste,
- onInputCompositionStart = props.onInputCompositionStart,
- onInputCompositionEnd = props.onInputCompositionEnd,
- onInputBlur = props.onInputBlur,
- title = props.title;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- inputChanged = _React$useState2[0],
- setInputChanged = _React$useState2[1];
- var combobox = mode === 'combobox';
- var inputEditable = combobox || showSearch;
- var item = values[0];
- var inputValue = searchValue || '';
- if (combobox && activeValue && !inputChanged) {
- inputValue = activeValue;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (combobox) {
- setInputChanged(false);
- }
- }, [combobox, activeValue]);
- // Not show text when closed expect combobox mode
- var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue;
- // Get title of selection item
- var selectionTitle = title === undefined ? getTitle(item) : title;
- var placeholderNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (item) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-selection-placeholder"),
- style: hasTextInput ? {
- visibility: 'hidden'
- } : undefined
- }, placeholder);
- }, [item, hasTextInput, placeholder, prefixCls]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-selection-wrap")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-selection-search")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Selector_Input, {
- ref: inputRef,
- prefixCls: prefixCls,
- id: id,
- open: open,
- inputElement: inputElement,
- disabled: disabled,
- autoFocus: autoFocus,
- autoComplete: autoComplete,
- editable: inputEditable,
- activeDescendantId: activeDescendantId,
- value: inputValue,
- onKeyDown: onInputKeyDown,
- onMouseDown: onInputMouseDown,
- onChange: function onChange(e) {
- setInputChanged(true);
- onInputChange(e);
- },
- onPaste: onInputPaste,
- onCompositionStart: onInputCompositionStart,
- onCompositionEnd: onInputCompositionEnd,
- onBlur: onInputBlur,
- tabIndex: tabIndex,
- attrs: (0,pickAttrs["default"])(props, true),
- maxLength: combobox ? maxLength : undefined
- })), !combobox && item ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-selection-item"),
- title: selectionTitle
- // 当 Select 已经选中选项时,还需 selection 隐藏但留在原地占位
- // https://github.com/ant-design/ant-design/issues/27688
- // https://github.com/ant-design/ant-design/issues/41530
- ,
- style: hasTextInput ? {
- visibility: 'hidden'
- } : undefined
- }, item.label) : null, placeholderNode);
- };
- /* harmony default export */ var Selector_SingleSelector = (SingleSelector);
- ;// ./node_modules/rc-select/es/Selector/index.js
- /**
- * Cursor rule:
- * 1. Only `showSearch` enabled
- * 2. Only `open` is `true`
- * 3. When typing, set `open` to `true` which hit rule of 2
- *
- * Accessibility:
- * - https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
- */
- var Selector = function Selector(props, ref) {
- var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var compositionStatusRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var prefixCls = props.prefixCls,
- open = props.open,
- mode = props.mode,
- showSearch = props.showSearch,
- tokenWithEnter = props.tokenWithEnter,
- disabled = props.disabled,
- prefix = props.prefix,
- autoClearSearchValue = props.autoClearSearchValue,
- onSearch = props.onSearch,
- onSearchSubmit = props.onSearchSubmit,
- onToggleOpen = props.onToggleOpen,
- onInputKeyDown = props.onInputKeyDown,
- onInputBlur = props.onInputBlur,
- domRef = props.domRef;
- // ======================= Ref =======================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- focus: function focus(options) {
- inputRef.current.focus(options);
- },
- blur: function blur() {
- inputRef.current.blur();
- }
- };
- });
- // ====================== Input ======================
- var _useLock = useLock(0),
- _useLock2 = (0,slicedToArray["default"])(_useLock, 2),
- getInputMouseDown = _useLock2[0],
- setInputMouseDown = _useLock2[1];
- var onInternalInputKeyDown = function onInternalInputKeyDown(event) {
- var which = event.which;
- // Compatible with multiple lines in TextArea
- var isTextAreaElement = inputRef.current instanceof HTMLTextAreaElement;
- if (!isTextAreaElement && open && (which === KeyCode["default"].UP || which === KeyCode["default"].DOWN)) {
- event.preventDefault();
- }
- if (onInputKeyDown) {
- onInputKeyDown(event);
- }
- if (which === KeyCode["default"].ENTER && mode === 'tags' && !compositionStatusRef.current && !open) {
- // When menu isn't open, OptionList won't trigger a value change
- // So when enter is pressed, the tag's input value should be emitted here to let selector know
- onSearchSubmit === null || onSearchSubmit === void 0 || onSearchSubmit(event.target.value);
- }
- // Move within the text box
- if (isTextAreaElement && !open && ~[KeyCode["default"].UP, KeyCode["default"].DOWN, KeyCode["default"].LEFT, KeyCode["default"].RIGHT].indexOf(which)) {
- return;
- }
- if (isValidateOpenKey(which)) {
- onToggleOpen(true);
- }
- };
- /**
- * We can not use `findDOMNode` sine it will get warning,
- * have to use timer to check if is input element.
- */
- var onInternalInputMouseDown = function onInternalInputMouseDown() {
- setInputMouseDown(true);
- };
- // When paste come, ignore next onChange
- var pastedTextRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var triggerOnSearch = function triggerOnSearch(value) {
- if (onSearch(value, true, compositionStatusRef.current) !== false) {
- onToggleOpen(true);
- }
- };
- var onInputCompositionStart = function onInputCompositionStart() {
- compositionStatusRef.current = true;
- };
- var onInputCompositionEnd = function onInputCompositionEnd(e) {
- compositionStatusRef.current = false;
- // Trigger search again to support `tokenSeparators` with typewriting
- if (mode !== 'combobox') {
- triggerOnSearch(e.target.value);
- }
- };
- var onInputChange = function onInputChange(event) {
- var value = event.target.value;
- // Pasted text should replace back to origin content
- if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
- // CRLF will be treated as a single space for input element
- var replacedText = pastedTextRef.current.replace(/[\r\n]+$/, '').replace(/\r\n/g, ' ').replace(/[\r\n]/g, ' ');
- value = value.replace(replacedText, pastedTextRef.current);
- }
- pastedTextRef.current = null;
- triggerOnSearch(value);
- };
- var onInputPaste = function onInputPaste(e) {
- var clipboardData = e.clipboardData;
- var value = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
- pastedTextRef.current = value || '';
- };
- var onClick = function onClick(_ref) {
- var target = _ref.target;
- if (target !== inputRef.current) {
- // Should focus input if click the selector
- var isIE = document.body.style.msTouchAction !== undefined;
- if (isIE) {
- setTimeout(function () {
- inputRef.current.focus();
- });
- } else {
- inputRef.current.focus();
- }
- }
- };
- var onMouseDown = function onMouseDown(event) {
- var inputMouseDown = getInputMouseDown();
- // when mode is combobox and it is disabled, don't prevent default behavior
- // https://github.com/ant-design/ant-design/issues/37320
- // https://github.com/ant-design/ant-design/issues/48281
- if (event.target !== inputRef.current && !inputMouseDown && !(mode === 'combobox' && disabled)) {
- event.preventDefault();
- }
- if (mode !== 'combobox' && (!showSearch || !inputMouseDown) || !open) {
- if (open && autoClearSearchValue !== false) {
- onSearch('', true, false);
- }
- onToggleOpen();
- }
- };
- // ================= Inner Selector ==================
- var sharedProps = {
- inputRef: inputRef,
- onInputKeyDown: onInternalInputKeyDown,
- onInputMouseDown: onInternalInputMouseDown,
- onInputChange: onInputChange,
- onInputPaste: onInputPaste,
- onInputCompositionStart: onInputCompositionStart,
- onInputCompositionEnd: onInputCompositionEnd,
- onInputBlur: onInputBlur
- };
- var selectNode = mode === 'multiple' || mode === 'tags' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MultipleSelector, (0,esm_extends["default"])({}, props, sharedProps)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Selector_SingleSelector, (0,esm_extends["default"])({}, props, sharedProps));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: domRef,
- className: "".concat(prefixCls, "-selector"),
- onClick: onClick,
- onMouseDown: onMouseDown
- }, prefix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-prefix")
- }, prefix), selectNode);
- };
- var ForwardSelector = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Selector);
- if (true) {
- ForwardSelector.displayName = 'Selector';
- }
- /* harmony default export */ var es_Selector = (ForwardSelector);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/shadow.js
- var shadow = __webpack_require__("./node_modules/rc-util/es/Dom/shadow.js");
- ;// ./node_modules/@rc-component/trigger/es/Popup/Arrow.js
- function Arrow(props) {
- var prefixCls = props.prefixCls,
- align = props.align,
- arrow = props.arrow,
- arrowPos = props.arrowPos;
- var _ref = arrow || {},
- className = _ref.className,
- content = _ref.content;
- var _arrowPos$x = arrowPos.x,
- x = _arrowPos$x === void 0 ? 0 : _arrowPos$x,
- _arrowPos$y = arrowPos.y,
- y = _arrowPos$y === void 0 ? 0 : _arrowPos$y;
- var arrowRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- // Skip if no align
- if (!align || !align.points) {
- return null;
- }
- var alignStyle = {
- position: 'absolute'
- };
- // Skip if no need to align
- if (align.autoArrow !== false) {
- var popupPoints = align.points[0];
- var targetPoints = align.points[1];
- var popupTB = popupPoints[0];
- var popupLR = popupPoints[1];
- var targetTB = targetPoints[0];
- var targetLR = targetPoints[1];
- // Top & Bottom
- if (popupTB === targetTB || !['t', 'b'].includes(popupTB)) {
- alignStyle.top = y;
- } else if (popupTB === 't') {
- alignStyle.top = 0;
- } else {
- alignStyle.bottom = 0;
- }
- // Left & Right
- if (popupLR === targetLR || !['l', 'r'].includes(popupLR)) {
- alignStyle.left = x;
- } else if (popupLR === 'l') {
- alignStyle.left = 0;
- } else {
- alignStyle.right = 0;
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: arrowRef,
- className: classnames_default()("".concat(prefixCls, "-arrow"), className),
- style: alignStyle
- }, content);
- }
- ;// ./node_modules/@rc-component/trigger/es/Popup/Mask.js
- function Mask_Mask(props) {
- var prefixCls = props.prefixCls,
- open = props.open,
- zIndex = props.zIndex,
- mask = props.mask,
- motion = props.motion;
- if (!mask) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({}, motion, {
- motionAppear: true,
- visible: open,
- removeOnLeave: true
- }), function (_ref) {
- var className = _ref.className;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- zIndex: zIndex
- },
- className: classnames_default()("".concat(prefixCls, "-mask"), className)
- });
- });
- }
- ;// ./node_modules/@rc-component/trigger/es/Popup/PopupContent.js
- var PopupContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(function (_ref) {
- var children = _ref.children;
- return children;
- }, function (_, next) {
- return next.cache;
- });
- if (true) {
- PopupContent.displayName = 'PopupContent';
- }
- /* harmony default export */ var Popup_PopupContent = (PopupContent);
- ;// ./node_modules/@rc-component/trigger/es/Popup/index.js
- var Popup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var popup = props.popup,
- className = props.className,
- prefixCls = props.prefixCls,
- style = props.style,
- target = props.target,
- _onVisibleChanged = props.onVisibleChanged,
- open = props.open,
- keepDom = props.keepDom,
- fresh = props.fresh,
- onClick = props.onClick,
- mask = props.mask,
- arrow = props.arrow,
- arrowPos = props.arrowPos,
- align = props.align,
- motion = props.motion,
- maskMotion = props.maskMotion,
- forceRender = props.forceRender,
- getPopupContainer = props.getPopupContainer,
- autoDestroy = props.autoDestroy,
- Portal = props.portal,
- zIndex = props.zIndex,
- onMouseEnter = props.onMouseEnter,
- onMouseLeave = props.onMouseLeave,
- onPointerEnter = props.onPointerEnter,
- onPointerDownCapture = props.onPointerDownCapture,
- ready = props.ready,
- offsetX = props.offsetX,
- offsetY = props.offsetY,
- offsetR = props.offsetR,
- offsetB = props.offsetB,
- onAlign = props.onAlign,
- onPrepare = props.onPrepare,
- stretch = props.stretch,
- targetWidth = props.targetWidth,
- targetHeight = props.targetHeight;
- var childNode = typeof popup === 'function' ? popup() : popup;
- // We can not remove holder only when motion finished.
- var isNodeVisible = open || keepDom;
- // ======================= Container ========================
- var getPopupContainerNeedParams = (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.length) > 0;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(!getPopupContainer || !getPopupContainerNeedParams),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- show = _React$useState2[0],
- setShow = _React$useState2[1];
- // Delay to show since `getPopupContainer` need target element
- (0,useLayoutEffect["default"])(function () {
- if (!show && getPopupContainerNeedParams && target) {
- setShow(true);
- }
- }, [show, getPopupContainerNeedParams, target]);
- // ========================= Render =========================
- if (!show) {
- return null;
- }
- // >>>>> Offset
- var AUTO = 'auto';
- var offsetStyle = {
- left: '-1000vw',
- top: '-1000vh',
- right: AUTO,
- bottom: AUTO
- };
- // Set align style
- if (ready || !open) {
- var _experimental;
- var points = align.points;
- var dynamicInset = align.dynamicInset || ((_experimental = align._experimental) === null || _experimental === void 0 ? void 0 : _experimental.dynamicInset);
- var alignRight = dynamicInset && points[0][1] === 'r';
- var alignBottom = dynamicInset && points[0][0] === 'b';
- if (alignRight) {
- offsetStyle.right = offsetR;
- offsetStyle.left = AUTO;
- } else {
- offsetStyle.left = offsetX;
- offsetStyle.right = AUTO;
- }
- if (alignBottom) {
- offsetStyle.bottom = offsetB;
- offsetStyle.top = AUTO;
- } else {
- offsetStyle.top = offsetY;
- offsetStyle.bottom = AUTO;
- }
- }
- // >>>>> Misc
- var miscStyle = {};
- if (stretch) {
- if (stretch.includes('height') && targetHeight) {
- miscStyle.height = targetHeight;
- } else if (stretch.includes('minHeight') && targetHeight) {
- miscStyle.minHeight = targetHeight;
- }
- if (stretch.includes('width') && targetWidth) {
- miscStyle.width = targetWidth;
- } else if (stretch.includes('minWidth') && targetWidth) {
- miscStyle.minWidth = targetWidth;
- }
- }
- if (!open) {
- miscStyle.pointerEvents = 'none';
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Portal, {
- open: forceRender || isNodeVisible,
- getContainer: getPopupContainer && function () {
- return getPopupContainer(target);
- },
- autoDestroy: autoDestroy
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Mask_Mask, {
- prefixCls: prefixCls,
- open: open,
- zIndex: zIndex,
- mask: mask,
- motion: maskMotion
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onAlign,
- disabled: !open
- }, function (resizeObserverRef) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- motionAppear: true,
- motionEnter: true,
- motionLeave: true,
- removeOnLeave: false,
- forceRender: forceRender,
- leavedClassName: "".concat(prefixCls, "-hidden")
- }, motion, {
- onAppearPrepare: onPrepare,
- onEnterPrepare: onPrepare,
- visible: open,
- onVisibleChanged: function onVisibleChanged(nextVisible) {
- var _motion$onVisibleChan;
- motion === null || motion === void 0 || (_motion$onVisibleChan = motion.onVisibleChanged) === null || _motion$onVisibleChan === void 0 || _motion$onVisibleChan.call(motion, nextVisible);
- _onVisibleChanged(nextVisible);
- }
- }), function (_ref, motionRef) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- var cls = classnames_default()(prefixCls, motionClassName, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: (0,es_ref.composeRef)(resizeObserverRef, ref, motionRef),
- className: cls,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({
- '--arrow-x': "".concat(arrowPos.x || 0, "px"),
- '--arrow-y': "".concat(arrowPos.y || 0, "px")
- }, offsetStyle), miscStyle), motionStyle), {}, {
- boxSizing: 'border-box',
- zIndex: zIndex
- }, style),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onPointerEnter: onPointerEnter,
- onClick: onClick,
- onPointerDownCapture: onPointerDownCapture
- }, arrow && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Arrow, {
- prefixCls: prefixCls,
- arrow: arrow,
- arrowPos: arrowPos,
- align: align
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Popup_PopupContent, {
- cache: !open && !fresh
- }, childNode));
- });
- }));
- });
- if (true) {
- Popup.displayName = 'Popup';
- }
- /* harmony default export */ var es_Popup = (Popup);
- ;// ./node_modules/@rc-component/trigger/es/TriggerWrapper.js
- var TriggerWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var children = props.children,
- getTriggerDOMNode = props.getTriggerDOMNode;
- var canUseRef = (0,es_ref.supportRef)(children);
- // When use `getTriggerDOMNode`, we should do additional work to get the real dom
- var setRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (node) {
- (0,es_ref.fillRef)(ref, getTriggerDOMNode ? getTriggerDOMNode(node) : node);
- }, [getTriggerDOMNode]);
- var mergedRef = (0,es_ref.useComposeRef)(setRef, (0,es_ref.getNodeRef)(children));
- return canUseRef ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
- ref: mergedRef
- }) : children;
- });
- if (true) {
- TriggerWrapper.displayName = 'TriggerWrapper';
- }
- /* harmony default export */ var es_TriggerWrapper = (TriggerWrapper);
- ;// ./node_modules/@rc-component/trigger/es/context.js
- var TriggerContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_context = (TriggerContext);
- ;// ./node_modules/@rc-component/trigger/es/hooks/useAction.js
- function useAction_toArray(val) {
- return val ? Array.isArray(val) ? val : [val] : [];
- }
- function useAction(mobile, action, showAction, hideAction) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var mergedShowAction = useAction_toArray(showAction !== null && showAction !== void 0 ? showAction : action);
- var mergedHideAction = useAction_toArray(hideAction !== null && hideAction !== void 0 ? hideAction : action);
- var showActionSet = new Set(mergedShowAction);
- var hideActionSet = new Set(mergedHideAction);
- if (mobile) {
- if (showActionSet.has('hover')) {
- showActionSet.delete('hover');
- showActionSet.add('click');
- }
- if (hideActionSet.has('hover')) {
- hideActionSet.delete('hover');
- hideActionSet.add('click');
- }
- }
- return [showActionSet, hideActionSet];
- }, [mobile, action, showAction, hideAction]);
- }
- ;// ./node_modules/@rc-component/trigger/es/util.js
- function isPointsEq() {
- var a1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var a2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var isAlignPoint = arguments.length > 2 ? arguments[2] : undefined;
- if (isAlignPoint) {
- return a1[0] === a2[0];
- }
- return a1[0] === a2[0] && a1[1] === a2[1];
- }
- function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
- var points = align.points;
- var placements = Object.keys(builtinPlacements);
- for (var i = 0; i < placements.length; i += 1) {
- var _builtinPlacements$pl;
- var placement = placements[i];
- if (isPointsEq((_builtinPlacements$pl = builtinPlacements[placement]) === null || _builtinPlacements$pl === void 0 ? void 0 : _builtinPlacements$pl.points, points, isAlignPoint)) {
- return "".concat(prefixCls, "-placement-").concat(placement);
- }
- }
- return '';
- }
- /** @deprecated We should not use this if we can refactor all deps */
- function es_util_getMotion(prefixCls, motion, animation, transitionName) {
- if (motion) {
- return motion;
- }
- if (animation) {
- return {
- motionName: "".concat(prefixCls, "-").concat(animation)
- };
- }
- if (transitionName) {
- return {
- motionName: transitionName
- };
- }
- return null;
- }
- function getWin(ele) {
- return ele.ownerDocument.defaultView;
- }
- /**
- * Get all the scrollable parent elements of the element
- * @param ele The element to be detected
- * @param areaOnly Only return the parent which will cut visible area
- */
- function collectScroller(ele) {
- var scrollerList = [];
- var current = ele === null || ele === void 0 ? void 0 : ele.parentElement;
- var scrollStyle = ['hidden', 'scroll', 'clip', 'auto'];
- while (current) {
- var _getWin$getComputedSt = getWin(current).getComputedStyle(current),
- overflowX = _getWin$getComputedSt.overflowX,
- overflowY = _getWin$getComputedSt.overflowY,
- overflow = _getWin$getComputedSt.overflow;
- if ([overflowX, overflowY, overflow].some(function (o) {
- return scrollStyle.includes(o);
- })) {
- scrollerList.push(current);
- }
- current = current.parentElement;
- }
- return scrollerList;
- }
- function toNum(num) {
- var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
- return Number.isNaN(num) ? defaultValue : num;
- }
- function getPxValue(val) {
- return toNum(parseFloat(val), 0);
- }
- /**
- *
- *
- * **************************************
- * * Border *
- * * ************************** *
- * * * * * *
- * * B * * S * B *
- * * o * * c * o *
- * * r * Content * r * r *
- * * d * * o * d *
- * * e * * l * e *
- * * r ******************** l * r *
- * * * Scroll * *
- * * ************************** *
- * * Border *
- * **************************************
- *
- */
- /**
- * Get visible area of element
- */
- function getVisibleArea(initArea, scrollerList) {
- var visibleArea = (0,objectSpread2["default"])({}, initArea);
- (scrollerList || []).forEach(function (ele) {
- if (ele instanceof HTMLBodyElement || ele instanceof HTMLHtmlElement) {
- return;
- }
- // Skip if static position which will not affect visible area
- var _getWin$getComputedSt2 = getWin(ele).getComputedStyle(ele),
- overflow = _getWin$getComputedSt2.overflow,
- overflowClipMargin = _getWin$getComputedSt2.overflowClipMargin,
- borderTopWidth = _getWin$getComputedSt2.borderTopWidth,
- borderBottomWidth = _getWin$getComputedSt2.borderBottomWidth,
- borderLeftWidth = _getWin$getComputedSt2.borderLeftWidth,
- borderRightWidth = _getWin$getComputedSt2.borderRightWidth;
- var eleRect = ele.getBoundingClientRect();
- var eleOutHeight = ele.offsetHeight,
- eleInnerHeight = ele.clientHeight,
- eleOutWidth = ele.offsetWidth,
- eleInnerWidth = ele.clientWidth;
- var borderTopNum = getPxValue(borderTopWidth);
- var borderBottomNum = getPxValue(borderBottomWidth);
- var borderLeftNum = getPxValue(borderLeftWidth);
- var borderRightNum = getPxValue(borderRightWidth);
- var scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1000) / 1000);
- var scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1000) / 1000);
- // Original visible area
- var eleScrollWidth = (eleOutWidth - eleInnerWidth - borderLeftNum - borderRightNum) * scaleX;
- var eleScrollHeight = (eleOutHeight - eleInnerHeight - borderTopNum - borderBottomNum) * scaleY;
- // Cut border size
- var scaledBorderTopWidth = borderTopNum * scaleY;
- var scaledBorderBottomWidth = borderBottomNum * scaleY;
- var scaledBorderLeftWidth = borderLeftNum * scaleX;
- var scaledBorderRightWidth = borderRightNum * scaleX;
- // Clip margin
- var clipMarginWidth = 0;
- var clipMarginHeight = 0;
- if (overflow === 'clip') {
- var clipNum = getPxValue(overflowClipMargin);
- clipMarginWidth = clipNum * scaleX;
- clipMarginHeight = clipNum * scaleY;
- }
- // Region
- var eleLeft = eleRect.x + scaledBorderLeftWidth - clipMarginWidth;
- var eleTop = eleRect.y + scaledBorderTopWidth - clipMarginHeight;
- var eleRight = eleLeft + eleRect.width + 2 * clipMarginWidth - scaledBorderLeftWidth - scaledBorderRightWidth - eleScrollWidth;
- var eleBottom = eleTop + eleRect.height + 2 * clipMarginHeight - scaledBorderTopWidth - scaledBorderBottomWidth - eleScrollHeight;
- visibleArea.left = Math.max(visibleArea.left, eleLeft);
- visibleArea.top = Math.max(visibleArea.top, eleTop);
- visibleArea.right = Math.min(visibleArea.right, eleRight);
- visibleArea.bottom = Math.min(visibleArea.bottom, eleBottom);
- });
- return visibleArea;
- }
- ;// ./node_modules/@rc-component/trigger/es/hooks/useAlign.js
- function getUnitOffset(size) {
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var offsetStr = "".concat(offset);
- var cells = offsetStr.match(/^(.*)\%$/);
- if (cells) {
- return size * (parseFloat(cells[1]) / 100);
- }
- return parseFloat(offsetStr);
- }
- function getNumberOffset(rect, offset) {
- var _ref = offset || [],
- _ref2 = (0,slicedToArray["default"])(_ref, 2),
- offsetX = _ref2[0],
- offsetY = _ref2[1];
- return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
- }
- function splitPoints() {
- var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- return [points[0], points[1]];
- }
- function getAlignPoint(rect, points) {
- var topBottom = points[0];
- var leftRight = points[1];
- var x;
- var y;
- // Top & Bottom
- if (topBottom === 't') {
- y = rect.y;
- } else if (topBottom === 'b') {
- y = rect.y + rect.height;
- } else {
- y = rect.y + rect.height / 2;
- }
- // Left & Right
- if (leftRight === 'l') {
- x = rect.x;
- } else if (leftRight === 'r') {
- x = rect.x + rect.width;
- } else {
- x = rect.x + rect.width / 2;
- }
- return {
- x: x,
- y: y
- };
- }
- function reversePoints(points, index) {
- var reverseMap = {
- t: 'b',
- b: 't',
- l: 'r',
- r: 'l'
- };
- return points.map(function (point, i) {
- if (i === index) {
- return reverseMap[point] || 'c';
- }
- return point;
- }).join('');
- }
- function useAlign(open, popupEle, target, placement, builtinPlacements, popupAlign, onPopupAlign) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({
- ready: false,
- offsetX: 0,
- offsetY: 0,
- offsetR: 0,
- offsetB: 0,
- arrowX: 0,
- arrowY: 0,
- scaleX: 1,
- scaleY: 1,
- align: builtinPlacements[placement] || {}
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- offsetInfo = _React$useState2[0],
- setOffsetInfo = _React$useState2[1];
- var alignCountRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(0);
- var scrollerList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!popupEle) {
- return [];
- }
- return collectScroller(popupEle);
- }, [popupEle]);
- // ========================= Flip ==========================
- // We will memo flip info.
- // If size change to make flip, it will memo the flip info and use it in next align.
- var prevFlipRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- var resetFlipCache = function resetFlipCache() {
- prevFlipRef.current = {};
- };
- if (!open) {
- resetFlipCache();
- }
- // ========================= Align =========================
- var onAlign = (0,useEvent["default"])(function () {
- if (popupEle && target && open) {
- var _popupElement$parentE, _popupRect$x, _popupRect$y, _popupElement$parentE2;
- var popupElement = popupEle;
- var doc = popupElement.ownerDocument;
- var win = getWin(popupElement);
- var _win$getComputedStyle = win.getComputedStyle(popupElement),
- popupPosition = _win$getComputedStyle.position;
- var originLeft = popupElement.style.left;
- var originTop = popupElement.style.top;
- var originRight = popupElement.style.right;
- var originBottom = popupElement.style.bottom;
- var originOverflow = popupElement.style.overflow;
- // Placement
- var placementInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, builtinPlacements[placement]), popupAlign);
- // placeholder element
- var placeholderElement = doc.createElement('div');
- (_popupElement$parentE = popupElement.parentElement) === null || _popupElement$parentE === void 0 || _popupElement$parentE.appendChild(placeholderElement);
- placeholderElement.style.left = "".concat(popupElement.offsetLeft, "px");
- placeholderElement.style.top = "".concat(popupElement.offsetTop, "px");
- placeholderElement.style.position = popupPosition;
- placeholderElement.style.height = "".concat(popupElement.offsetHeight, "px");
- placeholderElement.style.width = "".concat(popupElement.offsetWidth, "px");
- // Reset first
- popupElement.style.left = '0';
- popupElement.style.top = '0';
- popupElement.style.right = 'auto';
- popupElement.style.bottom = 'auto';
- popupElement.style.overflow = 'hidden';
- // Calculate align style, we should consider `transform` case
- var targetRect;
- if (Array.isArray(target)) {
- targetRect = {
- x: target[0],
- y: target[1],
- width: 0,
- height: 0
- };
- } else {
- var _rect$x, _rect$y;
- var rect = target.getBoundingClientRect();
- rect.x = (_rect$x = rect.x) !== null && _rect$x !== void 0 ? _rect$x : rect.left;
- rect.y = (_rect$y = rect.y) !== null && _rect$y !== void 0 ? _rect$y : rect.top;
- targetRect = {
- x: rect.x,
- y: rect.y,
- width: rect.width,
- height: rect.height
- };
- }
- var popupRect = popupElement.getBoundingClientRect();
- var _win$getComputedStyle2 = win.getComputedStyle(popupElement),
- height = _win$getComputedStyle2.height,
- width = _win$getComputedStyle2.width;
- popupRect.x = (_popupRect$x = popupRect.x) !== null && _popupRect$x !== void 0 ? _popupRect$x : popupRect.left;
- popupRect.y = (_popupRect$y = popupRect.y) !== null && _popupRect$y !== void 0 ? _popupRect$y : popupRect.top;
- var _doc$documentElement = doc.documentElement,
- clientWidth = _doc$documentElement.clientWidth,
- clientHeight = _doc$documentElement.clientHeight,
- scrollWidth = _doc$documentElement.scrollWidth,
- scrollHeight = _doc$documentElement.scrollHeight,
- scrollTop = _doc$documentElement.scrollTop,
- scrollLeft = _doc$documentElement.scrollLeft;
- var popupHeight = popupRect.height;
- var popupWidth = popupRect.width;
- var targetHeight = targetRect.height;
- var targetWidth = targetRect.width;
- // Get bounding of visible area
- var visibleRegion = {
- left: 0,
- top: 0,
- right: clientWidth,
- bottom: clientHeight
- };
- var scrollRegion = {
- left: -scrollLeft,
- top: -scrollTop,
- right: scrollWidth - scrollLeft,
- bottom: scrollHeight - scrollTop
- };
- var htmlRegion = placementInfo.htmlRegion;
- var VISIBLE = 'visible';
- var VISIBLE_FIRST = 'visibleFirst';
- if (htmlRegion !== 'scroll' && htmlRegion !== VISIBLE_FIRST) {
- htmlRegion = VISIBLE;
- }
- var isVisibleFirst = htmlRegion === VISIBLE_FIRST;
- var scrollRegionArea = getVisibleArea(scrollRegion, scrollerList);
- var visibleRegionArea = getVisibleArea(visibleRegion, scrollerList);
- var visibleArea = htmlRegion === VISIBLE ? visibleRegionArea : scrollRegionArea;
- // When set to `visibleFirst`,
- // the check `adjust` logic will use `visibleRegion` for check first.
- var adjustCheckVisibleArea = isVisibleFirst ? visibleRegionArea : visibleArea;
- // Record right & bottom align data
- popupElement.style.left = 'auto';
- popupElement.style.top = 'auto';
- popupElement.style.right = '0';
- popupElement.style.bottom = '0';
- var popupMirrorRect = popupElement.getBoundingClientRect();
- // Reset back
- popupElement.style.left = originLeft;
- popupElement.style.top = originTop;
- popupElement.style.right = originRight;
- popupElement.style.bottom = originBottom;
- popupElement.style.overflow = originOverflow;
- (_popupElement$parentE2 = popupElement.parentElement) === null || _popupElement$parentE2 === void 0 || _popupElement$parentE2.removeChild(placeholderElement);
- // Calculate scale
- var _scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1000) / 1000);
- var _scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1000) / 1000);
- // No need to align since it's not visible in view
- if (_scaleX === 0 || _scaleY === 0 || (0,findDOMNode.isDOM)(target) && !isVisible(target)) {
- return;
- }
- // Offset
- var offset = placementInfo.offset,
- targetOffset = placementInfo.targetOffset;
- var _getNumberOffset = getNumberOffset(popupRect, offset),
- _getNumberOffset2 = (0,slicedToArray["default"])(_getNumberOffset, 2),
- popupOffsetX = _getNumberOffset2[0],
- popupOffsetY = _getNumberOffset2[1];
- var _getNumberOffset3 = getNumberOffset(targetRect, targetOffset),
- _getNumberOffset4 = (0,slicedToArray["default"])(_getNumberOffset3, 2),
- targetOffsetX = _getNumberOffset4[0],
- targetOffsetY = _getNumberOffset4[1];
- targetRect.x -= targetOffsetX;
- targetRect.y -= targetOffsetY;
- // Points
- var _ref3 = placementInfo.points || [],
- _ref4 = (0,slicedToArray["default"])(_ref3, 2),
- popupPoint = _ref4[0],
- targetPoint = _ref4[1];
- var targetPoints = splitPoints(targetPoint);
- var popupPoints = splitPoints(popupPoint);
- var targetAlignPoint = getAlignPoint(targetRect, targetPoints);
- var popupAlignPoint = getAlignPoint(popupRect, popupPoints);
- // Real align info may not same as origin one
- var nextAlignInfo = (0,objectSpread2["default"])({}, placementInfo);
- // Next Offset
- var nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX;
- var nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY;
- // ============== Intersection ===============
- // Get area by position. Used for check if flip area is better
- function getIntersectionVisibleArea(offsetX, offsetY) {
- var area = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : visibleArea;
- var l = popupRect.x + offsetX;
- var t = popupRect.y + offsetY;
- var r = l + popupWidth;
- var b = t + popupHeight;
- var visibleL = Math.max(l, area.left);
- var visibleT = Math.max(t, area.top);
- var visibleR = Math.min(r, area.right);
- var visibleB = Math.min(b, area.bottom);
- return Math.max(0, (visibleR - visibleL) * (visibleB - visibleT));
- }
- var originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY);
- // As `visibleFirst`, we prepare this for check
- var originIntersectionRecommendArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY, visibleRegionArea);
- // ========================== Overflow ===========================
- var targetAlignPointTL = getAlignPoint(targetRect, ['t', 'l']);
- var popupAlignPointTL = getAlignPoint(popupRect, ['t', 'l']);
- var targetAlignPointBR = getAlignPoint(targetRect, ['b', 'r']);
- var popupAlignPointBR = getAlignPoint(popupRect, ['b', 'r']);
- var overflow = placementInfo.overflow || {};
- var adjustX = overflow.adjustX,
- adjustY = overflow.adjustY,
- shiftX = overflow.shiftX,
- shiftY = overflow.shiftY;
- var supportAdjust = function supportAdjust(val) {
- if (typeof val === 'boolean') {
- return val;
- }
- return val >= 0;
- };
- // Prepare position
- var nextPopupY;
- var nextPopupBottom;
- var nextPopupX;
- var nextPopupRight;
- function syncNextPopupPosition() {
- nextPopupY = popupRect.y + nextOffsetY;
- nextPopupBottom = nextPopupY + popupHeight;
- nextPopupX = popupRect.x + nextOffsetX;
- nextPopupRight = nextPopupX + popupWidth;
- }
- syncNextPopupPosition();
- // >>>>>>>>>> Top & Bottom
- var needAdjustY = supportAdjust(adjustY);
- var sameTB = popupPoints[0] === targetPoints[0];
- // Bottom to Top
- if (needAdjustY && popupPoints[0] === 't' && (nextPopupBottom > adjustCheckVisibleArea.bottom || prevFlipRef.current.bt)) {
- var tmpNextOffsetY = nextOffsetY;
- if (sameTB) {
- tmpNextOffsetY -= popupHeight - targetHeight;
- } else {
- tmpNextOffsetY = targetAlignPointTL.y - popupAlignPointBR.y - popupOffsetY;
- }
- var newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
- var newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
- if (
- // Of course use larger one
- newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
- // Choose recommend one
- newVisibleRecommendArea >= originIntersectionRecommendArea)) {
- prevFlipRef.current.bt = true;
- nextOffsetY = tmpNextOffsetY;
- popupOffsetY = -popupOffsetY;
- nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
- } else {
- prevFlipRef.current.bt = false;
- }
- }
- // Top to Bottom
- if (needAdjustY && popupPoints[0] === 'b' && (nextPopupY < adjustCheckVisibleArea.top || prevFlipRef.current.tb)) {
- var _tmpNextOffsetY = nextOffsetY;
- if (sameTB) {
- _tmpNextOffsetY += popupHeight - targetHeight;
- } else {
- _tmpNextOffsetY = targetAlignPointBR.y - popupAlignPointTL.y - popupOffsetY;
- }
- var _newVisibleArea = getIntersectionVisibleArea(nextOffsetX, _tmpNextOffsetY);
- var _newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, _tmpNextOffsetY, visibleRegionArea);
- if (
- // Of course use larger one
- _newVisibleArea > originIntersectionVisibleArea || _newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
- // Choose recommend one
- _newVisibleRecommendArea >= originIntersectionRecommendArea)) {
- prevFlipRef.current.tb = true;
- nextOffsetY = _tmpNextOffsetY;
- popupOffsetY = -popupOffsetY;
- nextAlignInfo.points = [reversePoints(popupPoints, 0), reversePoints(targetPoints, 0)];
- } else {
- prevFlipRef.current.tb = false;
- }
- }
- // >>>>>>>>>> Left & Right
- var needAdjustX = supportAdjust(adjustX);
- // >>>>> Flip
- var sameLR = popupPoints[1] === targetPoints[1];
- // Right to Left
- if (needAdjustX && popupPoints[1] === 'l' && (nextPopupRight > adjustCheckVisibleArea.right || prevFlipRef.current.rl)) {
- var tmpNextOffsetX = nextOffsetX;
- if (sameLR) {
- tmpNextOffsetX -= popupWidth - targetWidth;
- } else {
- tmpNextOffsetX = targetAlignPointTL.x - popupAlignPointBR.x - popupOffsetX;
- }
- var _newVisibleArea2 = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
- var _newVisibleRecommendArea2 = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
- if (
- // Of course use larger one
- _newVisibleArea2 > originIntersectionVisibleArea || _newVisibleArea2 === originIntersectionVisibleArea && (!isVisibleFirst ||
- // Choose recommend one
- _newVisibleRecommendArea2 >= originIntersectionRecommendArea)) {
- prevFlipRef.current.rl = true;
- nextOffsetX = tmpNextOffsetX;
- popupOffsetX = -popupOffsetX;
- nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
- } else {
- prevFlipRef.current.rl = false;
- }
- }
- // Left to Right
- if (needAdjustX && popupPoints[1] === 'r' && (nextPopupX < adjustCheckVisibleArea.left || prevFlipRef.current.lr)) {
- var _tmpNextOffsetX = nextOffsetX;
- if (sameLR) {
- _tmpNextOffsetX += popupWidth - targetWidth;
- } else {
- _tmpNextOffsetX = targetAlignPointBR.x - popupAlignPointTL.x - popupOffsetX;
- }
- var _newVisibleArea3 = getIntersectionVisibleArea(_tmpNextOffsetX, nextOffsetY);
- var _newVisibleRecommendArea3 = getIntersectionVisibleArea(_tmpNextOffsetX, nextOffsetY, visibleRegionArea);
- if (
- // Of course use larger one
- _newVisibleArea3 > originIntersectionVisibleArea || _newVisibleArea3 === originIntersectionVisibleArea && (!isVisibleFirst ||
- // Choose recommend one
- _newVisibleRecommendArea3 >= originIntersectionRecommendArea)) {
- prevFlipRef.current.lr = true;
- nextOffsetX = _tmpNextOffsetX;
- popupOffsetX = -popupOffsetX;
- nextAlignInfo.points = [reversePoints(popupPoints, 1), reversePoints(targetPoints, 1)];
- } else {
- prevFlipRef.current.lr = false;
- }
- }
- // ============================ Shift ============================
- syncNextPopupPosition();
- var numShiftX = shiftX === true ? 0 : shiftX;
- if (typeof numShiftX === 'number') {
- // Left
- if (nextPopupX < visibleRegionArea.left) {
- nextOffsetX -= nextPopupX - visibleRegionArea.left - popupOffsetX;
- if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) {
- nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
- }
- }
- // Right
- if (nextPopupRight > visibleRegionArea.right) {
- nextOffsetX -= nextPopupRight - visibleRegionArea.right - popupOffsetX;
- if (targetRect.x > visibleRegionArea.right - numShiftX) {
- nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
- }
- }
- }
- var numShiftY = shiftY === true ? 0 : shiftY;
- if (typeof numShiftY === 'number') {
- // Top
- if (nextPopupY < visibleRegionArea.top) {
- nextOffsetY -= nextPopupY - visibleRegionArea.top - popupOffsetY;
- // When target if far away from visible area
- // Stop shift
- if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) {
- nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
- }
- }
- // Bottom
- if (nextPopupBottom > visibleRegionArea.bottom) {
- nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom - popupOffsetY;
- if (targetRect.y > visibleRegionArea.bottom - numShiftY) {
- nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
- }
- }
- }
- // ============================ Arrow ============================
- // Arrow center align
- var popupLeft = popupRect.x + nextOffsetX;
- var popupRight = popupLeft + popupWidth;
- var popupTop = popupRect.y + nextOffsetY;
- var popupBottom = popupTop + popupHeight;
- var targetLeft = targetRect.x;
- var targetRight = targetLeft + targetWidth;
- var targetTop = targetRect.y;
- var targetBottom = targetTop + targetHeight;
- var maxLeft = Math.max(popupLeft, targetLeft);
- var minRight = Math.min(popupRight, targetRight);
- var xCenter = (maxLeft + minRight) / 2;
- var nextArrowX = xCenter - popupLeft;
- var maxTop = Math.max(popupTop, targetTop);
- var minBottom = Math.min(popupBottom, targetBottom);
- var yCenter = (maxTop + minBottom) / 2;
- var nextArrowY = yCenter - popupTop;
- onPopupAlign === null || onPopupAlign === void 0 || onPopupAlign(popupEle, nextAlignInfo);
- // Additional calculate right & bottom position
- var offsetX4Right = popupMirrorRect.right - popupRect.x - (nextOffsetX + popupRect.width);
- var offsetY4Bottom = popupMirrorRect.bottom - popupRect.y - (nextOffsetY + popupRect.height);
- if (_scaleX === 1) {
- nextOffsetX = Math.round(nextOffsetX);
- offsetX4Right = Math.round(offsetX4Right);
- }
- if (_scaleY === 1) {
- nextOffsetY = Math.round(nextOffsetY);
- offsetY4Bottom = Math.round(offsetY4Bottom);
- }
- var nextOffsetInfo = {
- ready: true,
- offsetX: nextOffsetX / _scaleX,
- offsetY: nextOffsetY / _scaleY,
- offsetR: offsetX4Right / _scaleX,
- offsetB: offsetY4Bottom / _scaleY,
- arrowX: nextArrowX / _scaleX,
- arrowY: nextArrowY / _scaleY,
- scaleX: _scaleX,
- scaleY: _scaleY,
- align: nextAlignInfo
- };
- setOffsetInfo(nextOffsetInfo);
- }
- });
- var triggerAlign = function triggerAlign() {
- alignCountRef.current += 1;
- var id = alignCountRef.current;
- // Merge all align requirement into one frame
- Promise.resolve().then(function () {
- if (alignCountRef.current === id) {
- onAlign();
- }
- });
- };
- // Reset ready status when placement & open changed
- var resetReady = function resetReady() {
- setOffsetInfo(function (ori) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, ori), {}, {
- ready: false
- });
- });
- };
- (0,useLayoutEffect["default"])(resetReady, [placement]);
- (0,useLayoutEffect["default"])(function () {
- if (!open) {
- resetReady();
- }
- }, [open]);
- return [offsetInfo.ready, offsetInfo.offsetX, offsetInfo.offsetY, offsetInfo.offsetR, offsetInfo.offsetB, offsetInfo.arrowX, offsetInfo.arrowY, offsetInfo.scaleX, offsetInfo.scaleY, offsetInfo.align, triggerAlign];
- }
- ;// ./node_modules/@rc-component/trigger/es/hooks/useWatch.js
- function useWatch_useWatch(open, target, popup, onAlign, onScroll) {
- (0,useLayoutEffect["default"])(function () {
- if (open && target && popup) {
- var targetElement = target;
- var popupElement = popup;
- var targetScrollList = collectScroller(targetElement);
- var popupScrollList = collectScroller(popupElement);
- var win = getWin(popupElement);
- var mergedList = new Set([win].concat((0,toConsumableArray["default"])(targetScrollList), (0,toConsumableArray["default"])(popupScrollList)));
- function notifyScroll() {
- onAlign();
- onScroll();
- }
- mergedList.forEach(function (scroller) {
- scroller.addEventListener('scroll', notifyScroll, {
- passive: true
- });
- });
- win.addEventListener('resize', notifyScroll, {
- passive: true
- });
- // First time always do align
- onAlign();
- return function () {
- mergedList.forEach(function (scroller) {
- scroller.removeEventListener('scroll', notifyScroll);
- win.removeEventListener('resize', notifyScroll);
- });
- };
- }
- }, [open, target, popup]);
- }
- ;// ./node_modules/@rc-component/trigger/es/hooks/useWinClick.js
- function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen) {
- var openRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(open);
- openRef.current = open;
- var popupPointerDownRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- // Click to hide is special action since click popup element should not hide
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (clickToHide && popupEle && (!mask || maskClosable)) {
- var onPointerDown = function onPointerDown() {
- popupPointerDownRef.current = false;
- };
- var onTriggerClose = function onTriggerClose(e) {
- var _e$composedPath;
- if (openRef.current && !inPopupOrChild(((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 || (_e$composedPath = _e$composedPath.call(e)) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath[0]) || e.target) && !popupPointerDownRef.current) {
- triggerOpen(false);
- }
- };
- var win = getWin(popupEle);
- win.addEventListener('pointerdown', onPointerDown, true);
- win.addEventListener('mousedown', onTriggerClose, true);
- win.addEventListener('contextmenu', onTriggerClose, true);
- // shadow root
- var targetShadowRoot = (0,shadow.getShadowRoot)(targetEle);
- if (targetShadowRoot) {
- targetShadowRoot.addEventListener('mousedown', onTriggerClose, true);
- targetShadowRoot.addEventListener('contextmenu', onTriggerClose, true);
- }
- // Warning if target and popup not in same root
- if (true) {
- var _targetEle$getRootNod, _popupEle$getRootNode;
- var targetRoot = targetEle === null || targetEle === void 0 || (_targetEle$getRootNod = targetEle.getRootNode) === null || _targetEle$getRootNod === void 0 ? void 0 : _targetEle$getRootNod.call(targetEle);
- var popupRoot = (_popupEle$getRootNode = popupEle.getRootNode) === null || _popupEle$getRootNode === void 0 ? void 0 : _popupEle$getRootNode.call(popupEle);
- (0,warning.warning)(targetRoot === popupRoot, "trigger element and popup element should in same shadow root.");
- }
- return function () {
- win.removeEventListener('pointerdown', onPointerDown, true);
- win.removeEventListener('mousedown', onTriggerClose, true);
- win.removeEventListener('contextmenu', onTriggerClose, true);
- if (targetShadowRoot) {
- targetShadowRoot.removeEventListener('mousedown', onTriggerClose, true);
- targetShadowRoot.removeEventListener('contextmenu', onTriggerClose, true);
- }
- };
- }
- }, [clickToHide, targetEle, popupEle, mask, maskClosable]);
- function onPopupPointerDown() {
- popupPointerDownRef.current = true;
- }
- return onPopupPointerDown;
- }
- ;// ./node_modules/@rc-component/trigger/es/index.js
- var es_excluded = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "fresh", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
- // Removed Props List
- // Seems this can be auto
- // getDocument?: (element?: HTMLElement) => Document;
- // New version will not wrap popup with `rc-trigger-popup-content` when multiple children
- function generateTrigger() {
- var PortalComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : portal_es;
- var Trigger = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-trigger-popup' : _props$prefixCls,
- children = props.children,
- _props$action = props.action,
- action = _props$action === void 0 ? 'hover' : _props$action,
- showAction = props.showAction,
- hideAction = props.hideAction,
- popupVisible = props.popupVisible,
- defaultPopupVisible = props.defaultPopupVisible,
- onPopupVisibleChange = props.onPopupVisibleChange,
- afterPopupVisibleChange = props.afterPopupVisibleChange,
- mouseEnterDelay = props.mouseEnterDelay,
- _props$mouseLeaveDela = props.mouseLeaveDelay,
- mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
- focusDelay = props.focusDelay,
- blurDelay = props.blurDelay,
- mask = props.mask,
- _props$maskClosable = props.maskClosable,
- maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
- getPopupContainer = props.getPopupContainer,
- forceRender = props.forceRender,
- autoDestroy = props.autoDestroy,
- destroyPopupOnHide = props.destroyPopupOnHide,
- popup = props.popup,
- popupClassName = props.popupClassName,
- popupStyle = props.popupStyle,
- popupPlacement = props.popupPlacement,
- _props$builtinPlaceme = props.builtinPlacements,
- builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme,
- popupAlign = props.popupAlign,
- zIndex = props.zIndex,
- stretch = props.stretch,
- getPopupClassNameFromAlign = props.getPopupClassNameFromAlign,
- fresh = props.fresh,
- alignPoint = props.alignPoint,
- onPopupClick = props.onPopupClick,
- onPopupAlign = props.onPopupAlign,
- arrow = props.arrow,
- popupMotion = props.popupMotion,
- maskMotion = props.maskMotion,
- popupTransitionName = props.popupTransitionName,
- popupAnimation = props.popupAnimation,
- maskTransitionName = props.maskTransitionName,
- maskAnimation = props.maskAnimation,
- className = props.className,
- getTriggerDOMNode = props.getTriggerDOMNode,
- restProps = (0,objectWithoutProperties["default"])(props, es_excluded);
- var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;
- // =========================== Mobile ===========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- mobile = _React$useState2[0],
- setMobile = _React$useState2[1];
- (0,useLayoutEffect["default"])(function () {
- setMobile(isMobile());
- }, []);
- // ========================== Context ===========================
- var subPopupElements = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- var parentContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_context);
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- registerSubPopup: function registerSubPopup(id, subPopupEle) {
- subPopupElements.current[id] = subPopupEle;
- parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, subPopupEle);
- }
- };
- }, [parentContext]);
- // =========================== Popup ============================
- var id = hooks_useId();
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- popupEle = _React$useState4[0],
- setPopupEle = _React$useState4[1];
- // Used for forwardRef popup. Not use internal
- var externalPopupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var setPopupRef = (0,useEvent["default"])(function (node) {
- externalPopupRef.current = node;
- if ((0,findDOMNode.isDOM)(node) && popupEle !== node) {
- setPopupEle(node);
- }
- parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, node);
- });
- // =========================== Target ===========================
- // Use state to control here since `useRef` update not trigger render
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- targetEle = _React$useState6[0],
- setTargetEle = _React$useState6[1];
- // Used for forwardRef target. Not use internal
- var externalForwardRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var setTargetRef = (0,useEvent["default"])(function (node) {
- if ((0,findDOMNode.isDOM)(node) && targetEle !== node) {
- setTargetEle(node);
- externalForwardRef.current = node;
- }
- });
- // ========================== Children ==========================
- var child = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(children);
- var originChildProps = (child === null || child === void 0 ? void 0 : child.props) || {};
- var cloneProps = {};
- var inPopupOrChild = (0,useEvent["default"])(function (ele) {
- var _getShadowRoot, _getShadowRoot2;
- var childDOM = targetEle;
- return (childDOM === null || childDOM === void 0 ? void 0 : childDOM.contains(ele)) || ((_getShadowRoot = (0,shadow.getShadowRoot)(childDOM)) === null || _getShadowRoot === void 0 ? void 0 : _getShadowRoot.host) === ele || ele === childDOM || (popupEle === null || popupEle === void 0 ? void 0 : popupEle.contains(ele)) || ((_getShadowRoot2 = (0,shadow.getShadowRoot)(popupEle)) === null || _getShadowRoot2 === void 0 ? void 0 : _getShadowRoot2.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function (subPopupEle) {
- return (subPopupEle === null || subPopupEle === void 0 ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;
- });
- });
- // =========================== Motion ===========================
- var mergePopupMotion = es_util_getMotion(prefixCls, popupMotion, popupAnimation, popupTransitionName);
- var mergeMaskMotion = es_util_getMotion(prefixCls, maskMotion, maskAnimation, maskTransitionName);
- // ============================ Open ============================
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(defaultPopupVisible || false),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- internalOpen = _React$useState8[0],
- setInternalOpen = _React$useState8[1];
- // Render still use props as first priority
- var mergedOpen = popupVisible !== null && popupVisible !== void 0 ? popupVisible : internalOpen;
- // We use effect sync here in case `popupVisible` back to `undefined`
- var setMergedOpen = (0,useEvent["default"])(function (nextOpen) {
- if (popupVisible === undefined) {
- setInternalOpen(nextOpen);
- }
- });
- (0,useLayoutEffect["default"])(function () {
- setInternalOpen(popupVisible || false);
- }, [popupVisible]);
- var openRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(mergedOpen);
- openRef.current = mergedOpen;
- var lastTriggerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- lastTriggerRef.current = [];
- var internalTriggerOpen = (0,useEvent["default"])(function (nextOpen) {
- var _lastTriggerRef$curre;
- setMergedOpen(nextOpen);
- // Enter or Pointer will both trigger open state change
- // We only need take one to avoid duplicated change event trigger
- // Use `lastTriggerRef` to record last open type
- if (((_lastTriggerRef$curre = lastTriggerRef.current[lastTriggerRef.current.length - 1]) !== null && _lastTriggerRef$curre !== void 0 ? _lastTriggerRef$curre : mergedOpen) !== nextOpen) {
- lastTriggerRef.current.push(nextOpen);
- onPopupVisibleChange === null || onPopupVisibleChange === void 0 || onPopupVisibleChange(nextOpen);
- }
- });
- // Trigger for delay
- var delayRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var clearDelay = function clearDelay() {
- clearTimeout(delayRef.current);
- };
- var triggerOpen = function triggerOpen(nextOpen) {
- var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- clearDelay();
- if (delay === 0) {
- internalTriggerOpen(nextOpen);
- } else {
- delayRef.current = setTimeout(function () {
- internalTriggerOpen(nextOpen);
- }, delay * 1000);
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return clearDelay;
- }, []);
- // ========================== Motion ============================
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- inMotion = _React$useState10[0],
- setInMotion = _React$useState10[1];
- (0,useLayoutEffect["default"])(function (firstMount) {
- if (!firstMount || mergedOpen) {
- setInMotion(true);
- }
- }, [mergedOpen]);
- var _React$useState11 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState12 = (0,slicedToArray["default"])(_React$useState11, 2),
- motionPrepareResolve = _React$useState12[0],
- setMotionPrepareResolve = _React$useState12[1];
- // =========================== Align ============================
- var _React$useState13 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState14 = (0,slicedToArray["default"])(_React$useState13, 2),
- mousePos = _React$useState14[0],
- setMousePos = _React$useState14[1];
- var setMousePosByEvent = function setMousePosByEvent(event) {
- setMousePos([event.clientX, event.clientY]);
- };
- var _useAlign = useAlign(mergedOpen, popupEle, alignPoint && mousePos !== null ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign),
- _useAlign2 = (0,slicedToArray["default"])(_useAlign, 11),
- ready = _useAlign2[0],
- offsetX = _useAlign2[1],
- offsetY = _useAlign2[2],
- offsetR = _useAlign2[3],
- offsetB = _useAlign2[4],
- arrowX = _useAlign2[5],
- arrowY = _useAlign2[6],
- scaleX = _useAlign2[7],
- scaleY = _useAlign2[8],
- alignInfo = _useAlign2[9],
- onAlign = _useAlign2[10];
- var _useAction = useAction(mobile, action, showAction, hideAction),
- _useAction2 = (0,slicedToArray["default"])(_useAction, 2),
- showActions = _useAction2[0],
- hideActions = _useAction2[1];
- var clickToShow = showActions.has('click');
- var clickToHide = hideActions.has('click') || hideActions.has('contextMenu');
- var triggerAlign = (0,useEvent["default"])(function () {
- if (!inMotion) {
- onAlign();
- }
- });
- var onScroll = function onScroll() {
- if (openRef.current && alignPoint && clickToHide) {
- triggerOpen(false);
- }
- };
- useWatch_useWatch(mergedOpen, targetEle, popupEle, triggerAlign, onScroll);
- (0,useLayoutEffect["default"])(function () {
- triggerAlign();
- }, [mousePos, popupPlacement]);
- // When no builtinPlacements and popupAlign changed
- (0,useLayoutEffect["default"])(function () {
- if (mergedOpen && !(builtinPlacements !== null && builtinPlacements !== void 0 && builtinPlacements[popupPlacement])) {
- triggerAlign();
- }
- }, [JSON.stringify(popupAlign)]);
- var alignedClassName = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var baseClassName = getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint);
- return classnames_default()(baseClassName, getPopupClassNameFromAlign === null || getPopupClassNameFromAlign === void 0 ? void 0 : getPopupClassNameFromAlign(alignInfo));
- }, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint]);
- // ============================ Refs ============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: externalForwardRef.current,
- popupElement: externalPopupRef.current,
- forceAlign: triggerAlign
- };
- });
- // ========================== Stretch ===========================
- var _React$useState15 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState16 = (0,slicedToArray["default"])(_React$useState15, 2),
- targetWidth = _React$useState16[0],
- setTargetWidth = _React$useState16[1];
- var _React$useState17 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState18 = (0,slicedToArray["default"])(_React$useState17, 2),
- targetHeight = _React$useState18[0],
- setTargetHeight = _React$useState18[1];
- var syncTargetSize = function syncTargetSize() {
- if (stretch && targetEle) {
- var rect = targetEle.getBoundingClientRect();
- setTargetWidth(rect.width);
- setTargetHeight(rect.height);
- }
- };
- var onTargetResize = function onTargetResize() {
- syncTargetSize();
- triggerAlign();
- };
- // ========================== Motion ============================
- var onVisibleChanged = function onVisibleChanged(visible) {
- setInMotion(false);
- onAlign();
- afterPopupVisibleChange === null || afterPopupVisibleChange === void 0 || afterPopupVisibleChange(visible);
- };
- // We will trigger align when motion is in prepare
- var onPrepare = function onPrepare() {
- return new Promise(function (resolve) {
- syncTargetSize();
- setMotionPrepareResolve(function () {
- return resolve;
- });
- });
- };
- (0,useLayoutEffect["default"])(function () {
- if (motionPrepareResolve) {
- onAlign();
- motionPrepareResolve();
- setMotionPrepareResolve(null);
- }
- }, [motionPrepareResolve]);
- // =========================== Action ===========================
- /**
- * Util wrapper for trigger action
- */
- function wrapperAction(eventName, nextOpen, delay, preEvent) {
- cloneProps[eventName] = function (event) {
- var _originChildProps$eve;
- preEvent === null || preEvent === void 0 || preEvent(event);
- triggerOpen(nextOpen, delay);
- // Pass to origin
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- (_originChildProps$eve = originChildProps[eventName]) === null || _originChildProps$eve === void 0 || _originChildProps$eve.call.apply(_originChildProps$eve, [originChildProps, event].concat(args));
- };
- }
- // ======================= Action: Click ========================
- if (clickToShow || clickToHide) {
- cloneProps.onClick = function (event) {
- var _originChildProps$onC;
- if (openRef.current && clickToHide) {
- triggerOpen(false);
- } else if (!openRef.current && clickToShow) {
- setMousePosByEvent(event);
- triggerOpen(true);
- }
- // Pass to origin
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- (_originChildProps$onC = originChildProps.onClick) === null || _originChildProps$onC === void 0 || _originChildProps$onC.call.apply(_originChildProps$onC, [originChildProps, event].concat(args));
- };
- }
- // Click to hide is special action since click popup element should not hide
- var onPopupPointerDown = useWinClick(mergedOpen, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);
- // ======================= Action: Hover ========================
- var hoverToShow = showActions.has('hover');
- var hoverToHide = hideActions.has('hover');
- var onPopupMouseEnter;
- var onPopupMouseLeave;
- if (hoverToShow) {
- // Compatible with old browser which not support pointer event
- wrapperAction('onMouseEnter', true, mouseEnterDelay, function (event) {
- setMousePosByEvent(event);
- });
- wrapperAction('onPointerEnter', true, mouseEnterDelay, function (event) {
- setMousePosByEvent(event);
- });
- onPopupMouseEnter = function onPopupMouseEnter(event) {
- // Only trigger re-open when popup is visible
- if ((mergedOpen || inMotion) && popupEle !== null && popupEle !== void 0 && popupEle.contains(event.target)) {
- triggerOpen(true, mouseEnterDelay);
- }
- };
- // Align Point
- if (alignPoint) {
- cloneProps.onMouseMove = function (event) {
- var _originChildProps$onM;
- // setMousePosByEvent(event);
- (_originChildProps$onM = originChildProps.onMouseMove) === null || _originChildProps$onM === void 0 || _originChildProps$onM.call(originChildProps, event);
- };
- }
- }
- if (hoverToHide) {
- wrapperAction('onMouseLeave', false, mouseLeaveDelay);
- wrapperAction('onPointerLeave', false, mouseLeaveDelay);
- onPopupMouseLeave = function onPopupMouseLeave() {
- triggerOpen(false, mouseLeaveDelay);
- };
- }
- // ======================= Action: Focus ========================
- if (showActions.has('focus')) {
- wrapperAction('onFocus', true, focusDelay);
- }
- if (hideActions.has('focus')) {
- wrapperAction('onBlur', false, blurDelay);
- }
- // ==================== Action: ContextMenu =====================
- if (showActions.has('contextMenu')) {
- cloneProps.onContextMenu = function (event) {
- var _originChildProps$onC2;
- if (openRef.current && hideActions.has('contextMenu')) {
- triggerOpen(false);
- } else {
- setMousePosByEvent(event);
- triggerOpen(true);
- }
- event.preventDefault();
- // Pass to origin
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
- args[_key3 - 1] = arguments[_key3];
- }
- (_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 || _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));
- };
- }
- // ========================= ClassName ==========================
- if (className) {
- cloneProps.className = classnames_default()(originChildProps.className, className);
- }
- // ============================ Perf ============================
- var renderedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- renderedRef.current || (renderedRef.current = forceRender || mergedOpen || inMotion);
- // =========================== Render ===========================
- var mergedChildrenProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, originChildProps), cloneProps);
- // Pass props into cloneProps for nest usage
- var passedProps = {};
- var passedEventList = ['onContextMenu', 'onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur'];
- passedEventList.forEach(function (eventName) {
- if (restProps[eventName]) {
- passedProps[eventName] = function () {
- var _mergedChildrenProps$;
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
- }
- (_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 || _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args));
- restProps[eventName].apply(restProps, args);
- };
- }
- });
- // Child Node
- var triggerNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedChildrenProps), passedProps));
- var arrowPos = {
- x: arrowX,
- y: arrowY
- };
- var innerArrow = arrow ? (0,objectSpread2["default"])({}, arrow !== true ? arrow : {}) : null;
- // Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- disabled: !mergedOpen,
- ref: setTargetRef,
- onResize: onTargetResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TriggerWrapper, {
- getTriggerDOMNode: getTriggerDOMNode
- }, triggerNode)), renderedRef.current && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_context.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Popup, {
- portal: PortalComponent,
- ref: setPopupRef,
- prefixCls: prefixCls,
- popup: popup,
- className: classnames_default()(popupClassName, alignedClassName),
- style: popupStyle,
- target: targetEle,
- onMouseEnter: onPopupMouseEnter,
- onMouseLeave: onPopupMouseLeave
- // https://github.com/ant-design/ant-design/issues/43924
- ,
- onPointerEnter: onPopupMouseEnter,
- zIndex: zIndex
- // Open
- ,
- open: mergedOpen,
- keepDom: inMotion,
- fresh: fresh
- // Click
- ,
- onClick: onPopupClick,
- onPointerDownCapture: onPopupPointerDown
- // Mask
- ,
- mask: mask
- // Motion
- ,
- motion: mergePopupMotion,
- maskMotion: mergeMaskMotion,
- onVisibleChanged: onVisibleChanged,
- onPrepare: onPrepare
- // Portal
- ,
- forceRender: forceRender,
- autoDestroy: mergedAutoDestroy,
- getPopupContainer: getPopupContainer
- // Arrow
- ,
- align: alignInfo,
- arrow: innerArrow,
- arrowPos: arrowPos
- // Align
- ,
- ready: ready,
- offsetX: offsetX,
- offsetY: offsetY,
- offsetR: offsetR,
- offsetB: offsetB,
- onAlign: triggerAlign
- // Stretch
- ,
- stretch: stretch,
- targetWidth: targetWidth / scaleX,
- targetHeight: targetHeight / scaleY
- })));
- });
- if (true) {
- Trigger.displayName = 'Trigger';
- }
- return Trigger;
- }
- /* harmony default export */ var trigger_es = (generateTrigger(portal_es));
- ;// ./node_modules/rc-select/es/SelectTrigger.js
- var SelectTrigger_excluded = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"];
- var getBuiltInPlacements = function getBuiltInPlacements(dropdownMatchSelectWidth) {
- // Enable horizontal overflow auto-adjustment when a custom dropdown width is provided
- var adjustX = dropdownMatchSelectWidth === true ? 0 : 1;
- return {
- bottomLeft: {
- points: ['tl', 'bl'],
- offset: [0, 4],
- overflow: {
- adjustX: adjustX,
- adjustY: 1
- },
- htmlRegion: 'scroll'
- },
- bottomRight: {
- points: ['tr', 'br'],
- offset: [0, 4],
- overflow: {
- adjustX: adjustX,
- adjustY: 1
- },
- htmlRegion: 'scroll'
- },
- topLeft: {
- points: ['bl', 'tl'],
- offset: [0, -4],
- overflow: {
- adjustX: adjustX,
- adjustY: 1
- },
- htmlRegion: 'scroll'
- },
- topRight: {
- points: ['br', 'tr'],
- offset: [0, -4],
- overflow: {
- adjustX: adjustX,
- adjustY: 1
- },
- htmlRegion: 'scroll'
- }
- };
- };
- var SelectTrigger = function SelectTrigger(props, ref) {
- var prefixCls = props.prefixCls,
- disabled = props.disabled,
- visible = props.visible,
- children = props.children,
- popupElement = props.popupElement,
- animation = props.animation,
- transitionName = props.transitionName,
- dropdownStyle = props.dropdownStyle,
- dropdownClassName = props.dropdownClassName,
- _props$direction = props.direction,
- direction = _props$direction === void 0 ? 'ltr' : _props$direction,
- placement = props.placement,
- builtinPlacements = props.builtinPlacements,
- dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
- dropdownRender = props.dropdownRender,
- dropdownAlign = props.dropdownAlign,
- getPopupContainer = props.getPopupContainer,
- empty = props.empty,
- getTriggerDOMNode = props.getTriggerDOMNode,
- onPopupVisibleChange = props.onPopupVisibleChange,
- onPopupMouseEnter = props.onPopupMouseEnter,
- restProps = (0,objectWithoutProperties["default"])(props, SelectTrigger_excluded);
- var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
- var popupNode = popupElement;
- if (dropdownRender) {
- popupNode = dropdownRender(popupElement);
- }
- var mergedBuiltinPlacements = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return builtinPlacements || getBuiltInPlacements(dropdownMatchSelectWidth);
- }, [builtinPlacements, dropdownMatchSelectWidth]);
- // ===================== Motion ======================
- var mergedTransitionName = animation ? "".concat(dropdownPrefixCls, "-").concat(animation) : transitionName;
- // =================== Popup Width ===================
- var isNumberPopupWidth = typeof dropdownMatchSelectWidth === 'number';
- var stretch = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (isNumberPopupWidth) {
- return null;
- }
- return dropdownMatchSelectWidth === false ? 'minWidth' : 'width';
- }, [dropdownMatchSelectWidth, isNumberPopupWidth]);
- var popupStyle = dropdownStyle;
- if (isNumberPopupWidth) {
- popupStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, popupStyle), {}, {
- width: dropdownMatchSelectWidth
- });
- }
- // ======================= Ref =======================
- var triggerPopupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- getPopupElement: function getPopupElement() {
- var _triggerPopupRef$curr;
- return (_triggerPopupRef$curr = triggerPopupRef.current) === null || _triggerPopupRef$curr === void 0 ? void 0 : _triggerPopupRef$curr.popupElement;
- }
- };
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, (0,esm_extends["default"])({}, restProps, {
- showAction: onPopupVisibleChange ? ['click'] : [],
- hideAction: onPopupVisibleChange ? ['click'] : [],
- popupPlacement: placement || (direction === 'rtl' ? 'bottomRight' : 'bottomLeft'),
- builtinPlacements: mergedBuiltinPlacements,
- prefixCls: dropdownPrefixCls,
- popupTransitionName: mergedTransitionName,
- popup: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- onMouseEnter: onPopupMouseEnter
- }, popupNode),
- ref: triggerPopupRef,
- stretch: stretch,
- popupAlign: dropdownAlign,
- popupVisible: visible,
- getPopupContainer: getPopupContainer,
- popupClassName: classnames_default()(dropdownClassName, (0,defineProperty["default"])({}, "".concat(dropdownPrefixCls, "-empty"), empty)),
- popupStyle: popupStyle,
- getTriggerDOMNode: getTriggerDOMNode,
- onPopupVisibleChange: onPopupVisibleChange
- }), children);
- };
- var RefSelectTrigger = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SelectTrigger);
- if (true) {
- RefSelectTrigger.displayName = 'SelectTrigger';
- }
- /* harmony default export */ var es_SelectTrigger = (RefSelectTrigger);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
- var esm_toArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/toArray.js");
- ;// ./node_modules/rc-select/es/utils/valueUtil.js
- function getKey(data, index) {
- var key = data.key;
- var value;
- if ('value' in data) {
- value = data.value;
- }
- if (key !== null && key !== undefined) {
- return key;
- }
- if (value !== undefined) {
- return value;
- }
- return "rc-index-key-".concat(index);
- }
- function isValidCount(value) {
- return typeof value !== 'undefined' && !Number.isNaN(value);
- }
- function fillFieldNames(fieldNames, childrenAsData) {
- var _ref = fieldNames || {},
- label = _ref.label,
- value = _ref.value,
- options = _ref.options,
- groupLabel = _ref.groupLabel;
- var mergedLabel = label || (childrenAsData ? 'children' : 'label');
- return {
- label: mergedLabel,
- value: value || 'value',
- options: options || 'options',
- groupLabel: groupLabel || mergedLabel
- };
- }
- /**
- * Flat options into flatten list.
- * We use `optionOnly` here is aim to avoid user use nested option group.
- * Here is simply set `key` to the index if not provided.
- */
- function flattenOptions(options) {
- var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- fieldNames = _ref2.fieldNames,
- childrenAsData = _ref2.childrenAsData;
- var flattenList = [];
- var _fillFieldNames = fillFieldNames(fieldNames, false),
- fieldLabel = _fillFieldNames.label,
- fieldValue = _fillFieldNames.value,
- fieldOptions = _fillFieldNames.options,
- groupLabel = _fillFieldNames.groupLabel;
- function dig(list, isGroupOption) {
- if (!Array.isArray(list)) {
- return;
- }
- list.forEach(function (data) {
- if (isGroupOption || !(fieldOptions in data)) {
- var value = data[fieldValue];
- // Option
- flattenList.push({
- key: getKey(data, flattenList.length),
- groupOption: isGroupOption,
- data: data,
- label: data[fieldLabel],
- value: value
- });
- } else {
- var grpLabel = data[groupLabel];
- if (grpLabel === undefined && childrenAsData) {
- grpLabel = data.label;
- }
- // Option Group
- flattenList.push({
- key: getKey(data, flattenList.length),
- group: true,
- data: data,
- label: grpLabel
- });
- dig(data[fieldOptions], true);
- }
- });
- }
- dig(options, false);
- return flattenList;
- }
- /**
- * Inject `props` into `option` for legacy usage
- */
- function injectPropsWithOption(option) {
- var newOption = (0,objectSpread2["default"])({}, option);
- if (!('props' in newOption)) {
- Object.defineProperty(newOption, 'props', {
- get: function get() {
- (0,warning["default"])(false, 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.');
- return newOption;
- }
- });
- }
- return newOption;
- }
- var getSeparatedContent = function getSeparatedContent(text, tokens, end) {
- if (!tokens || !tokens.length) {
- return null;
- }
- var match = false;
- var separate = function separate(str, _ref3) {
- var _ref4 = (0,esm_toArray["default"])(_ref3),
- token = _ref4[0],
- restTokens = _ref4.slice(1);
- if (!token) {
- return [str];
- }
- var list = str.split(token);
- match = match || list.length > 1;
- return list.reduce(function (prevList, unitStr) {
- return [].concat((0,toConsumableArray["default"])(prevList), (0,toConsumableArray["default"])(separate(unitStr, restTokens)));
- }, []).filter(Boolean);
- };
- var list = separate(text, tokens);
- if (match) {
- return typeof end !== 'undefined' ? list.slice(0, end) : list;
- } else {
- return null;
- }
- };
- ;// ./node_modules/rc-select/es/SelectContext.js
- // Use any here since we do not get the type during compilation
- var SelectContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_SelectContext = (SelectContext);
- ;// ./node_modules/rc-select/es/BaseSelect/Polite.js
- function Polite(props) {
- var visible = props.visible,
- values = props.values;
- if (!visible) {
- return null;
- }
- // Only cut part of values since it's a screen reader
- var MAX_COUNT = 50;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- "aria-live": "polite",
- style: {
- width: 0,
- height: 0,
- position: 'absolute',
- overflow: 'hidden',
- opacity: 0
- }
- }, "".concat(values.slice(0, MAX_COUNT).map(function (_ref) {
- var label = _ref.label,
- value = _ref.value;
- return ['number', 'string'].includes((0,esm_typeof["default"])(label)) ? label : value;
- }).join(', ')), values.length > MAX_COUNT ? ', ...' : null);
- }
- ;// ./node_modules/rc-select/es/BaseSelect/index.js
- var BaseSelect_excluded = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "prefix", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"];
- var DEFAULT_OMIT_PROPS = ['value', 'onChange', 'removeIcon', 'placeholder', 'autoFocus', 'maxTagCount', 'maxTagTextLength', 'maxTagPlaceholder', 'choiceTransitionName', 'onInputKeyDown', 'onPopupScroll', 'tabIndex'];
- var isMultiple = function isMultiple(mode) {
- return mode === 'tags' || mode === 'multiple';
- };
- var BaseSelect = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _customizeRawInputEle;
- var id = props.id,
- prefixCls = props.prefixCls,
- className = props.className,
- showSearch = props.showSearch,
- tagRender = props.tagRender,
- direction = props.direction,
- omitDomProps = props.omitDomProps,
- displayValues = props.displayValues,
- onDisplayValuesChange = props.onDisplayValuesChange,
- emptyOptions = props.emptyOptions,
- _props$notFoundConten = props.notFoundContent,
- notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,
- onClear = props.onClear,
- mode = props.mode,
- disabled = props.disabled,
- loading = props.loading,
- getInputElement = props.getInputElement,
- getRawInputElement = props.getRawInputElement,
- open = props.open,
- defaultOpen = props.defaultOpen,
- onDropdownVisibleChange = props.onDropdownVisibleChange,
- activeValue = props.activeValue,
- onActiveValueChange = props.onActiveValueChange,
- activeDescendantId = props.activeDescendantId,
- searchValue = props.searchValue,
- autoClearSearchValue = props.autoClearSearchValue,
- onSearch = props.onSearch,
- onSearchSplit = props.onSearchSplit,
- tokenSeparators = props.tokenSeparators,
- allowClear = props.allowClear,
- prefix = props.prefix,
- suffixIcon = props.suffixIcon,
- clearIcon = props.clearIcon,
- OptionList = props.OptionList,
- animation = props.animation,
- transitionName = props.transitionName,
- dropdownStyle = props.dropdownStyle,
- dropdownClassName = props.dropdownClassName,
- dropdownMatchSelectWidth = props.dropdownMatchSelectWidth,
- dropdownRender = props.dropdownRender,
- dropdownAlign = props.dropdownAlign,
- placement = props.placement,
- builtinPlacements = props.builtinPlacements,
- getPopupContainer = props.getPopupContainer,
- _props$showAction = props.showAction,
- showAction = _props$showAction === void 0 ? [] : _props$showAction,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyUp = props.onKeyUp,
- onKeyDown = props.onKeyDown,
- onMouseDown = props.onMouseDown,
- restProps = (0,objectWithoutProperties["default"])(props, BaseSelect_excluded);
- // ============================== MISC ==============================
- var multiple = isMultiple(mode);
- var mergedShowSearch = (showSearch !== undefined ? showSearch : multiple) || mode === 'combobox';
- var domProps = (0,objectSpread2["default"])({}, restProps);
- DEFAULT_OMIT_PROPS.forEach(function (propName) {
- delete domProps[propName];
- });
- omitDomProps === null || omitDomProps === void 0 || omitDomProps.forEach(function (propName) {
- delete domProps[propName];
- });
- // ============================= Mobile =============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- mobile = _React$useState2[0],
- setMobile = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // Only update on the client side
- setMobile(isMobile());
- }, []);
- // ============================== Refs ==============================
- var containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var selectorDomRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var triggerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var selectorRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var listRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var blurRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- /** Used for component focused management */
- var _useDelayReset = useDelayReset(),
- _useDelayReset2 = (0,slicedToArray["default"])(_useDelayReset, 3),
- mockFocused = _useDelayReset2[0],
- setMockFocused = _useDelayReset2[1],
- cancelSetMockFocused = _useDelayReset2[2];
- // =========================== Imperative ===========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- var _selectorRef$current, _selectorRef$current2;
- return {
- focus: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.focus,
- blur: (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 ? void 0 : _selectorRef$current2.blur,
- scrollTo: function scrollTo(arg) {
- var _listRef$current;
- return (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollTo(arg);
- },
- nativeElement: containerRef.current || selectorDomRef.current
- };
- });
- // ========================== Search Value ==========================
- var mergedSearchValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var _displayValues$;
- if (mode !== 'combobox') {
- return searchValue;
- }
- var val = (_displayValues$ = displayValues[0]) === null || _displayValues$ === void 0 ? void 0 : _displayValues$.value;
- return typeof val === 'string' || typeof val === 'number' ? String(val) : '';
- }, [searchValue, mode, displayValues]);
- // ========================== Custom Input ==========================
- // Only works in `combobox`
- var customizeInputElement = mode === 'combobox' && typeof getInputElement === 'function' && getInputElement() || null;
- // Used for customize replacement for `rc-cascader`
- var customizeRawInputElement = typeof getRawInputElement === 'function' && getRawInputElement();
- var customizeRawInputRef = (0,es_ref.useComposeRef)(selectorDomRef, customizeRawInputElement === null || customizeRawInputElement === void 0 || (_customizeRawInputEle = customizeRawInputElement.props) === null || _customizeRawInputEle === void 0 ? void 0 : _customizeRawInputEle.ref);
- // ============================== Open ==============================
- // SSR not support Portal which means we need delay `open` for the first time render
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- rendered = _React$useState4[0],
- setRendered = _React$useState4[1];
- (0,useLayoutEffect["default"])(function () {
- setRendered(true);
- }, []);
- var _useMergedState = (0,useMergedState["default"])(false, {
- defaultValue: defaultOpen,
- value: open
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- innerOpen = _useMergedState2[0],
- setInnerOpen = _useMergedState2[1];
- var mergedOpen = rendered ? innerOpen : false;
- // Not trigger `open` in `combobox` when `notFoundContent` is empty
- var emptyListContent = !notFoundContent && emptyOptions;
- if (disabled || emptyListContent && mergedOpen && mode === 'combobox') {
- mergedOpen = false;
- }
- var triggerOpen = emptyListContent ? false : mergedOpen;
- var onToggleOpen = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (newOpen) {
- var nextOpen = newOpen !== undefined ? newOpen : !mergedOpen;
- if (!disabled) {
- setInnerOpen(nextOpen);
- if (mergedOpen !== nextOpen) {
- onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 || onDropdownVisibleChange(nextOpen);
- }
- }
- }, [disabled, mergedOpen, setInnerOpen, onDropdownVisibleChange]);
- // ============================= Search =============================
- var tokenWithEnter = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (tokenSeparators || []).some(function (tokenSeparator) {
- return ['\n', '\r\n'].includes(tokenSeparator);
- });
- }, [tokenSeparators]);
- var _ref = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_SelectContext) || {},
- maxCount = _ref.maxCount,
- rawValues = _ref.rawValues;
- var onInternalSearch = function onInternalSearch(searchText, fromTyping, isCompositing) {
- if (multiple && isValidCount(maxCount) && (rawValues === null || rawValues === void 0 ? void 0 : rawValues.size) >= maxCount) {
- return;
- }
- var ret = true;
- var newSearchText = searchText;
- onActiveValueChange === null || onActiveValueChange === void 0 || onActiveValueChange(null);
- var separatedList = getSeparatedContent(searchText, tokenSeparators, isValidCount(maxCount) ? maxCount - rawValues.size : undefined);
- // Check if match the `tokenSeparators`
- var patchLabels = isCompositing ? null : separatedList;
- // Ignore combobox since it's not split-able
- if (mode !== 'combobox' && patchLabels) {
- newSearchText = '';
- onSearchSplit === null || onSearchSplit === void 0 || onSearchSplit(patchLabels);
- // Should close when paste finish
- onToggleOpen(false);
- // Tell Selector that break next actions
- ret = false;
- }
- if (onSearch && mergedSearchValue !== newSearchText) {
- onSearch(newSearchText, {
- source: fromTyping ? 'typing' : 'effect'
- });
- }
- return ret;
- };
- // Only triggered when menu is closed & mode is tags
- // If menu is open, OptionList will take charge
- // If mode isn't tags, press enter is not meaningful when you can't see any option
- var onInternalSearchSubmit = function onInternalSearchSubmit(searchText) {
- // prevent empty tags from appearing when you click the Enter button
- if (!searchText || !searchText.trim()) {
- return;
- }
- onSearch(searchText, {
- source: 'submit'
- });
- };
- // Close will clean up single mode search text
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!mergedOpen && !multiple && mode !== 'combobox') {
- onInternalSearch('', false, false);
- }
- }, [mergedOpen]);
- // ============================ Disabled ============================
- // Close dropdown & remove focus state when disabled change
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (innerOpen && disabled) {
- setInnerOpen(false);
- }
- // After onBlur is triggered, the focused does not need to be reset
- if (disabled && !blurRef.current) {
- setMockFocused(false);
- }
- }, [disabled]);
- // ============================ Keyboard ============================
- /**
- * We record input value here to check if can press to clean up by backspace
- * - null: Key is not down, this is reset by key up
- * - true: Search text is empty when first time backspace down
- * - false: Search text is not empty when first time backspace down
- */
- var _useLock = useLock(),
- _useLock2 = (0,slicedToArray["default"])(_useLock, 2),
- getClearLock = _useLock2[0],
- setClearLock = _useLock2[1];
- var keyLockRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- // KeyDown
- var onInternalKeyDown = function onInternalKeyDown(event) {
- var clearLock = getClearLock();
- var key = event.key;
- var isEnterKey = key === 'Enter';
- if (isEnterKey) {
- // Do not submit form when type in the input
- if (mode !== 'combobox') {
- event.preventDefault();
- }
- // We only manage open state here, close logic should handle by list component
- if (!mergedOpen) {
- onToggleOpen(true);
- }
- }
- setClearLock(!!mergedSearchValue);
- // Remove value by `backspace`
- if (key === 'Backspace' && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
- var cloneDisplayValues = (0,toConsumableArray["default"])(displayValues);
- var removedDisplayValue = null;
- for (var i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
- var current = cloneDisplayValues[i];
- if (!current.disabled) {
- cloneDisplayValues.splice(i, 1);
- removedDisplayValue = current;
- break;
- }
- }
- if (removedDisplayValue) {
- onDisplayValuesChange(cloneDisplayValues, {
- type: 'remove',
- values: [removedDisplayValue]
- });
- }
- }
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- rest[_key - 1] = arguments[_key];
- }
- if (mergedOpen && (!isEnterKey || !keyLockRef.current)) {
- var _listRef$current2;
- // Lock the Enter key after it is pressed to avoid repeated triggering of the onChange event.
- if (isEnterKey) {
- keyLockRef.current = true;
- }
- (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.onKeyDown.apply(_listRef$current2, [event].concat(rest));
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown.apply(void 0, [event].concat(rest));
- };
- // KeyUp
- var onInternalKeyUp = function onInternalKeyUp(event) {
- for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- rest[_key2 - 1] = arguments[_key2];
- }
- if (mergedOpen) {
- var _listRef$current3;
- (_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || _listRef$current3.onKeyUp.apply(_listRef$current3, [event].concat(rest));
- }
- if (event.key === 'Enter') {
- keyLockRef.current = false;
- }
- onKeyUp === null || onKeyUp === void 0 || onKeyUp.apply(void 0, [event].concat(rest));
- };
- // ============================ Selector ============================
- var onSelectorRemove = function onSelectorRemove(val) {
- var newValues = displayValues.filter(function (i) {
- return i !== val;
- });
- onDisplayValuesChange(newValues, {
- type: 'remove',
- values: [val]
- });
- };
- var onInputBlur = function onInputBlur() {
- // Unlock the Enter key after the input blur; otherwise, the Enter key needs to be pressed twice to trigger the correct effect.
- keyLockRef.current = false;
- };
- // ========================== Focus / Blur ==========================
- /** Record real focus status */
- var focusRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var onContainerFocus = function onContainerFocus() {
- setMockFocused(true);
- if (!disabled) {
- if (onFocus && !focusRef.current) {
- onFocus.apply(void 0, arguments);
- }
- // `showAction` should handle `focus` if set
- if (showAction.includes('focus')) {
- onToggleOpen(true);
- }
- }
- focusRef.current = true;
- };
- var onContainerBlur = function onContainerBlur() {
- blurRef.current = true;
- setMockFocused(false, function () {
- focusRef.current = false;
- blurRef.current = false;
- onToggleOpen(false);
- });
- if (disabled) {
- return;
- }
- if (mergedSearchValue) {
- // `tags` mode should move `searchValue` into values
- if (mode === 'tags') {
- onSearch(mergedSearchValue, {
- source: 'submit'
- });
- } else if (mode === 'multiple') {
- // `multiple` mode only clean the search value but not trigger event
- onSearch('', {
- source: 'blur'
- });
- }
- }
- if (onBlur) {
- onBlur.apply(void 0, arguments);
- }
- };
- // Give focus back of Select
- var activeTimeoutIds = [];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- activeTimeoutIds.forEach(function (timeoutId) {
- return clearTimeout(timeoutId);
- });
- activeTimeoutIds.splice(0, activeTimeoutIds.length);
- };
- }, []);
- var onInternalMouseDown = function onInternalMouseDown(event) {
- var _triggerRef$current;
- var target = event.target;
- var popupElement = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getPopupElement();
- // We should give focus back to selector if clicked item is not focusable
- if (popupElement && popupElement.contains(target)) {
- var timeoutId = setTimeout(function () {
- var index = activeTimeoutIds.indexOf(timeoutId);
- if (index !== -1) {
- activeTimeoutIds.splice(index, 1);
- }
- cancelSetMockFocused();
- if (!mobile && !popupElement.contains(document.activeElement)) {
- var _selectorRef$current3;
- (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 || _selectorRef$current3.focus();
- }
- });
- activeTimeoutIds.push(timeoutId);
- }
- for (var _len3 = arguments.length, restArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
- restArgs[_key3 - 1] = arguments[_key3];
- }
- onMouseDown === null || onMouseDown === void 0 || onMouseDown.apply(void 0, [event].concat(restArgs));
- };
- // ============================ Dropdown ============================
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- forceUpdate = _React$useState6[1];
- // We need force update here since popup dom is render async
- function onPopupMouseEnter() {
- forceUpdate({});
- }
- // Used for raw custom input trigger
- var onTriggerVisibleChange;
- if (customizeRawInputElement) {
- onTriggerVisibleChange = function onTriggerVisibleChange(newOpen) {
- onToggleOpen(newOpen);
- };
- }
- // Close when click on non-select element
- useSelectTriggerControl(function () {
- var _triggerRef$current2;
- return [containerRef.current, (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.getPopupElement()];
- }, triggerOpen, onToggleOpen, !!customizeRawInputElement);
- // ============================ Context =============================
- var baseSelectContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- notFoundContent: notFoundContent,
- open: mergedOpen,
- triggerOpen: triggerOpen,
- id: id,
- showSearch: mergedShowSearch,
- multiple: multiple,
- toggleOpen: onToggleOpen
- });
- }, [props, notFoundContent, triggerOpen, mergedOpen, id, mergedShowSearch, multiple, onToggleOpen]);
- // ==================================================================
- // == Render ==
- // ==================================================================
- // ============================= Arrow ==============================
- var showSuffixIcon = !!suffixIcon || loading;
- var arrowNode;
- if (showSuffixIcon) {
- arrowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TransBtn, {
- className: classnames_default()("".concat(prefixCls, "-arrow"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-arrow-loading"), loading)),
- customizeIcon: suffixIcon,
- customizeIconProps: {
- loading: loading,
- searchValue: mergedSearchValue,
- open: mergedOpen,
- focused: mockFocused,
- showSearch: mergedShowSearch
- }
- });
- }
- // ============================= Clear ==============================
- var onClearMouseDown = function onClearMouseDown() {
- var _selectorRef$current4;
- onClear === null || onClear === void 0 || onClear();
- (_selectorRef$current4 = selectorRef.current) === null || _selectorRef$current4 === void 0 || _selectorRef$current4.focus();
- onDisplayValuesChange([], {
- type: 'clear',
- values: displayValues
- });
- onInternalSearch('', false, false);
- };
- var _useAllowClear = useAllowClear(prefixCls, onClearMouseDown, displayValues, allowClear, clearIcon, disabled, mergedSearchValue, mode),
- mergedAllowClear = _useAllowClear.allowClear,
- clearNode = _useAllowClear.clearIcon;
- // =========================== OptionList ===========================
- var optionList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OptionList, {
- ref: listRef
- });
- // ============================= Select =============================
- var mergedClassName = classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-focused"), mockFocused), "".concat(prefixCls, "-multiple"), multiple), "".concat(prefixCls, "-single"), !multiple), "".concat(prefixCls, "-allow-clear"), allowClear), "".concat(prefixCls, "-show-arrow"), showSuffixIcon), "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-loading"), loading), "".concat(prefixCls, "-open"), mergedOpen), "".concat(prefixCls, "-customize-input"), customizeInputElement), "".concat(prefixCls, "-show-search"), mergedShowSearch));
- // >>> Selector
- var selectorNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_SelectTrigger, {
- ref: triggerRef,
- disabled: disabled,
- prefixCls: prefixCls,
- visible: triggerOpen,
- popupElement: optionList,
- animation: animation,
- transitionName: transitionName,
- dropdownStyle: dropdownStyle,
- dropdownClassName: dropdownClassName,
- direction: direction,
- dropdownMatchSelectWidth: dropdownMatchSelectWidth,
- dropdownRender: dropdownRender,
- dropdownAlign: dropdownAlign,
- placement: placement,
- builtinPlacements: builtinPlacements,
- getPopupContainer: getPopupContainer,
- empty: emptyOptions,
- getTriggerDOMNode: function getTriggerDOMNode(node) {
- return (
- // TODO: This is workaround and should be removed in `rc-select`
- // And use new standard `nativeElement` for ref.
- // But we should update `rc-resize-observer` first.
- selectorDomRef.current || node
- );
- },
- onPopupVisibleChange: onTriggerVisibleChange,
- onPopupMouseEnter: onPopupMouseEnter
- }, customizeRawInputElement ? ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(customizeRawInputElement, {
- ref: customizeRawInputRef
- })) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Selector, (0,esm_extends["default"])({}, props, {
- domRef: selectorDomRef,
- prefixCls: prefixCls,
- inputElement: customizeInputElement,
- ref: selectorRef,
- id: id,
- prefix: prefix,
- showSearch: mergedShowSearch,
- autoClearSearchValue: autoClearSearchValue,
- mode: mode,
- activeDescendantId: activeDescendantId,
- tagRender: tagRender,
- values: displayValues,
- open: mergedOpen,
- onToggleOpen: onToggleOpen,
- activeValue: activeValue,
- searchValue: mergedSearchValue,
- onSearch: onInternalSearch,
- onSearchSubmit: onInternalSearchSubmit,
- onRemove: onSelectorRemove,
- tokenWithEnter: tokenWithEnter,
- onInputBlur: onInputBlur
- })));
- // >>> Render
- var renderNode;
- // Render raw
- if (customizeRawInputElement) {
- renderNode = selectorNode;
- } else {
- renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- className: mergedClassName
- }, domProps, {
- ref: containerRef,
- onMouseDown: onInternalMouseDown,
- onKeyDown: onInternalKeyDown,
- onKeyUp: onInternalKeyUp,
- onFocus: onContainerFocus,
- onBlur: onContainerBlur
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Polite, {
- visible: mockFocused && !mergedOpen,
- values: displayValues
- }), selectorNode, arrowNode, mergedAllowClear && clearNode);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(BaseSelectContext.Provider, {
- value: baseSelectContext
- }, renderNode);
- });
- // Set display name for dev
- if (true) {
- BaseSelect.displayName = 'BaseSelect';
- }
- /* harmony default export */ var es_BaseSelect = (BaseSelect);
- ;// ./node_modules/rc-select/es/OptGroup.js
- /* istanbul ignore file */
- /** This is a placeholder, not real render in dom */
- var OptGroup = function OptGroup() {
- return null;
- };
- OptGroup.isSelectOptGroup = true;
- /* harmony default export */ var es_OptGroup = (OptGroup);
- ;// ./node_modules/rc-select/es/Option.js
- /* istanbul ignore file */
- /** This is a placeholder, not real render in dom */
- var Option = function Option() {
- return null;
- };
- Option.isSelectOption = true;
- /* harmony default export */ var es_Option = (Option);
- ;// ./node_modules/rc-virtual-list/es/Filler.js
- /**
- * Fill component to provided the scroll content real height.
- */
- var Filler = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (_ref, ref) {
- var height = _ref.height,
- offsetY = _ref.offsetY,
- offsetX = _ref.offsetX,
- children = _ref.children,
- prefixCls = _ref.prefixCls,
- onInnerResize = _ref.onInnerResize,
- innerProps = _ref.innerProps,
- rtl = _ref.rtl,
- extra = _ref.extra;
- var outerStyle = {};
- var innerStyle = {
- display: 'flex',
- flexDirection: 'column'
- };
- if (offsetY !== undefined) {
- // Not set `width` since this will break `sticky: right`
- outerStyle = {
- height: height,
- position: 'relative',
- overflow: 'hidden'
- };
- innerStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, innerStyle), {}, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({
- transform: "translateY(".concat(offsetY, "px)")
- }, rtl ? 'marginRight' : 'marginLeft', -offsetX), "position", 'absolute'), "left", 0), "right", 0), "top", 0));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: outerStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: function onResize(_ref2) {
- var offsetHeight = _ref2.offsetHeight;
- if (offsetHeight && onInnerResize) {
- onInnerResize();
- }
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- style: innerStyle,
- className: classnames_default()((0,defineProperty["default"])({}, "".concat(prefixCls, "-holder-inner"), prefixCls)),
- ref: ref
- }, innerProps), children, extra)));
- });
- Filler.displayName = 'Filler';
- /* harmony default export */ var es_Filler = (Filler);
- ;// ./node_modules/rc-virtual-list/es/Item.js
- function Item_Item(_ref) {
- var children = _ref.children,
- setRef = _ref.setRef;
- var refFunc = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (node) {
- setRef(node);
- }, []);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
- ref: refFunc
- });
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useChildren.js
- function useChildren(list, startIndex, endIndex, scrollWidth, offsetX, setNodeRef, renderFunc, _ref) {
- var getKey = _ref.getKey;
- return list.slice(startIndex, endIndex + 1).map(function (item, index) {
- var eleIndex = startIndex + index;
- var node = renderFunc(item, eleIndex, {
- style: {
- width: scrollWidth
- },
- offsetX: offsetX
- });
- var key = getKey(item);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Item_Item, {
- key: key,
- setRef: function setRef(ele) {
- return setNodeRef(item, ele);
- }
- }, node);
- });
- }
- ;// ./node_modules/rc-virtual-list/es/utils/algorithmUtil.js
- /**
- * Get index with specific start index one by one. e.g.
- * min: 3, max: 9, start: 6
- *
- * Return index is:
- * [0]: 6
- * [1]: 7
- * [2]: 5
- * [3]: 8
- * [4]: 4
- * [5]: 9
- * [6]: 3
- */
- function getIndexByStartLoc(min, max, start, index) {
- var beforeCount = start - min;
- var afterCount = max - start;
- var balanceCount = Math.min(beforeCount, afterCount) * 2;
- // Balance
- if (index <= balanceCount) {
- var stepIndex = Math.floor(index / 2);
- if (index % 2) {
- return start + stepIndex + 1;
- }
- return start - stepIndex;
- }
- // One is out of range
- if (beforeCount > afterCount) {
- return start - (index - afterCount);
- }
- return start + (index - beforeCount);
- }
- /**
- * We assume that 2 list has only 1 item diff and others keeping the order.
- * So we can use dichotomy algorithm to find changed one.
- */
- function findListDiffIndex(originList, targetList, getKey) {
- var originLen = originList.length;
- var targetLen = targetList.length;
- var shortList;
- var longList;
- if (originLen === 0 && targetLen === 0) {
- return null;
- }
- if (originLen < targetLen) {
- shortList = originList;
- longList = targetList;
- } else {
- shortList = targetList;
- longList = originList;
- }
- var notExistKey = {
- __EMPTY_ITEM__: true
- };
- function getItemKey(item) {
- if (item !== undefined) {
- return getKey(item);
- }
- return notExistKey;
- }
- // Loop to find diff one
- var diffIndex = null;
- var multiple = Math.abs(originLen - targetLen) !== 1;
- for (var i = 0; i < longList.length; i += 1) {
- var shortKey = getItemKey(shortList[i]);
- var longKey = getItemKey(longList[i]);
- if (shortKey !== longKey) {
- diffIndex = i;
- multiple = multiple || shortKey !== getItemKey(longList[i + 1]);
- break;
- }
- }
- return diffIndex === null ? null : {
- index: diffIndex,
- multiple: multiple
- };
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useDiffItem.js
- function useDiffItem(data, getKey, onDiff) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(data),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- prevData = _React$useState2[0],
- setPrevData = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- diffItem = _React$useState4[0],
- setDiffItem = _React$useState4[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var diff = findListDiffIndex(prevData || [], data || [], getKey);
- if ((diff === null || diff === void 0 ? void 0 : diff.index) !== undefined) {
- onDiff === null || onDiff === void 0 || onDiff(diff.index);
- setDiffItem(data[diff.index]);
- }
- setPrevData(data);
- }, [data]);
- return [diffItem];
- }
- ;// ./node_modules/rc-virtual-list/es/utils/isFirefox.js
- var isFF = (typeof navigator === "undefined" ? "undefined" : (0,esm_typeof["default"])(navigator)) === 'object' && /Firefox/i.test(navigator.userAgent);
- /* harmony default export */ var isFirefox = (isFF);
- ;// ./node_modules/rc-virtual-list/es/hooks/useOriginScroll.js
- /* harmony default export */ var useOriginScroll = (function (isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight) {
- // Do lock for a wheel when scrolling
- var lockRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var lockTimeoutRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- function lockScroll() {
- clearTimeout(lockTimeoutRef.current);
- lockRef.current = true;
- lockTimeoutRef.current = setTimeout(function () {
- lockRef.current = false;
- }, 50);
- }
- // Pass to ref since global add is in closure
- var scrollPingRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
- top: isScrollAtTop,
- bottom: isScrollAtBottom,
- left: isScrollAtLeft,
- right: isScrollAtRight
- });
- scrollPingRef.current.top = isScrollAtTop;
- scrollPingRef.current.bottom = isScrollAtBottom;
- scrollPingRef.current.left = isScrollAtLeft;
- scrollPingRef.current.right = isScrollAtRight;
- return function (isHorizontal, delta) {
- var smoothOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var originScroll = isHorizontal ?
- // Pass origin wheel when on the left
- delta < 0 && scrollPingRef.current.left ||
- // Pass origin wheel when on the right
- delta > 0 && scrollPingRef.current.right // Pass origin wheel when on the top
- : delta < 0 && scrollPingRef.current.top ||
- // Pass origin wheel when on the bottom
- delta > 0 && scrollPingRef.current.bottom;
- if (smoothOffset && originScroll) {
- // No need lock anymore when it's smooth offset from touchMove interval
- clearTimeout(lockTimeoutRef.current);
- lockRef.current = false;
- } else if (!originScroll || lockRef.current) {
- lockScroll();
- }
- return !lockRef.current && originScroll;
- };
- });
- ;// ./node_modules/rc-virtual-list/es/hooks/useFrameWheel.js
- function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight, horizontalScroll,
- /***
- * Return `true` when you need to prevent default event
- */
- onWheelDelta) {
- var offsetRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var nextFrameRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // Firefox patch
- var wheelValueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var isMouseScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- // Scroll status sync
- var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight);
- function onWheelY(e, deltaY) {
- raf["default"].cancel(nextFrameRef.current);
- // Do nothing when scroll at the edge, Skip check when is in scroll
- if (originScroll(false, deltaY)) return;
- // Skip if nest List has handled this event
- var event = e;
- if (!event._virtualHandled) {
- event._virtualHandled = true;
- } else {
- return;
- }
- offsetRef.current += deltaY;
- wheelValueRef.current = deltaY;
- // Proxy of scroll events
- if (!isFirefox) {
- event.preventDefault();
- }
- nextFrameRef.current = (0,raf["default"])(function () {
- // Patch a multiple for Firefox to fix wheel number too small
- // ref: https://github.com/ant-design/ant-design/issues/26372#issuecomment-679460266
- var patchMultiple = isMouseScrollRef.current ? 10 : 1;
- onWheelDelta(offsetRef.current * patchMultiple, false);
- offsetRef.current = 0;
- });
- }
- function onWheelX(event, deltaX) {
- onWheelDelta(deltaX, true);
- if (!isFirefox) {
- event.preventDefault();
- }
- }
- // Check for which direction does wheel do. `sx` means `shift + wheel`
- var wheelDirectionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var wheelDirectionCleanRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- function onWheel(event) {
- if (!inVirtual) return;
- // Wait for 2 frame to clean direction
- raf["default"].cancel(wheelDirectionCleanRef.current);
- wheelDirectionCleanRef.current = (0,raf["default"])(function () {
- wheelDirectionRef.current = null;
- }, 2);
- var deltaX = event.deltaX,
- deltaY = event.deltaY,
- shiftKey = event.shiftKey;
- var mergedDeltaX = deltaX;
- var mergedDeltaY = deltaY;
- if (wheelDirectionRef.current === 'sx' || !wheelDirectionRef.current && (shiftKey || false) && deltaY && !deltaX) {
- mergedDeltaX = deltaY;
- mergedDeltaY = 0;
- wheelDirectionRef.current = 'sx';
- }
- var absX = Math.abs(mergedDeltaX);
- var absY = Math.abs(mergedDeltaY);
- if (wheelDirectionRef.current === null) {
- wheelDirectionRef.current = horizontalScroll && absX > absY ? 'x' : 'y';
- }
- if (wheelDirectionRef.current === 'y') {
- onWheelY(event, mergedDeltaY);
- } else {
- onWheelX(event, mergedDeltaX);
- }
- }
- // A patch for firefox
- function onFireFoxScroll(event) {
- if (!inVirtual) return;
- isMouseScrollRef.current = event.detail === wheelValueRef.current;
- }
- return [onWheel, onFireFoxScroll];
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useGetSize.js
- /**
- * Size info need loop query for the `heights` which will has the perf issue.
- * Let cache result for each render phase.
- */
- function useGetSize(mergedData, getKey, heights, itemHeight) {
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return [new Map(), []];
- }, [mergedData, heights.id, itemHeight]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- key2Index = _React$useMemo2[0],
- bottomList = _React$useMemo2[1];
- var getSize = function getSize(startKey) {
- var endKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startKey;
- // Get from cache first
- var startIndex = key2Index.get(startKey);
- var endIndex = key2Index.get(endKey);
- // Loop to fill the cache
- if (startIndex === undefined || endIndex === undefined) {
- var dataLen = mergedData.length;
- for (var i = bottomList.length; i < dataLen; i += 1) {
- var _heights$get;
- var item = mergedData[i];
- var key = getKey(item);
- key2Index.set(key, i);
- var cacheHeight = (_heights$get = heights.get(key)) !== null && _heights$get !== void 0 ? _heights$get : itemHeight;
- bottomList[i] = (bottomList[i - 1] || 0) + cacheHeight;
- if (key === startKey) {
- startIndex = i;
- }
- if (key === endKey) {
- endIndex = i;
- }
- if (startIndex !== undefined && endIndex !== undefined) {
- break;
- }
- }
- }
- return {
- top: bottomList[startIndex - 1] || 0,
- bottom: bottomList[endIndex]
- };
- };
- return getSize;
- }
- ;// ./node_modules/rc-virtual-list/es/utils/CacheMap.js
- // Firefox has low performance of map.
- var CacheMap = /*#__PURE__*/function () {
- function CacheMap() {
- (0,classCallCheck["default"])(this, CacheMap);
- (0,defineProperty["default"])(this, "maps", void 0);
- // Used for cache key
- // `useMemo` no need to update if `id` not change
- (0,defineProperty["default"])(this, "id", 0);
- (0,defineProperty["default"])(this, "diffRecords", new Map());
- this.maps = Object.create(null);
- }
- (0,createClass["default"])(CacheMap, [{
- key: "set",
- value: function set(key, value) {
- // Record prev value
- this.diffRecords.set(key, this.maps[key]);
- this.maps[key] = value;
- this.id += 1;
- }
- }, {
- key: "get",
- value: function get(key) {
- return this.maps[key];
- }
- /**
- * CacheMap will record the key changed.
- * To help to know what's update in the next render.
- */
- }, {
- key: "resetRecord",
- value: function resetRecord() {
- this.diffRecords.clear();
- }
- }, {
- key: "getRecord",
- value: function getRecord() {
- return this.diffRecords;
- }
- }]);
- return CacheMap;
- }();
- /* harmony default export */ var utils_CacheMap = (CacheMap);
- ;// ./node_modules/rc-virtual-list/es/hooks/useHeights.js
- function parseNumber(value) {
- var num = parseFloat(value);
- return isNaN(num) ? 0 : num;
- }
- function useHeights(getKey, onItemAdd, onItemRemove) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- updatedMark = _React$useState2[0],
- setUpdatedMark = _React$useState2[1];
- var instanceRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(new Map());
- var heightsRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(new utils_CacheMap());
- var promiseIdRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- function cancelRaf() {
- promiseIdRef.current += 1;
- }
- function collectHeight() {
- var sync = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- cancelRaf();
- var doCollect = function doCollect() {
- var changed = false;
- instanceRef.current.forEach(function (element, key) {
- if (element && element.offsetParent) {
- var offsetHeight = element.offsetHeight;
- var _getComputedStyle = getComputedStyle(element),
- marginTop = _getComputedStyle.marginTop,
- marginBottom = _getComputedStyle.marginBottom;
- var marginTopNum = parseNumber(marginTop);
- var marginBottomNum = parseNumber(marginBottom);
- var totalHeight = offsetHeight + marginTopNum + marginBottomNum;
- if (heightsRef.current.get(key) !== totalHeight) {
- heightsRef.current.set(key, totalHeight);
- changed = true;
- }
- }
- });
- // Always trigger update mark to tell parent that should re-calculate heights when resized
- if (changed) {
- setUpdatedMark(function (c) {
- return c + 1;
- });
- }
- };
- if (sync) {
- doCollect();
- } else {
- promiseIdRef.current += 1;
- var id = promiseIdRef.current;
- Promise.resolve().then(function () {
- if (id === promiseIdRef.current) {
- doCollect();
- }
- });
- }
- }
- function setInstanceRef(item, instance) {
- var key = getKey(item);
- var origin = instanceRef.current.get(key);
- if (instance) {
- instanceRef.current.set(key, instance);
- collectHeight();
- } else {
- instanceRef.current.delete(key);
- }
- // Instance changed
- if (!origin !== !instance) {
- if (instance) {
- onItemAdd === null || onItemAdd === void 0 || onItemAdd(item);
- } else {
- onItemRemove === null || onItemRemove === void 0 || onItemRemove(item);
- }
- }
- }
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return cancelRaf;
- }, []);
- return [setInstanceRef, collectHeight, heightsRef.current, updatedMark];
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js
- var SMOOTH_PTG = 14 / 15;
- function useMobileTouchMove(inVirtual, listRef, callback) {
- var touchedRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var touchXRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var touchYRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // Smooth scroll
- var intervalRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- /* eslint-disable prefer-const */
- var cleanUpEvents;
- var onTouchMove = function onTouchMove(e) {
- if (touchedRef.current) {
- var currentX = Math.ceil(e.touches[0].pageX);
- var currentY = Math.ceil(e.touches[0].pageY);
- var offsetX = touchXRef.current - currentX;
- var offsetY = touchYRef.current - currentY;
- var _isHorizontal = Math.abs(offsetX) > Math.abs(offsetY);
- if (_isHorizontal) {
- touchXRef.current = currentX;
- } else {
- touchYRef.current = currentY;
- }
- var scrollHandled = callback(_isHorizontal, _isHorizontal ? offsetX : offsetY, false, e);
- if (scrollHandled) {
- e.preventDefault();
- }
- // Smooth interval
- clearInterval(intervalRef.current);
- if (scrollHandled) {
- intervalRef.current = setInterval(function () {
- if (_isHorizontal) {
- offsetX *= SMOOTH_PTG;
- } else {
- offsetY *= SMOOTH_PTG;
- }
- var offset = Math.floor(_isHorizontal ? offsetX : offsetY);
- if (!callback(_isHorizontal, offset, true) || Math.abs(offset) <= 0.1) {
- clearInterval(intervalRef.current);
- }
- }, 16);
- }
- }
- };
- var onTouchEnd = function onTouchEnd() {
- touchedRef.current = false;
- cleanUpEvents();
- };
- var onTouchStart = function onTouchStart(e) {
- cleanUpEvents();
- if (e.touches.length === 1 && !touchedRef.current) {
- touchedRef.current = true;
- touchXRef.current = Math.ceil(e.touches[0].pageX);
- touchYRef.current = Math.ceil(e.touches[0].pageY);
- elementRef.current = e.target;
- elementRef.current.addEventListener('touchmove', onTouchMove, {
- passive: false
- });
- elementRef.current.addEventListener('touchend', onTouchEnd, {
- passive: true
- });
- }
- };
- cleanUpEvents = function cleanUpEvents() {
- if (elementRef.current) {
- elementRef.current.removeEventListener('touchmove', onTouchMove);
- elementRef.current.removeEventListener('touchend', onTouchEnd);
- }
- };
- (0,useLayoutEffect["default"])(function () {
- if (inVirtual) {
- listRef.current.addEventListener('touchstart', onTouchStart, {
- passive: true
- });
- }
- return function () {
- var _listRef$current;
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.removeEventListener('touchstart', onTouchStart);
- cleanUpEvents();
- clearInterval(intervalRef.current);
- };
- }, [inVirtual]);
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useScrollDrag.js
- function smoothScrollOffset(offset) {
- return Math.floor(Math.pow(offset, 0.5));
- }
- function getPageXY(e, horizontal) {
- var obj = 'touches' in e ? e.touches[0] : e;
- return obj[horizontal ? 'pageX' : 'pageY'] - window[horizontal ? 'scrollX' : 'scrollY'];
- }
- function useScrollDrag(inVirtual, componentRef, onScrollOffset) {
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var ele = componentRef.current;
- if (inVirtual && ele) {
- var mouseDownLock = false;
- var rafId;
- var _offset;
- var stopScroll = function stopScroll() {
- raf["default"].cancel(rafId);
- };
- var continueScroll = function continueScroll() {
- stopScroll();
- rafId = (0,raf["default"])(function () {
- onScrollOffset(_offset);
- continueScroll();
- });
- };
- var clearDragState = function clearDragState() {
- mouseDownLock = false;
- stopScroll();
- };
- var onMouseDown = function onMouseDown(e) {
- // Skip if element set draggable
- if (e.target.draggable || e.button !== 0) {
- return;
- }
- // Skip if nest List has handled this event
- var event = e;
- if (!event._virtualHandled) {
- event._virtualHandled = true;
- mouseDownLock = true;
- }
- };
- var onMouseMove = function onMouseMove(e) {
- if (mouseDownLock) {
- var mouseY = getPageXY(e, false);
- var _ele$getBoundingClien = ele.getBoundingClientRect(),
- top = _ele$getBoundingClien.top,
- bottom = _ele$getBoundingClien.bottom;
- if (mouseY <= top) {
- var diff = top - mouseY;
- _offset = -smoothScrollOffset(diff);
- continueScroll();
- } else if (mouseY >= bottom) {
- var _diff = mouseY - bottom;
- _offset = smoothScrollOffset(_diff);
- continueScroll();
- } else {
- stopScroll();
- }
- }
- };
- ele.addEventListener('mousedown', onMouseDown);
- ele.ownerDocument.addEventListener('mouseup', clearDragState);
- ele.ownerDocument.addEventListener('mousemove', onMouseMove);
- ele.ownerDocument.addEventListener('dragend', clearDragState);
- return function () {
- ele.removeEventListener('mousedown', onMouseDown);
- ele.ownerDocument.removeEventListener('mouseup', clearDragState);
- ele.ownerDocument.removeEventListener('mousemove', onMouseMove);
- ele.ownerDocument.removeEventListener('dragend', clearDragState);
- stopScroll();
- };
- }
- }, [inVirtual]);
- }
- ;// ./node_modules/rc-virtual-list/es/hooks/useScrollTo.js
- /* eslint-disable no-param-reassign */
- var MAX_TIMES = 10;
- function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHeight, syncScrollTop, triggerFlash) {
- var scrollRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- syncState = _React$useState2[0],
- setSyncState = _React$useState2[1];
- // ========================== Sync Scroll ==========================
- (0,useLayoutEffect["default"])(function () {
- if (syncState && syncState.times < MAX_TIMES) {
- // Never reach
- if (!containerRef.current) {
- setSyncState(function (ori) {
- return (0,objectSpread2["default"])({}, ori);
- });
- return;
- }
- collectHeight();
- var targetAlign = syncState.targetAlign,
- originAlign = syncState.originAlign,
- index = syncState.index,
- offset = syncState.offset;
- var height = containerRef.current.clientHeight;
- var needCollectHeight = false;
- var newTargetAlign = targetAlign;
- var targetTop = null;
- // Go to next frame if height not exist
- if (height) {
- var mergedAlign = targetAlign || originAlign;
- // Get top & bottom
- var stackTop = 0;
- var itemTop = 0;
- var itemBottom = 0;
- var maxLen = Math.min(data.length - 1, index);
- for (var i = 0; i <= maxLen; i += 1) {
- var key = getKey(data[i]);
- itemTop = stackTop;
- var cacheHeight = heights.get(key);
- itemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
- stackTop = itemBottom;
- }
- // Check if need sync height (visible range has item not record height)
- var leftHeight = mergedAlign === 'top' ? offset : height - offset;
- for (var _i = maxLen; _i >= 0; _i -= 1) {
- var _key = getKey(data[_i]);
- var _cacheHeight = heights.get(_key);
- if (_cacheHeight === undefined) {
- needCollectHeight = true;
- break;
- }
- leftHeight -= _cacheHeight;
- if (leftHeight <= 0) {
- break;
- }
- }
- // Scroll to
- switch (mergedAlign) {
- case 'top':
- targetTop = itemTop - offset;
- break;
- case 'bottom':
- targetTop = itemBottom - height + offset;
- break;
- default:
- {
- var scrollTop = containerRef.current.scrollTop;
- var scrollBottom = scrollTop + height;
- if (itemTop < scrollTop) {
- newTargetAlign = 'top';
- } else if (itemBottom > scrollBottom) {
- newTargetAlign = 'bottom';
- }
- }
- }
- if (targetTop !== null) {
- syncScrollTop(targetTop);
- }
- // One more time for sync
- if (targetTop !== syncState.lastTop) {
- needCollectHeight = true;
- }
- }
- // Trigger next effect
- if (needCollectHeight) {
- setSyncState((0,objectSpread2["default"])((0,objectSpread2["default"])({}, syncState), {}, {
- times: syncState.times + 1,
- targetAlign: newTargetAlign,
- lastTop: targetTop
- }));
- }
- } else if ( true && (syncState === null || syncState === void 0 ? void 0 : syncState.times) === MAX_TIMES) {
- (0,rc_util_es.warning)(false, 'Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.');
- }
- }, [syncState, containerRef.current]);
- // =========================== Scroll To ===========================
- return function (arg) {
- // When not argument provided, we think dev may want to show the scrollbar
- if (arg === null || arg === undefined) {
- triggerFlash();
- return;
- }
- // Normal scroll logic
- raf["default"].cancel(scrollRef.current);
- if (typeof arg === 'number') {
- syncScrollTop(arg);
- } else if (arg && (0,esm_typeof["default"])(arg) === 'object') {
- var index;
- var align = arg.align;
- if ('index' in arg) {
- index = arg.index;
- } else {
- index = data.findIndex(function (item) {
- return getKey(item) === arg.key;
- });
- }
- var _arg$offset = arg.offset,
- offset = _arg$offset === void 0 ? 0 : _arg$offset;
- setSyncState({
- times: 0,
- index: index,
- offset: offset,
- originAlign: align
- });
- }
- };
- }
- ;// ./node_modules/rc-virtual-list/es/ScrollBar.js
- var ScrollBar = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- rtl = props.rtl,
- scrollOffset = props.scrollOffset,
- scrollRange = props.scrollRange,
- onStartMove = props.onStartMove,
- onStopMove = props.onStopMove,
- onScroll = props.onScroll,
- horizontal = props.horizontal,
- spinSize = props.spinSize,
- containerSize = props.containerSize,
- style = props.style,
- propsThumbStyle = props.thumbStyle,
- showScrollBar = props.showScrollBar;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- dragging = _React$useState2[0],
- setDragging = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- pageXY = _React$useState4[0],
- setPageXY = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- startTop = _React$useState6[0],
- setStartTop = _React$useState6[1];
- var isLTR = !rtl;
- // ========================= Refs =========================
- var scrollbarRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var thumbRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- // ======================= Visible ========================
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(showScrollBar),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- visible = _React$useState8[0],
- setVisible = _React$useState8[1];
- var visibleTimeoutRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var delayHidden = function delayHidden() {
- if (showScrollBar === true || showScrollBar === false) return;
- clearTimeout(visibleTimeoutRef.current);
- setVisible(true);
- visibleTimeoutRef.current = setTimeout(function () {
- setVisible(false);
- }, 3000);
- };
- // ======================== Range =========================
- var enableScrollRange = scrollRange - containerSize || 0;
- var enableOffsetRange = containerSize - spinSize || 0;
- // ========================= Top ==========================
- var top = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (scrollOffset === 0 || enableScrollRange === 0) {
- return 0;
- }
- var ptg = scrollOffset / enableScrollRange;
- return ptg * enableOffsetRange;
- }, [scrollOffset, enableScrollRange, enableOffsetRange]);
- // ====================== Container =======================
- var onContainerMouseDown = function onContainerMouseDown(e) {
- e.stopPropagation();
- e.preventDefault();
- };
- // ======================== Thumb =========================
- var stateRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- top: top,
- dragging: dragging,
- pageY: pageXY,
- startTop: startTop
- });
- stateRef.current = {
- top: top,
- dragging: dragging,
- pageY: pageXY,
- startTop: startTop
- };
- var onThumbMouseDown = function onThumbMouseDown(e) {
- setDragging(true);
- setPageXY(getPageXY(e, horizontal));
- setStartTop(stateRef.current.top);
- onStartMove();
- e.stopPropagation();
- e.preventDefault();
- };
- // ======================== Effect ========================
- // React make event as passive, but we need to preventDefault
- // Add event on dom directly instead.
- // ref: https://github.com/facebook/react/issues/9809
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var onScrollbarTouchStart = function onScrollbarTouchStart(e) {
- e.preventDefault();
- };
- var scrollbarEle = scrollbarRef.current;
- var thumbEle = thumbRef.current;
- scrollbarEle.addEventListener('touchstart', onScrollbarTouchStart, {
- passive: false
- });
- thumbEle.addEventListener('touchstart', onThumbMouseDown, {
- passive: false
- });
- return function () {
- scrollbarEle.removeEventListener('touchstart', onScrollbarTouchStart);
- thumbEle.removeEventListener('touchstart', onThumbMouseDown);
- };
- }, []);
- // Pass to effect
- var enableScrollRangeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- enableScrollRangeRef.current = enableScrollRange;
- var enableOffsetRangeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- enableOffsetRangeRef.current = enableOffsetRange;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (dragging) {
- var moveRafId;
- var onMouseMove = function onMouseMove(e) {
- var _stateRef$current = stateRef.current,
- stateDragging = _stateRef$current.dragging,
- statePageY = _stateRef$current.pageY,
- stateStartTop = _stateRef$current.startTop;
- raf["default"].cancel(moveRafId);
- var rect = scrollbarRef.current.getBoundingClientRect();
- var scale = containerSize / (horizontal ? rect.width : rect.height);
- if (stateDragging) {
- var offset = (getPageXY(e, horizontal) - statePageY) * scale;
- var newTop = stateStartTop;
- if (!isLTR && horizontal) {
- newTop -= offset;
- } else {
- newTop += offset;
- }
- var tmpEnableScrollRange = enableScrollRangeRef.current;
- var tmpEnableOffsetRange = enableOffsetRangeRef.current;
- var ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0;
- var newScrollTop = Math.ceil(ptg * tmpEnableScrollRange);
- newScrollTop = Math.max(newScrollTop, 0);
- newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange);
- moveRafId = (0,raf["default"])(function () {
- onScroll(newScrollTop, horizontal);
- });
- }
- };
- var onMouseUp = function onMouseUp() {
- setDragging(false);
- onStopMove();
- };
- window.addEventListener('mousemove', onMouseMove, {
- passive: true
- });
- window.addEventListener('touchmove', onMouseMove, {
- passive: true
- });
- window.addEventListener('mouseup', onMouseUp, {
- passive: true
- });
- window.addEventListener('touchend', onMouseUp, {
- passive: true
- });
- return function () {
- window.removeEventListener('mousemove', onMouseMove);
- window.removeEventListener('touchmove', onMouseMove);
- window.removeEventListener('mouseup', onMouseUp);
- window.removeEventListener('touchend', onMouseUp);
- raf["default"].cancel(moveRafId);
- };
- }
- }, [dragging]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- delayHidden();
- return function () {
- clearTimeout(visibleTimeoutRef.current);
- };
- }, [scrollOffset]);
- // ====================== Imperative ======================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- delayHidden: delayHidden
- };
- });
- // ======================== Render ========================
- var scrollbarPrefixCls = "".concat(prefixCls, "-scrollbar");
- var containerStyle = {
- position: 'absolute',
- visibility: visible ? null : 'hidden'
- };
- var thumbStyle = {
- position: 'absolute',
- borderRadius: 99,
- background: 'var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))',
- cursor: 'pointer',
- userSelect: 'none'
- };
- if (horizontal) {
- Object.assign(containerStyle, {
- height: 8,
- left: 0,
- right: 0,
- bottom: 0
- });
- Object.assign(thumbStyle, (0,defineProperty["default"])({
- height: '100%',
- width: spinSize
- }, isLTR ? 'left' : 'right', top));
- } else {
- Object.assign(containerStyle, (0,defineProperty["default"])({
- width: 8,
- top: 0,
- bottom: 0
- }, isLTR ? 'right' : 'left', 0));
- Object.assign(thumbStyle, {
- width: '100%',
- height: spinSize,
- top: top
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: scrollbarRef,
- className: classnames_default()(scrollbarPrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(scrollbarPrefixCls, "-horizontal"), horizontal), "".concat(scrollbarPrefixCls, "-vertical"), !horizontal), "".concat(scrollbarPrefixCls, "-visible"), visible)),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, containerStyle), style),
- onMouseDown: onContainerMouseDown,
- onMouseMove: delayHidden
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: thumbRef,
- className: classnames_default()("".concat(scrollbarPrefixCls, "-thumb"), (0,defineProperty["default"])({}, "".concat(scrollbarPrefixCls, "-thumb-moving"), dragging)),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, thumbStyle), propsThumbStyle),
- onMouseDown: onThumbMouseDown
- }));
- });
- if (true) {
- ScrollBar.displayName = 'ScrollBar';
- }
- /* harmony default export */ var es_ScrollBar = (ScrollBar);
- ;// ./node_modules/rc-virtual-list/es/utils/scrollbarUtil.js
- var MIN_SIZE = 20;
- function getSpinSize() {
- var containerSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var scrollRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var baseSize = containerSize / scrollRange * containerSize;
- if (isNaN(baseSize)) {
- baseSize = 0;
- }
- baseSize = Math.max(baseSize, MIN_SIZE);
- return Math.floor(baseSize);
- }
- ;// ./node_modules/rc-virtual-list/es/List.js
- var List_excluded = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles", "showScrollBar"];
- var EMPTY_DATA = [];
- var ScrollStyle = {
- overflowY: 'auto',
- overflowAnchor: 'none'
- };
- function RawList(props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-virtual-list' : _props$prefixCls,
- className = props.className,
- height = props.height,
- itemHeight = props.itemHeight,
- _props$fullHeight = props.fullHeight,
- fullHeight = _props$fullHeight === void 0 ? true : _props$fullHeight,
- style = props.style,
- data = props.data,
- children = props.children,
- itemKey = props.itemKey,
- virtual = props.virtual,
- direction = props.direction,
- scrollWidth = props.scrollWidth,
- _props$component = props.component,
- Component = _props$component === void 0 ? 'div' : _props$component,
- onScroll = props.onScroll,
- onVirtualScroll = props.onVirtualScroll,
- onVisibleChange = props.onVisibleChange,
- innerProps = props.innerProps,
- extraRender = props.extraRender,
- styles = props.styles,
- _props$showScrollBar = props.showScrollBar,
- showScrollBar = _props$showScrollBar === void 0 ? 'optional' : _props$showScrollBar,
- restProps = (0,objectWithoutProperties["default"])(props, List_excluded);
- // =============================== Item Key ===============================
- var getKey = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (item) {
- if (typeof itemKey === 'function') {
- return itemKey(item);
- }
- return item === null || item === void 0 ? void 0 : item[itemKey];
- }, [itemKey]);
- // ================================ Height ================================
- var _useHeights = useHeights(getKey, null, null),
- _useHeights2 = (0,slicedToArray["default"])(_useHeights, 4),
- setInstanceRef = _useHeights2[0],
- collectHeight = _useHeights2[1],
- heights = _useHeights2[2],
- heightUpdatedMark = _useHeights2[3];
- // ================================= MISC =================================
- var useVirtual = !!(virtual !== false && height && itemHeight);
- var containerHeight = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return Object.values(heights.maps).reduce(function (total, curr) {
- return total + curr;
- }, 0);
- }, [heights.id, heights.maps]);
- var inVirtual = useVirtual && data && (Math.max(itemHeight * data.length, containerHeight) > height || !!scrollWidth);
- var isRTL = direction === 'rtl';
- var mergedClassName = classnames_default()(prefixCls, (0,defineProperty["default"])({}, "".concat(prefixCls, "-rtl"), isRTL), className);
- var mergedData = data || EMPTY_DATA;
- var componentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var fillerInnerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // =============================== Item Key ===============================
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- offsetTop = _useState2[0],
- setOffsetTop = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- offsetLeft = _useState4[0],
- setOffsetLeft = _useState4[1];
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState6 = (0,slicedToArray["default"])(_useState5, 2),
- scrollMoving = _useState6[0],
- setScrollMoving = _useState6[1];
- var onScrollbarStartMove = function onScrollbarStartMove() {
- setScrollMoving(true);
- };
- var onScrollbarStopMove = function onScrollbarStopMove() {
- setScrollMoving(false);
- };
- var sharedConfig = {
- getKey: getKey
- };
- // ================================ Scroll ================================
- function syncScrollTop(newTop) {
- setOffsetTop(function (origin) {
- var value;
- if (typeof newTop === 'function') {
- value = newTop(origin);
- } else {
- value = newTop;
- }
- var alignedTop = keepInRange(value);
- componentRef.current.scrollTop = alignedTop;
- return alignedTop;
- });
- }
- // ================================ Legacy ================================
- // Put ref here since the range is generate by follow
- var rangeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
- start: 0,
- end: mergedData.length
- });
- var diffItemRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var _useDiffItem = useDiffItem(mergedData, getKey),
- _useDiffItem2 = (0,slicedToArray["default"])(_useDiffItem, 1),
- diffItem = _useDiffItem2[0];
- diffItemRef.current = diffItem;
- // ========================== Visible Calculation =========================
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!useVirtual) {
- return {
- scrollHeight: undefined,
- start: 0,
- end: mergedData.length - 1,
- offset: undefined
- };
- }
- // Always use virtual scroll bar in avoid shaking
- if (!inVirtual) {
- var _fillerInnerRef$curre;
- return {
- scrollHeight: ((_fillerInnerRef$curre = fillerInnerRef.current) === null || _fillerInnerRef$curre === void 0 ? void 0 : _fillerInnerRef$curre.offsetHeight) || 0,
- start: 0,
- end: mergedData.length - 1,
- offset: undefined
- };
- }
- var itemTop = 0;
- var startIndex;
- var startOffset;
- var endIndex;
- var dataLen = mergedData.length;
- for (var i = 0; i < dataLen; i += 1) {
- var _item = mergedData[i];
- var key = getKey(_item);
- var cacheHeight = heights.get(key);
- var currentItemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
- // Check item top in the range
- if (currentItemBottom >= offsetTop && startIndex === undefined) {
- startIndex = i;
- startOffset = itemTop;
- }
- // Check item bottom in the range. We will render additional one item for motion usage
- if (currentItemBottom > offsetTop + height && endIndex === undefined) {
- endIndex = i;
- }
- itemTop = currentItemBottom;
- }
- // When scrollTop at the end but data cut to small count will reach this
- if (startIndex === undefined) {
- startIndex = 0;
- startOffset = 0;
- endIndex = Math.ceil(height / itemHeight);
- }
- if (endIndex === undefined) {
- endIndex = mergedData.length - 1;
- }
- // Give cache to improve scroll experience
- endIndex = Math.min(endIndex + 1, mergedData.length - 1);
- return {
- scrollHeight: itemTop,
- start: startIndex,
- end: endIndex,
- offset: startOffset
- };
- }, [inVirtual, useVirtual, offsetTop, mergedData, heightUpdatedMark, height]),
- scrollHeight = _React$useMemo.scrollHeight,
- start = _React$useMemo.start,
- end = _React$useMemo.end,
- fillerOffset = _React$useMemo.offset;
- rangeRef.current.start = start;
- rangeRef.current.end = end;
- // When scroll up, first visible item get real height may not same as `itemHeight`,
- // Which will make scroll jump.
- // Let's sync scroll top to avoid jump
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect(function () {
- var changedRecord = heights.getRecord();
- if (changedRecord.size === 1) {
- var recordKey = Array.from(changedRecord.keys())[0];
- var prevCacheHeight = changedRecord.get(recordKey);
- // Quick switch data may cause `start` not in `mergedData` anymore
- var startItem = mergedData[start];
- if (startItem && prevCacheHeight === undefined) {
- var startIndexKey = getKey(startItem);
- if (startIndexKey === recordKey) {
- var realStartHeight = heights.get(recordKey);
- var diffHeight = realStartHeight - itemHeight;
- syncScrollTop(function (ori) {
- return ori + diffHeight;
- });
- }
- }
- }
- heights.resetRecord();
- }, [scrollHeight]);
- // ================================= Size =================================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({
- width: 0,
- height: height
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- size = _React$useState2[0],
- setSize = _React$useState2[1];
- var onHolderResize = function onHolderResize(sizeInfo) {
- setSize({
- width: sizeInfo.offsetWidth,
- height: sizeInfo.offsetHeight
- });
- };
- // Hack on scrollbar to enable flash call
- var verticalScrollBarRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var horizontalScrollBarRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var horizontalScrollBarSpinSize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getSpinSize(size.width, scrollWidth);
- }, [size.width, scrollWidth]);
- var verticalScrollBarSpinSize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getSpinSize(size.height, scrollHeight);
- }, [size.height, scrollHeight]);
- // =============================== In Range ===============================
- var maxScrollHeight = scrollHeight - height;
- var maxScrollHeightRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(maxScrollHeight);
- maxScrollHeightRef.current = maxScrollHeight;
- function keepInRange(newScrollTop) {
- var newTop = newScrollTop;
- if (!Number.isNaN(maxScrollHeightRef.current)) {
- newTop = Math.min(newTop, maxScrollHeightRef.current);
- }
- newTop = Math.max(newTop, 0);
- return newTop;
- }
- var isScrollAtTop = offsetTop <= 0;
- var isScrollAtBottom = offsetTop >= maxScrollHeight;
- var isScrollAtLeft = offsetLeft <= 0;
- var isScrollAtRight = offsetLeft >= scrollWidth;
- var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight);
- // ================================ Scroll ================================
- var getVirtualScrollInfo = function getVirtualScrollInfo() {
- return {
- x: isRTL ? -offsetLeft : offsetLeft,
- y: offsetTop
- };
- };
- var lastVirtualScrollInfoRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(getVirtualScrollInfo());
- var triggerScroll = (0,rc_util_es.useEvent)(function (params) {
- if (onVirtualScroll) {
- var nextInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, getVirtualScrollInfo()), params);
- // Trigger when offset changed
- if (lastVirtualScrollInfoRef.current.x !== nextInfo.x || lastVirtualScrollInfoRef.current.y !== nextInfo.y) {
- onVirtualScroll(nextInfo);
- lastVirtualScrollInfoRef.current = nextInfo;
- }
- }
- });
- function onScrollBar(newScrollOffset, horizontal) {
- var newOffset = newScrollOffset;
- if (horizontal) {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(function () {
- setOffsetLeft(newOffset);
- });
- triggerScroll();
- } else {
- syncScrollTop(newOffset);
- }
- }
- // When data size reduce. It may trigger native scroll event back to fit scroll position
- function onFallbackScroll(e) {
- var newScrollTop = e.currentTarget.scrollTop;
- if (newScrollTop !== offsetTop) {
- syncScrollTop(newScrollTop);
- }
- // Trigger origin onScroll
- onScroll === null || onScroll === void 0 || onScroll(e);
- triggerScroll();
- }
- var keepInHorizontalRange = function keepInHorizontalRange(nextOffsetLeft) {
- var tmpOffsetLeft = nextOffsetLeft;
- var max = !!scrollWidth ? scrollWidth - size.width : 0;
- tmpOffsetLeft = Math.max(tmpOffsetLeft, 0);
- tmpOffsetLeft = Math.min(tmpOffsetLeft, max);
- return tmpOffsetLeft;
- };
- var onWheelDelta = (0,rc_util_es.useEvent)(function (offsetXY, fromHorizontal) {
- if (fromHorizontal) {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(function () {
- setOffsetLeft(function (left) {
- var nextOffsetLeft = left + (isRTL ? -offsetXY : offsetXY);
- return keepInHorizontalRange(nextOffsetLeft);
- });
- });
- triggerScroll();
- } else {
- syncScrollTop(function (top) {
- var newTop = top + offsetXY;
- return newTop;
- });
- }
- });
- // Since this added in global,should use ref to keep update
- var _useFrameWheel = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight, !!scrollWidth, onWheelDelta),
- _useFrameWheel2 = (0,slicedToArray["default"])(_useFrameWheel, 2),
- onRawWheel = _useFrameWheel2[0],
- onFireFoxScroll = _useFrameWheel2[1];
- // Mobile touch move
- useMobileTouchMove(useVirtual, componentRef, function (isHorizontal, delta, smoothOffset, e) {
- var event = e;
- if (originScroll(isHorizontal, delta, smoothOffset)) {
- return false;
- }
- // Fix nest List trigger TouchMove event
- if (!event || !event._virtualHandled) {
- if (event) {
- event._virtualHandled = true;
- }
- onRawWheel({
- preventDefault: function preventDefault() {},
- deltaX: isHorizontal ? delta : 0,
- deltaY: isHorizontal ? 0 : delta
- });
- return true;
- }
- return false;
- });
- // MouseDown drag for scroll
- useScrollDrag(inVirtual, componentRef, function (offset) {
- syncScrollTop(function (top) {
- return top + offset;
- });
- });
- (0,useLayoutEffect["default"])(function () {
- // Firefox only
- function onMozMousePixelScroll(e) {
- // scrolling at top/bottom limit
- var scrollingUpAtTop = isScrollAtTop && e.detail < 0;
- var scrollingDownAtBottom = isScrollAtBottom && e.detail > 0;
- if (useVirtual && !scrollingUpAtTop && !scrollingDownAtBottom) {
- e.preventDefault();
- }
- }
- var componentEle = componentRef.current;
- componentEle.addEventListener('wheel', onRawWheel, {
- passive: false
- });
- componentEle.addEventListener('DOMMouseScroll', onFireFoxScroll, {
- passive: true
- });
- componentEle.addEventListener('MozMousePixelScroll', onMozMousePixelScroll, {
- passive: false
- });
- return function () {
- componentEle.removeEventListener('wheel', onRawWheel);
- componentEle.removeEventListener('DOMMouseScroll', onFireFoxScroll);
- componentEle.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
- };
- }, [useVirtual, isScrollAtTop, isScrollAtBottom]);
- // Sync scroll left
- (0,useLayoutEffect["default"])(function () {
- if (scrollWidth) {
- var newOffsetLeft = keepInHorizontalRange(offsetLeft);
- setOffsetLeft(newOffsetLeft);
- triggerScroll({
- x: newOffsetLeft
- });
- }
- }, [size.width, scrollWidth]);
- // ================================= Ref ==================================
- var delayHideScrollBar = function delayHideScrollBar() {
- var _verticalScrollBarRef, _horizontalScrollBarR;
- (_verticalScrollBarRef = verticalScrollBarRef.current) === null || _verticalScrollBarRef === void 0 || _verticalScrollBarRef.delayHidden();
- (_horizontalScrollBarR = horizontalScrollBarRef.current) === null || _horizontalScrollBarR === void 0 || _horizontalScrollBarR.delayHidden();
- };
- var _scrollTo = useScrollTo(componentRef, mergedData, heights, itemHeight, getKey, function () {
- return collectHeight(true);
- }, syncScrollTop, delayHideScrollBar);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: containerRef.current,
- getScrollInfo: getVirtualScrollInfo,
- scrollTo: function scrollTo(config) {
- function isPosScroll(arg) {
- return arg && (0,esm_typeof["default"])(arg) === 'object' && ('left' in arg || 'top' in arg);
- }
- if (isPosScroll(config)) {
- // Scroll X
- if (config.left !== undefined) {
- setOffsetLeft(keepInHorizontalRange(config.left));
- }
- // Scroll Y
- _scrollTo(config.top);
- } else {
- _scrollTo(config);
- }
- }
- };
- });
- // ================================ Effect ================================
- /** We need told outside that some list not rendered */
- (0,useLayoutEffect["default"])(function () {
- if (onVisibleChange) {
- var renderList = mergedData.slice(start, end + 1);
- onVisibleChange(renderList, mergedData);
- }
- }, [start, end, mergedData]);
- // ================================ Extra =================================
- var getSize = useGetSize(mergedData, getKey, heights, itemHeight);
- var extraContent = extraRender === null || extraRender === void 0 ? void 0 : extraRender({
- start: start,
- end: end,
- virtual: inVirtual,
- offsetX: offsetLeft,
- offsetY: fillerOffset,
- rtl: isRTL,
- getSize: getSize
- });
- // ================================ Render ================================
- var listChildren = useChildren(mergedData, start, end, scrollWidth, offsetLeft, setInstanceRef, children, sharedConfig);
- var componentStyle = null;
- if (height) {
- componentStyle = (0,objectSpread2["default"])((0,defineProperty["default"])({}, fullHeight ? 'height' : 'maxHeight', height), ScrollStyle);
- if (useVirtual) {
- componentStyle.overflowY = 'hidden';
- if (scrollWidth) {
- componentStyle.overflowX = 'hidden';
- }
- if (scrollMoving) {
- componentStyle.pointerEvents = 'none';
- }
- }
- }
- var containerProps = {};
- if (isRTL) {
- containerProps.dir = 'rtl';
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- ref: containerRef,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), {}, {
- position: 'relative'
- }),
- className: mergedClassName
- }, containerProps, restProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onHolderResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, {
- className: "".concat(prefixCls, "-holder"),
- style: componentStyle,
- ref: componentRef,
- onScroll: onFallbackScroll,
- onMouseEnter: delayHideScrollBar
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Filler, {
- prefixCls: prefixCls,
- height: scrollHeight,
- offsetX: offsetLeft,
- offsetY: fillerOffset,
- scrollWidth: scrollWidth,
- onInnerResize: collectHeight,
- ref: fillerInnerRef,
- innerProps: innerProps,
- rtl: isRTL,
- extra: extraContent
- }, listChildren))), inVirtual && scrollHeight > height && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ScrollBar, {
- ref: verticalScrollBarRef,
- prefixCls: prefixCls,
- scrollOffset: offsetTop,
- scrollRange: scrollHeight,
- rtl: isRTL,
- onScroll: onScrollBar,
- onStartMove: onScrollbarStartMove,
- onStopMove: onScrollbarStopMove,
- spinSize: verticalScrollBarSpinSize,
- containerSize: size.height,
- style: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBar,
- thumbStyle: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBarThumb,
- showScrollBar: showScrollBar
- }), inVirtual && scrollWidth > size.width && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ScrollBar, {
- ref: horizontalScrollBarRef,
- prefixCls: prefixCls,
- scrollOffset: offsetLeft,
- scrollRange: scrollWidth,
- rtl: isRTL,
- onScroll: onScrollBar,
- onStartMove: onScrollbarStartMove,
- onStopMove: onScrollbarStopMove,
- spinSize: horizontalScrollBarSpinSize,
- containerSize: size.width,
- horizontal: true,
- style: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBar,
- thumbStyle: styles === null || styles === void 0 ? void 0 : styles.horizontalScrollBarThumb,
- showScrollBar: showScrollBar
- }));
- }
- var List_List = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RawList);
- List_List.displayName = 'List';
- /* harmony default export */ var rc_virtual_list_es_List = (List_List);
- ;// ./node_modules/rc-virtual-list/es/index.js
- /* harmony default export */ var rc_virtual_list_es = (rc_virtual_list_es_List);
- ;// ./node_modules/rc-select/es/utils/platformUtil.js
- /* istanbul ignore file */
- function isPlatformMac() {
- return /(mac\sos|macintosh)/i.test(navigator.appVersion);
- }
- ;// ./node_modules/rc-select/es/OptionList.js
- var OptionList_excluded = ["disabled", "title", "children", "style", "className"];
- // export interface OptionListProps<OptionsType extends object[]> {
- function OptionList_isTitleType(content) {
- return typeof content === 'string' || typeof content === 'number';
- }
- /**
- * Using virtual list of option display.
- * Will fallback to dom if use customize render.
- */
- var OptionList = function OptionList(_, ref) {
- var _useBaseProps = useBaseProps(),
- prefixCls = _useBaseProps.prefixCls,
- id = _useBaseProps.id,
- open = _useBaseProps.open,
- multiple = _useBaseProps.multiple,
- mode = _useBaseProps.mode,
- searchValue = _useBaseProps.searchValue,
- toggleOpen = _useBaseProps.toggleOpen,
- notFoundContent = _useBaseProps.notFoundContent,
- onPopupScroll = _useBaseProps.onPopupScroll;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_SelectContext),
- maxCount = _React$useContext.maxCount,
- flattenOptions = _React$useContext.flattenOptions,
- onActiveValue = _React$useContext.onActiveValue,
- defaultActiveFirstOption = _React$useContext.defaultActiveFirstOption,
- onSelect = _React$useContext.onSelect,
- menuItemSelectedIcon = _React$useContext.menuItemSelectedIcon,
- rawValues = _React$useContext.rawValues,
- fieldNames = _React$useContext.fieldNames,
- virtual = _React$useContext.virtual,
- direction = _React$useContext.direction,
- listHeight = _React$useContext.listHeight,
- listItemHeight = _React$useContext.listItemHeight,
- optionRender = _React$useContext.optionRender;
- var itemPrefixCls = "".concat(prefixCls, "-item");
- var memoFlattenOptions = (0,useMemo["default"])(function () {
- return flattenOptions;
- }, [open, flattenOptions], function (prev, next) {
- return next[0] && prev[1] !== next[1];
- });
- // =========================== List ===========================
- var listRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var overMaxCount = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return multiple && isValidCount(maxCount) && (rawValues === null || rawValues === void 0 ? void 0 : rawValues.size) >= maxCount;
- }, [multiple, maxCount, rawValues === null || rawValues === void 0 ? void 0 : rawValues.size]);
- var onListMouseDown = function onListMouseDown(event) {
- event.preventDefault();
- };
- var scrollIntoView = function scrollIntoView(args) {
- var _listRef$current;
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.scrollTo(typeof args === 'number' ? {
- index: args
- } : args);
- };
- // https://github.com/ant-design/ant-design/issues/34975
- var isSelected = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (value) {
- if (mode === 'combobox') {
- return false;
- }
- return rawValues.has(value);
- }, [mode, (0,toConsumableArray["default"])(rawValues).toString(), rawValues.size]);
- // ========================== Active ==========================
- var getEnabledActiveIndex = function getEnabledActiveIndex(index) {
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
- var len = memoFlattenOptions.length;
- for (var i = 0; i < len; i += 1) {
- var current = (index + i * offset + len) % len;
- var _ref = memoFlattenOptions[current] || {},
- group = _ref.group,
- data = _ref.data;
- if (!group && !(data !== null && data !== void 0 && data.disabled) && (isSelected(data.value) || !overMaxCount)) {
- return current;
- }
- }
- return -1;
- };
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- return getEnabledActiveIndex(0);
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeIndex = _React$useState2[0],
- setActiveIndex = _React$useState2[1];
- var setActive = function setActive(index) {
- var fromKeyboard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- setActiveIndex(index);
- var info = {
- source: fromKeyboard ? 'keyboard' : 'mouse'
- };
- // Trigger active event
- var flattenItem = memoFlattenOptions[index];
- if (!flattenItem) {
- onActiveValue(null, -1, info);
- return;
- }
- onActiveValue(flattenItem.value, index, info);
- };
- // Auto active first item when list length or searchValue changed
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
- }, [memoFlattenOptions.length, searchValue]);
- // https://github.com/ant-design/ant-design/issues/48036
- var isAriaSelected = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (value) {
- if (mode === 'combobox') {
- return String(value).toLowerCase() === searchValue.toLowerCase();
- }
- return rawValues.has(value);
- }, [mode, searchValue, (0,toConsumableArray["default"])(rawValues).toString(), rawValues.size]);
- // Auto scroll to item position in single mode
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- /**
- * React will skip `onChange` when component update.
- * `setActive` function will call root accessibility state update which makes re-render.
- * So we need to delay to let Input component trigger onChange first.
- */
- var timeoutId = setTimeout(function () {
- if (!multiple && open && rawValues.size === 1) {
- var value = Array.from(rawValues)[0];
- // Scroll to the option closest to the searchValue if searching.
- var index = memoFlattenOptions.findIndex(function (_ref2) {
- var data = _ref2.data;
- return searchValue ? String(data.value).startsWith(searchValue) : data.value === value;
- });
- if (index !== -1) {
- setActive(index);
- scrollIntoView(index);
- }
- }
- });
- // Force trigger scrollbar visible when open
- if (open) {
- var _listRef$current2;
- (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.scrollTo(undefined);
- }
- return function () {
- return clearTimeout(timeoutId);
- };
- }, [open, searchValue]);
- // ========================== Values ==========================
- var onSelectValue = function onSelectValue(value) {
- if (value !== undefined) {
- onSelect(value, {
- selected: !rawValues.has(value)
- });
- }
- // Single mode should always close by select
- if (!multiple) {
- toggleOpen(false);
- }
- };
- // ========================= Keyboard =========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- onKeyDown: function onKeyDown(event) {
- var which = event.which,
- ctrlKey = event.ctrlKey;
- switch (which) {
- // >>> Arrow keys & ctrl + n/p on Mac
- case KeyCode["default"].N:
- case KeyCode["default"].P:
- case KeyCode["default"].UP:
- case KeyCode["default"].DOWN:
- {
- var offset = 0;
- if (which === KeyCode["default"].UP) {
- offset = -1;
- } else if (which === KeyCode["default"].DOWN) {
- offset = 1;
- } else if (isPlatformMac() && ctrlKey) {
- if (which === KeyCode["default"].N) {
- offset = 1;
- } else if (which === KeyCode["default"].P) {
- offset = -1;
- }
- }
- if (offset !== 0) {
- var nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
- scrollIntoView(nextActiveIndex);
- setActive(nextActiveIndex, true);
- }
- break;
- }
- // >>> Select (Tab / Enter)
- case KeyCode["default"].TAB:
- case KeyCode["default"].ENTER:
- {
- var _item$data;
- // value
- var item = memoFlattenOptions[activeIndex];
- if (item && !(item !== null && item !== void 0 && (_item$data = item.data) !== null && _item$data !== void 0 && _item$data.disabled) && !overMaxCount) {
- onSelectValue(item.value);
- } else {
- onSelectValue(undefined);
- }
- if (open) {
- event.preventDefault();
- }
- break;
- }
- // >>> Close
- case KeyCode["default"].ESC:
- {
- toggleOpen(false);
- if (open) {
- event.stopPropagation();
- }
- }
- }
- },
- onKeyUp: function onKeyUp() {},
- scrollTo: function scrollTo(index) {
- scrollIntoView(index);
- }
- };
- });
- // ========================== Render ==========================
- if (memoFlattenOptions.length === 0) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- role: "listbox",
- id: "".concat(id, "_list"),
- className: "".concat(itemPrefixCls, "-empty"),
- onMouseDown: onListMouseDown
- }, notFoundContent);
- }
- var omitFieldNameList = Object.keys(fieldNames).map(function (key) {
- return fieldNames[key];
- });
- var getLabel = function getLabel(item) {
- return item.label;
- };
- function getItemAriaProps(item, index) {
- var group = item.group;
- return {
- role: group ? 'presentation' : 'option',
- id: "".concat(id, "_list_").concat(index)
- };
- }
- var renderItem = function renderItem(index) {
- var item = memoFlattenOptions[index];
- if (!item) {
- return null;
- }
- var itemData = item.data || {};
- var value = itemData.value;
- var group = item.group;
- var attrs = (0,pickAttrs["default"])(itemData, true);
- var mergedLabel = getLabel(item);
- return item ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- "aria-label": typeof mergedLabel === 'string' && !group ? mergedLabel : null
- }, attrs, {
- key: index
- }, getItemAriaProps(item, index), {
- "aria-selected": isAriaSelected(value)
- }), value) : null;
- };
- var a11yProps = {
- role: 'listbox',
- id: "".concat(id, "_list")
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, virtual && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, a11yProps, {
- style: {
- height: 0,
- width: 0,
- overflow: 'hidden'
- }
- }), renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_virtual_list_es, {
- itemKey: "key",
- ref: listRef,
- data: memoFlattenOptions,
- height: listHeight,
- itemHeight: listItemHeight,
- fullHeight: false,
- onMouseDown: onListMouseDown,
- onScroll: onPopupScroll,
- virtual: virtual,
- direction: direction,
- innerProps: virtual ? null : a11yProps
- }, function (item, itemIndex) {
- var group = item.group,
- groupOption = item.groupOption,
- data = item.data,
- label = item.label,
- value = item.value;
- var key = data.key;
- // Group
- if (group) {
- var _data$title;
- var groupTitle = (_data$title = data.title) !== null && _data$title !== void 0 ? _data$title : OptionList_isTitleType(label) ? label.toString() : undefined;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(itemPrefixCls, "".concat(itemPrefixCls, "-group"), data.className),
- title: groupTitle
- }, label !== undefined ? label : key);
- }
- var disabled = data.disabled,
- title = data.title,
- children = data.children,
- style = data.style,
- className = data.className,
- otherProps = (0,objectWithoutProperties["default"])(data, OptionList_excluded);
- var passedProps = (0,omit["default"])(otherProps, omitFieldNameList);
- // Option
- var selected = isSelected(value);
- var mergedDisabled = disabled || !selected && overMaxCount;
- var optionPrefixCls = "".concat(itemPrefixCls, "-option");
- var optionClassName = classnames_default()(itemPrefixCls, optionPrefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(optionPrefixCls, "-grouped"), groupOption), "".concat(optionPrefixCls, "-active"), activeIndex === itemIndex && !mergedDisabled), "".concat(optionPrefixCls, "-disabled"), mergedDisabled), "".concat(optionPrefixCls, "-selected"), selected));
- var mergedLabel = getLabel(item);
- var iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === 'function' || selected;
- // https://github.com/ant-design/ant-design/issues/34145
- var content = typeof mergedLabel === 'number' ? mergedLabel : mergedLabel || value;
- // https://github.com/ant-design/ant-design/issues/26717
- var optionTitle = OptionList_isTitleType(content) ? content.toString() : undefined;
- if (title !== undefined) {
- optionTitle = title;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, (0,pickAttrs["default"])(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
- "aria-selected": isAriaSelected(value),
- className: optionClassName,
- title: optionTitle,
- onMouseMove: function onMouseMove() {
- if (activeIndex === itemIndex || mergedDisabled) {
- return;
- }
- setActive(itemIndex);
- },
- onClick: function onClick() {
- if (!mergedDisabled) {
- onSelectValue(value);
- }
- },
- style: style
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(optionPrefixCls, "-content")
- }, typeof optionRender === 'function' ? optionRender(item, {
- index: itemIndex
- }) : content), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(menuItemSelectedIcon) || selected, iconVisible && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TransBtn, {
- className: "".concat(itemPrefixCls, "-option-state"),
- customizeIcon: menuItemSelectedIcon,
- customizeIconProps: {
- value: value,
- disabled: mergedDisabled,
- isSelected: selected
- }
- }, selected ? '✓' : null));
- }));
- };
- var RefOptionList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(OptionList);
- if (true) {
- RefOptionList.displayName = 'OptionList';
- }
- /* harmony default export */ var es_OptionList = (RefOptionList);
- ;// ./node_modules/rc-select/es/hooks/useCache.js
- /**
- * Cache `value` related LabeledValue & options.
- */
- /* harmony default export */ var useCache = (function (labeledValues, valueOptions) {
- var cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- values: new Map(),
- options: new Map()
- });
- var filledLabeledValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var _cacheRef$current = cacheRef.current,
- prevValueCache = _cacheRef$current.values,
- prevOptionCache = _cacheRef$current.options;
- // Fill label by cache
- var patchedValues = labeledValues.map(function (item) {
- if (item.label === undefined) {
- var _prevValueCache$get;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- label: (_prevValueCache$get = prevValueCache.get(item.value)) === null || _prevValueCache$get === void 0 ? void 0 : _prevValueCache$get.label
- });
- }
- return item;
- });
- // Refresh cache
- var valueCache = new Map();
- var optionCache = new Map();
- patchedValues.forEach(function (item) {
- valueCache.set(item.value, item);
- optionCache.set(item.value, valueOptions.get(item.value) || prevOptionCache.get(item.value));
- });
- cacheRef.current.values = valueCache;
- cacheRef.current.options = optionCache;
- return patchedValues;
- }, [labeledValues, valueOptions]);
- var getOption = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (val) {
- return valueOptions.get(val) || cacheRef.current.options.get(val);
- }, [valueOptions]);
- return [filledLabeledValues, getOption];
- });
- ;// ./node_modules/rc-select/es/hooks/useFilterOptions.js
- function includes(test, search) {
- return commonUtil_toArray(test).join('').toUpperCase().includes(search);
- }
- /* harmony default export */ var useFilterOptions = (function (options, fieldNames, searchValue, filterOption, optionFilterProp) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!searchValue || filterOption === false) {
- return options;
- }
- var fieldOptions = fieldNames.options,
- fieldLabel = fieldNames.label,
- fieldValue = fieldNames.value;
- var filteredOptions = [];
- var customizeFilter = typeof filterOption === 'function';
- var upperSearch = searchValue.toUpperCase();
- var filterFunc = customizeFilter ? filterOption : function (_, option) {
- // Use provided `optionFilterProp`
- if (optionFilterProp) {
- return includes(option[optionFilterProp], upperSearch);
- }
- // Auto select `label` or `value` by option type
- if (option[fieldOptions]) {
- // hack `fieldLabel` since `OptionGroup` children is not `label`
- return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
- }
- return includes(option[fieldValue], upperSearch);
- };
- var wrapOption = customizeFilter ? function (opt) {
- return injectPropsWithOption(opt);
- } : function (opt) {
- return opt;
- };
- options.forEach(function (item) {
- // Group should check child options
- if (item[fieldOptions]) {
- // Check group first
- var matchGroup = filterFunc(searchValue, wrapOption(item));
- if (matchGroup) {
- filteredOptions.push(item);
- } else {
- // Check option
- var subOptions = item[fieldOptions].filter(function (subItem) {
- return filterFunc(searchValue, wrapOption(subItem));
- });
- if (subOptions.length) {
- filteredOptions.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, (0,defineProperty["default"])({}, fieldOptions, subOptions)));
- }
- }
- return;
- }
- if (filterFunc(searchValue, wrapOption(item))) {
- filteredOptions.push(item);
- }
- });
- return filteredOptions;
- }, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
- });
- ;// ./node_modules/rc-select/es/hooks/useId.js
- var hooks_useId_uuid = 0;
- /** Is client side and not jsdom */
- var useId_isBrowserClient = true && (0,canUseDom["default"])();
- /** Get unique id for accessibility usage */
- function getUUID() {
- var retId;
- // Test never reach
- /* istanbul ignore if */
- if (useId_isBrowserClient) {
- retId = hooks_useId_uuid;
- hooks_useId_uuid += 1;
- } else {
- retId = 'TEST_OR_SSR';
- }
- return retId;
- }
- function useId_useId(id) {
- // Inner id for accessibility usage. Only work in client side
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- innerId = _React$useState2[0],
- setInnerId = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setInnerId("rc_select_".concat(getUUID()));
- }, []);
- return id || innerId;
- }
- ;// ./node_modules/rc-select/es/utils/legacyUtil.js
- var legacyUtil_excluded = ["children", "value"],
- legacyUtil_excluded2 = ["children"];
- function convertNodeToOption(node) {
- var _ref = node,
- key = _ref.key,
- _ref$props = _ref.props,
- children = _ref$props.children,
- value = _ref$props.value,
- restProps = (0,objectWithoutProperties["default"])(_ref$props, legacyUtil_excluded);
- return (0,objectSpread2["default"])({
- key: key,
- value: value !== undefined ? value : key,
- children: children
- }, restProps);
- }
- function convertChildrenToData(nodes) {
- var optionOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- return (0,toArray["default"])(nodes).map(function (node, index) {
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node) || !node.type) {
- return null;
- }
- var _ref2 = node,
- isSelectOptGroup = _ref2.type.isSelectOptGroup,
- key = _ref2.key,
- _ref2$props = _ref2.props,
- children = _ref2$props.children,
- restProps = (0,objectWithoutProperties["default"])(_ref2$props, legacyUtil_excluded2);
- if (optionOnly || !isSelectOptGroup) {
- return convertNodeToOption(node);
- }
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({
- key: "__RC_SELECT_GRP__".concat(key === null ? index : key, "__"),
- label: key
- }, restProps), {}, {
- options: convertChildrenToData(children)
- });
- }).filter(function (data) {
- return data;
- });
- }
- ;// ./node_modules/rc-select/es/hooks/useOptions.js
- /**
- * Parse `children` to `options` if `options` is not provided.
- * Then flatten the `options`.
- */
- var useOptions = function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var mergedOptions = options;
- var childrenAsData = !options;
- if (childrenAsData) {
- mergedOptions = convertChildrenToData(children);
- }
- var valueOptions = new Map();
- var labelOptions = new Map();
- var setLabelOptions = function setLabelOptions(labelOptionsMap, option, key) {
- if (key && typeof key === 'string') {
- labelOptionsMap.set(option[key], option);
- }
- };
- var dig = function dig(optionList) {
- var isChildren = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- // for loop to speed up collection speed
- for (var i = 0; i < optionList.length; i += 1) {
- var option = optionList[i];
- if (!option[fieldNames.options] || isChildren) {
- valueOptions.set(option[fieldNames.value], option);
- setLabelOptions(labelOptions, option, fieldNames.label);
- // https://github.com/ant-design/ant-design/issues/35304
- setLabelOptions(labelOptions, option, optionFilterProp);
- setLabelOptions(labelOptions, option, optionLabelProp);
- } else {
- dig(option[fieldNames.options], true);
- }
- }
- };
- dig(mergedOptions);
- return {
- options: mergedOptions,
- valueOptions: valueOptions,
- labelOptions: labelOptions
- };
- }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
- };
- /* harmony default export */ var hooks_useOptions = (useOptions);
- ;// ./node_modules/rc-select/es/hooks/useRefFunc.js
- /**
- * Same as `React.useCallback` but always return a memoized function
- * but redirect to real function.
- */
- function useRefFunc(callback) {
- var funcRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- funcRef.current = callback;
- var cacheFn = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function () {
- return funcRef.current.apply(funcRef, arguments);
- }, []);
- return cacheFn;
- }
- ;// ./node_modules/rc-select/es/utils/warningPropsUtil.js
- function warningProps(props) {
- var mode = props.mode,
- options = props.options,
- children = props.children,
- backfill = props.backfill,
- allowClear = props.allowClear,
- placeholder = props.placeholder,
- getInputElement = props.getInputElement,
- showSearch = props.showSearch,
- onSearch = props.onSearch,
- defaultOpen = props.defaultOpen,
- autoFocus = props.autoFocus,
- labelInValue = props.labelInValue,
- value = props.value,
- inputValue = props.inputValue,
- optionLabelProp = props.optionLabelProp;
- var multiple = isMultiple(mode);
- var mergedShowSearch = showSearch !== undefined ? showSearch : multiple || mode === 'combobox';
- var mergedOptions = options || convertChildrenToData(children);
- // `tags` should not set option as disabled
- (0,warning["default"])(mode !== 'tags' || mergedOptions.every(function (opt) {
- return !opt.disabled;
- }), 'Please avoid setting option to disabled in tags mode since user can always type text as tag.');
- // `combobox` & `tags` should option be `string` type
- if (mode === 'tags' || mode === 'combobox') {
- var hasNumberValue = mergedOptions.some(function (item) {
- if (item.options) {
- return item.options.some(function (opt) {
- return typeof ('value' in opt ? opt.value : opt.key) === 'number';
- });
- }
- return typeof ('value' in item ? item.value : item.key) === 'number';
- });
- (0,warning["default"])(!hasNumberValue, '`value` of Option should not use number type when `mode` is `tags` or `combobox`.');
- }
- // `combobox` should not use `optionLabelProp`
- (0,warning["default"])(mode !== 'combobox' || !optionLabelProp, '`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.');
- // Only `combobox` support `backfill`
- (0,warning["default"])(mode === 'combobox' || !backfill, '`backfill` only works with `combobox` mode.');
- // Only `combobox` support `getInputElement`
- (0,warning["default"])(mode === 'combobox' || !getInputElement, '`getInputElement` only work with `combobox` mode.');
- // Customize `getInputElement` should not use `allowClear` & `placeholder`
- (0,warning.noteOnce)(mode !== 'combobox' || !getInputElement || !allowClear || !placeholder, 'Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.');
- // `onSearch` should use in `combobox` or `showSearch`
- if (onSearch && !mergedShowSearch && mode !== 'combobox' && mode !== 'tags') {
- (0,warning["default"])(false, '`onSearch` should work with `showSearch` instead of use alone.');
- }
- (0,warning.noteOnce)(!defaultOpen || autoFocus, '`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.');
- if (value !== undefined && value !== null) {
- var values = commonUtil_toArray(value);
- (0,warning["default"])(!labelInValue || values.every(function (val) {
- return (0,esm_typeof["default"])(val) === 'object' && ('key' in val || 'value' in val);
- }), '`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`');
- (0,warning["default"])(!multiple || Array.isArray(value), '`value` should be array when `mode` is `multiple` or `tags`');
- }
- // Syntactic sugar should use correct children type
- if (children) {
- var invalidateChildType = null;
- (0,toArray["default"])(children).some(function (node) {
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node) || !node.type) {
- return false;
- }
- var _ref = node,
- type = _ref.type;
- if (type.isSelectOption) {
- return false;
- }
- if (type.isSelectOptGroup) {
- var allChildrenValid = (0,toArray["default"])(node.props.children).every(function (subNode) {
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(subNode) || !node.type || subNode.type.isSelectOption) {
- return true;
- }
- invalidateChildType = subNode.type;
- return false;
- });
- if (allChildrenValid) {
- return false;
- }
- return true;
- }
- invalidateChildType = type;
- return true;
- });
- if (invalidateChildType) {
- (0,warning["default"])(false, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(invalidateChildType.displayName || invalidateChildType.name || invalidateChildType, "`."));
- }
- (0,warning["default"])(inputValue === undefined, '`inputValue` is deprecated, please use `searchValue` instead.');
- }
- }
- // value in Select option should not be null
- // note: OptGroup has options too
- function warningNullOptions(options, fieldNames) {
- if (options) {
- var recursiveOptions = function recursiveOptions(optionsList) {
- var inGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- for (var i = 0; i < optionsList.length; i++) {
- var option = optionsList[i];
- if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
- (0,warning["default"])(false, '`value` in Select options should not be `null`.');
- return true;
- }
- if (!inGroup && Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.options], true)) {
- break;
- }
- }
- };
- recursiveOptions(options);
- }
- }
- /* harmony default export */ var warningPropsUtil = (warningProps);
- ;// ./node_modules/rc-select/es/Select.js
- var Select_excluded = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "optionRender", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "labelRender", "value", "defaultValue", "labelInValue", "onChange", "maxCount"];
- /**
- * To match accessibility requirement, we always provide an input in the component.
- * Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
- * For focused select, we set `aria-live="polite"` to update the accessibility content.
- *
- * ref:
- * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
- *
- * New api:
- * - listHeight
- * - listItemHeight
- * - component
- *
- * Remove deprecated api:
- * - multiple
- * - tags
- * - combobox
- * - firstActiveValue
- * - dropdownMenuStyle
- * - openClassName (Not list in api)
- *
- * Update:
- * - `backfill` only support `combobox` mode
- * - `combobox` mode not support `labelInValue` since it's meaningless
- * - `getInputElement` only support `combobox` mode
- * - `onChange` return OptionData instead of ReactNode
- * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
- * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
- * - `combobox` mode not support `optionLabelProp`
- */
- var OMIT_DOM_PROPS = ['inputValue'];
- function isRawValue(value) {
- return !value || (0,esm_typeof["default"])(value) !== 'object';
- }
- var Select = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var id = props.id,
- mode = props.mode,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-select' : _props$prefixCls,
- backfill = props.backfill,
- fieldNames = props.fieldNames,
- inputValue = props.inputValue,
- searchValue = props.searchValue,
- onSearch = props.onSearch,
- _props$autoClearSearc = props.autoClearSearchValue,
- autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
- onSelect = props.onSelect,
- onDeselect = props.onDeselect,
- _props$dropdownMatchS = props.dropdownMatchSelectWidth,
- dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,
- filterOption = props.filterOption,
- filterSort = props.filterSort,
- optionFilterProp = props.optionFilterProp,
- optionLabelProp = props.optionLabelProp,
- options = props.options,
- optionRender = props.optionRender,
- children = props.children,
- defaultActiveFirstOption = props.defaultActiveFirstOption,
- menuItemSelectedIcon = props.menuItemSelectedIcon,
- virtual = props.virtual,
- direction = props.direction,
- _props$listHeight = props.listHeight,
- listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,
- _props$listItemHeight = props.listItemHeight,
- listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,
- labelRender = props.labelRender,
- value = props.value,
- defaultValue = props.defaultValue,
- labelInValue = props.labelInValue,
- onChange = props.onChange,
- maxCount = props.maxCount,
- restProps = (0,objectWithoutProperties["default"])(props, Select_excluded);
- var mergedId = useId_useId(id);
- var multiple = isMultiple(mode);
- var childrenAsData = !!(!options && children);
- var mergedFilterOption = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (filterOption === undefined && mode === 'combobox') {
- return false;
- }
- return filterOption;
- }, [filterOption, mode]);
- // ========================= FieldNames =========================
- var mergedFieldNames = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return fillFieldNames(fieldNames, childrenAsData);
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [
- // We stringify fieldNames to avoid unnecessary re-renders.
- JSON.stringify(fieldNames), childrenAsData]
- /* eslint-enable react-hooks/exhaustive-deps */);
- // =========================== Search ===========================
- var _useMergedState = (0,useMergedState["default"])('', {
- value: searchValue !== undefined ? searchValue : inputValue,
- postState: function postState(search) {
- return search || '';
- }
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedSearchValue = _useMergedState2[0],
- setSearchValue = _useMergedState2[1];
- // =========================== Option ===========================
- var parsedOptions = hooks_useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);
- var valueOptions = parsedOptions.valueOptions,
- labelOptions = parsedOptions.labelOptions,
- mergedOptions = parsedOptions.options;
- // ========================= Wrap Value =========================
- var convert2LabelValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (draftValues) {
- // Convert to array
- var valueList = commonUtil_toArray(draftValues);
- // Convert to labelInValue type
- return valueList.map(function (val) {
- var rawValue;
- var rawLabel;
- var rawKey;
- var rawDisabled;
- var rawTitle;
- // Fill label & value
- if (isRawValue(val)) {
- rawValue = val;
- } else {
- var _val$value;
- rawKey = val.key;
- rawLabel = val.label;
- rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;
- }
- var option = valueOptions.get(rawValue);
- if (option) {
- var _option$key;
- // Fill missing props
- if (rawLabel === undefined) rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];
- if (rawKey === undefined) rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;
- rawDisabled = option === null || option === void 0 ? void 0 : option.disabled;
- rawTitle = option === null || option === void 0 ? void 0 : option.title;
- // Warning if label not same as provided
- if ( true && !optionLabelProp) {
- var optionLabel = option === null || option === void 0 ? void 0 : option[mergedFieldNames.label];
- if (optionLabel !== undefined && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(optionLabel) && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(rawLabel) && optionLabel !== rawLabel) {
- (0,warning["default"])(false, '`label` of `value` is not same as `label` in Select options.');
- }
- }
- }
- return {
- label: rawLabel,
- value: rawValue,
- key: rawKey,
- disabled: rawDisabled,
- title: rawTitle
- };
- });
- }, [mergedFieldNames, optionLabelProp, valueOptions]);
- // =========================== Values ===========================
- var _useMergedState3 = (0,useMergedState["default"])(defaultValue, {
- value: value
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- internalValue = _useMergedState4[0],
- setInternalValue = _useMergedState4[1];
- // Merged value with LabelValueType
- var rawLabeledValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var _values$;
- var newInternalValue = multiple && internalValue === null ? [] : internalValue;
- var values = convert2LabelValues(newInternalValue);
- // combobox no need save value when it's no value (exclude value equal 0)
- if (mode === 'combobox' && isComboNoValue((_values$ = values[0]) === null || _values$ === void 0 ? void 0 : _values$.value)) {
- return [];
- }
- return values;
- }, [internalValue, convert2LabelValues, mode, multiple]);
- // Fill label with cache to avoid option remove
- var _useCache = useCache(rawLabeledValues, valueOptions),
- _useCache2 = (0,slicedToArray["default"])(_useCache, 2),
- mergedValues = _useCache2[0],
- getMixedOption = _useCache2[1];
- var displayValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // `null` need show as placeholder instead
- // https://github.com/ant-design/ant-design/issues/25057
- if (!mode && mergedValues.length === 1) {
- var firstValue = mergedValues[0];
- if (firstValue.value === null && (firstValue.label === null || firstValue.label === undefined)) {
- return [];
- }
- }
- return mergedValues.map(function (item) {
- var _ref;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- label: (_ref = typeof labelRender === 'function' ? labelRender(item) : item.label) !== null && _ref !== void 0 ? _ref : item.value
- });
- });
- }, [mode, mergedValues, labelRender]);
- /** Convert `displayValues` to raw value type set */
- var rawValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return new Set(mergedValues.map(function (val) {
- return val.value;
- }));
- }, [mergedValues]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (mode === 'combobox') {
- var _mergedValues$;
- var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;
- setSearchValue(hasValue(strValue) ? String(strValue) : '');
- }
- }, [mergedValues]);
- // ======================= Display Option =======================
- // Create a placeholder item if not exist in `options`
- var createTagOption = useRefFunc(function (val, label) {
- var mergedLabel = label !== null && label !== void 0 ? label : val;
- return (0,defineProperty["default"])((0,defineProperty["default"])({}, mergedFieldNames.value, val), mergedFieldNames.label, mergedLabel);
- });
- // Fill tag as option if mode is `tags`
- var filledTagOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (mode !== 'tags') {
- return mergedOptions;
- }
- // >>> Tag mode
- var cloneOptions = (0,toConsumableArray["default"])(mergedOptions);
- // Check if value exist in options (include new patch item)
- var existOptions = function existOptions(val) {
- return valueOptions.has(val);
- };
- // Fill current value as option
- (0,toConsumableArray["default"])(mergedValues).sort(function (a, b) {
- return a.value < b.value ? -1 : 1;
- }).forEach(function (item) {
- var val = item.value;
- if (!existOptions(val)) {
- cloneOptions.push(createTagOption(val, item.label));
- }
- });
- return cloneOptions;
- }, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);
- var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp);
- // Fill options with search value if needed
- var filledSearchOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (mode !== 'tags' || !mergedSearchValue || filteredOptions.some(function (item) {
- return item[optionFilterProp || 'value'] === mergedSearchValue;
- })) {
- return filteredOptions;
- }
- // ignore when search value equal select input value
- if (filteredOptions.some(function (item) {
- return item[mergedFieldNames.value] === mergedSearchValue;
- })) {
- return filteredOptions;
- }
- // Fill search value as option
- return [createTagOption(mergedSearchValue)].concat((0,toConsumableArray["default"])(filteredOptions));
- }, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue, mergedFieldNames]);
- var sorter = function sorter(inputOptions) {
- var sortedOptions = (0,toConsumableArray["default"])(inputOptions).sort(function (a, b) {
- return filterSort(a, b, {
- searchValue: mergedSearchValue
- });
- });
- return sortedOptions.map(function (item) {
- if (Array.isArray(item.options)) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- options: item.options.length > 0 ? sorter(item.options) : item.options
- });
- }
- return item;
- });
- };
- var orderedFilteredOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!filterSort) {
- return filledSearchOptions;
- }
- return sorter(filledSearchOptions);
- }, [filledSearchOptions, filterSort, mergedSearchValue]);
- var displayOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return flattenOptions(orderedFilteredOptions, {
- fieldNames: mergedFieldNames,
- childrenAsData: childrenAsData
- });
- }, [orderedFilteredOptions, mergedFieldNames, childrenAsData]);
- // =========================== Change ===========================
- var triggerChange = function triggerChange(values) {
- var labeledValues = convert2LabelValues(values);
- setInternalValue(labeledValues);
- if (onChange && (
- // Trigger event only when value changed
- labeledValues.length !== mergedValues.length || labeledValues.some(function (newVal, index) {
- var _mergedValues$index;
- return ((_mergedValues$index = mergedValues[index]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);
- }))) {
- var returnValues = labelInValue ? labeledValues : labeledValues.map(function (v) {
- return v.value;
- });
- var returnOptions = labeledValues.map(function (v) {
- return injectPropsWithOption(getMixedOption(v.value));
- });
- onChange(
- // Value
- multiple ? returnValues : returnValues[0],
- // Option
- multiple ? returnOptions : returnOptions[0]);
- }
- };
- // ======================= Accessibility ========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeValue = _React$useState2[0],
- setActiveValue = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- accessibilityIndex = _React$useState4[0],
- setAccessibilityIndex = _React$useState4[1];
- var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';
- var onActiveValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (active, index) {
- var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- _ref3$source = _ref3.source,
- source = _ref3$source === void 0 ? 'keyboard' : _ref3$source;
- setAccessibilityIndex(index);
- if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {
- setActiveValue(String(active));
- }
- }, [backfill, mode]);
- // ========================= OptionList =========================
- var triggerSelect = function triggerSelect(val, selected, type) {
- var getSelectEnt = function getSelectEnt() {
- var _option$key2;
- var option = getMixedOption(val);
- return [labelInValue ? {
- label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],
- value: val,
- key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val
- } : val, injectPropsWithOption(option)];
- };
- if (selected && onSelect) {
- var _getSelectEnt = getSelectEnt(),
- _getSelectEnt2 = (0,slicedToArray["default"])(_getSelectEnt, 2),
- wrappedValue = _getSelectEnt2[0],
- _option = _getSelectEnt2[1];
- onSelect(wrappedValue, _option);
- } else if (!selected && onDeselect && type !== 'clear') {
- var _getSelectEnt3 = getSelectEnt(),
- _getSelectEnt4 = (0,slicedToArray["default"])(_getSelectEnt3, 2),
- _wrappedValue = _getSelectEnt4[0],
- _option2 = _getSelectEnt4[1];
- onDeselect(_wrappedValue, _option2);
- }
- };
- // Used for OptionList selection
- var onInternalSelect = useRefFunc(function (val, info) {
- var cloneValues;
- // Single mode always trigger select only with option list
- var mergedSelect = multiple ? info.selected : true;
- if (mergedSelect) {
- cloneValues = multiple ? [].concat((0,toConsumableArray["default"])(mergedValues), [val]) : [val];
- } else {
- cloneValues = mergedValues.filter(function (v) {
- return v.value !== val;
- });
- }
- triggerChange(cloneValues);
- triggerSelect(val, mergedSelect);
- // Clean search value if single or configured
- if (mode === 'combobox') {
- // setSearchValue(String(val));
- setActiveValue('');
- } else if (!isMultiple || autoClearSearchValue) {
- setSearchValue('');
- setActiveValue('');
- }
- });
- // ======================= Display Change =======================
- // BaseSelect display values change
- var onDisplayValuesChange = function onDisplayValuesChange(nextValues, info) {
- triggerChange(nextValues);
- var type = info.type,
- values = info.values;
- if (type === 'remove' || type === 'clear') {
- values.forEach(function (item) {
- triggerSelect(item.value, false, type);
- });
- }
- };
- // =========================== Search ===========================
- var onInternalSearch = function onInternalSearch(searchText, info) {
- setSearchValue(searchText);
- setActiveValue(null);
- // [Submit] Tag mode should flush input
- if (info.source === 'submit') {
- var formatted = (searchText || '').trim();
- // prevent empty tags from appearing when you click the Enter button
- if (formatted) {
- var newRawValues = Array.from(new Set([].concat((0,toConsumableArray["default"])(rawValues), [formatted])));
- triggerChange(newRawValues);
- triggerSelect(formatted, true);
- setSearchValue('');
- }
- return;
- }
- if (info.source !== 'blur') {
- if (mode === 'combobox') {
- triggerChange(searchText);
- }
- onSearch === null || onSearch === void 0 || onSearch(searchText);
- }
- };
- var onInternalSearchSplit = function onInternalSearchSplit(words) {
- var patchValues = words;
- if (mode !== 'tags') {
- patchValues = words.map(function (word) {
- var opt = labelOptions.get(word);
- return opt === null || opt === void 0 ? void 0 : opt.value;
- }).filter(function (val) {
- return val !== undefined;
- });
- }
- var newRawValues = Array.from(new Set([].concat((0,toConsumableArray["default"])(rawValues), (0,toConsumableArray["default"])(patchValues))));
- triggerChange(newRawValues);
- newRawValues.forEach(function (newRawValue) {
- triggerSelect(newRawValue, true);
- });
- };
- // ========================== Context ===========================
- var selectContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, parsedOptions), {}, {
- flattenOptions: displayOptions,
- onActiveValue: onActiveValue,
- defaultActiveFirstOption: mergedDefaultActiveFirstOption,
- onSelect: onInternalSelect,
- menuItemSelectedIcon: menuItemSelectedIcon,
- rawValues: rawValues,
- fieldNames: mergedFieldNames,
- virtual: realVirtual,
- direction: direction,
- listHeight: listHeight,
- listItemHeight: listItemHeight,
- childrenAsData: childrenAsData,
- maxCount: maxCount,
- optionRender: optionRender
- });
- }, [maxCount, parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, direction, listHeight, listItemHeight, childrenAsData, optionRender]);
- // ========================== Warning ===========================
- if (true) {
- warningPropsUtil(props);
- warningNullOptions(mergedOptions, mergedFieldNames);
- }
- // ==============================================================
- // == Render ==
- // ==============================================================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_SelectContext.Provider, {
- value: selectContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_BaseSelect, (0,esm_extends["default"])({}, restProps, {
- // >>> MISC
- id: mergedId,
- prefixCls: prefixCls,
- ref: ref,
- omitDomProps: OMIT_DOM_PROPS,
- mode: mode
- // >>> Values
- ,
- displayValues: displayValues,
- onDisplayValuesChange: onDisplayValuesChange
- // >>> Trigger
- ,
- direction: direction
- // >>> Search
- ,
- searchValue: mergedSearchValue,
- onSearch: onInternalSearch,
- autoClearSearchValue: autoClearSearchValue,
- onSearchSplit: onInternalSearchSplit,
- dropdownMatchSelectWidth: dropdownMatchSelectWidth
- // >>> OptionList
- ,
- OptionList: es_OptionList,
- emptyOptions: !displayOptions.length
- // >>> Accessibility
- ,
- activeValue: activeValue,
- activeDescendantId: "".concat(mergedId, "_list_").concat(accessibilityIndex)
- })));
- });
- if (true) {
- Select.displayName = 'Select';
- }
- var TypedSelect = Select;
- TypedSelect.Option = es_Option;
- TypedSelect.OptGroup = es_OptGroup;
- /* harmony default export */ var es_Select = (TypedSelect);
- ;// ./node_modules/rc-select/es/index.js
- /* harmony default export */ var rc_select_es = (es_Select);
- ;// ./components/_util/statusUtils.ts
- const _InputStatuses = ['warning', 'error', ''];
- function getStatusClassNames(prefixCls, status, hasFeedback) {
- return classnames_default()({
- [`${prefixCls}-status-success`]: status === 'success',
- [`${prefixCls}-status-warning`]: status === 'warning',
- [`${prefixCls}-status-error`]: status === 'error',
- [`${prefixCls}-status-validating`]: status === 'validating',
- [`${prefixCls}-has-feedback`]: hasFeedback
- });
- }
- const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus;
- ;// ./components/empty/empty.tsx
- const Empty = () => {
- const [, token] = (0,useToken["default"])();
- const [locale] = (0,useLocale["default"])('Empty');
- const bgColor = new fast_color_es.FastColor(token.colorBgBase);
- // Dark Theme need more dark of this
- const themeStyle = bgColor.toHsl().l < 0.5 ? {
- opacity: 0.65
- } : {};
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- style: themeStyle,
- width: "184",
- height: "152",
- viewBox: "0 0 184 152",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, (locale === null || locale === void 0 ? void 0 : locale.description) || 'Empty'), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- fill: "none",
- fillRule: "evenodd"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- transform: "translate(24 31.67)"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ellipse", {
- fillOpacity: ".8",
- fill: "#F5F5F7",
- cx: "67.797",
- cy: "106.89",
- rx: "67.797",
- ry: "12.668"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
- fill: "#AEB8C2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
- fill: "url(#linearGradient-1)",
- transform: "translate(13.56)"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
- fill: "#F5F5F7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
- fill: "#DCE0E6"
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
- fill: "#DCE0E6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- transform: "translate(149.65 15.383)",
- fill: "#FFF"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ellipse", {
- cx: "20.654",
- cy: "3.167",
- rx: "2.849",
- ry: "2.815"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
- }))));
- };
- if (true) {
- Empty.displayName = 'EmptyImage';
- }
- /* harmony default export */ var empty = (Empty);
- ;// ./components/empty/simple.tsx
- const Simple = () => {
- const [, token] = (0,useToken["default"])();
- const [locale] = (0,useLocale["default"])('Empty');
- const {
- colorFill,
- colorFillTertiary,
- colorFillQuaternary,
- colorBgContainer
- } = token;
- const {
- borderColor,
- shadowColor,
- contentColor
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => ({
- borderColor: new fast_color_es.FastColor(colorFill).onBackground(colorBgContainer).toHexString(),
- shadowColor: new fast_color_es.FastColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(),
- contentColor: new fast_color_es.FastColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString()
- }), [colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- width: "64",
- height: "41",
- viewBox: "0 0 64 41",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, (locale === null || locale === void 0 ? void 0 : locale.description) || 'Empty'), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- transform: "translate(0 1)",
- fill: "none",
- fillRule: "evenodd"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ellipse", {
- fill: shadowColor,
- cx: "32",
- cy: "33",
- rx: "32",
- ry: "7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- fillRule: "nonzero",
- stroke: borderColor
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
- fill: contentColor
- }))));
- };
- if (true) {
- Simple.displayName = 'SimpleImage';
- }
- /* harmony default export */ var simple = (Simple);
- // EXTERNAL MODULE: ./components/empty/style/index.ts
- var empty_style = __webpack_require__("./components/empty/style/index.ts");
- ;// ./components/empty/index.tsx
- var empty_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const defaultEmptyImg = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(empty, null);
- const simpleEmptyImg = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(simple, null);
- const empty_Empty = props => {
- var _a;
- const {
- className,
- rootClassName,
- prefixCls: customizePrefixCls,
- image,
- description,
- children,
- imageStyle,
- style,
- classNames: emptyClassNames,
- styles
- } = props,
- restProps = empty_rest(props, ["className", "rootClassName", "prefixCls", "image", "description", "children", "imageStyle", "style", "classNames", "styles"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles,
- image: contextImage
- } = (0,config_provider_context.useComponentConfig)('empty');
- const prefixCls = getPrefixCls('empty', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,empty_style["default"])(prefixCls);
- const [locale] = (0,useLocale["default"])('Empty');
- const des = typeof description !== 'undefined' ? description : locale === null || locale === void 0 ? void 0 : locale.description;
- const alt = typeof des === 'string' ? des : 'empty';
- const mergedImage = (_a = image !== null && image !== void 0 ? image : contextImage) !== null && _a !== void 0 ? _a : defaultEmptyImg;
- let imageNode = null;
- if (typeof mergedImage === 'string') {
- imageNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("img", {
- draggable: false,
- alt: alt,
- src: mergedImage
- });
- } else {
- imageNode = mergedImage;
- }
- // ============================= Warning ==============================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Empty');
- [['imageStyle', 'styles: { image: {} }']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- className: classnames_default()(hashId, cssVarCls, prefixCls, contextClassName, {
- [`${prefixCls}-normal`]: mergedImage === simpleEmptyImg,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, contextClassNames.root, emptyClassNames === null || emptyClassNames === void 0 ? void 0 : emptyClassNames.root),
- style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), contextStyle), styles === null || styles === void 0 ? void 0 : styles.root), style)
- }, restProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-image`, contextClassNames.image, emptyClassNames === null || emptyClassNames === void 0 ? void 0 : emptyClassNames.image),
- style: Object.assign(Object.assign(Object.assign({}, imageStyle), contextStyles.image), styles === null || styles === void 0 ? void 0 : styles.image)
- }, imageNode), des && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-description`, contextClassNames.description, emptyClassNames === null || emptyClassNames === void 0 ? void 0 : emptyClassNames.description),
- style: Object.assign(Object.assign({}, contextStyles.description), styles === null || styles === void 0 ? void 0 : styles.description)
- }, des)), children && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-footer`, contextClassNames.footer, emptyClassNames === null || emptyClassNames === void 0 ? void 0 : emptyClassNames.footer),
- style: Object.assign(Object.assign({}, contextStyles.footer), styles === null || styles === void 0 ? void 0 : styles.footer)
- }, children))));
- };
- empty_Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
- empty_Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
- if (true) {
- empty_Empty.displayName = 'Empty';
- }
- /* harmony default export */ var components_empty = (empty_Empty);
- ;// ./components/config-provider/defaultRenderEmpty.tsx
- const DefaultRenderEmpty = props => {
- const {
- componentName
- } = props;
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefix = getPrefixCls('empty');
- switch (componentName) {
- case 'Table':
- case 'List':
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_empty, {
- image: components_empty.PRESENTED_IMAGE_SIMPLE
- });
- case 'Select':
- case 'TreeSelect':
- case 'Cascader':
- case 'Transfer':
- case 'Mentions':
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_empty, {
- image: components_empty.PRESENTED_IMAGE_SIMPLE,
- className: `${prefix}-small`
- });
- /**
- * This type of component should satisfy the nullish coalescing operator(??) on the left-hand side.
- * to let the component itself implement the logic.
- * For example `Table.filter`.
- */
- case 'Table.filter':
- // why `null`? legacy react16 node type `undefined` is not allowed.
- return null;
- default:
- // Should never hit if we take all the component into consider.
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_empty, null);
- }
- };
- /* harmony default export */ var defaultRenderEmpty = (DefaultRenderEmpty);
- ;// ./components/form/hooks/useVariants.ts
- /**
- * Compatible for legacy `bordered` prop.
- */
- const useVariant = (component, variant, legacyBordered = undefined) => {
- var _a, _b;
- const {
- variant: configVariant,
- [component]: componentConfig
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const ctxVariant = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(VariantContext);
- const configComponentVariant = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.variant;
- let mergedVariant;
- if (typeof variant !== 'undefined') {
- mergedVariant = variant;
- } else if (legacyBordered === false) {
- mergedVariant = 'borderless';
- } else {
- // form variant > component global variant > global variant
- mergedVariant = (_b = (_a = ctxVariant !== null && ctxVariant !== void 0 ? ctxVariant : configComponentVariant) !== null && _a !== void 0 ? _a : configVariant) !== null && _b !== void 0 ? _b : 'outlined';
- }
- const enableVariantCls = config_provider_context.Variants.includes(mergedVariant);
- return [mergedVariant, enableVariantCls];
- };
- /* harmony default export */ var useVariants = (useVariant);
- ;// ./components/select/mergedBuiltinPlacements.ts
- const mergedBuiltinPlacements_getBuiltInPlacements = popupOverflow => {
- const htmlRegion = popupOverflow === 'scroll' ? 'scroll' : 'visible';
- const sharedConfig = {
- overflow: {
- adjustX: true,
- adjustY: true,
- shiftY: true
- },
- htmlRegion,
- dynamicInset: true
- };
- return {
- bottomLeft: Object.assign(Object.assign({}, sharedConfig), {
- points: ['tl', 'bl'],
- offset: [0, 4]
- }),
- bottomRight: Object.assign(Object.assign({}, sharedConfig), {
- points: ['tr', 'br'],
- offset: [0, 4]
- }),
- topLeft: Object.assign(Object.assign({}, sharedConfig), {
- points: ['bl', 'tl'],
- offset: [0, -4]
- }),
- topRight: Object.assign(Object.assign({}, sharedConfig), {
- points: ['br', 'tr'],
- offset: [0, -4]
- })
- };
- };
- function mergedBuiltinPlacements(buildInPlacements, popupOverflow) {
- return buildInPlacements || mergedBuiltinPlacements_getBuiltInPlacements(popupOverflow);
- }
- /* harmony default export */ var select_mergedBuiltinPlacements = (mergedBuiltinPlacements);
- // EXTERNAL MODULE: ./components/select/style/index.ts + 4 modules
- var select_style = __webpack_require__("./components/select/style/index.ts");
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js
- // This icon file is generated automatically.
- var CheckOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" };
- /* harmony default export */ var asn_CheckOutlined = (CheckOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CheckOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CheckOutlined_CheckOutlined = function CheckOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CheckOutlined
- }));
- };
- /** */
- var CheckOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CheckOutlined_CheckOutlined);
- if (true) {
- CheckOutlined_RefIcon.displayName = 'CheckOutlined';
- }
- /* harmony default export */ var icons_CheckOutlined = (CheckOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/DownOutlined.js
- // This icon file is generated automatically.
- var DownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
- /* harmony default export */ var asn_DownOutlined = (DownOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/DownOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var DownOutlined_DownOutlined = function DownOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_DownOutlined
- }));
- };
- /** */
- var DownOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DownOutlined_DownOutlined);
- if (true) {
- DownOutlined_RefIcon.displayName = 'DownOutlined';
- }
- /* harmony default export */ var icons_DownOutlined = (DownOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/SearchOutlined.js
- // This icon file is generated automatically.
- var SearchOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
- /* harmony default export */ var asn_SearchOutlined = (SearchOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/SearchOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var SearchOutlined_SearchOutlined = function SearchOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_SearchOutlined
- }));
- };
- /** */
- var SearchOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SearchOutlined_SearchOutlined);
- if (true) {
- SearchOutlined_RefIcon.displayName = 'SearchOutlined';
- }
- /* harmony default export */ var icons_SearchOutlined = (SearchOutlined_RefIcon);
- ;// ./components/select/useIcons.tsx
- function useIcons({
- suffixIcon,
- clearIcon,
- menuItemSelectedIcon,
- removeIcon,
- loading,
- multiple,
- hasFeedback,
- prefixCls,
- showSuffixIcon,
- feedbackIcon,
- showArrow,
- componentName
- }) {
- if (true) {
- const warning = (0,_util_warning.devUseWarning)(componentName);
- warning.deprecated(!clearIcon, 'clearIcon', 'allowClear={{ clearIcon: React.ReactNode }}');
- }
- // Clear Icon
- const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseCircleFilled, null);
- // Validation Feedback Icon
- const getSuffixIconNode = arrowIcon => {
- if (suffixIcon === null && !hasFeedback && !showArrow) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, showSuffixIcon !== false && arrowIcon, hasFeedback && feedbackIcon);
- };
- // Arrow item icon
- let mergedSuffixIcon = null;
- if (suffixIcon !== undefined) {
- mergedSuffixIcon = getSuffixIconNode(suffixIcon);
- } else if (loading) {
- mergedSuffixIcon = getSuffixIconNode(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, {
- spin: true
- }));
- } else {
- const iconCls = `${prefixCls}-suffix`;
- mergedSuffixIcon = ({
- open,
- showSearch
- }) => {
- if (open && showSearch) {
- return getSuffixIconNode(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SearchOutlined, {
- className: iconCls
- }));
- }
- return getSuffixIconNode(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DownOutlined, {
- className: iconCls
- }));
- };
- }
- // Checked item icon
- let mergedItemIcon = null;
- if (menuItemSelectedIcon !== undefined) {
- mergedItemIcon = menuItemSelectedIcon;
- } else if (multiple) {
- mergedItemIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckOutlined, null);
- } else {
- mergedItemIcon = null;
- }
- let mergedRemoveIcon = null;
- if (removeIcon !== undefined) {
- mergedRemoveIcon = removeIcon;
- } else {
- mergedRemoveIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, null);
- }
- return {
- clearIcon: mergedClearIcon,
- suffixIcon: mergedSuffixIcon,
- itemIcon: mergedItemIcon,
- removeIcon: mergedRemoveIcon
- };
- }
- ;// ./components/select/usePopupRender.tsx
- function usePopupRender(renderFn) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- if (!renderFn) {
- return undefined;
- }
- return (...args) => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ContextIsolator, {
- space: true
- }, renderFn.apply(void 0, args));
- }, [renderFn]);
- }
- /* harmony default export */ var select_usePopupRender = (usePopupRender);
- ;// ./components/select/useShowArrow.ts
- /**
- * Since Select, TreeSelect, Cascader is same Select like component.
- * We just use same hook to handle this logic.
- *
- * If `suffixIcon` is not equal to `null`, always show it.
- */
- function useShowArrow(suffixIcon, showArrow) {
- return showArrow !== undefined ? showArrow : suffixIcon !== null;
- }
- ;// ./components/select/index.tsx
- var select_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- // TODO: 4.0 - codemod should help to change `filterOption` to support node props.
- const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
- const InternalSelect = (props, ref) => {
- var _a, _b, _c, _d, _e;
- const {
- prefixCls: customizePrefixCls,
- bordered,
- className,
- rootClassName,
- getPopupContainer,
- popupClassName,
- dropdownClassName,
- listHeight = 256,
- placement,
- listItemHeight: customListItemHeight,
- size: customizeSize,
- disabled: customDisabled,
- notFoundContent,
- status: customStatus,
- builtinPlacements,
- dropdownMatchSelectWidth,
- popupMatchSelectWidth,
- direction: propDirection,
- style,
- allowClear,
- variant: customizeVariant,
- dropdownStyle,
- transitionName,
- tagRender,
- maxCount,
- prefix,
- dropdownRender,
- popupRender,
- onDropdownVisibleChange,
- onOpenChange,
- styles,
- classNames
- } = props,
- rest = select_rest(props, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix", "dropdownRender", "popupRender", "onDropdownVisibleChange", "onOpenChange", "styles", "classNames"]);
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- renderEmpty,
- direction: contextDirection,
- virtual,
- popupMatchSelectWidth: contextPopupMatchSelectWidth,
- popupOverflow
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- showSearch,
- style: contextStyle,
- styles: contextStyles,
- className: contextClassName,
- classNames: contextClassNames
- } = (0,config_provider_context.useComponentConfig)('select');
- const [, token] = (0,useToken["default"])();
- const listItemHeight = customListItemHeight !== null && customListItemHeight !== void 0 ? customListItemHeight : token === null || token === void 0 ? void 0 : token.controlHeight;
- const prefixCls = getPrefixCls('select', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const direction = propDirection !== null && propDirection !== void 0 ? propDirection : contextDirection;
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const [variant, enableVariantCls] = useVariants('select', customizeVariant, bordered);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,select_style["default"])(prefixCls, rootCls);
- const mode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const {
- mode: m
- } = props;
- if (m === 'combobox') {
- return undefined;
- }
- if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
- return 'combobox';
- }
- return m;
- }, [props.mode]);
- const isMultiple = mode === 'multiple' || mode === 'tags';
- const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
- const mergedPopupMatchSelectWidth = (_a = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : contextPopupMatchSelectWidth;
- const mergedPopupStyle = ((_b = styles === null || styles === void 0 ? void 0 : styles.popup) === null || _b === void 0 ? void 0 : _b.root) || ((_c = contextStyles.popup) === null || _c === void 0 ? void 0 : _c.root) || dropdownStyle;
- const mergedPopupRender = select_usePopupRender(popupRender || dropdownRender);
- const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
- // ===================== Form Status =====================
- const {
- status: contextStatus,
- hasFeedback,
- isFormItemInput,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- // ===================== Empty =====================
- let mergedNotFound;
- if (notFoundContent !== undefined) {
- mergedNotFound = notFoundContent;
- } else if (mode === 'combobox') {
- mergedNotFound = null;
- } else {
- mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Select"
- });
- }
- // ===================== Icons =====================
- const {
- suffixIcon,
- itemIcon,
- removeIcon,
- clearIcon
- } = useIcons(Object.assign(Object.assign({}, rest), {
- multiple: isMultiple,
- hasFeedback,
- feedbackIcon,
- showSuffixIcon,
- prefixCls,
- componentName: 'Select'
- }));
- const mergedAllowClear = allowClear === true ? {
- clearIcon
- } : allowClear;
- const selectProps = (0,omit["default"])(rest, ['suffixIcon', 'itemIcon']);
- const mergedPopupClassName = classnames_default()(((_d = classNames === null || classNames === void 0 ? void 0 : classNames.popup) === null || _d === void 0 ? void 0 : _d.root) || ((_e = contextClassNames === null || contextClassNames === void 0 ? void 0 : contextClassNames.popup) === null || _e === void 0 ? void 0 : _e.root) || popupClassName || dropdownClassName, {
- [`${prefixCls}-dropdown-${direction}`]: direction === 'rtl'
- }, rootClassName, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cssVarCls, rootCls, hashId);
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const mergedClassName = classnames_default()({
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-${variant}`]: enableVariantCls,
- [`${prefixCls}-in-form-item`]: isFormItemInput
- }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, rootClassName, cssVarCls, rootCls, hashId);
- // ===================== Placement =====================
- const memoPlacement = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (placement !== undefined) {
- return placement;
- }
- return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
- }, [placement, direction]);
- // ====================== Warning ======================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Select');
- const deprecatedProps = {
- dropdownMatchSelectWidth: 'popupMatchSelectWidth',
- dropdownStyle: 'styles.popup.root',
- dropdownClassName: 'classNames.popup.root',
- popupClassName: 'classNames.popup.root',
- dropdownRender: 'popupRender',
- onDropdownVisibleChange: 'onOpenChange',
- bordered: 'variant'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- true ? warning(!('showArrow' in props), 'deprecated', '`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.') : 0;
- true ? warning(!(typeof maxCount !== 'undefined' && !isMultiple), 'usage', '`maxCount` only works with mode `multiple` or `tags`') : 0;
- }
- // ====================== zIndex =========================
- const [zIndex] = (0,useZIndex.useZIndex)('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex);
- // ====================== Render =======================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_select_es, Object.assign({
- ref: ref,
- virtual: virtual,
- showSearch: showSearch
- }, selectProps, {
- style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), contextStyle), style),
- dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'slide-up', transitionName),
- builtinPlacements: select_mergedBuiltinPlacements(builtinPlacements, popupOverflow),
- listHeight: listHeight,
- listItemHeight: listItemHeight,
- mode: mode,
- prefixCls: prefixCls,
- placement: memoPlacement,
- direction: direction,
- prefix: prefix,
- suffixIcon: suffixIcon,
- menuItemSelectedIcon: itemIcon,
- removeIcon: removeIcon,
- allowClear: mergedAllowClear,
- notFoundContent: mergedNotFound,
- className: mergedClassName,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- dropdownClassName: mergedPopupClassName,
- disabled: mergedDisabled,
- dropdownStyle: Object.assign(Object.assign({}, mergedPopupStyle), {
- zIndex
- }),
- maxCount: isMultiple ? maxCount : undefined,
- tagRender: isMultiple ? tagRender : undefined,
- dropdownRender: mergedPopupRender,
- onDropdownVisibleChange: mergedOnOpenChange
- })));
- };
- if (true) {
- InternalSelect.displayName = 'Select';
- }
- const select_Select = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalSelect);
- // We don't care debug panel
- /* istanbul ignore next */
- const select_PurePanel = _util_PurePanel(select_Select, 'dropdownAlign');
- select_Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
- select_Select.Option = es_Option;
- select_Select.OptGroup = es_OptGroup;
- select_Select._InternalPanelDoNotUseOrYouWillBeFired = select_PurePanel;
- if (true) {
- select_Select.displayName = 'Select';
- }
- /* harmony default export */ var components_select = (select_Select);
- ;// ./components/auto-complete/AutoComplete.tsx
- const {
- Option: AutoComplete_Option
- } = components_select;
- function isSelectOptionOrSelectOptGroup(child) {
- return (child === null || child === void 0 ? void 0 : child.type) && (child.type.isSelectOption || child.type.isSelectOptGroup);
- }
- const AutoComplete = (props, ref) => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- className,
- popupClassName,
- dropdownClassName,
- children,
- dataSource,
- dropdownStyle,
- dropdownRender,
- popupRender,
- onDropdownVisibleChange,
- onOpenChange,
- styles,
- classNames
- } = props;
- const childNodes = (0,toArray["default"])(children);
- const mergedPopupStyle = ((_a = styles === null || styles === void 0 ? void 0 : styles.popup) === null || _a === void 0 ? void 0 : _a.root) || dropdownStyle;
- const mergedPopupClassName = ((_b = classNames === null || classNames === void 0 ? void 0 : classNames.popup) === null || _b === void 0 ? void 0 : _b.root) || popupClassName || dropdownClassName;
- const mergedPopupRender = popupRender || dropdownRender;
- const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
- // ============================= Input =============================
- let customizeInput;
- if (childNodes.length === 1 && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
- [customizeInput] = childNodes;
- }
- const getInputElement = customizeInput ? () => customizeInput : undefined;
- // ============================ Options ============================
- let optionChildren;
- // [Legacy] convert `children` or `dataSource` into option children
- if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
- optionChildren = children;
- } else {
- optionChildren = dataSource ? dataSource.map(item => {
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(item)) {
- return item;
- }
- switch (typeof item) {
- case 'string':
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AutoComplete_Option, {
- key: item,
- value: item
- }, item);
- case 'object':
- {
- const {
- value: optionValue
- } = item;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AutoComplete_Option, {
- key: optionValue,
- value: optionValue
- }, item.text);
- }
- default:
- return undefined;
- }
- }) : [];
- }
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('AutoComplete');
- true ? warning(!customizeInput || !('size' in props), 'usage', 'You need to control style self instead of setting `size` when using customize input.') : 0;
- const deprecatedProps = {
- dropdownMatchSelectWidth: 'popupMatchSelectWidth',
- dropdownStyle: 'styles.popup.root',
- dropdownClassName: 'classNames.popup.root',
- popupClassName: 'classNames.popup.root',
- dropdownRender: 'popupRender',
- onDropdownVisibleChange: 'onOpenChange',
- dataSource: 'options'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- }
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('select', customizePrefixCls);
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_select, Object.assign({
- ref: ref,
- suffixIcon: null
- }, (0,omit["default"])(props, ['dataSource', 'dropdownClassName', 'popupClassName']), {
- prefixCls: prefixCls,
- classNames: {
- popup: {
- root: mergedPopupClassName
- },
- root: classNames === null || classNames === void 0 ? void 0 : classNames.root
- },
- styles: {
- popup: {
- root: Object.assign(Object.assign({}, mergedPopupStyle), {
- zIndex
- })
- },
- root: styles === null || styles === void 0 ? void 0 : styles.root
- },
- className: classnames_default()(`${prefixCls}-auto-complete`, className),
- mode: components_select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
- popupRender: mergedPopupRender,
- onOpenChange: mergedOnOpenChange,
- // Internal api
- getInputElement
- }), optionChildren);
- };
- const RefAutoComplete = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(AutoComplete);
- if (true) {
- RefAutoComplete.displayName = 'AutoComplete';
- }
- /* harmony default export */ var auto_complete_AutoComplete = (RefAutoComplete);
- ;// ./components/auto-complete/index.tsx
- const {
- Option: auto_complete_Option
- } = components_select;
- // We don't care debug panel
- /* istanbul ignore next */
- const auto_complete_PurePanel = _util_PurePanel(auto_complete_AutoComplete, 'dropdownAlign', props => (0,omit["default"])(props, ['visible']));
- const components_auto_complete_AutoComplete = auto_complete_AutoComplete;
- components_auto_complete_AutoComplete.Option = auto_complete_Option;
- components_auto_complete_AutoComplete._InternalPanelDoNotUseOrYouWillBeFired = auto_complete_PurePanel;
- /* harmony default export */ var auto_complete = (components_auto_complete_AutoComplete);
- ;// ./components/_util/mediaQueryUtil.ts
- const addMediaQueryListener = (mql, handler) => {
- // Don't delete here, please keep the code compatible
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.addEventListener) !== 'undefined') {
- mql.addEventListener('change', handler);
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.addListener) !== 'undefined') {
- mql.addListener(handler);
- }
- };
- const removeMediaQueryListener = (mql, handler) => {
- // Don't delete here, please keep the code compatible
- if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeEventListener) !== 'undefined') {
- mql.removeEventListener('change', handler);
- } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeListener) !== 'undefined') {
- mql.removeListener(handler);
- }
- };
- ;// ./components/_util/responsiveObserver.ts
- const responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
- const getResponsiveMap = token => ({
- xs: `(max-width: ${token.screenXSMax}px)`,
- sm: `(min-width: ${token.screenSM}px)`,
- md: `(min-width: ${token.screenMD}px)`,
- lg: `(min-width: ${token.screenLG}px)`,
- xl: `(min-width: ${token.screenXL}px)`,
- xxl: `(min-width: ${token.screenXXL}px)`
- });
- /**
- * Ensures that the breakpoints token are valid, in good order
- * For each breakpoint : screenMin <= screen <= screenMax and screenMax <= nextScreenMin
- */
- const validateBreakpoints = token => {
- const indexableToken = token;
- const revBreakpoints = [].concat(responsiveArray).reverse();
- revBreakpoints.forEach((breakpoint, i) => {
- const breakpointUpper = breakpoint.toUpperCase();
- const screenMin = `screen${breakpointUpper}Min`;
- const screen = `screen${breakpointUpper}`;
- if (!(indexableToken[screenMin] <= indexableToken[screen])) {
- throw new Error(`${screenMin}<=${screen} fails : !(${indexableToken[screenMin]}<=${indexableToken[screen]})`);
- }
- if (i < revBreakpoints.length - 1) {
- const screenMax = `screen${breakpointUpper}Max`;
- if (!(indexableToken[screen] <= indexableToken[screenMax])) {
- throw new Error(`${screen}<=${screenMax} fails : !(${indexableToken[screen]}<=${indexableToken[screenMax]})`);
- }
- const nextBreakpointUpperMin = revBreakpoints[i + 1].toUpperCase();
- const nextScreenMin = `screen${nextBreakpointUpperMin}Min`;
- if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) {
- throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`);
- }
- }
- });
- return token;
- };
- const matchScreen = (screens, screenSizes) => {
- if (!screenSizes) {
- return;
- }
- for (const breakpoint of responsiveArray) {
- if (screens[breakpoint] && (screenSizes === null || screenSizes === void 0 ? void 0 : screenSizes[breakpoint]) !== undefined) {
- return screenSizes[breakpoint];
- }
- }
- };
- const useResponsiveObserver = () => {
- const [, token] = (0,useToken["default"])();
- const responsiveMap = getResponsiveMap(validateBreakpoints(token));
- // To avoid repeat create instance, we add `useMemo` here.
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- const subscribers = new Map();
- let subUid = -1;
- let screens = {};
- return {
- responsiveMap,
- matchHandlers: {},
- dispatch(pointMap) {
- screens = pointMap;
- subscribers.forEach(func => func(screens));
- return subscribers.size >= 1;
- },
- subscribe(func) {
- if (!subscribers.size) {
- this.register();
- }
- subUid += 1;
- subscribers.set(subUid, func);
- func(screens);
- return subUid;
- },
- unsubscribe(paramToken) {
- subscribers.delete(paramToken);
- if (!subscribers.size) {
- this.unregister();
- }
- },
- register() {
- Object.entries(responsiveMap).forEach(([screen, mediaQuery]) => {
- const listener = ({
- matches
- }) => {
- this.dispatch(Object.assign(Object.assign({}, screens), {
- [screen]: matches
- }));
- };
- const mql = window.matchMedia(mediaQuery);
- addMediaQueryListener(mql, listener);
- this.matchHandlers[mediaQuery] = {
- mql,
- listener
- };
- listener(mql);
- });
- },
- unregister() {
- Object.values(responsiveMap).forEach(mediaQuery => {
- const handler = this.matchHandlers[mediaQuery];
- removeMediaQueryListener(handler === null || handler === void 0 ? void 0 : handler.mql, handler === null || handler === void 0 ? void 0 : handler.listener);
- });
- subscribers.clear();
- }
- };
- }, [token]);
- };
- /* harmony default export */ var _util_responsiveObserver = (useResponsiveObserver);
- ;// ./components/_util/hooks/useForceUpdate.ts
- function useForceUpdate() {
- const [, forceUpdate] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useReducer(x => x + 1, 0);
- return forceUpdate;
- }
- ;// ./components/grid/hooks/useBreakpoint.tsx
- function useBreakpoint(refreshOnChange = true, defaultScreens = {}) {
- const screensRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(defaultScreens);
- const forceUpdate = useForceUpdate();
- const responsiveObserver = _util_responsiveObserver();
- (0,useLayoutEffect["default"])(() => {
- const token = responsiveObserver.subscribe(supportScreens => {
- screensRef.current = supportScreens;
- if (refreshOnChange) {
- forceUpdate();
- }
- });
- return () => responsiveObserver.unsubscribe(token);
- }, []);
- return screensRef.current;
- }
- /* harmony default export */ var hooks_useBreakpoint = (useBreakpoint);
- ;// ./components/avatar/AvatarContext.ts
- const AvatarContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- /* harmony default export */ var avatar_AvatarContext = (AvatarContext);
- // EXTERNAL MODULE: ./components/avatar/style/index.ts
- var avatar_style = __webpack_require__("./components/avatar/style/index.ts");
- ;// ./components/avatar/Avatar.tsx
- var Avatar_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Avatar_Avatar = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- shape,
- size: customSize,
- src,
- srcSet,
- icon,
- className,
- rootClassName,
- style,
- alt,
- draggable,
- children,
- crossOrigin,
- gap = 4,
- onError
- } = props,
- others = Avatar_rest(props, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "style", "alt", "draggable", "children", "crossOrigin", "gap", "onError"]);
- const [scale, setScale] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(1);
- const [mounted, setMounted] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [isImgExist, setIsImgExist] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true);
- const avatarNodeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const avatarChildrenRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const avatarNodeMergedRef = (0,es_ref.composeRef)(ref, avatarNodeRef);
- const {
- getPrefixCls,
- avatar
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const avatarCtx = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(avatar_AvatarContext);
- const setScaleParam = () => {
- if (!avatarChildrenRef.current || !avatarNodeRef.current) {
- return;
- }
- const childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale
- const nodeWidth = avatarNodeRef.current.offsetWidth;
- // denominator is 0 is no meaning
- if (childrenWidth !== 0 && nodeWidth !== 0) {
- if (gap * 2 < nodeWidth) {
- setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
- }
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setMounted(true);
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setIsImgExist(true);
- setScale(1);
- }, [src]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(setScaleParam, [gap]);
- const handleImgLoadError = () => {
- const errorFlag = onError === null || onError === void 0 ? void 0 : onError();
- if (errorFlag !== false) {
- setIsImgExist(false);
- }
- };
- const size = (0,useSize["default"])(ctxSize => {
- var _a, _b;
- return (_b = (_a = customSize !== null && customSize !== void 0 ? customSize : avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.size) !== null && _a !== void 0 ? _a : ctxSize) !== null && _b !== void 0 ? _b : 'default';
- });
- const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
- const screens = hooks_useBreakpoint(needResponsive);
- const responsiveSizeStyle = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (typeof size !== 'object') {
- return {};
- }
- const currentBreakpoint = responsiveArray.find(screen => screens[screen]);
- const currentSize = size[currentBreakpoint];
- return currentSize ? {
- width: currentSize,
- height: currentSize,
- fontSize: currentSize && (icon || children) ? currentSize / 2 : 18
- } : {};
- }, [screens, size]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Avatar');
- true ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : 0;
- }
- const prefixCls = getPrefixCls('avatar', customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,avatar_style["default"])(prefixCls, rootCls);
- const sizeCls = classnames_default()({
- [`${prefixCls}-lg`]: size === 'large',
- [`${prefixCls}-sm`]: size === 'small'
- });
- const hasImageElement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(src);
- const mergedShape = shape || (avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.shape) || 'circle';
- const classString = classnames_default()(prefixCls, sizeCls, avatar === null || avatar === void 0 ? void 0 : avatar.className, `${prefixCls}-${mergedShape}`, {
- [`${prefixCls}-image`]: hasImageElement || src && isImgExist,
- [`${prefixCls}-icon`]: !!icon
- }, cssVarCls, rootCls, className, rootClassName, hashId);
- const sizeStyle = typeof size === 'number' ? {
- width: size,
- height: size,
- fontSize: icon ? size / 2 : 18
- } : {};
- let childrenToRender;
- if (typeof src === 'string' && isImgExist) {
- childrenToRender = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("img", {
- src: src,
- draggable: draggable,
- srcSet: srcSet,
- onError: handleImgLoadError,
- alt: alt,
- crossOrigin: crossOrigin
- });
- } else if (hasImageElement) {
- childrenToRender = src;
- } else if (icon) {
- childrenToRender = icon;
- } else if (mounted || scale !== 1) {
- const transformString = `scale(${scale})`;
- const childrenStyle = {
- msTransform: transformString,
- WebkitTransform: transformString,
- transform: transformString
- };
- childrenToRender = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: setScaleParam
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-string`,
- ref: avatarChildrenRef,
- style: Object.assign({}, childrenStyle)
- }, children));
- } else {
- childrenToRender = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-string`,
- style: {
- opacity: 0
- },
- ref: avatarChildrenRef
- }, children);
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({}, others, {
- style: Object.assign(Object.assign(Object.assign(Object.assign({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), style),
- className: classString,
- ref: avatarNodeMergedRef
- }), childrenToRender));
- });
- if (true) {
- Avatar_Avatar.displayName = 'Avatar';
- }
- /* harmony default export */ var avatar_Avatar = (Avatar_Avatar);
- ;// ./components/_util/getRenderPropValue.ts
- const getRenderPropValue = propValue => {
- if (!propValue) {
- return null;
- }
- return typeof propValue === 'function' ? propValue() : propValue;
- };
- ;// ./node_modules/rc-tooltip/es/Popup.js
- function Popup_Popup(props) {
- var children = props.children,
- prefixCls = props.prefixCls,
- id = props.id,
- innerStyle = props.overlayInnerStyle,
- bodyClassName = props.bodyClassName,
- className = props.className,
- style = props.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content"), className),
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-inner"), bodyClassName),
- id: id,
- role: "tooltip",
- style: innerStyle
- }, typeof children === 'function' ? children() : children));
- }
- ;// ./node_modules/rc-tooltip/es/placements.js
- var autoAdjustOverflowTopBottom = {
- shiftX: 64,
- adjustY: 1
- };
- var autoAdjustOverflowLeftRight = {
- adjustX: 1,
- shiftY: true
- };
- var targetOffset = [0, 0];
- var placements = {
- left: {
- points: ['cr', 'cl'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [-4, 0],
- targetOffset: targetOffset
- },
- right: {
- points: ['cl', 'cr'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [4, 0],
- targetOffset: targetOffset
- },
- top: {
- points: ['bc', 'tc'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, -4],
- targetOffset: targetOffset
- },
- bottom: {
- points: ['tc', 'bc'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, 4],
- targetOffset: targetOffset
- },
- topLeft: {
- points: ['bl', 'tl'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, -4],
- targetOffset: targetOffset
- },
- leftTop: {
- points: ['tr', 'tl'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [-4, 0],
- targetOffset: targetOffset
- },
- topRight: {
- points: ['br', 'tr'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, -4],
- targetOffset: targetOffset
- },
- rightTop: {
- points: ['tl', 'tr'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [4, 0],
- targetOffset: targetOffset
- },
- bottomRight: {
- points: ['tr', 'br'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, 4],
- targetOffset: targetOffset
- },
- rightBottom: {
- points: ['bl', 'br'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [4, 0],
- targetOffset: targetOffset
- },
- bottomLeft: {
- points: ['tl', 'bl'],
- overflow: autoAdjustOverflowTopBottom,
- offset: [0, 4],
- targetOffset: targetOffset
- },
- leftBottom: {
- points: ['br', 'bl'],
- overflow: autoAdjustOverflowLeftRight,
- offset: [-4, 0],
- targetOffset: targetOffset
- }
- };
- /* harmony default export */ var es_placements = (placements);
- ;// ./node_modules/rc-tooltip/es/Tooltip.js
- var Tooltip_excluded = ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "children", "onVisibleChange", "afterVisibleChange", "transitionName", "animation", "motion", "placement", "align", "destroyTooltipOnHide", "defaultVisible", "getTooltipContainer", "overlayInnerStyle", "arrowContent", "overlay", "id", "showArrow", "classNames", "styles"];
- var Tooltip = function Tooltip(props, ref) {
- var overlayClassName = props.overlayClassName,
- _props$trigger = props.trigger,
- trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
- _props$mouseEnterDela = props.mouseEnterDelay,
- mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0 : _props$mouseEnterDela,
- _props$mouseLeaveDela = props.mouseLeaveDelay,
- mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
- overlayStyle = props.overlayStyle,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-tooltip' : _props$prefixCls,
- children = props.children,
- onVisibleChange = props.onVisibleChange,
- afterVisibleChange = props.afterVisibleChange,
- transitionName = props.transitionName,
- animation = props.animation,
- motion = props.motion,
- _props$placement = props.placement,
- placement = _props$placement === void 0 ? 'right' : _props$placement,
- _props$align = props.align,
- align = _props$align === void 0 ? {} : _props$align,
- _props$destroyTooltip = props.destroyTooltipOnHide,
- destroyTooltipOnHide = _props$destroyTooltip === void 0 ? false : _props$destroyTooltip,
- defaultVisible = props.defaultVisible,
- getTooltipContainer = props.getTooltipContainer,
- overlayInnerStyle = props.overlayInnerStyle,
- arrowContent = props.arrowContent,
- overlay = props.overlay,
- id = props.id,
- _props$showArrow = props.showArrow,
- showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
- tooltipClassNames = props.classNames,
- tooltipStyles = props.styles,
- restProps = (0,objectWithoutProperties["default"])(props, Tooltip_excluded);
- var mergedId = hooks_useId(id);
- var triggerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- return triggerRef.current;
- });
- var extraProps = (0,objectSpread2["default"])({}, restProps);
- if ('visible' in props) {
- extraProps.popupVisible = props.visible;
- }
- var getPopupElement = function getPopupElement() {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Popup_Popup, {
- key: "content",
- prefixCls: prefixCls,
- id: mergedId,
- bodyClassName: tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.body,
- overlayInnerStyle: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, overlayInnerStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.body)
- }, overlay);
- };
- var getChildren = function getChildren() {
- var child = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(children);
- var originalProps = (child === null || child === void 0 ? void 0 : child.props) || {};
- var childProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, originalProps), {}, {
- 'aria-describedby': overlay ? mergedId : null
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, childProps);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, (0,esm_extends["default"])({
- popupClassName: classnames_default()(overlayClassName, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.root),
- prefixCls: prefixCls,
- popup: getPopupElement,
- action: trigger,
- builtinPlacements: placements,
- popupPlacement: placement,
- ref: triggerRef,
- popupAlign: align,
- getPopupContainer: getTooltipContainer,
- onPopupVisibleChange: onVisibleChange,
- afterPopupVisibleChange: afterVisibleChange,
- popupTransitionName: transitionName,
- popupAnimation: animation,
- popupMotion: motion,
- defaultPopupVisible: defaultVisible,
- autoDestroy: destroyTooltipOnHide,
- mouseLeaveDelay: mouseLeaveDelay,
- popupStyle: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, overlayStyle), tooltipStyles === null || tooltipStyles === void 0 ? void 0 : tooltipStyles.root),
- mouseEnterDelay: mouseEnterDelay,
- arrow: showArrow
- }, extraProps), getChildren());
- };
- /* harmony default export */ var es_Tooltip = (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(Tooltip));
- ;// ./node_modules/rc-tooltip/es/index.js
- /* harmony default export */ var rc_tooltip_es = (es_Tooltip);
- // EXTERNAL MODULE: ./components/style/placementArrow.ts
- var placementArrow = __webpack_require__("./components/style/placementArrow.ts");
- ;// ./components/_util/placements.ts
- function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow) {
- if (autoAdjustOverflow === false) {
- return {
- adjustX: false,
- adjustY: false
- };
- }
- const overflow = autoAdjustOverflow && typeof autoAdjustOverflow === 'object' ? autoAdjustOverflow : {};
- const baseOverflow = {};
- switch (placement) {
- case 'top':
- case 'bottom':
- baseOverflow.shiftX = arrowOffset.arrowOffsetHorizontal * 2 + arrowWidth;
- baseOverflow.shiftY = true;
- baseOverflow.adjustY = true;
- break;
- case 'left':
- case 'right':
- baseOverflow.shiftY = arrowOffset.arrowOffsetVertical * 2 + arrowWidth;
- baseOverflow.shiftX = true;
- baseOverflow.adjustX = true;
- break;
- }
- const mergedOverflow = Object.assign(Object.assign({}, baseOverflow), overflow);
- // Support auto shift
- if (!mergedOverflow.shiftX) {
- mergedOverflow.adjustX = true;
- }
- if (!mergedOverflow.shiftY) {
- mergedOverflow.adjustY = true;
- }
- return mergedOverflow;
- }
- const PlacementAlignMap = {
- left: {
- points: ['cr', 'cl']
- },
- right: {
- points: ['cl', 'cr']
- },
- top: {
- points: ['bc', 'tc']
- },
- bottom: {
- points: ['tc', 'bc']
- },
- topLeft: {
- points: ['bl', 'tl']
- },
- leftTop: {
- points: ['tr', 'tl']
- },
- topRight: {
- points: ['br', 'tr']
- },
- rightTop: {
- points: ['tl', 'tr']
- },
- bottomRight: {
- points: ['tr', 'br']
- },
- rightBottom: {
- points: ['bl', 'br']
- },
- bottomLeft: {
- points: ['tl', 'bl']
- },
- leftBottom: {
- points: ['br', 'bl']
- }
- };
- const ArrowCenterPlacementAlignMap = {
- topLeft: {
- points: ['bl', 'tc']
- },
- leftTop: {
- points: ['tr', 'cl']
- },
- topRight: {
- points: ['br', 'tc']
- },
- rightTop: {
- points: ['tl', 'cr']
- },
- bottomRight: {
- points: ['tr', 'bc']
- },
- rightBottom: {
- points: ['bl', 'cr']
- },
- bottomLeft: {
- points: ['tl', 'bc']
- },
- leftBottom: {
- points: ['br', 'cl']
- }
- };
- const DisableAutoArrowList = new Set(['topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom']);
- function getPlacements(config) {
- const {
- arrowWidth,
- autoAdjustOverflow,
- arrowPointAtCenter,
- offset,
- borderRadius,
- visibleFirst
- } = config;
- const halfArrowWidth = arrowWidth / 2;
- const placementMap = {};
- // Dynamic offset
- const arrowOffset = (0,placementArrow.getArrowOffsetToken)({
- contentRadius: borderRadius,
- limitVerticalRadius: true
- });
- Object.keys(PlacementAlignMap).forEach(key => {
- const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key];
- const placementInfo = Object.assign(Object.assign({}, template), {
- offset: [0, 0],
- dynamicInset: true
- });
- placementMap[key] = placementInfo;
- // Disable autoArrow since design is fixed position
- if (DisableAutoArrowList.has(key)) {
- placementInfo.autoArrow = false;
- }
- // Static offset
- switch (key) {
- case 'top':
- case 'topLeft':
- case 'topRight':
- placementInfo.offset[1] = -halfArrowWidth - offset;
- break;
- case 'bottom':
- case 'bottomLeft':
- case 'bottomRight':
- placementInfo.offset[1] = halfArrowWidth + offset;
- break;
- case 'left':
- case 'leftTop':
- case 'leftBottom':
- placementInfo.offset[0] = -halfArrowWidth - offset;
- break;
- case 'right':
- case 'rightTop':
- case 'rightBottom':
- placementInfo.offset[0] = halfArrowWidth + offset;
- break;
- }
- if (arrowPointAtCenter) {
- switch (key) {
- case 'topLeft':
- case 'bottomLeft':
- placementInfo.offset[0] = -arrowOffset.arrowOffsetHorizontal - halfArrowWidth;
- break;
- case 'topRight':
- case 'bottomRight':
- placementInfo.offset[0] = arrowOffset.arrowOffsetHorizontal + halfArrowWidth;
- break;
- case 'leftTop':
- case 'rightTop':
- placementInfo.offset[1] = -arrowOffset.arrowOffsetHorizontal * 2 + halfArrowWidth;
- break;
- case 'leftBottom':
- case 'rightBottom':
- placementInfo.offset[1] = arrowOffset.arrowOffsetHorizontal * 2 - halfArrowWidth;
- break;
- }
- }
- // Overflow
- placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow);
- // VisibleFirst
- if (visibleFirst) {
- placementInfo.htmlRegion = 'visibleFirst';
- }
- });
- return placementMap;
- }
- // EXTERNAL MODULE: ./components/tooltip/style/index.ts
- var tooltip_style = __webpack_require__("./components/tooltip/style/index.ts");
- ;// ./components/_util/colors.ts
- const inverseColors = presetColors.PresetColors.map(color => `${color}-inverse`);
- const PresetStatusColorTypes = ['success', 'processing', 'error', 'default', 'warning'];
- /**
- * determine if the color keyword belongs to the `Ant Design` {@link PresetColors}.
- * @param color color to be judged
- * @param includeInverse whether to include reversed colors
- */
- function isPresetColor(color, includeInverse = true) {
- if (includeInverse) {
- return [].concat((0,toConsumableArray["default"])(inverseColors), (0,toConsumableArray["default"])(presetColors.PresetColors)).includes(color);
- }
- return presetColors.PresetColors.includes(color);
- }
- function isPresetStatusColor(color) {
- return PresetStatusColorTypes.includes(color);
- }
- // EXTERNAL MODULE: ./components/color-picker/util.ts
- var util = __webpack_require__("./components/color-picker/util.ts");
- ;// ./components/tooltip/util.ts
- function parseColor(prefixCls, color) {
- const isInternalColor = isPresetColor(color);
- const className = classnames_default()({
- [`${prefixCls}-${color}`]: color && isInternalColor
- });
- const overlayStyle = {};
- const arrowStyle = {};
- const rgb = (0,util.generateColor)(color).toRgb();
- const luminance = (0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b) / 255;
- const textColor = luminance < 0.5 ? '#FFF' : '#000';
- if (color && !isInternalColor) {
- overlayStyle.background = color;
- overlayStyle['--ant-tooltip-color'] = textColor;
- // @ts-ignore
- arrowStyle['--antd-arrow-background-color'] = color;
- }
- return {
- className,
- overlayStyle,
- arrowStyle
- };
- }
- ;// ./components/tooltip/PurePanel.tsx
- /** @private Internal Component. Do not use in your production. */
- const tooltip_PurePanel_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- placement = 'top',
- title,
- color,
- overlayInnerStyle
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,tooltip_style["default"])(prefixCls);
- // Color
- const colorInfo = parseColor(prefixCls, color);
- const arrowContentStyle = colorInfo.arrowStyle;
- const formattedOverlayInnerStyle = Object.assign(Object.assign({}, overlayInnerStyle), colorInfo.overlayStyle);
- const cls = classnames_default()(hashId, cssVarCls, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className, colorInfo.className);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: arrowContentStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-arrow`
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Popup_Popup, Object.assign({}, props, {
- className: hashId,
- prefixCls: prefixCls,
- overlayInnerStyle: formattedOverlayInnerStyle
- }), title)));
- };
- /* harmony default export */ var tooltip_PurePanel = (tooltip_PurePanel_PurePanel);
- ;// ./components/tooltip/index.tsx
- var tooltip_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalTooltip = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- openClassName,
- getTooltipContainer,
- color,
- overlayInnerStyle,
- children,
- afterOpenChange,
- afterVisibleChange,
- destroyTooltipOnHide,
- destroyOnHidden,
- arrow = true,
- title,
- overlay,
- builtinPlacements,
- arrowPointAtCenter = false,
- autoAdjustOverflow = true,
- motion,
- getPopupContainer,
- placement = 'top',
- mouseEnterDelay = 0.1,
- mouseLeaveDelay = 0.1,
- overlayStyle,
- rootClassName,
- overlayClassName,
- styles,
- classNames: tooltipClassNames
- } = props,
- restProps = tooltip_rest(props, ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"]);
- const mergedShowArrow = !!arrow;
- const [, token] = (0,useToken["default"])();
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('tooltip');
- // ============================== Ref ===============================
- const warning = (0,_util_warning.devUseWarning)('Tooltip');
- const tooltipRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const forceAlign = () => {
- var _a;
- (_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.forceAlign();
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => {
- var _a, _b;
- return {
- forceAlign,
- forcePopupAlign: () => {
- warning.deprecated(false, 'forcePopupAlign', 'forceAlign');
- forceAlign();
- },
- nativeElement: (_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement,
- popupElement: (_b = tooltipRef.current) === null || _b === void 0 ? void 0 : _b.popupElement
- };
- });
- // ============================== Warn ==============================
- if (true) {
- [['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['destroyTooltipOnHide', 'destroyOnHidden'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- true ? warning(!destroyTooltipOnHide || typeof destroyTooltipOnHide === 'boolean', 'usage', '`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly.') : 0;
- true ? warning(!arrow || typeof arrow === 'boolean' || !('arrowPointAtCenter' in arrow), 'deprecated', '`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead.') : 0;
- }
- // ============================== Open ==============================
- const [open, setOpen] = (0,useMergedState["default"])(false, {
- value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,
- defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible
- });
- const noTitle = !title && !overlay && title !== 0; // overlay for old version compatibility
- const onOpenChange = vis => {
- var _a, _b;
- setOpen(noTitle ? false : vis);
- if (!noTitle) {
- (_a = props.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(props, vis);
- (_b = props.onVisibleChange) === null || _b === void 0 ? void 0 : _b.call(props, vis);
- }
- };
- const tooltipPlacements = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- let mergedArrowPointAtCenter = arrowPointAtCenter;
- if (typeof arrow === 'object') {
- mergedArrowPointAtCenter = (_b = (_a = arrow.pointAtCenter) !== null && _a !== void 0 ? _a : arrow.arrowPointAtCenter) !== null && _b !== void 0 ? _b : arrowPointAtCenter;
- }
- return builtinPlacements || getPlacements({
- arrowPointAtCenter: mergedArrowPointAtCenter,
- autoAdjustOverflow,
- arrowWidth: mergedShowArrow ? token.sizePopupArrow : 0,
- borderRadius: token.borderRadius,
- offset: token.marginXXS,
- visibleFirst: true
- });
- }, [arrowPointAtCenter, arrow, builtinPlacements, token]);
- const memoOverlay = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (title === 0) {
- return title;
- }
- return overlay || title || '';
- }, [overlay, title]);
- const memoOverlayWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- space: true
- }, typeof memoOverlay === 'function' ? memoOverlay() : memoOverlay);
- const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const injectFromPopover = props['data-popover-inject'];
- let tempOpen = open;
- // Hide tooltip when there is no title
- if (!('open' in props) && !('visible' in props) && noTitle) {
- tempOpen = false;
- }
- // ============================= Render =============================
- const child = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(children) && !(0,reactNode.isFragment)(children) ? children : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, children);
- const childProps = child.props;
- const childCls = !childProps.className || typeof childProps.className === 'string' ? classnames_default()(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,tooltip_style["default"])(prefixCls, !injectFromPopover);
- // Color
- const colorInfo = parseColor(prefixCls, color);
- const arrowContentStyle = colorInfo.arrowStyle;
- const rootClassNames = classnames_default()(overlayClassName, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, colorInfo.className, rootClassName, hashId, cssVarCls, contextClassName, contextClassNames.root, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.root);
- const bodyClassNames = classnames_default()(contextClassNames.body, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.body);
- // ============================ zIndex ============================
- const [zIndex, contextZIndex] = (0,useZIndex.useZIndex)('Tooltip', restProps.zIndex);
- const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_tooltip_es, Object.assign({}, restProps, {
- zIndex: zIndex,
- showArrow: mergedShowArrow,
- placement: placement,
- mouseEnterDelay: mouseEnterDelay,
- mouseLeaveDelay: mouseLeaveDelay,
- prefixCls: prefixCls,
- classNames: {
- root: rootClassNames,
- body: bodyClassNames
- },
- styles: {
- root: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, arrowContentStyle), contextStyles.root), contextStyle), overlayStyle), styles === null || styles === void 0 ? void 0 : styles.root),
- body: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.body), overlayInnerStyle), styles === null || styles === void 0 ? void 0 : styles.body), colorInfo.overlayStyle)
- },
- getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,
- ref: tooltipRef,
- builtinPlacements: tooltipPlacements,
- overlay: memoOverlayWrapper,
- visible: tempOpen,
- onVisibleChange: onOpenChange,
- afterVisibleChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
- arrowContent: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-arrow-content`
- }),
- motion: {
- motionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'zoom-big-fast', props.transitionName),
- motionDeadline: 1000
- },
- // TODO: In the future, destroyTooltipOnHide in rc-tooltip needs to be upgrade to destroyOnHidden
- destroyTooltipOnHide: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide
- }), tempOpen ? (0,reactNode.cloneElement)(child, {
- className: childCls
- }) : child);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(zindexContext["default"].Provider, {
- value: contextZIndex
- }, content));
- });
- const tooltip_Tooltip = InternalTooltip;
- if (true) {
- tooltip_Tooltip.displayName = 'Tooltip';
- }
- tooltip_Tooltip._InternalPanelDoNotUseOrYouWillBeFired = tooltip_PurePanel;
- /* harmony default export */ var components_tooltip = (tooltip_Tooltip);
- // EXTERNAL MODULE: ./components/popover/style/index.ts
- var popover_style = __webpack_require__("./components/popover/style/index.ts");
- ;// ./components/popover/PurePanel.tsx
- var popover_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Overlay = ({
- title,
- content,
- prefixCls
- }) => {
- if (!title && !content) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-title`
- }, title), content && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-inner-content`
- }, content));
- };
- const RawPurePanel = props => {
- const {
- hashId,
- prefixCls,
- className,
- style,
- placement = 'top',
- title,
- content,
- children
- } = props;
- const titleNode = getRenderPropValue(title);
- const contentNode = getRenderPropValue(content);
- const cls = classnames_default()(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-arrow`
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Popup_Popup, Object.assign({}, props, {
- className: hashId,
- prefixCls: prefixCls
- }), children || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Overlay, {
- prefixCls: prefixCls,
- title: titleNode,
- content: contentNode
- })));
- };
- const popover_PurePanel_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- className
- } = props,
- restProps = popover_PurePanel_rest(props, ["prefixCls", "className"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('popover', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,popover_style["default"])(prefixCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RawPurePanel, Object.assign({}, restProps, {
- prefixCls: prefixCls,
- hashId: hashId,
- className: classnames_default()(className, cssVarCls)
- })));
- };
- /* harmony default export */ var popover_PurePanel = (popover_PurePanel_PurePanel);
- ;// ./components/popover/index.tsx
- var popover_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- // CSSINJS
- const InternalPopover = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- title,
- content,
- overlayClassName,
- placement = 'top',
- trigger = 'hover',
- children,
- mouseEnterDelay = 0.1,
- mouseLeaveDelay = 0.1,
- onOpenChange,
- overlayStyle = {},
- styles,
- classNames: popoverClassNames
- } = props,
- otherProps = popover_rest(props, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "children", "mouseEnterDelay", "mouseLeaveDelay", "onOpenChange", "overlayStyle", "styles", "classNames"]);
- const {
- getPrefixCls,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('popover');
- const prefixCls = getPrefixCls('popover', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,popover_style["default"])(prefixCls);
- const rootPrefixCls = getPrefixCls();
- const rootClassNames = classnames_default()(overlayClassName, hashId, cssVarCls, contextClassName, contextClassNames.root, popoverClassNames === null || popoverClassNames === void 0 ? void 0 : popoverClassNames.root);
- const bodyClassNames = classnames_default()(contextClassNames.body, popoverClassNames === null || popoverClassNames === void 0 ? void 0 : popoverClassNames.body);
- const [open, setOpen] = (0,useMergedState["default"])(false, {
- value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,
- defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible
- });
- const settingOpen = (value, e) => {
- setOpen(value, true);
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(value, e);
- };
- const onKeyDown = e => {
- if (e.keyCode === KeyCode["default"].ESC) {
- settingOpen(false, e);
- }
- };
- const onInternalOpenChange = value => {
- settingOpen(value);
- };
- const titleNode = getRenderPropValue(title);
- const contentNode = getRenderPropValue(content);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({
- placement: placement,
- trigger: trigger,
- mouseEnterDelay: mouseEnterDelay,
- mouseLeaveDelay: mouseLeaveDelay
- }, otherProps, {
- prefixCls: prefixCls,
- classNames: {
- root: rootClassNames,
- body: bodyClassNames
- },
- styles: {
- root: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), contextStyle), overlayStyle), styles === null || styles === void 0 ? void 0 : styles.root),
- body: Object.assign(Object.assign({}, contextStyles.body), styles === null || styles === void 0 ? void 0 : styles.body)
- },
- ref: ref,
- open: open,
- onOpenChange: onInternalOpenChange,
- overlay: titleNode || contentNode ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Overlay, {
- prefixCls: prefixCls,
- title: titleNode,
- content: contentNode
- })) : null,
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'zoom-big', otherProps.transitionName),
- "data-popover-inject": true
- }), (0,reactNode.cloneElement)(children, {
- onKeyDown: e => {
- var _a, _b;
- if (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children)) {
- (_b = children === null || children === void 0 ? void 0 : (_a = children.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
- }
- onKeyDown(e);
- }
- })));
- });
- const Popover = InternalPopover;
- Popover._InternalPanelDoNotUseOrYouWillBeFired = popover_PurePanel;
- if (true) {
- Popover.displayName = 'Popover';
- }
- /* harmony default export */ var popover = (Popover);
- ;// ./components/avatar/AvatarGroup.tsx
- const AvatarContextProvider = props => {
- const {
- size,
- shape
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(avatar_AvatarContext);
- const avatarContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- size: props.size || size,
- shape: props.shape || shape
- }), [props.size, props.shape, size, shape]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(avatar_AvatarContext.Provider, {
- value: avatarContextValue
- }, props.children);
- };
- const AvatarGroup = props => {
- var _a, _b, _c, _d;
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- maxCount,
- maxStyle,
- size,
- shape,
- maxPopoverPlacement,
- maxPopoverTrigger,
- children,
- max
- } = props;
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Avatar.Group');
- [['maxCount', 'max={{ count: number }}'], ['maxStyle', 'max={{ style: CSSProperties }}'], ['maxPopoverPlacement', 'max={{ popover: PopoverProps }}'], ['maxPopoverTrigger', 'max={{ popover: PopoverProps }}']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- const prefixCls = getPrefixCls('avatar', customizePrefixCls);
- const groupPrefixCls = `${prefixCls}-group`;
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,avatar_style["default"])(prefixCls, rootCls);
- const cls = classnames_default()(groupPrefixCls, {
- [`${groupPrefixCls}-rtl`]: direction === 'rtl'
- }, cssVarCls, rootCls, className, rootClassName, hashId);
- const childrenWithProps = (0,toArray["default"])(children).map((child, index) => (0,reactNode.cloneElement)(child, {
- // eslint-disable-next-line react/no-array-index-key
- key: `avatar-key-${index}`
- }));
- const mergeCount = (max === null || max === void 0 ? void 0 : max.count) || maxCount;
- const numOfChildren = childrenWithProps.length;
- if (mergeCount && mergeCount < numOfChildren) {
- const childrenShow = childrenWithProps.slice(0, mergeCount);
- const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);
- const mergeStyle = (max === null || max === void 0 ? void 0 : max.style) || maxStyle;
- const mergePopoverTrigger = ((_a = max === null || max === void 0 ? void 0 : max.popover) === null || _a === void 0 ? void 0 : _a.trigger) || maxPopoverTrigger || 'hover';
- const mergePopoverPlacement = ((_b = max === null || max === void 0 ? void 0 : max.popover) === null || _b === void 0 ? void 0 : _b.placement) || maxPopoverPlacement || 'top';
- const mergeProps = Object.assign(Object.assign({
- content: childrenHidden
- }, max === null || max === void 0 ? void 0 : max.popover), {
- classNames: {
- root: classnames_default()(`${groupPrefixCls}-popover`, (_d = (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.classNames) === null || _d === void 0 ? void 0 : _d.root)
- },
- placement: mergePopoverPlacement,
- trigger: mergePopoverTrigger
- });
- childrenShow.push(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(popover, Object.assign({
- key: "avatar-popover-key",
- destroyOnHidden: true
- }, mergeProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(avatar_Avatar, {
- style: mergeStyle
- }, `+${numOfChildren - mergeCount}`)));
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AvatarContextProvider, {
- shape: shape,
- size: size
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: style
- }, childrenShow)));
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AvatarContextProvider, {
- shape: shape,
- size: size
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: style
- }, childrenWithProps)));
- };
- /* harmony default export */ var avatar_AvatarGroup = (AvatarGroup);
- ;// ./components/avatar/index.tsx
- const components_avatar_Avatar = avatar_Avatar;
- components_avatar_Avatar.Group = avatar_AvatarGroup;
- /* harmony default export */ var avatar = (components_avatar_Avatar);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/VerticalAlignTopOutlined.js
- // This icon file is generated automatically.
- var VerticalAlignTopOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z" } }] }, "name": "vertical-align-top", "theme": "outlined" };
- /* harmony default export */ var asn_VerticalAlignTopOutlined = (VerticalAlignTopOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/VerticalAlignTopOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var VerticalAlignTopOutlined_VerticalAlignTopOutlined = function VerticalAlignTopOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_VerticalAlignTopOutlined
- }));
- };
- /** */
- var VerticalAlignTopOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(VerticalAlignTopOutlined_VerticalAlignTopOutlined);
- if (true) {
- VerticalAlignTopOutlined_RefIcon.displayName = 'VerticalAlignTopOutlined';
- }
- /* harmony default export */ var icons_VerticalAlignTopOutlined = (VerticalAlignTopOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/back-top/style/index.ts
- var back_top_style = __webpack_require__("./components/back-top/style/index.ts");
- ;// ./components/back-top/index.tsx
- const BackTop = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- visibilityHeight = 400,
- target,
- onClick,
- duration = 450
- } = props;
- const [visible, setVisible] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(visibilityHeight === 0);
- const ref = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const getDefaultTarget = () => {
- var _a;
- return ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) || window;
- };
- const handleScroll = _util_throttleByAnimationFrame(e => {
- const scrollTop = _util_getScroll(e.target);
- setVisible(scrollTop >= visibilityHeight);
- });
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('BackTop');
- warning.deprecated(false, 'BackTop', 'FloatButton.BackTop');
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const getTarget = target || getDefaultTarget;
- const container = getTarget();
- handleScroll({
- target: container
- });
- container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);
- return () => {
- handleScroll.cancel();
- container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);
- };
- }, [target]);
- const scrollToTop = e => {
- scrollTo(0, {
- getContainer: target || getDefaultTarget,
- duration
- });
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
- };
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('back-top', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const [wrapCSSVar, hashId, cssVarCls] = (0,back_top_style["default"])(prefixCls);
- const classString = classnames_default()(hashId, cssVarCls, prefixCls, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName);
- // fix https://fb.me/react-unknown-prop
- const divProps = (0,omit["default"])(props, ['prefixCls', 'className', 'rootClassName', 'children', 'visibilityHeight', 'target']);
- const defaultElement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-content`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-icon`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_VerticalAlignTopOutlined, null)));
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, divProps, {
- className: classString,
- onClick: scrollToTop,
- ref: ref
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: visible,
- motionName: `${rootPrefixCls}-fade`
- }, ({
- className: motionClassName
- }) => (0,reactNode.cloneElement)(props.children || defaultElement, ({
- className: cloneCls
- }) => ({
- className: classnames_default()(motionClassName, cloneCls)
- })))));
- };
- if (true) {
- BackTop.displayName = 'BackTop';
- }
- /* harmony default export */ var back_top = (BackTop);
- // EXTERNAL MODULE: ./components/badge/style/index.ts
- var badge_style = __webpack_require__("./components/badge/style/index.ts");
- // EXTERNAL MODULE: ./components/theme/util/genPresetColor.ts
- var genPresetColor = __webpack_require__("./components/theme/util/genPresetColor.ts");
- ;// ./components/badge/style/ribbon.ts
- // ============================== Ribbon ==============================
- const genRibbonStyle = token => {
- const {
- antCls,
- badgeFontHeight,
- marginXS,
- badgeRibbonOffset,
- calc
- } = token;
- const ribbonPrefixCls = `${antCls}-ribbon`;
- const ribbonWrapperPrefixCls = `${antCls}-ribbon-wrapper`;
- const statusRibbonPreset = (0,genPresetColor["default"])(token, (colorKey, {
- darkColor
- }) => ({
- [`&${ribbonPrefixCls}-color-${colorKey}`]: {
- background: darkColor,
- color: darkColor
- }
- }));
- return {
- [ribbonWrapperPrefixCls]: {
- position: 'relative'
- },
- [ribbonPrefixCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), {
- position: 'absolute',
- top: marginXS,
- padding: `0 ${(0,cssinjs.unit)(token.paddingXS)}`,
- color: token.colorPrimary,
- lineHeight: (0,cssinjs.unit)(badgeFontHeight),
- whiteSpace: 'nowrap',
- backgroundColor: token.colorPrimary,
- borderRadius: token.borderRadiusSM,
- [`${ribbonPrefixCls}-text`]: {
- color: token.badgeTextColor
- },
- [`${ribbonPrefixCls}-corner`]: {
- position: 'absolute',
- top: '100%',
- width: badgeRibbonOffset,
- height: badgeRibbonOffset,
- color: 'currentcolor',
- border: `${(0,cssinjs.unit)(calc(badgeRibbonOffset).div(2).equal())} solid`,
- transform: token.badgeRibbonCornerTransform,
- transformOrigin: 'top',
- filter: token.badgeRibbonCornerFilter
- }
- }), statusRibbonPreset), {
- [`&${ribbonPrefixCls}-placement-end`]: {
- insetInlineEnd: calc(badgeRibbonOffset).mul(-1).equal(),
- borderEndEndRadius: 0,
- [`${ribbonPrefixCls}-corner`]: {
- insetInlineEnd: 0,
- borderInlineEndColor: 'transparent',
- borderBlockEndColor: 'transparent'
- }
- },
- [`&${ribbonPrefixCls}-placement-start`]: {
- insetInlineStart: calc(badgeRibbonOffset).mul(-1).equal(),
- borderEndStartRadius: 0,
- [`${ribbonPrefixCls}-corner`]: {
- insetInlineStart: 0,
- borderBlockEndColor: 'transparent',
- borderInlineStartColor: 'transparent'
- }
- },
- // ====================== RTL =======================
- '&-rtl': {
- direction: 'rtl'
- }
- })
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var ribbon = ((0,genStyleUtils.genStyleHooks)(['Badge', 'Ribbon'], token => {
- const badgeToken = (0,badge_style.prepareToken)(token);
- return genRibbonStyle(badgeToken);
- }, badge_style.prepareComponentToken));
- ;// ./components/badge/Ribbon.tsx
- const Ribbon = props => {
- const {
- className,
- prefixCls: customizePrefixCls,
- style,
- color,
- children,
- text,
- placement = 'end',
- rootClassName
- } = props;
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('ribbon', customizePrefixCls);
- const wrapperCls = `${prefixCls}-wrapper`;
- const [wrapCSSVar, hashId, cssVarCls] = ribbon(prefixCls, wrapperCls);
- const colorInPreset = isPresetColor(color, false);
- const ribbonCls = classnames_default()(prefixCls, `${prefixCls}-placement-${placement}`, {
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-color-${color}`]: colorInPreset
- }, className);
- const colorStyle = {};
- const cornerColorStyle = {};
- if (color && !colorInPreset) {
- colorStyle.background = color;
- cornerColorStyle.color = color;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(wrapperCls, rootClassName, hashId, cssVarCls)
- }, children, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(ribbonCls, hashId),
- style: Object.assign(Object.assign({}, colorStyle), style)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-text`
- }, text), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-corner`,
- style: cornerColorStyle
- }))));
- };
- if (true) {
- Ribbon.displayName = 'Ribbon';
- }
- /* harmony default export */ var badge_Ribbon = (Ribbon);
- ;// ./components/badge/SingleNumber.tsx
- const UnitNumber = props => {
- const {
- prefixCls,
- value,
- current,
- offset = 0
- } = props;
- let style;
- if (offset) {
- style = {
- position: 'absolute',
- top: `${offset}00%`,
- left: 0
- };
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: style,
- className: classnames_default()(`${prefixCls}-only-unit`, {
- current
- })
- }, value);
- };
- function getOffset(start, end, unit) {
- let index = start;
- let offset = 0;
- while ((index + 10) % 10 !== end) {
- index += unit;
- offset += unit;
- }
- return offset;
- }
- const SingleNumber = props => {
- const {
- prefixCls,
- count: originCount,
- value: originValue
- } = props;
- const value = Number(originValue);
- const count = Math.abs(originCount);
- const [prevValue, setPrevValue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(value);
- const [prevCount, setPrevCount] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(count);
- // ============================= Events =============================
- const onTransitionEnd = () => {
- setPrevValue(value);
- setPrevCount(count);
- };
- // Fallback if transition events are not supported
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const timer = setTimeout(onTransitionEnd, 1000);
- return () => clearTimeout(timer);
- }, [value]);
- // ============================= Render =============================
- // Render unit list
- let unitNodes;
- let offsetStyle;
- if (prevValue === value || Number.isNaN(value) || Number.isNaN(prevValue)) {
- // Nothing to change
- unitNodes = [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(UnitNumber, Object.assign({}, props, {
- key: value,
- current: true
- }))];
- offsetStyle = {
- transition: 'none'
- };
- } else {
- unitNodes = [];
- // Fill basic number units
- const end = value + 10;
- const unitNumberList = [];
- for (let index = value; index <= end; index += 1) {
- unitNumberList.push(index);
- }
- const unit = prevCount < count ? 1 : -1;
- // Fill with number unit nodes
- const prevIndex = unitNumberList.findIndex(n => n % 10 === prevValue);
- // Cut list
- const cutUnitNumberList = unit < 0 ? unitNumberList.slice(0, prevIndex + 1) : unitNumberList.slice(prevIndex);
- unitNodes = cutUnitNumberList.map((n, index) => {
- const singleUnit = n % 10;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(UnitNumber, Object.assign({}, props, {
- key: n,
- value: singleUnit,
- offset: unit < 0 ? index - prevIndex : index,
- current: index === prevIndex
- }));
- });
- // Calculate container offset value
- offsetStyle = {
- transform: `translateY(${-getOffset(prevValue, value, unit)}00%)`
- };
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-only`,
- style: offsetStyle,
- onTransitionEnd: onTransitionEnd
- }, unitNodes);
- };
- /* harmony default export */ var badge_SingleNumber = (SingleNumber);
- ;// ./components/badge/ScrollNumber.tsx
- var ScrollNumber_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const ScrollNumber = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- count,
- className,
- motionClassName,
- style,
- title,
- show,
- component: Component = 'sup',
- children
- } = props,
- restProps = ScrollNumber_rest(props, ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('scroll-number', customizePrefixCls);
- // ============================ Render ============================
- const newProps = Object.assign(Object.assign({}, restProps), {
- 'data-show': show,
- style,
- className: classnames_default()(prefixCls, className, motionClassName),
- title: title
- });
- // Only integer need motion
- let numberNodes = count;
- if (count && Number(count) % 1 === 0) {
- const numberList = String(count).split('');
- numberNodes = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("bdi", null, numberList.map((num, i) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(badge_SingleNumber, {
- prefixCls: prefixCls,
- count: Number(count),
- value: num,
- // eslint-disable-next-line react/no-array-index-key
- key: numberList.length - i
- }))));
- }
- // allow specify the border
- // mock border-color by box-shadow for compatible with old usage:
- // <Badge count={4} style={{ backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9' }} />
- if (style === null || style === void 0 ? void 0 : style.borderColor) {
- newProps.style = Object.assign(Object.assign({}, style), {
- boxShadow: `0 0 0 1px ${style.borderColor} inset`
- });
- }
- if (children) {
- return (0,reactNode.cloneElement)(children, oriProps => ({
- className: classnames_default()(`${prefixCls}-custom-component`, oriProps === null || oriProps === void 0 ? void 0 : oriProps.className, motionClassName)
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, Object.assign({}, newProps, {
- ref: ref
- }), numberNodes);
- });
- /* harmony default export */ var badge_ScrollNumber = (ScrollNumber);
- ;// ./components/badge/index.tsx
- var badge_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalBadge = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b, _c, _d, _e;
- const {
- prefixCls: customizePrefixCls,
- scrollNumberPrefixCls: customizeScrollNumberPrefixCls,
- children,
- status,
- text,
- color,
- count = null,
- overflowCount = 99,
- dot = false,
- size = 'default',
- title,
- offset,
- style,
- className,
- rootClassName,
- classNames,
- styles,
- showZero = false
- } = props,
- restProps = badge_rest(props, ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "rootClassName", "classNames", "styles", "showZero"]);
- const {
- getPrefixCls,
- direction,
- badge
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('badge', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,badge_style["default"])(prefixCls);
- // ================================ Misc ================================
- const numberedDisplayCount = count > overflowCount ? `${overflowCount}+` : count;
- const isZero = numberedDisplayCount === '0' || numberedDisplayCount === 0 || text === '0' || text === 0;
- const ignoreCount = count === null || isZero && !showZero;
- const hasStatus = (status !== null && status !== undefined || color !== null && color !== undefined) && ignoreCount;
- const hasStatusValue = status !== null && status !== undefined || !isZero;
- const showAsDot = dot && !isZero;
- const mergedCount = showAsDot ? '' : numberedDisplayCount;
- const isHidden = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const isEmpty = (mergedCount === null || mergedCount === undefined || mergedCount === '') && (text === undefined || text === null || text === '');
- return (isEmpty || isZero && !showZero) && !showAsDot;
- }, [mergedCount, isZero, showZero, showAsDot, text]);
- // Count should be cache in case hidden change it
- const countRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(count);
- if (!isHidden) {
- countRef.current = count;
- }
- const livingCount = countRef.current;
- // We need cache count since remove motion should not change count display
- const displayCountRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(mergedCount);
- if (!isHidden) {
- displayCountRef.current = mergedCount;
- }
- const displayCount = displayCountRef.current;
- // We will cache the dot status to avoid shaking on leaved motion
- const isDotRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(showAsDot);
- if (!isHidden) {
- isDotRef.current = showAsDot;
- }
- // =============================== Styles ===============================
- const mergedStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (!offset) {
- return Object.assign(Object.assign({}, badge === null || badge === void 0 ? void 0 : badge.style), style);
- }
- const offsetStyle = {
- marginTop: offset[1]
- };
- if (direction === 'rtl') {
- offsetStyle.left = parseInt(offset[0], 10);
- } else {
- offsetStyle.right = -parseInt(offset[0], 10);
- }
- return Object.assign(Object.assign(Object.assign({}, offsetStyle), badge === null || badge === void 0 ? void 0 : badge.style), style);
- }, [direction, offset, style, badge === null || badge === void 0 ? void 0 : badge.style]);
- // =============================== Render ===============================
- // >>> Title
- const titleNode = title !== null && title !== void 0 ? title : typeof livingCount === 'string' || typeof livingCount === 'number' ? livingCount : undefined;
- // >>> Status Text
- const showStatusTextNode = !isHidden && (text === 0 ? showZero : !!text && text !== true);
- const statusTextNode = !showStatusTextNode ? null : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-status-text`
- }, text));
- // >>> Display Component
- const displayNode = !livingCount || typeof livingCount !== 'object' ? undefined : (0,reactNode.cloneElement)(livingCount, oriProps => ({
- style: Object.assign(Object.assign({}, mergedStyle), oriProps.style)
- }));
- // InternalColor
- const isInternalColor = isPresetColor(color, false);
- // Shared styles
- const statusCls = classnames_default()(classNames === null || classNames === void 0 ? void 0 : classNames.indicator, (_a = badge === null || badge === void 0 ? void 0 : badge.classNames) === null || _a === void 0 ? void 0 : _a.indicator, {
- [`${prefixCls}-status-dot`]: hasStatus,
- [`${prefixCls}-status-${status}`]: !!status,
- [`${prefixCls}-color-${color}`]: isInternalColor
- });
- const statusStyle = {};
- if (color && !isInternalColor) {
- statusStyle.color = color;
- statusStyle.background = color;
- }
- const badgeClassName = classnames_default()(prefixCls, {
- [`${prefixCls}-status`]: hasStatus,
- [`${prefixCls}-not-a-wrapper`]: !children,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, badge === null || badge === void 0 ? void 0 : badge.className, (_b = badge === null || badge === void 0 ? void 0 : badge.classNames) === null || _b === void 0 ? void 0 : _b.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, hashId, cssVarCls);
- // <Badge status="success" />
- if (!children && hasStatus && (text || hasStatusValue || !ignoreCount)) {
- const statusTextColor = mergedStyle.color;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({}, restProps, {
- className: badgeClassName,
- style: Object.assign(Object.assign(Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.root), (_c = badge === null || badge === void 0 ? void 0 : badge.styles) === null || _c === void 0 ? void 0 : _c.root), mergedStyle)
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: statusCls,
- style: Object.assign(Object.assign(Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.indicator), (_d = badge === null || badge === void 0 ? void 0 : badge.styles) === null || _d === void 0 ? void 0 : _d.indicator), statusStyle)
- }), showStatusTextNode && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: {
- color: statusTextColor
- },
- className: `${prefixCls}-status-text`
- }, text))));
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({
- ref: ref
- }, restProps, {
- className: badgeClassName,
- style: Object.assign(Object.assign({}, (_e = badge === null || badge === void 0 ? void 0 : badge.styles) === null || _e === void 0 ? void 0 : _e.root), styles === null || styles === void 0 ? void 0 : styles.root)
- }), children, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: !isHidden,
- motionName: `${prefixCls}-zoom`,
- motionAppear: false,
- motionDeadline: 1000
- }, ({
- className: motionClassName
- }) => {
- var _a, _b;
- const scrollNumberPrefixCls = getPrefixCls('scroll-number', customizeScrollNumberPrefixCls);
- const isDot = isDotRef.current;
- const scrollNumberCls = classnames_default()(classNames === null || classNames === void 0 ? void 0 : classNames.indicator, (_a = badge === null || badge === void 0 ? void 0 : badge.classNames) === null || _a === void 0 ? void 0 : _a.indicator, {
- [`${prefixCls}-dot`]: isDot,
- [`${prefixCls}-count`]: !isDot,
- [`${prefixCls}-count-sm`]: size === 'small',
- [`${prefixCls}-multiple-words`]: !isDot && displayCount && displayCount.toString().length > 1,
- [`${prefixCls}-status-${status}`]: !!status,
- [`${prefixCls}-color-${color}`]: isInternalColor
- });
- let scrollNumberStyle = Object.assign(Object.assign(Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.indicator), (_b = badge === null || badge === void 0 ? void 0 : badge.styles) === null || _b === void 0 ? void 0 : _b.indicator), mergedStyle);
- if (color && !isInternalColor) {
- scrollNumberStyle = scrollNumberStyle || {};
- scrollNumberStyle.background = color;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(badge_ScrollNumber, {
- prefixCls: scrollNumberPrefixCls,
- show: !isHidden,
- motionClassName: motionClassName,
- className: scrollNumberCls,
- count: displayCount,
- title: titleNode,
- style: scrollNumberStyle,
- key: "scrollNumber"
- }, displayNode);
- }), statusTextNode));
- });
- const Badge = InternalBadge;
- Badge.Ribbon = badge_Ribbon;
- if (true) {
- Badge.displayName = 'Badge';
- }
- /* harmony default export */ var components_badge = (Badge);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/LeftOutlined.js
- // This icon file is generated automatically.
- var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
- /* harmony default export */ var asn_LeftOutlined = (LeftOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/LeftOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var LeftOutlined_LeftOutlined = function LeftOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_LeftOutlined
- }));
- };
- /** */
- var LeftOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(LeftOutlined_LeftOutlined);
- if (true) {
- LeftOutlined_RefIcon.displayName = 'LeftOutlined';
- }
- /* harmony default export */ var icons_LeftOutlined = (LeftOutlined_RefIcon);
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules
- var RightOutlined = __webpack_require__("./node_modules/@ant-design/icons/es/icons/RightOutlined.js");
- ;// ./node_modules/rc-dropdown/es/hooks/useAccessibility.js
- var ESC = KeyCode["default"].ESC,
- TAB = KeyCode["default"].TAB;
- function useAccessibility(_ref) {
- var visible = _ref.visible,
- triggerRef = _ref.triggerRef,
- onVisibleChange = _ref.onVisibleChange,
- autoFocus = _ref.autoFocus,
- overlayRef = _ref.overlayRef;
- var focusMenuRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var handleCloseMenuAndReturnFocus = function handleCloseMenuAndReturnFocus() {
- if (visible) {
- var _triggerRef$current, _triggerRef$current$f;
- (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || (_triggerRef$current$f = _triggerRef$current.focus) === null || _triggerRef$current$f === void 0 || _triggerRef$current$f.call(_triggerRef$current);
- onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(false);
- }
- };
- var focusMenu = function focusMenu() {
- var _overlayRef$current;
- if ((_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.focus) {
- overlayRef.current.focus();
- focusMenuRef.current = true;
- return true;
- }
- return false;
- };
- var handleKeyDown = function handleKeyDown(event) {
- switch (event.keyCode) {
- case ESC:
- handleCloseMenuAndReturnFocus();
- break;
- case TAB:
- {
- var focusResult = false;
- if (!focusMenuRef.current) {
- focusResult = focusMenu();
- }
- if (focusResult) {
- event.preventDefault();
- } else {
- handleCloseMenuAndReturnFocus();
- }
- break;
- }
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (visible) {
- window.addEventListener("keydown", handleKeyDown);
- if (autoFocus) {
- // FIXME: hack with raf
- (0,raf["default"])(focusMenu, 3);
- }
- return function () {
- window.removeEventListener("keydown", handleKeyDown);
- focusMenuRef.current = false;
- };
- }
- return function () {
- focusMenuRef.current = false;
- };
- }, [visible]); // eslint-disable-line react-hooks/exhaustive-deps
- }
- ;// ./node_modules/rc-dropdown/es/Overlay.js
- var Overlay_Overlay = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var overlay = props.overlay,
- arrow = props.arrow,
- prefixCls = props.prefixCls;
- var overlayNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var overlayElement;
- if (typeof overlay === 'function') {
- overlayElement = overlay();
- } else {
- overlayElement = overlay;
- }
- return overlayElement;
- }, [overlay]);
- var composedRef = (0,es_ref.composeRef)(ref, (0,es_ref.getNodeRef)(overlayNode));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, arrow && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-arrow")
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(overlayNode, {
- ref: (0,es_ref.supportRef)(overlayNode) ? composedRef : undefined
- }));
- });
- /* harmony default export */ var es_Overlay = (Overlay_Overlay);
- ;// ./node_modules/rc-dropdown/es/placements.js
- var autoAdjustOverflow = {
- adjustX: 1,
- adjustY: 1
- };
- var placements_targetOffset = [0, 0];
- var placements_placements = {
- topLeft: {
- points: ['bl', 'tl'],
- overflow: autoAdjustOverflow,
- offset: [0, -4],
- targetOffset: placements_targetOffset
- },
- top: {
- points: ['bc', 'tc'],
- overflow: autoAdjustOverflow,
- offset: [0, -4],
- targetOffset: placements_targetOffset
- },
- topRight: {
- points: ['br', 'tr'],
- overflow: autoAdjustOverflow,
- offset: [0, -4],
- targetOffset: placements_targetOffset
- },
- bottomLeft: {
- points: ['tl', 'bl'],
- overflow: autoAdjustOverflow,
- offset: [0, 4],
- targetOffset: placements_targetOffset
- },
- bottom: {
- points: ['tc', 'bc'],
- overflow: autoAdjustOverflow,
- offset: [0, 4],
- targetOffset: placements_targetOffset
- },
- bottomRight: {
- points: ['tr', 'br'],
- overflow: autoAdjustOverflow,
- offset: [0, 4],
- targetOffset: placements_targetOffset
- }
- };
- /* harmony default export */ var rc_dropdown_es_placements = (placements_placements);
- ;// ./node_modules/rc-dropdown/es/Dropdown.js
- var Dropdown_excluded = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus", "overlay", "children", "onVisibleChange"];
- function Dropdown(props, ref) {
- var _children$props;
- var _props$arrow = props.arrow,
- arrow = _props$arrow === void 0 ? false : _props$arrow,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-dropdown' : _props$prefixCls,
- transitionName = props.transitionName,
- animation = props.animation,
- align = props.align,
- _props$placement = props.placement,
- placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,
- _props$placements = props.placements,
- placements = _props$placements === void 0 ? rc_dropdown_es_placements : _props$placements,
- getPopupContainer = props.getPopupContainer,
- showAction = props.showAction,
- hideAction = props.hideAction,
- overlayClassName = props.overlayClassName,
- overlayStyle = props.overlayStyle,
- visible = props.visible,
- _props$trigger = props.trigger,
- trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,
- autoFocus = props.autoFocus,
- overlay = props.overlay,
- children = props.children,
- onVisibleChange = props.onVisibleChange,
- otherProps = (0,objectWithoutProperties["default"])(props, Dropdown_excluded);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- triggerVisible = _React$useState2[0],
- setTriggerVisible = _React$useState2[1];
- var mergedVisible = 'visible' in props ? visible : triggerVisible;
- var triggerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var overlayRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var childRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, function () {
- return triggerRef.current;
- });
- var handleVisibleChange = function handleVisibleChange(newVisible) {
- setTriggerVisible(newVisible);
- onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(newVisible);
- };
- useAccessibility({
- visible: mergedVisible,
- triggerRef: childRef,
- onVisibleChange: handleVisibleChange,
- autoFocus: autoFocus,
- overlayRef: overlayRef
- });
- var onClick = function onClick(e) {
- var onOverlayClick = props.onOverlayClick;
- setTriggerVisible(false);
- if (onOverlayClick) {
- onOverlayClick(e);
- }
- };
- var getMenuElement = function getMenuElement() {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Overlay, {
- ref: overlayRef,
- overlay: overlay,
- prefixCls: prefixCls,
- arrow: arrow
- });
- };
- var getMenuElementOrLambda = function getMenuElementOrLambda() {
- if (typeof overlay === 'function') {
- return getMenuElement;
- }
- return getMenuElement();
- };
- var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger() {
- var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger,
- alignPoint = props.alignPoint;
- if ('minOverlayWidthMatchTrigger' in props) {
- return minOverlayWidthMatchTrigger;
- }
- return !alignPoint;
- };
- var getOpenClassName = function getOpenClassName() {
- var openClassName = props.openClassName;
- if (openClassName !== undefined) {
- return openClassName;
- }
- return "".concat(prefixCls, "-open");
- };
- var childrenNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
- className: classnames_default()((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, mergedVisible && getOpenClassName()),
- ref: (0,es_ref.supportRef)(children) ? (0,es_ref.composeRef)(childRef, (0,es_ref.getNodeRef)(children)) : undefined
- });
- var triggerHideAction = hideAction;
- if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {
- triggerHideAction = ['click'];
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger_es, (0,esm_extends["default"])({
- builtinPlacements: placements
- }, otherProps, {
- prefixCls: prefixCls,
- ref: triggerRef,
- popupClassName: classnames_default()(overlayClassName, (0,defineProperty["default"])({}, "".concat(prefixCls, "-show-arrow"), arrow)),
- popupStyle: overlayStyle,
- action: trigger,
- showAction: showAction,
- hideAction: triggerHideAction,
- popupPlacement: placement,
- popupAlign: align,
- popupTransitionName: transitionName,
- popupAnimation: animation,
- popupVisible: mergedVisible,
- stretch: getMinOverlayWidthMatchTrigger() ? 'minWidth' : '',
- popup: getMenuElementOrLambda(),
- onPopupVisibleChange: handleVisibleChange,
- onPopupClick: onClick,
- getPopupContainer: getPopupContainer
- }), childrenNode);
- }
- /* harmony default export */ var es_Dropdown = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Dropdown));
- ;// ./node_modules/rc-dropdown/es/index.js
- /* harmony default export */ var rc_dropdown_es = (es_Dropdown);
- ;// ./components/_util/isPrimitive.ts
- const isPrimitive = value => typeof value !== 'object' && typeof value !== 'function' || value === null;
- /* harmony default export */ var _util_isPrimitive = (isPrimitive);
- ;// ./node_modules/rc-menu/es/context/IdContext.js
- var IdContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- function getMenuId(uuid, eventKey) {
- if (uuid === undefined) {
- return null;
- }
- return "".concat(uuid, "-").concat(eventKey);
- }
- /**
- * Get `data-menu-id`
- */
- function useMenuId(eventKey) {
- var id = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(IdContext);
- return getMenuId(id, eventKey);
- }
- ;// ./node_modules/rc-menu/es/context/MenuContext.js
- var MenuContext_excluded = ["children", "locked"];
- var MenuContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- function MenuContext_mergeProps(origin, target) {
- var clone = (0,objectSpread2["default"])({}, origin);
- Object.keys(target).forEach(function (key) {
- var value = target[key];
- if (value !== undefined) {
- clone[key] = value;
- }
- });
- return clone;
- }
- function InheritableContextProvider(_ref) {
- var children = _ref.children,
- locked = _ref.locked,
- restProps = (0,objectWithoutProperties["default"])(_ref, MenuContext_excluded);
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext);
- var inheritableContext = (0,useMemo["default"])(function () {
- return MenuContext_mergeProps(context, restProps);
- }, [context, restProps], function (prev, next) {
- return !locked && (prev[0] !== next[0] || !(0,isEqual["default"])(prev[1], next[1], true));
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MenuContext.Provider, {
- value: inheritableContext
- }, children);
- }
- ;// ./node_modules/rc-menu/es/context/PathContext.js
- var EmptyList = [];
- // ========================= Path Register =========================
- var PathRegisterContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- function useMeasure() {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PathRegisterContext);
- }
- // ========================= Path Tracker ==========================
- var PathTrackerContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(EmptyList);
- function useFullPath(eventKey) {
- var parentKeyPath = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PathTrackerContext);
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return eventKey !== undefined ? [].concat((0,toConsumableArray["default"])(parentKeyPath), [eventKey]) : parentKeyPath;
- }, [parentKeyPath, eventKey]);
- }
- // =========================== Path User ===========================
- var PathUserContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- ;// ./node_modules/rc-menu/es/context/PrivateContext.js
- var PrivateContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- /* harmony default export */ var context_PrivateContext = (PrivateContext);
- ;// ./node_modules/rc-util/es/Dom/focus.js
- function focusable(node) {
- var includePositive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (isVisible(node)) {
- var nodeName = node.nodeName.toLowerCase();
- var isFocusableElement =
- // Focusable element
- ['input', 'select', 'textarea', 'button'].includes(nodeName) ||
- // Editable element
- node.isContentEditable ||
- // Anchor with href element
- nodeName === 'a' && !!node.getAttribute('href');
- // Get tabIndex
- var tabIndexAttr = node.getAttribute('tabindex');
- var tabIndexNum = Number(tabIndexAttr);
- // Parse as number if validate
- var tabIndex = null;
- if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {
- tabIndex = tabIndexNum;
- } else if (isFocusableElement && tabIndex === null) {
- tabIndex = 0;
- }
- // Block focusable if disabled
- if (isFocusableElement && node.disabled) {
- tabIndex = null;
- }
- return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);
- }
- return false;
- }
- function getFocusNodeList(node) {
- var includePositive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var res = (0,toConsumableArray["default"])(node.querySelectorAll('*')).filter(function (child) {
- return focusable(child, includePositive);
- });
- if (focusable(node, includePositive)) {
- res.unshift(node);
- }
- return res;
- }
- var lastFocusElement = null;
- /** @deprecated Do not use since this may failed when used in async */
- function saveLastFocusNode() {
- lastFocusElement = document.activeElement;
- }
- /** @deprecated Do not use since this may failed when used in async */
- function clearLastFocusNode() {
- lastFocusElement = null;
- }
- /** @deprecated Do not use since this may failed when used in async */
- function backLastFocusNode() {
- if (lastFocusElement) {
- try {
- // 元素可能已经被移动了
- lastFocusElement.focus();
- /* eslint-disable no-empty */
- } catch (e) {
- // empty
- }
- /* eslint-enable no-empty */
- }
- }
- function limitTabRange(node, e) {
- if (e.keyCode === 9) {
- var tabNodeList = getFocusNodeList(node);
- var lastTabNode = tabNodeList[e.shiftKey ? 0 : tabNodeList.length - 1];
- var leavingTab = lastTabNode === document.activeElement || node === document.activeElement;
- if (leavingTab) {
- var target = tabNodeList[e.shiftKey ? tabNodeList.length - 1 : 0];
- target.focus();
- e.preventDefault();
- }
- }
- }
- ;// ./node_modules/rc-menu/es/hooks/useAccessibility.js
- // destruct to reduce minify size
- var LEFT = KeyCode["default"].LEFT,
- RIGHT = KeyCode["default"].RIGHT,
- UP = KeyCode["default"].UP,
- DOWN = KeyCode["default"].DOWN,
- ENTER = KeyCode["default"].ENTER,
- useAccessibility_ESC = KeyCode["default"].ESC,
- HOME = KeyCode["default"].HOME,
- END = KeyCode["default"].END;
- var ArrowKeys = [UP, DOWN, LEFT, RIGHT];
- function useAccessibility_getOffset(mode, isRootLevel, isRtl, which) {
- var _offsets;
- var prev = 'prev';
- var next = 'next';
- var children = 'children';
- var parent = 'parent';
- // Inline enter is special that we use unique operation
- if (mode === 'inline' && which === ENTER) {
- return {
- inlineTrigger: true
- };
- }
- var inline = (0,defineProperty["default"])((0,defineProperty["default"])({}, UP, prev), DOWN, next);
- var horizontal = (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, LEFT, isRtl ? next : prev), RIGHT, isRtl ? prev : next), DOWN, children), ENTER, children);
- var vertical = (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, UP, prev), DOWN, next), ENTER, children), useAccessibility_ESC, parent), LEFT, isRtl ? children : parent), RIGHT, isRtl ? parent : children);
- var offsets = {
- inline: inline,
- horizontal: horizontal,
- vertical: vertical,
- inlineSub: inline,
- horizontalSub: vertical,
- verticalSub: vertical
- };
- var type = (_offsets = offsets["".concat(mode).concat(isRootLevel ? '' : 'Sub')]) === null || _offsets === void 0 ? void 0 : _offsets[which];
- switch (type) {
- case prev:
- return {
- offset: -1,
- sibling: true
- };
- case next:
- return {
- offset: 1,
- sibling: true
- };
- case parent:
- return {
- offset: -1,
- sibling: false
- };
- case children:
- return {
- offset: 1,
- sibling: false
- };
- default:
- return null;
- }
- }
- function findContainerUL(element) {
- var current = element;
- while (current) {
- if (current.getAttribute('data-menu-list')) {
- return current;
- }
- current = current.parentElement;
- }
- // Normally should not reach this line
- /* istanbul ignore next */
- return null;
- }
- /**
- * Find focused element within element set provided
- */
- function getFocusElement(activeElement, elements) {
- var current = activeElement || document.activeElement;
- while (current) {
- if (elements.has(current)) {
- return current;
- }
- current = current.parentElement;
- }
- return null;
- }
- /**
- * Get focusable elements from the element set under provided container
- */
- function getFocusableElements(container, elements) {
- var list = getFocusNodeList(container, true);
- return list.filter(function (ele) {
- return elements.has(ele);
- });
- }
- function getNextFocusElement(parentQueryContainer, elements, focusMenuElement) {
- var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
- // Key on the menu item will not get validate parent container
- if (!parentQueryContainer) {
- return null;
- }
- // List current level menu item elements
- var sameLevelFocusableMenuElementList = getFocusableElements(parentQueryContainer, elements);
- // Find next focus index
- var count = sameLevelFocusableMenuElementList.length;
- var focusIndex = sameLevelFocusableMenuElementList.findIndex(function (ele) {
- return focusMenuElement === ele;
- });
- if (offset < 0) {
- if (focusIndex === -1) {
- focusIndex = count - 1;
- } else {
- focusIndex -= 1;
- }
- } else if (offset > 0) {
- focusIndex += 1;
- }
- focusIndex = (focusIndex + count) % count;
- // Focus menu item
- return sameLevelFocusableMenuElementList[focusIndex];
- }
- var refreshElements = function refreshElements(keys, id) {
- var elements = new Set();
- var key2element = new Map();
- var element2key = new Map();
- keys.forEach(function (key) {
- var element = document.querySelector("[data-menu-id='".concat(getMenuId(id, key), "']"));
- if (element) {
- elements.add(element);
- element2key.set(element, key);
- key2element.set(key, element);
- }
- });
- return {
- elements: elements,
- key2element: key2element,
- element2key: element2key
- };
- };
- function useAccessibility_useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) {
- var rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var activeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- activeRef.current = activeKey;
- var cleanRaf = function cleanRaf() {
- raf["default"].cancel(rafRef.current);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- cleanRaf();
- };
- }, []);
- return function (e) {
- var which = e.which;
- if ([].concat(ArrowKeys, [ENTER, useAccessibility_ESC, HOME, END]).includes(which)) {
- var keys = getKeys();
- var refreshedElements = refreshElements(keys, id);
- var _refreshedElements = refreshedElements,
- elements = _refreshedElements.elements,
- key2element = _refreshedElements.key2element,
- element2key = _refreshedElements.element2key;
- // First we should find current focused MenuItem/SubMenu element
- var activeElement = key2element.get(activeKey);
- var focusMenuElement = getFocusElement(activeElement, elements);
- var focusMenuKey = element2key.get(focusMenuElement);
- var offsetObj = useAccessibility_getOffset(mode, getKeyPath(focusMenuKey, true).length === 1, isRtl, which);
- // Some mode do not have fully arrow operation like inline
- if (!offsetObj && which !== HOME && which !== END) {
- return;
- }
- // Arrow prevent default to avoid page scroll
- if (ArrowKeys.includes(which) || [HOME, END].includes(which)) {
- e.preventDefault();
- }
- var tryFocus = function tryFocus(menuElement) {
- if (menuElement) {
- var focusTargetElement = menuElement;
- // Focus to link instead of menu item if possible
- var link = menuElement.querySelector('a');
- if (link !== null && link !== void 0 && link.getAttribute('href')) {
- focusTargetElement = link;
- }
- var targetKey = element2key.get(menuElement);
- triggerActiveKey(targetKey);
- /**
- * Do not `useEffect` here since `tryFocus` may trigger async
- * which makes React sync update the `activeKey`
- * that force render before `useRef` set the next activeKey
- */
- cleanRaf();
- rafRef.current = (0,raf["default"])(function () {
- if (activeRef.current === targetKey) {
- focusTargetElement.focus();
- }
- });
- }
- };
- if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {
- // ========================== Sibling ==========================
- // Find walkable focus menu element container
- var parentQueryContainer;
- if (!focusMenuElement || mode === 'inline') {
- parentQueryContainer = containerRef.current;
- } else {
- parentQueryContainer = findContainerUL(focusMenuElement);
- }
- // Get next focus element
- var targetElement;
- var focusableElements = getFocusableElements(parentQueryContainer, elements);
- if (which === HOME) {
- targetElement = focusableElements[0];
- } else if (which === END) {
- targetElement = focusableElements[focusableElements.length - 1];
- } else {
- targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);
- }
- // Focus menu item
- tryFocus(targetElement);
- // ======================= InlineTrigger =======================
- } else if (offsetObj.inlineTrigger) {
- // Inline trigger no need switch to sub menu item
- triggerAccessibilityOpen(focusMenuKey);
- // =========================== Level ===========================
- } else if (offsetObj.offset > 0) {
- triggerAccessibilityOpen(focusMenuKey, true);
- cleanRaf();
- rafRef.current = (0,raf["default"])(function () {
- // Async should resync elements
- refreshedElements = refreshElements(keys, id);
- var controlId = focusMenuElement.getAttribute('aria-controls');
- var subQueryContainer = document.getElementById(controlId);
- // Get sub focusable menu item
- var targetElement = getNextFocusElement(subQueryContainer, refreshedElements.elements);
- // Focus menu item
- tryFocus(targetElement);
- }, 5);
- } else if (offsetObj.offset < 0) {
- var keyPath = getKeyPath(focusMenuKey, true);
- var parentKey = keyPath[keyPath.length - 2];
- var parentMenuElement = key2element.get(parentKey);
- // Focus menu item
- triggerAccessibilityOpen(parentKey, false);
- tryFocus(parentMenuElement);
- }
- }
- // Pass origin key down event
- originOnKeyDown === null || originOnKeyDown === void 0 || originOnKeyDown(e);
- };
- }
- ;// ./node_modules/rc-menu/es/utils/timeUtil.js
- function nextSlice(callback) {
- /* istanbul ignore next */
- Promise.resolve().then(callback);
- }
- ;// ./node_modules/rc-menu/es/hooks/useKeyRecords.js
- var PATH_SPLIT = '__RC_UTIL_PATH_SPLIT__';
- var getPathStr = function getPathStr(keyPath) {
- return keyPath.join(PATH_SPLIT);
- };
- var getPathKeys = function getPathKeys(keyPathStr) {
- return keyPathStr.split(PATH_SPLIT);
- };
- var OVERFLOW_KEY = 'rc-menu-more';
- function useKeyRecords() {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- internalForceUpdate = _React$useState2[1];
- var key2pathRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(new Map());
- var path2keyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(new Map());
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- overflowKeys = _React$useState4[0],
- setOverflowKeys = _React$useState4[1];
- var updateRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var destroyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var forceUpdate = function forceUpdate() {
- if (!destroyRef.current) {
- internalForceUpdate({});
- }
- };
- var registerPath = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (key, keyPath) {
- // Warning for invalidate or duplicated `key`
- if (true) {
- (0,warning["default"])(!key2pathRef.current.has(key), "Duplicated key '".concat(key, "' used in Menu by path [").concat(keyPath.join(' > '), "]"));
- }
- // Fill map
- var connectedPath = getPathStr(keyPath);
- path2keyRef.current.set(connectedPath, key);
- key2pathRef.current.set(key, connectedPath);
- updateRef.current += 1;
- var id = updateRef.current;
- nextSlice(function () {
- if (id === updateRef.current) {
- forceUpdate();
- }
- });
- }, []);
- var unregisterPath = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (key, keyPath) {
- var connectedPath = getPathStr(keyPath);
- path2keyRef.current.delete(connectedPath);
- key2pathRef.current.delete(key);
- }, []);
- var refreshOverflowKeys = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (keys) {
- setOverflowKeys(keys);
- }, []);
- var getKeyPath = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (eventKey, includeOverflow) {
- var fullPath = key2pathRef.current.get(eventKey) || '';
- var keys = getPathKeys(fullPath);
- if (includeOverflow && overflowKeys.includes(keys[0])) {
- keys.unshift(OVERFLOW_KEY);
- }
- return keys;
- }, [overflowKeys]);
- var isSubPathKey = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (pathKeys, eventKey) {
- return pathKeys.filter(function (item) {
- return item !== undefined;
- }).some(function (pathKey) {
- var pathKeyList = getKeyPath(pathKey, true);
- return pathKeyList.includes(eventKey);
- });
- }, [getKeyPath]);
- var getKeys = function getKeys() {
- var keys = (0,toConsumableArray["default"])(key2pathRef.current.keys());
- if (overflowKeys.length) {
- keys.push(OVERFLOW_KEY);
- }
- return keys;
- };
- /**
- * Find current key related child path keys
- */
- var getSubPathKeys = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (key) {
- var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT);
- var pathKeys = new Set();
- (0,toConsumableArray["default"])(path2keyRef.current.keys()).forEach(function (pathKey) {
- if (pathKey.startsWith(connectedPath)) {
- pathKeys.add(path2keyRef.current.get(pathKey));
- }
- });
- return pathKeys;
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- destroyRef.current = true;
- };
- }, []);
- return {
- // Register
- registerPath: registerPath,
- unregisterPath: unregisterPath,
- refreshOverflowKeys: refreshOverflowKeys,
- // Util
- isSubPathKey: isSubPathKey,
- getKeyPath: getKeyPath,
- getKeys: getKeys,
- getSubPathKeys: getSubPathKeys
- };
- }
- ;// ./node_modules/rc-menu/es/hooks/useMemoCallback.js
- /**
- * Cache callback function that always return same ref instead.
- * This is used for context optimization.
- */
- function useMemoCallback(func) {
- var funRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(func);
- funRef.current = func;
- var callback = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function () {
- var _funRef$current;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return (_funRef$current = funRef.current) === null || _funRef$current === void 0 ? void 0 : _funRef$current.call.apply(_funRef$current, [funRef].concat(args));
- }, []);
- return func ? callback : undefined;
- }
- ;// ./node_modules/rc-menu/es/hooks/useUUID.js
- var uniquePrefix = Math.random().toFixed(5).toString().slice(2);
- var internalId = 0;
- function useUUID(id) {
- var _useMergedState = (0,useMergedState["default"])(id, {
- value: id
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- uuid = _useMergedState2[0],
- setUUID = _useMergedState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- internalId += 1;
- var newId = false ? 0 : "".concat(uniquePrefix, "-").concat(internalId);
- setUUID("rc-menu-uuid-".concat(newId));
- }, []);
- return uuid;
- }
- ;// ./node_modules/rc-menu/es/hooks/useActive.js
- function useActive(eventKey, disabled, onMouseEnter, onMouseLeave) {
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- activeKey = _React$useContext.activeKey,
- onActive = _React$useContext.onActive,
- onInactive = _React$useContext.onInactive;
- var ret = {
- active: activeKey === eventKey
- };
- // Skip when disabled
- if (!disabled) {
- ret.onMouseEnter = function (domEvent) {
- onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
- key: eventKey,
- domEvent: domEvent
- });
- onActive(eventKey);
- };
- ret.onMouseLeave = function (domEvent) {
- onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({
- key: eventKey,
- domEvent: domEvent
- });
- onInactive(eventKey);
- };
- }
- return ret;
- }
- ;// ./node_modules/rc-menu/es/hooks/useDirectionStyle.js
- function useDirectionStyle(level) {
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- mode = _React$useContext.mode,
- rtl = _React$useContext.rtl,
- inlineIndent = _React$useContext.inlineIndent;
- if (mode !== 'inline') {
- return null;
- }
- var len = level;
- return rtl ? {
- paddingRight: len * inlineIndent
- } : {
- paddingLeft: len * inlineIndent
- };
- }
- ;// ./node_modules/rc-menu/es/Icon.js
- function Icon(_ref) {
- var icon = _ref.icon,
- props = _ref.props,
- children = _ref.children;
- var iconNode;
- if (icon === null || icon === false) {
- return null;
- }
- if (typeof icon === 'function') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icon, (0,objectSpread2["default"])({}, props));
- } else if (typeof icon !== "boolean") {
- // Compatible for origin definition
- iconNode = icon;
- }
- return iconNode || children || null;
- }
- ;// ./node_modules/rc-menu/es/utils/warnUtil.js
- var warnUtil_excluded = ["item"];
- /**
- * `onClick` event return `info.item` which point to react node directly.
- * We should warning this since it will not work on FC.
- */
- function warnItemProp(_ref) {
- var item = _ref.item,
- restInfo = (0,objectWithoutProperties["default"])(_ref, warnUtil_excluded);
- Object.defineProperty(restInfo, 'item', {
- get: function get() {
- (0,warning["default"])(false, '`info.item` is deprecated since we will move to function component that not provides React Node instance in future.');
- return item;
- }
- });
- return restInfo;
- }
- ;// ./node_modules/rc-menu/es/MenuItem.js
- var MenuItem_excluded = ["title", "attribute", "elementRef"],
- MenuItem_excluded2 = ["style", "className", "eventKey", "warnKey", "disabled", "itemIcon", "children", "role", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "onFocus"],
- MenuItem_excluded3 = ["active"];
- // Since Menu event provide the `info.item` which point to the MenuItem node instance.
- // We have to use class component here.
- // This should be removed from doc & api in future.
- var LegacyMenuItem = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(LegacyMenuItem, _React$Component);
- var _super = (0,createSuper["default"])(LegacyMenuItem);
- function LegacyMenuItem() {
- (0,classCallCheck["default"])(this, LegacyMenuItem);
- return _super.apply(this, arguments);
- }
- (0,createClass["default"])(LegacyMenuItem, [{
- key: "render",
- value: function render() {
- var _this$props = this.props,
- title = _this$props.title,
- attribute = _this$props.attribute,
- elementRef = _this$props.elementRef,
- restProps = (0,objectWithoutProperties["default"])(_this$props, MenuItem_excluded);
- // Here the props are eventually passed to the DOM element.
- // React does not recognize non-standard attributes.
- // Therefore, remove the props that is not used here.
- // ref: https://github.com/ant-design/ant-design/issues/41395
- var passedProps = (0,omit["default"])(restProps, ['eventKey', 'popupClassName', 'popupOffset', 'onTitleClick']);
- (0,warning["default"])(!attribute, '`attribute` of Menu.Item is deprecated. Please pass attribute directly.');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_overflow_es.Item, (0,esm_extends["default"])({}, attribute, {
- title: typeof title === 'string' ? title : undefined
- }, passedProps, {
- ref: elementRef
- }));
- }
- }]);
- return LegacyMenuItem;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- /**
- * Real Menu Item component
- */
- var InternalMenuItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var style = props.style,
- className = props.className,
- eventKey = props.eventKey,
- warnKey = props.warnKey,
- disabled = props.disabled,
- itemIcon = props.itemIcon,
- children = props.children,
- role = props.role,
- onMouseEnter = props.onMouseEnter,
- onMouseLeave = props.onMouseLeave,
- onClick = props.onClick,
- onKeyDown = props.onKeyDown,
- onFocus = props.onFocus,
- restProps = (0,objectWithoutProperties["default"])(props, MenuItem_excluded2);
- var domDataId = useMenuId(eventKey);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls,
- onItemClick = _React$useContext.onItemClick,
- contextDisabled = _React$useContext.disabled,
- overflowDisabled = _React$useContext.overflowDisabled,
- contextItemIcon = _React$useContext.itemIcon,
- selectedKeys = _React$useContext.selectedKeys,
- onActive = _React$useContext.onActive;
- var _React$useContext2 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_PrivateContext),
- _internalRenderMenuItem = _React$useContext2._internalRenderMenuItem;
- var itemCls = "".concat(prefixCls, "-item");
- var legacyMenuItemRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var elementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var mergedDisabled = contextDisabled || disabled;
- var mergedEleRef = (0,es_ref.useComposeRef)(ref, elementRef);
- var connectedKeys = useFullPath(eventKey);
- // ================================ Warn ================================
- if ( true && warnKey) {
- (0,warning["default"])(false, 'MenuItem should not leave undefined `key`.');
- }
- // ============================= Info =============================
- var getEventInfo = function getEventInfo(e) {
- return {
- key: eventKey,
- // Note: For legacy code is reversed which not like other antd component
- keyPath: (0,toConsumableArray["default"])(connectedKeys).reverse(),
- item: legacyMenuItemRef.current,
- domEvent: e
- };
- };
- // ============================= Icon =============================
- var mergedItemIcon = itemIcon || contextItemIcon;
- // ============================ Active ============================
- var _useActive = useActive(eventKey, mergedDisabled, onMouseEnter, onMouseLeave),
- active = _useActive.active,
- activeProps = (0,objectWithoutProperties["default"])(_useActive, MenuItem_excluded3);
- // ============================ Select ============================
- var selected = selectedKeys.includes(eventKey);
- // ======================== DirectionStyle ========================
- var directionStyle = useDirectionStyle(connectedKeys.length);
- // ============================ Events ============================
- var onInternalClick = function onInternalClick(e) {
- if (mergedDisabled) {
- return;
- }
- var info = getEventInfo(e);
- onClick === null || onClick === void 0 || onClick(warnItemProp(info));
- onItemClick(info);
- };
- var onInternalKeyDown = function onInternalKeyDown(e) {
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
- if (e.which === KeyCode["default"].ENTER) {
- var info = getEventInfo(e);
- // Legacy. Key will also trigger click event
- onClick === null || onClick === void 0 || onClick(warnItemProp(info));
- onItemClick(info);
- }
- };
- /**
- * Used for accessibility. Helper will focus element without key board.
- * We should manually trigger an active
- */
- var onInternalFocus = function onInternalFocus(e) {
- onActive(eventKey);
- onFocus === null || onFocus === void 0 || onFocus(e);
- };
- // ============================ Render ============================
- var optionRoleProps = {};
- if (props.role === 'option') {
- optionRoleProps['aria-selected'] = selected;
- }
- var renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(LegacyMenuItem, (0,esm_extends["default"])({
- ref: legacyMenuItemRef,
- elementRef: mergedEleRef,
- role: role === null ? 'none' : role || 'menuitem',
- tabIndex: disabled ? null : -1,
- "data-menu-id": overflowDisabled && domDataId ? null : domDataId
- }, (0,omit["default"])(restProps, ['extra']), activeProps, optionRoleProps, {
- component: "li",
- "aria-disabled": disabled,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, directionStyle), style),
- className: classnames_default()(itemCls, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(itemCls, "-active"), active), "".concat(itemCls, "-selected"), selected), "".concat(itemCls, "-disabled"), mergedDisabled), className),
- onClick: onInternalClick,
- onKeyDown: onInternalKeyDown,
- onFocus: onInternalFocus
- }), children, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon, {
- props: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- isSelected: selected
- }),
- icon: mergedItemIcon
- }));
- if (_internalRenderMenuItem) {
- renderNode = _internalRenderMenuItem(renderNode, props, {
- selected: selected
- });
- }
- return renderNode;
- });
- function MenuItem(props, ref) {
- var eventKey = props.eventKey;
- // ==================== Record KeyPath ====================
- var measure = useMeasure();
- var connectedKeyPath = useFullPath(eventKey);
- // eslint-disable-next-line consistent-return
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (measure) {
- measure.registerPath(eventKey, connectedKeyPath);
- return function () {
- measure.unregisterPath(eventKey, connectedKeyPath);
- };
- }
- }, [connectedKeyPath]);
- if (measure) {
- return null;
- }
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalMenuItem, (0,esm_extends["default"])({}, props, {
- ref: ref
- }));
- }
- /* harmony default export */ var es_MenuItem = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(MenuItem));
- ;// ./node_modules/rc-menu/es/SubMenu/SubMenuList.js
- var SubMenuList_excluded = ["className", "children"];
- var InternalSubMenuList = function InternalSubMenuList(_ref, ref) {
- var className = _ref.className,
- children = _ref.children,
- restProps = (0,objectWithoutProperties["default"])(_ref, SubMenuList_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls,
- mode = _React$useContext.mode,
- rtl = _React$useContext.rtl;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", (0,esm_extends["default"])({
- className: classnames_default()(prefixCls, rtl && "".concat(prefixCls, "-rtl"), "".concat(prefixCls, "-sub"), "".concat(prefixCls, "-").concat(mode === 'inline' ? 'inline' : 'vertical'), className),
- role: "menu"
- }, restProps, {
- "data-menu-list": true,
- ref: ref
- }), children);
- };
- var SubMenuList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalSubMenuList);
- SubMenuList.displayName = 'SubMenuList';
- /* harmony default export */ var SubMenu_SubMenuList = (SubMenuList);
- ;// ./node_modules/rc-menu/es/utils/commonUtil.js
- function parseChildren(children, keyPath) {
- return (0,toArray["default"])(children).map(function (child, index) {
- if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child)) {
- var _eventKey, _child$props;
- var key = child.key;
- var eventKey = (_eventKey = (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.eventKey) !== null && _eventKey !== void 0 ? _eventKey : key;
- var emptyKey = eventKey === null || eventKey === undefined;
- if (emptyKey) {
- eventKey = "tmp_key-".concat([].concat((0,toConsumableArray["default"])(keyPath), [index]).join('-'));
- }
- var cloneProps = {
- key: eventKey,
- eventKey: eventKey
- };
- if ( true && emptyKey) {
- cloneProps.warnKey = true;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(child, cloneProps);
- }
- return child;
- });
- }
- ;// ./node_modules/rc-menu/es/placements.js
- var placements_autoAdjustOverflow = {
- adjustX: 1,
- adjustY: 1
- };
- var es_placements_placements = {
- topLeft: {
- points: ['bl', 'tl'],
- overflow: placements_autoAdjustOverflow
- },
- topRight: {
- points: ['br', 'tr'],
- overflow: placements_autoAdjustOverflow
- },
- bottomLeft: {
- points: ['tl', 'bl'],
- overflow: placements_autoAdjustOverflow
- },
- bottomRight: {
- points: ['tr', 'br'],
- overflow: placements_autoAdjustOverflow
- },
- leftTop: {
- points: ['tr', 'tl'],
- overflow: placements_autoAdjustOverflow
- },
- leftBottom: {
- points: ['br', 'bl'],
- overflow: placements_autoAdjustOverflow
- },
- rightTop: {
- points: ['tl', 'tr'],
- overflow: placements_autoAdjustOverflow
- },
- rightBottom: {
- points: ['bl', 'br'],
- overflow: placements_autoAdjustOverflow
- }
- };
- var placementsRtl = {
- topLeft: {
- points: ['bl', 'tl'],
- overflow: placements_autoAdjustOverflow
- },
- topRight: {
- points: ['br', 'tr'],
- overflow: placements_autoAdjustOverflow
- },
- bottomLeft: {
- points: ['tl', 'bl'],
- overflow: placements_autoAdjustOverflow
- },
- bottomRight: {
- points: ['tr', 'br'],
- overflow: placements_autoAdjustOverflow
- },
- rightTop: {
- points: ['tr', 'tl'],
- overflow: placements_autoAdjustOverflow
- },
- rightBottom: {
- points: ['br', 'bl'],
- overflow: placements_autoAdjustOverflow
- },
- leftTop: {
- points: ['tl', 'tr'],
- overflow: placements_autoAdjustOverflow
- },
- leftBottom: {
- points: ['bl', 'br'],
- overflow: placements_autoAdjustOverflow
- }
- };
- /* harmony default export */ var rc_menu_es_placements = (es_placements_placements);
- ;// ./node_modules/rc-menu/es/utils/motionUtil.js
- function motionUtil_getMotion(mode, motion, defaultMotions) {
- if (motion) {
- return motion;
- }
- if (defaultMotions) {
- return defaultMotions[mode] || defaultMotions.other;
- }
- return undefined;
- }
- ;// ./node_modules/rc-menu/es/SubMenu/PopupTrigger.js
- var popupPlacementMap = {
- horizontal: 'bottomLeft',
- vertical: 'rightTop',
- 'vertical-left': 'rightTop',
- 'vertical-right': 'leftTop'
- };
- function PopupTrigger(_ref) {
- var prefixCls = _ref.prefixCls,
- visible = _ref.visible,
- children = _ref.children,
- popup = _ref.popup,
- popupStyle = _ref.popupStyle,
- popupClassName = _ref.popupClassName,
- popupOffset = _ref.popupOffset,
- disabled = _ref.disabled,
- mode = _ref.mode,
- onVisibleChange = _ref.onVisibleChange;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- getPopupContainer = _React$useContext.getPopupContainer,
- rtl = _React$useContext.rtl,
- subMenuOpenDelay = _React$useContext.subMenuOpenDelay,
- subMenuCloseDelay = _React$useContext.subMenuCloseDelay,
- builtinPlacements = _React$useContext.builtinPlacements,
- triggerSubMenuAction = _React$useContext.triggerSubMenuAction,
- forceSubMenuRender = _React$useContext.forceSubMenuRender,
- rootClassName = _React$useContext.rootClassName,
- motion = _React$useContext.motion,
- defaultMotions = _React$useContext.defaultMotions;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- innerVisible = _React$useState2[0],
- setInnerVisible = _React$useState2[1];
- var placement = rtl ? (0,objectSpread2["default"])((0,objectSpread2["default"])({}, placementsRtl), builtinPlacements) : (0,objectSpread2["default"])((0,objectSpread2["default"])({}, es_placements_placements), builtinPlacements);
- var popupPlacement = popupPlacementMap[mode];
- var targetMotion = motionUtil_getMotion(mode, motion, defaultMotions);
- var targetMotionRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(targetMotion);
- if (mode !== 'inline') {
- /**
- * PopupTrigger is only used for vertical and horizontal types.
- * When collapsed is unfolded, the inline animation will destroy the vertical animation.
- */
- targetMotionRef.current = targetMotion;
- }
- var mergedMotion = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, targetMotionRef.current), {}, {
- leavedClassName: "".concat(prefixCls, "-hidden"),
- removeOnLeave: false,
- motionAppear: true
- });
- // Delay to change visible
- var visibleRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- visibleRef.current = (0,raf["default"])(function () {
- setInnerVisible(visible);
- });
- return function () {
- raf["default"].cancel(visibleRef.current);
- };
- }, [visible]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, {
- prefixCls: prefixCls,
- popupClassName: classnames_default()("".concat(prefixCls, "-popup"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-rtl"), rtl), popupClassName, rootClassName),
- stretch: mode === 'horizontal' ? 'minWidth' : null,
- getPopupContainer: getPopupContainer,
- builtinPlacements: placement,
- popupPlacement: popupPlacement,
- popupVisible: innerVisible,
- popup: popup,
- popupStyle: popupStyle,
- popupAlign: popupOffset && {
- offset: popupOffset
- },
- action: disabled ? [] : [triggerSubMenuAction],
- mouseEnterDelay: subMenuOpenDelay,
- mouseLeaveDelay: subMenuCloseDelay,
- onPopupVisibleChange: onVisibleChange,
- forceRender: forceSubMenuRender,
- popupMotion: mergedMotion,
- fresh: true
- }, children);
- }
- ;// ./node_modules/rc-menu/es/SubMenu/InlineSubMenuList.js
- function InlineSubMenuList(_ref) {
- var id = _ref.id,
- open = _ref.open,
- keyPath = _ref.keyPath,
- children = _ref.children;
- var fixedMode = 'inline';
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls,
- forceSubMenuRender = _React$useContext.forceSubMenuRender,
- motion = _React$useContext.motion,
- defaultMotions = _React$useContext.defaultMotions,
- mode = _React$useContext.mode;
- // Always use latest mode check
- var sameModeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- sameModeRef.current = mode === fixedMode;
- // We record `destroy` mark here since when mode change from `inline` to others.
- // The inline list should remove when motion end.
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(!sameModeRef.current),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- destroy = _React$useState2[0],
- setDestroy = _React$useState2[1];
- var mergedOpen = sameModeRef.current ? open : false;
- // ================================= Effect =================================
- // Reset destroy state when mode change back
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (sameModeRef.current) {
- setDestroy(false);
- }
- }, [mode]);
- // ================================= Render =================================
- var mergedMotion = (0,objectSpread2["default"])({}, motionUtil_getMotion(fixedMode, motion, defaultMotions));
- // No need appear since nest inlineCollapse changed
- if (keyPath.length > 1) {
- mergedMotion.motionAppear = false;
- }
- // Hide inline list when mode changed and motion end
- var originOnVisibleChanged = mergedMotion.onVisibleChanged;
- mergedMotion.onVisibleChanged = function (newVisible) {
- if (!sameModeRef.current && !newVisible) {
- setDestroy(true);
- }
- return originOnVisibleChanged === null || originOnVisibleChanged === void 0 ? void 0 : originOnVisibleChanged(newVisible);
- };
- if (destroy) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InheritableContextProvider, {
- mode: fixedMode,
- locked: !sameModeRef.current
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- visible: mergedOpen
- }, mergedMotion, {
- forceRender: forceSubMenuRender,
- removeOnLeave: false,
- leavedClassName: "".concat(prefixCls, "-hidden")
- }), function (_ref2) {
- var motionClassName = _ref2.className,
- motionStyle = _ref2.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SubMenu_SubMenuList, {
- id: id,
- className: motionClassName,
- style: motionStyle
- }, children);
- }));
- }
- ;// ./node_modules/rc-menu/es/SubMenu/index.js
- var SubMenu_excluded = ["style", "className", "title", "eventKey", "warnKey", "disabled", "internalPopupClose", "children", "itemIcon", "expandIcon", "popupClassName", "popupOffset", "popupStyle", "onClick", "onMouseEnter", "onMouseLeave", "onTitleClick", "onTitleMouseEnter", "onTitleMouseLeave"],
- SubMenu_excluded2 = ["active"];
- var InternalSubMenu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var style = props.style,
- className = props.className,
- title = props.title,
- eventKey = props.eventKey,
- warnKey = props.warnKey,
- disabled = props.disabled,
- internalPopupClose = props.internalPopupClose,
- children = props.children,
- itemIcon = props.itemIcon,
- expandIcon = props.expandIcon,
- popupClassName = props.popupClassName,
- popupOffset = props.popupOffset,
- popupStyle = props.popupStyle,
- onClick = props.onClick,
- onMouseEnter = props.onMouseEnter,
- onMouseLeave = props.onMouseLeave,
- onTitleClick = props.onTitleClick,
- onTitleMouseEnter = props.onTitleMouseEnter,
- onTitleMouseLeave = props.onTitleMouseLeave,
- restProps = (0,objectWithoutProperties["default"])(props, SubMenu_excluded);
- var domDataId = useMenuId(eventKey);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls,
- mode = _React$useContext.mode,
- openKeys = _React$useContext.openKeys,
- contextDisabled = _React$useContext.disabled,
- overflowDisabled = _React$useContext.overflowDisabled,
- activeKey = _React$useContext.activeKey,
- selectedKeys = _React$useContext.selectedKeys,
- contextItemIcon = _React$useContext.itemIcon,
- contextExpandIcon = _React$useContext.expandIcon,
- onItemClick = _React$useContext.onItemClick,
- onOpenChange = _React$useContext.onOpenChange,
- onActive = _React$useContext.onActive;
- var _React$useContext2 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_PrivateContext),
- _internalRenderSubMenuItem = _React$useContext2._internalRenderSubMenuItem;
- var _React$useContext3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PathUserContext),
- isSubPathKey = _React$useContext3.isSubPathKey;
- var connectedPath = useFullPath();
- var subMenuPrefixCls = "".concat(prefixCls, "-submenu");
- var mergedDisabled = contextDisabled || disabled;
- var elementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var popupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- // ================================ Warn ================================
- if ( true && warnKey) {
- (0,warning["default"])(false, 'SubMenu should not leave undefined `key`.');
- }
- // ================================ Icon ================================
- var mergedItemIcon = itemIcon !== null && itemIcon !== void 0 ? itemIcon : contextItemIcon;
- var mergedExpandIcon = expandIcon !== null && expandIcon !== void 0 ? expandIcon : contextExpandIcon;
- // ================================ Open ================================
- var originOpen = openKeys.includes(eventKey);
- var open = !overflowDisabled && originOpen;
- // =============================== Select ===============================
- var childrenSelected = isSubPathKey(selectedKeys, eventKey);
- // =============================== Active ===============================
- var _useActive = useActive(eventKey, mergedDisabled, onTitleMouseEnter, onTitleMouseLeave),
- active = _useActive.active,
- activeProps = (0,objectWithoutProperties["default"])(_useActive, SubMenu_excluded2);
- // Fallback of active check to avoid hover on menu title or disabled item
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- childrenActive = _React$useState2[0],
- setChildrenActive = _React$useState2[1];
- var triggerChildrenActive = function triggerChildrenActive(newActive) {
- if (!mergedDisabled) {
- setChildrenActive(newActive);
- }
- };
- var onInternalMouseEnter = function onInternalMouseEnter(domEvent) {
- triggerChildrenActive(true);
- onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
- key: eventKey,
- domEvent: domEvent
- });
- };
- var onInternalMouseLeave = function onInternalMouseLeave(domEvent) {
- triggerChildrenActive(false);
- onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({
- key: eventKey,
- domEvent: domEvent
- });
- };
- var mergedActive = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (active) {
- return active;
- }
- if (mode !== 'inline') {
- return childrenActive || isSubPathKey([activeKey], eventKey);
- }
- return false;
- }, [mode, active, activeKey, childrenActive, eventKey, isSubPathKey]);
- // ========================== DirectionStyle ==========================
- var directionStyle = useDirectionStyle(connectedPath.length);
- // =============================== Events ===============================
- // >>>> Title click
- var onInternalTitleClick = function onInternalTitleClick(e) {
- // Skip if disabled
- if (mergedDisabled) {
- return;
- }
- onTitleClick === null || onTitleClick === void 0 || onTitleClick({
- key: eventKey,
- domEvent: e
- });
- // Trigger open by click when mode is `inline`
- if (mode === 'inline') {
- onOpenChange(eventKey, !originOpen);
- }
- };
- // >>>> Context for children click
- var onMergedItemClick = useMemoCallback(function (info) {
- onClick === null || onClick === void 0 || onClick(warnItemProp(info));
- onItemClick(info);
- });
- // >>>>> Visible change
- var onPopupVisibleChange = function onPopupVisibleChange(newVisible) {
- if (mode !== 'inline') {
- onOpenChange(eventKey, newVisible);
- }
- };
- /**
- * Used for accessibility. Helper will focus element without key board.
- * We should manually trigger an active
- */
- var onInternalFocus = function onInternalFocus() {
- onActive(eventKey);
- };
- // =============================== Render ===============================
- var popupId = domDataId && "".concat(domDataId, "-popup");
- var expandIconNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon, {
- icon: mode !== 'horizontal' ? mergedExpandIcon : undefined,
- props: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- isOpen: open,
- // [Legacy] Not sure why need this mark
- isSubMenu: true
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("i", {
- className: "".concat(subMenuPrefixCls, "-arrow")
- }));
- }, [mode, mergedExpandIcon, props, open, subMenuPrefixCls]);
- // >>>>> Title
- var titleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- role: "menuitem",
- style: directionStyle,
- className: "".concat(subMenuPrefixCls, "-title"),
- tabIndex: mergedDisabled ? null : -1,
- ref: elementRef,
- title: typeof title === 'string' ? title : null,
- "data-menu-id": overflowDisabled && domDataId ? null : domDataId,
- "aria-expanded": open,
- "aria-haspopup": true,
- "aria-controls": popupId,
- "aria-disabled": mergedDisabled,
- onClick: onInternalTitleClick,
- onFocus: onInternalFocus
- }, activeProps), title, expandIconNode);
- // Cache mode if it change to `inline` which do not have popup motion
- var triggerModeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(mode);
- if (mode !== 'inline' && connectedPath.length > 1) {
- triggerModeRef.current = 'vertical';
- } else {
- triggerModeRef.current = mode;
- }
- if (!overflowDisabled) {
- var triggerMode = triggerModeRef.current;
- // Still wrap with Trigger here since we need avoid react re-mount dom node
- // Which makes motion failed
- titleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PopupTrigger, {
- mode: triggerMode,
- prefixCls: subMenuPrefixCls,
- visible: !internalPopupClose && open && mode !== 'inline',
- popupClassName: popupClassName,
- popupOffset: popupOffset,
- popupStyle: popupStyle,
- popup: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InheritableContextProvider
- // Special handle of horizontal mode
- , {
- mode: triggerMode === 'horizontal' ? 'vertical' : triggerMode
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SubMenu_SubMenuList, {
- id: popupId,
- ref: popupRef
- }, children)),
- disabled: mergedDisabled,
- onVisibleChange: onPopupVisibleChange
- }, titleNode);
- }
- // >>>>> List node
- var listNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_overflow_es.Item, (0,esm_extends["default"])({
- ref: ref,
- role: "none"
- }, restProps, {
- component: "li",
- style: style,
- className: classnames_default()(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(subMenuPrefixCls, "-open"), open), "".concat(subMenuPrefixCls, "-active"), mergedActive), "".concat(subMenuPrefixCls, "-selected"), childrenSelected), "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled)),
- onMouseEnter: onInternalMouseEnter,
- onMouseLeave: onInternalMouseLeave
- }), titleNode, !overflowDisabled && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InlineSubMenuList, {
- id: popupId,
- open: open,
- keyPath: connectedPath
- }, children));
- if (_internalRenderSubMenuItem) {
- listNode = _internalRenderSubMenuItem(listNode, props, {
- selected: childrenSelected,
- active: mergedActive,
- open: open,
- disabled: mergedDisabled
- });
- }
- // >>>>> Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InheritableContextProvider, {
- onItemClick: onMergedItemClick,
- mode: mode === 'horizontal' ? 'vertical' : mode,
- itemIcon: mergedItemIcon,
- expandIcon: mergedExpandIcon
- }, listNode);
- });
- var SubMenu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var eventKey = props.eventKey,
- children = props.children;
- var connectedKeyPath = useFullPath(eventKey);
- var childList = parseChildren(children, connectedKeyPath);
- // ==================== Record KeyPath ====================
- var measure = useMeasure();
- // eslint-disable-next-line consistent-return
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (measure) {
- measure.registerPath(eventKey, connectedKeyPath);
- return function () {
- measure.unregisterPath(eventKey, connectedKeyPath);
- };
- }
- }, [connectedKeyPath]);
- var renderNode;
- // ======================== Render ========================
- if (measure) {
- renderNode = childList;
- } else {
- renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalSubMenu, (0,esm_extends["default"])({
- ref: ref
- }, props), childList);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PathTrackerContext.Provider, {
- value: connectedKeyPath
- }, renderNode);
- });
- if (true) {
- SubMenu.displayName = 'SubMenu';
- }
- /* harmony default export */ var es_SubMenu = (SubMenu);
- ;// ./node_modules/rc-menu/es/Divider.js
- function Divider(_ref) {
- var className = _ref.className,
- style = _ref.style;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls;
- var measure = useMeasure();
- if (measure) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- role: "separator",
- className: classnames_default()("".concat(prefixCls, "-item-divider"), className),
- style: style
- });
- }
- ;// ./node_modules/rc-menu/es/MenuItemGroup.js
- var MenuItemGroup_excluded = ["className", "title", "eventKey", "children"];
- var InternalMenuItemGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var className = props.className,
- title = props.title,
- eventKey = props.eventKey,
- children = props.children,
- restProps = (0,objectWithoutProperties["default"])(props, MenuItemGroup_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(MenuContext),
- prefixCls = _React$useContext.prefixCls;
- var groupPrefixCls = "".concat(prefixCls, "-item-group");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", (0,esm_extends["default"])({
- ref: ref,
- role: "presentation"
- }, restProps, {
- onClick: function onClick(e) {
- return e.stopPropagation();
- },
- className: classnames_default()(groupPrefixCls, className)
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- role: "presentation",
- className: "".concat(groupPrefixCls, "-title"),
- title: typeof title === 'string' ? title : undefined
- }, title), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- role: "group",
- className: "".concat(groupPrefixCls, "-list")
- }, children));
- });
- var MenuItemGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var eventKey = props.eventKey,
- children = props.children;
- var connectedKeyPath = useFullPath(eventKey);
- var childList = parseChildren(children, connectedKeyPath);
- var measure = useMeasure();
- if (measure) {
- return childList;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalMenuItemGroup, (0,esm_extends["default"])({
- ref: ref
- }, (0,omit["default"])(props, ['warnKey'])), childList);
- });
- if (true) {
- MenuItemGroup.displayName = 'MenuItemGroup';
- }
- /* harmony default export */ var es_MenuItemGroup = (MenuItemGroup);
- ;// ./node_modules/rc-menu/es/utils/nodeUtil.js
- var nodeUtil_excluded = ["label", "children", "key", "type", "extra"];
- function convertItemsToNodes(list, components, prefixCls) {
- var MergedMenuItem = components.item,
- MergedMenuItemGroup = components.group,
- MergedSubMenu = components.submenu,
- MergedDivider = components.divider;
- return (list || []).map(function (opt, index) {
- if (opt && (0,esm_typeof["default"])(opt) === 'object') {
- var _ref = opt,
- label = _ref.label,
- children = _ref.children,
- key = _ref.key,
- type = _ref.type,
- extra = _ref.extra,
- restProps = (0,objectWithoutProperties["default"])(_ref, nodeUtil_excluded);
- var mergedKey = key !== null && key !== void 0 ? key : "tmp-".concat(index);
- // MenuItemGroup & SubMenuItem
- if (children || type === 'group') {
- if (type === 'group') {
- // Group
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MergedMenuItemGroup, (0,esm_extends["default"])({
- key: mergedKey
- }, restProps, {
- title: label
- }), convertItemsToNodes(children, components, prefixCls));
- }
- // Sub Menu
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MergedSubMenu, (0,esm_extends["default"])({
- key: mergedKey
- }, restProps, {
- title: label
- }), convertItemsToNodes(children, components, prefixCls));
- }
- // MenuItem & Divider
- if (type === 'divider') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MergedDivider, (0,esm_extends["default"])({
- key: mergedKey
- }, restProps));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MergedMenuItem, (0,esm_extends["default"])({
- key: mergedKey
- }, restProps, {
- extra: extra
- }), label, (!!extra || extra === 0) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-item-extra")
- }, extra));
- }
- return null;
- }).filter(function (opt) {
- return opt;
- });
- }
- function parseItems(children, items, keyPath, components, prefixCls) {
- var childNodes = children;
- var mergedComponents = (0,objectSpread2["default"])({
- divider: Divider,
- item: es_MenuItem,
- group: es_MenuItemGroup,
- submenu: es_SubMenu
- }, components);
- if (items) {
- childNodes = convertItemsToNodes(items, mergedComponents, prefixCls);
- }
- return parseChildren(childNodes, keyPath);
- }
- ;// ./node_modules/rc-menu/es/Menu.js
- var Menu_excluded = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem", "_internalComponents"];
- /**
- * Menu modify after refactor:
- * ## Add
- * - disabled
- *
- * ## Remove
- * - openTransitionName
- * - openAnimation
- * - onDestroy
- * - siderCollapsed: Seems antd do not use this prop (Need test in antd)
- * - collapsedWidth: Seems this logic should be handle by antd Layout.Sider
- */
- // optimize for render
- var Menu_EMPTY_LIST = [];
- var Menu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _childList$;
- var _ref = props,
- _ref$prefixCls = _ref.prefixCls,
- prefixCls = _ref$prefixCls === void 0 ? 'rc-menu' : _ref$prefixCls,
- rootClassName = _ref.rootClassName,
- style = _ref.style,
- className = _ref.className,
- _ref$tabIndex = _ref.tabIndex,
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
- items = _ref.items,
- children = _ref.children,
- direction = _ref.direction,
- id = _ref.id,
- _ref$mode = _ref.mode,
- mode = _ref$mode === void 0 ? 'vertical' : _ref$mode,
- inlineCollapsed = _ref.inlineCollapsed,
- disabled = _ref.disabled,
- disabledOverflow = _ref.disabledOverflow,
- _ref$subMenuOpenDelay = _ref.subMenuOpenDelay,
- subMenuOpenDelay = _ref$subMenuOpenDelay === void 0 ? 0.1 : _ref$subMenuOpenDelay,
- _ref$subMenuCloseDela = _ref.subMenuCloseDelay,
- subMenuCloseDelay = _ref$subMenuCloseDela === void 0 ? 0.1 : _ref$subMenuCloseDela,
- forceSubMenuRender = _ref.forceSubMenuRender,
- defaultOpenKeys = _ref.defaultOpenKeys,
- openKeys = _ref.openKeys,
- activeKey = _ref.activeKey,
- defaultActiveFirst = _ref.defaultActiveFirst,
- _ref$selectable = _ref.selectable,
- selectable = _ref$selectable === void 0 ? true : _ref$selectable,
- _ref$multiple = _ref.multiple,
- multiple = _ref$multiple === void 0 ? false : _ref$multiple,
- defaultSelectedKeys = _ref.defaultSelectedKeys,
- selectedKeys = _ref.selectedKeys,
- onSelect = _ref.onSelect,
- onDeselect = _ref.onDeselect,
- _ref$inlineIndent = _ref.inlineIndent,
- inlineIndent = _ref$inlineIndent === void 0 ? 24 : _ref$inlineIndent,
- motion = _ref.motion,
- defaultMotions = _ref.defaultMotions,
- _ref$triggerSubMenuAc = _ref.triggerSubMenuAction,
- triggerSubMenuAction = _ref$triggerSubMenuAc === void 0 ? 'hover' : _ref$triggerSubMenuAc,
- builtinPlacements = _ref.builtinPlacements,
- itemIcon = _ref.itemIcon,
- expandIcon = _ref.expandIcon,
- _ref$overflowedIndica = _ref.overflowedIndicator,
- overflowedIndicator = _ref$overflowedIndica === void 0 ? '...' : _ref$overflowedIndica,
- overflowedIndicatorPopupClassName = _ref.overflowedIndicatorPopupClassName,
- getPopupContainer = _ref.getPopupContainer,
- onClick = _ref.onClick,
- onOpenChange = _ref.onOpenChange,
- onKeyDown = _ref.onKeyDown,
- openAnimation = _ref.openAnimation,
- openTransitionName = _ref.openTransitionName,
- _internalRenderMenuItem = _ref._internalRenderMenuItem,
- _internalRenderSubMenuItem = _ref._internalRenderSubMenuItem,
- _internalComponents = _ref._internalComponents,
- restProps = (0,objectWithoutProperties["default"])(_ref, Menu_excluded);
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return [parseItems(children, items, Menu_EMPTY_LIST, _internalComponents, prefixCls), parseItems(children, items, Menu_EMPTY_LIST, {}, prefixCls)];
- }, [children, items, _internalComponents]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- childList = _React$useMemo2[0],
- measureChildList = _React$useMemo2[1];
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- mounted = _React$useState2[0],
- setMounted = _React$useState2[1];
- var containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var uuid = useUUID(id);
- var isRtl = direction === 'rtl';
- // ========================= Warn =========================
- if (true) {
- (0,warning["default"])(!openAnimation && !openTransitionName, '`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.');
- }
- // ========================= Open =========================
- var _useMergedState = (0,useMergedState["default"])(defaultOpenKeys, {
- value: openKeys,
- postState: function postState(keys) {
- return keys || Menu_EMPTY_LIST;
- }
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedOpenKeys = _useMergedState2[0],
- setMergedOpenKeys = _useMergedState2[1];
- // React 18 will merge mouse event which means we open key will not sync
- // ref: https://github.com/ant-design/ant-design/issues/38818
- var triggerOpenKeys = function triggerOpenKeys(keys) {
- var forceFlush = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- function doUpdate() {
- setMergedOpenKeys(keys);
- onOpenChange === null || onOpenChange === void 0 || onOpenChange(keys);
- }
- if (forceFlush) {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(doUpdate);
- } else {
- doUpdate();
- }
- };
- // >>>>> Cache & Reset open keys when inlineCollapsed changed
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(mergedOpenKeys),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- inlineCacheOpenKeys = _React$useState4[0],
- setInlineCacheOpenKeys = _React$useState4[1];
- var mountRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- // ========================= Mode =========================
- var _React$useMemo3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if ((mode === 'inline' || mode === 'vertical') && inlineCollapsed) {
- return ['vertical', inlineCollapsed];
- }
- return [mode, false];
- }, [mode, inlineCollapsed]),
- _React$useMemo4 = (0,slicedToArray["default"])(_React$useMemo3, 2),
- mergedMode = _React$useMemo4[0],
- mergedInlineCollapsed = _React$useMemo4[1];
- var isInlineMode = mergedMode === 'inline';
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(mergedMode),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- internalMode = _React$useState6[0],
- setInternalMode = _React$useState6[1];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(mergedInlineCollapsed),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- internalInlineCollapsed = _React$useState8[0],
- setInternalInlineCollapsed = _React$useState8[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setInternalMode(mergedMode);
- setInternalInlineCollapsed(mergedInlineCollapsed);
- if (!mountRef.current) {
- return;
- }
- // Synchronously update MergedOpenKeys
- if (isInlineMode) {
- setMergedOpenKeys(inlineCacheOpenKeys);
- } else {
- // Trigger open event in case its in control
- triggerOpenKeys(Menu_EMPTY_LIST);
- }
- }, [mergedMode, mergedInlineCollapsed]);
- // ====================== Responsive ======================
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- lastVisibleIndex = _React$useState10[0],
- setLastVisibleIndex = _React$useState10[1];
- var allVisible = lastVisibleIndex >= childList.length - 1 || internalMode !== 'horizontal' || disabledOverflow;
- // Cache
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (isInlineMode) {
- setInlineCacheOpenKeys(mergedOpenKeys);
- }
- }, [mergedOpenKeys]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- mountRef.current = true;
- return function () {
- mountRef.current = false;
- };
- }, []);
- // ========================= Path =========================
- var _useKeyRecords = useKeyRecords(),
- registerPath = _useKeyRecords.registerPath,
- unregisterPath = _useKeyRecords.unregisterPath,
- refreshOverflowKeys = _useKeyRecords.refreshOverflowKeys,
- isSubPathKey = _useKeyRecords.isSubPathKey,
- getKeyPath = _useKeyRecords.getKeyPath,
- getKeys = _useKeyRecords.getKeys,
- getSubPathKeys = _useKeyRecords.getSubPathKeys;
- var registerPathContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- registerPath: registerPath,
- unregisterPath: unregisterPath
- };
- }, [registerPath, unregisterPath]);
- var pathUserContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- isSubPathKey: isSubPathKey
- };
- }, [isSubPathKey]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- refreshOverflowKeys(allVisible ? Menu_EMPTY_LIST : childList.slice(lastVisibleIndex + 1).map(function (child) {
- return child.key;
- }));
- }, [lastVisibleIndex, allVisible]);
- // ======================== Active ========================
- var _useMergedState3 = (0,useMergedState["default"])(activeKey || defaultActiveFirst && ((_childList$ = childList[0]) === null || _childList$ === void 0 ? void 0 : _childList$.key), {
- value: activeKey
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedActiveKey = _useMergedState4[0],
- setMergedActiveKey = _useMergedState4[1];
- var onActive = useMemoCallback(function (key) {
- setMergedActiveKey(key);
- });
- var onInactive = useMemoCallback(function () {
- setMergedActiveKey(undefined);
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- return {
- list: containerRef.current,
- focus: function focus(options) {
- var _childList$find;
- var keys = getKeys();
- var _refreshElements = refreshElements(keys, uuid),
- elements = _refreshElements.elements,
- key2element = _refreshElements.key2element,
- element2key = _refreshElements.element2key;
- var focusableElements = getFocusableElements(containerRef.current, elements);
- var shouldFocusKey = mergedActiveKey !== null && mergedActiveKey !== void 0 ? mergedActiveKey : focusableElements[0] ? element2key.get(focusableElements[0]) : (_childList$find = childList.find(function (node) {
- return !node.props.disabled;
- })) === null || _childList$find === void 0 ? void 0 : _childList$find.key;
- var elementToFocus = key2element.get(shouldFocusKey);
- if (shouldFocusKey && elementToFocus) {
- var _elementToFocus$focus;
- elementToFocus === null || elementToFocus === void 0 || (_elementToFocus$focus = elementToFocus.focus) === null || _elementToFocus$focus === void 0 || _elementToFocus$focus.call(elementToFocus, options);
- }
- }
- };
- });
- // ======================== Select ========================
- // >>>>> Select keys
- var _useMergedState5 = (0,useMergedState["default"])(defaultSelectedKeys || [], {
- value: selectedKeys,
- // Legacy convert key to array
- postState: function postState(keys) {
- if (Array.isArray(keys)) {
- return keys;
- }
- if (keys === null || keys === undefined) {
- return Menu_EMPTY_LIST;
- }
- return [keys];
- }
- }),
- _useMergedState6 = (0,slicedToArray["default"])(_useMergedState5, 2),
- mergedSelectKeys = _useMergedState6[0],
- setMergedSelectKeys = _useMergedState6[1];
- // >>>>> Trigger select
- var triggerSelection = function triggerSelection(info) {
- if (selectable) {
- // Insert or Remove
- var targetKey = info.key;
- var exist = mergedSelectKeys.includes(targetKey);
- var newSelectKeys;
- if (multiple) {
- if (exist) {
- newSelectKeys = mergedSelectKeys.filter(function (key) {
- return key !== targetKey;
- });
- } else {
- newSelectKeys = [].concat((0,toConsumableArray["default"])(mergedSelectKeys), [targetKey]);
- }
- } else {
- newSelectKeys = [targetKey];
- }
- setMergedSelectKeys(newSelectKeys);
- // Trigger event
- var selectInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, info), {}, {
- selectedKeys: newSelectKeys
- });
- if (exist) {
- onDeselect === null || onDeselect === void 0 || onDeselect(selectInfo);
- } else {
- onSelect === null || onSelect === void 0 || onSelect(selectInfo);
- }
- }
- // Whatever selectable, always close it
- if (!multiple && mergedOpenKeys.length && internalMode !== 'inline') {
- triggerOpenKeys(Menu_EMPTY_LIST);
- }
- };
- // ========================= Open =========================
- /**
- * Click for item. SubMenu do not have selection status
- */
- var onInternalClick = useMemoCallback(function (info) {
- onClick === null || onClick === void 0 || onClick(warnItemProp(info));
- triggerSelection(info);
- });
- var onInternalOpenChange = useMemoCallback(function (key, open) {
- var newOpenKeys = mergedOpenKeys.filter(function (k) {
- return k !== key;
- });
- if (open) {
- newOpenKeys.push(key);
- } else if (internalMode !== 'inline') {
- // We need find all related popup to close
- var subPathKeys = getSubPathKeys(key);
- newOpenKeys = newOpenKeys.filter(function (k) {
- return !subPathKeys.has(k);
- });
- }
- if (!(0,isEqual["default"])(mergedOpenKeys, newOpenKeys, true)) {
- triggerOpenKeys(newOpenKeys, true);
- }
- });
- // ==================== Accessibility =====================
- var triggerAccessibilityOpen = function triggerAccessibilityOpen(key, open) {
- var nextOpen = open !== null && open !== void 0 ? open : !mergedOpenKeys.includes(key);
- onInternalOpenChange(key, nextOpen);
- };
- var onInternalKeyDown = useAccessibility_useAccessibility(internalMode, mergedActiveKey, isRtl, uuid, containerRef, getKeys, getKeyPath, setMergedActiveKey, triggerAccessibilityOpen, onKeyDown);
- // ======================== Effect ========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setMounted(true);
- }, []);
- // ======================= Context ========================
- var privateContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- _internalRenderMenuItem: _internalRenderMenuItem,
- _internalRenderSubMenuItem: _internalRenderSubMenuItem
- };
- }, [_internalRenderMenuItem, _internalRenderSubMenuItem]);
- // ======================== Render ========================
- // >>>>> Children
- var wrappedChildList = internalMode !== 'horizontal' || disabledOverflow ? childList :
- // Need wrap for overflow dropdown that do not response for open
- childList.map(function (child, index) {
- return (
- /*#__PURE__*/
- // Always wrap provider to avoid sub node re-mount
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InheritableContextProvider, {
- key: child.key,
- overflowDisabled: index > lastVisibleIndex
- }, child)
- );
- });
- // >>>>> Container
- var container = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_overflow_es, (0,esm_extends["default"])({
- id: id,
- ref: containerRef,
- prefixCls: "".concat(prefixCls, "-overflow"),
- component: "ul",
- itemComponent: es_MenuItem,
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), "".concat(prefixCls, "-rtl"), isRtl), rootClassName),
- dir: direction,
- style: style,
- role: "menu",
- tabIndex: tabIndex,
- data: wrappedChildList,
- renderRawItem: function renderRawItem(node) {
- return node;
- },
- renderRawRest: function renderRawRest(omitItems) {
- // We use origin list since wrapped list use context to prevent open
- var len = omitItems.length;
- var originOmitItems = len ? childList.slice(-len) : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_SubMenu, {
- eventKey: OVERFLOW_KEY,
- title: overflowedIndicator,
- disabled: allVisible,
- internalPopupClose: len === 0,
- popupClassName: overflowedIndicatorPopupClassName
- }, originOmitItems);
- },
- maxCount: internalMode !== 'horizontal' || disabledOverflow ? rc_overflow_es.INVALIDATE : rc_overflow_es.RESPONSIVE,
- ssr: "full",
- "data-menu-list": true,
- onVisibleChange: function onVisibleChange(newLastIndex) {
- setLastVisibleIndex(newLastIndex);
- },
- onKeyDown: onInternalKeyDown
- }, restProps));
- // >>>>> Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_PrivateContext.Provider, {
- value: privateContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(IdContext.Provider, {
- value: uuid
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InheritableContextProvider, {
- prefixCls: prefixCls,
- rootClassName: rootClassName,
- mode: internalMode,
- openKeys: mergedOpenKeys,
- rtl: isRtl
- // Disabled
- ,
- disabled: disabled
- // Motion
- ,
- motion: mounted ? motion : null,
- defaultMotions: mounted ? defaultMotions : null
- // Active
- ,
- activeKey: mergedActiveKey,
- onActive: onActive,
- onInactive: onInactive
- // Selection
- ,
- selectedKeys: mergedSelectKeys
- // Level
- ,
- inlineIndent: inlineIndent
- // Popup
- ,
- subMenuOpenDelay: subMenuOpenDelay,
- subMenuCloseDelay: subMenuCloseDelay,
- forceSubMenuRender: forceSubMenuRender,
- builtinPlacements: builtinPlacements,
- triggerSubMenuAction: triggerSubMenuAction,
- getPopupContainer: getPopupContainer
- // Icon
- ,
- itemIcon: itemIcon,
- expandIcon: expandIcon
- // Events
- ,
- onItemClick: onInternalClick,
- onOpenChange: onInternalOpenChange
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PathUserContext.Provider, {
- value: pathUserContext
- }, container), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- display: 'none'
- },
- "aria-hidden": true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PathRegisterContext.Provider, {
- value: registerPathContext
- }, measureChildList)))));
- });
- /* harmony default export */ var es_Menu = (Menu);
- ;// ./node_modules/rc-menu/es/index.js
- var ExportMenu = es_Menu;
- ExportMenu.Item = es_MenuItem;
- ExportMenu.SubMenu = es_SubMenu;
- ExportMenu.ItemGroup = es_MenuItemGroup;
- ExportMenu.Divider = Divider;
- /* harmony default export */ var rc_menu_es = (ExportMenu);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/BarsOutlined.js
- // This icon file is generated automatically.
- var BarsOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "bars", "theme": "outlined" };
- /* harmony default export */ var asn_BarsOutlined = (BarsOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/BarsOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var BarsOutlined_BarsOutlined = function BarsOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_BarsOutlined
- }));
- };
- /** */
- var BarsOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(BarsOutlined_BarsOutlined);
- if (true) {
- BarsOutlined_RefIcon.displayName = 'BarsOutlined';
- }
- /* harmony default export */ var icons_BarsOutlined = (BarsOutlined_RefIcon);
- ;// ./components/layout/context.ts
- const LayoutContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- siderHook: {
- addSider: () => null,
- removeSider: () => null
- }
- });
- // EXTERNAL MODULE: ./components/layout/style/index.ts
- var layout_style = __webpack_require__("./components/layout/style/index.ts");
- ;// ./components/layout/style/sider.ts
- const genSiderStyle = token => {
- const {
- componentCls,
- siderBg,
- motionDurationMid,
- motionDurationSlow,
- antCls,
- triggerHeight,
- triggerColor,
- triggerBg,
- headerHeight,
- zeroTriggerWidth,
- zeroTriggerHeight,
- borderRadiusLG,
- lightSiderBg,
- lightTriggerColor,
- lightTriggerBg,
- bodyBg
- } = token;
- return {
- [componentCls]: {
- position: 'relative',
- // fix firefox can't set width smaller than content on flex item
- minWidth: 0,
- background: siderBg,
- transition: `all ${motionDurationMid}, background 0s`,
- '&-has-trigger': {
- paddingBottom: triggerHeight
- },
- '&-right': {
- order: 1
- },
- [`${componentCls}-children`]: {
- height: '100%',
- // Hack for fixing margin collapse bug
- // https://github.com/ant-design/ant-design/issues/7967
- // solution from https://stackoverflow.com/a/33132624/3040605
- marginTop: -0.1,
- paddingTop: 0.1,
- [`${antCls}-menu${antCls}-menu-inline-collapsed`]: {
- width: 'auto'
- }
- },
- [`&-zero-width ${componentCls}-children`]: {
- overflow: 'hidden'
- },
- [`${componentCls}-trigger`]: {
- position: 'fixed',
- bottom: 0,
- zIndex: 1,
- height: triggerHeight,
- color: triggerColor,
- lineHeight: (0,cssinjs.unit)(triggerHeight),
- textAlign: 'center',
- background: triggerBg,
- cursor: 'pointer',
- transition: `all ${motionDurationMid}`
- },
- [`${componentCls}-zero-width-trigger`]: {
- position: 'absolute',
- top: headerHeight,
- insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),
- zIndex: 1,
- width: zeroTriggerWidth,
- height: zeroTriggerHeight,
- color: triggerColor,
- fontSize: token.fontSizeXL,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- background: siderBg,
- borderRadius: `0 ${(0,cssinjs.unit)(borderRadiusLG)} ${(0,cssinjs.unit)(borderRadiusLG)} 0`,
- cursor: 'pointer',
- transition: `background ${motionDurationSlow} ease`,
- '&::after': {
- position: 'absolute',
- inset: 0,
- background: 'transparent',
- transition: `all ${motionDurationSlow}`,
- content: '""'
- },
- '&:hover::after': {
- background: `rgba(255, 255, 255, 0.2)`
- },
- '&-right': {
- insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
- borderRadius: `${(0,cssinjs.unit)(borderRadiusLG)} 0 0 ${(0,cssinjs.unit)(borderRadiusLG)}`
- }
- },
- // Light
- '&-light': {
- background: lightSiderBg,
- [`${componentCls}-trigger`]: {
- color: lightTriggerColor,
- background: lightTriggerBg
- },
- [`${componentCls}-zero-width-trigger`]: {
- color: lightTriggerColor,
- background: lightTriggerBg,
- border: `1px solid ${bodyBg}`,
- // Safe to modify to any other color
- borderInlineStart: 0
- }
- }
- }
- };
- };
- /* harmony default export */ var sider = ((0,genStyleUtils.genStyleHooks)(['Layout', 'Sider'], genSiderStyle, layout_style.prepareComponentToken, {
- deprecatedTokens: layout_style.DEPRECATED_TOKENS
- }));
- ;// ./components/layout/Sider.tsx
- var Sider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const dimensionMaxMap = {
- xs: '479.98px',
- sm: '575.98px',
- md: '767.98px',
- lg: '991.98px',
- xl: '1199.98px',
- xxl: '1599.98px'
- };
- const isNumeric = value => !Number.isNaN(Number.parseFloat(value)) && isFinite(value);
- const SiderContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- const generateId = (() => {
- let i = 0;
- return (prefix = '') => {
- i += 1;
- return `${prefix}${i}`;
- };
- })();
- const Sider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- trigger,
- children,
- defaultCollapsed = false,
- theme = 'dark',
- style = {},
- collapsible = false,
- reverseArrow = false,
- width = 200,
- collapsedWidth = 80,
- zeroWidthTriggerStyle,
- breakpoint,
- onCollapse,
- onBreakpoint
- } = props,
- otherProps = Sider_rest(props, ["prefixCls", "className", "trigger", "children", "defaultCollapsed", "theme", "style", "collapsible", "reverseArrow", "width", "collapsedWidth", "zeroWidthTriggerStyle", "breakpoint", "onCollapse", "onBreakpoint"]);
- const {
- siderHook
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(LayoutContext);
- const [collapsed, setCollapsed] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)('collapsed' in props ? props.collapsed : defaultCollapsed);
- const [below, setBelow] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- if ('collapsed' in props) {
- setCollapsed(props.collapsed);
- }
- }, [props.collapsed]);
- const handleSetCollapsed = (value, type) => {
- if (!('collapsed' in props)) {
- setCollapsed(value);
- }
- onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(value, type);
- };
- // =========================== Prefix ===========================
- const {
- getPrefixCls,
- direction
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = sider(prefixCls);
- // ========================= Responsive =========================
- const responsiveHandlerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- responsiveHandlerRef.current = mql => {
- setBelow(mql.matches);
- onBreakpoint === null || onBreakpoint === void 0 ? void 0 : onBreakpoint(mql.matches);
- if (collapsed !== mql.matches) {
- handleSetCollapsed(mql.matches, 'responsive');
- }
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- function responsiveHandler(mql) {
- var _a;
- return (_a = responsiveHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(responsiveHandlerRef, mql);
- }
- let mql;
- if (typeof (window === null || window === void 0 ? void 0 : window.matchMedia) !== 'undefined' && breakpoint && breakpoint in dimensionMaxMap) {
- mql = window.matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
- addMediaQueryListener(mql, responsiveHandler);
- responsiveHandler(mql);
- }
- return () => {
- removeMediaQueryListener(mql, responsiveHandler);
- };
- }, [breakpoint]); // in order to accept dynamic 'breakpoint' property, we need to add 'breakpoint' into dependency array.
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- const uniqueId = generateId('ant-sider-');
- siderHook.addSider(uniqueId);
- return () => siderHook.removeSider(uniqueId);
- }, []);
- const toggle = () => {
- handleSetCollapsed(!collapsed, 'clickTrigger');
- };
- const divProps = (0,omit["default"])(otherProps, ['collapsed']);
- const rawWidth = collapsed ? collapsedWidth : width;
- // use "px" as fallback unit for width
- const siderWidth = isNumeric(rawWidth) ? `${rawWidth}px` : String(rawWidth);
- // special trigger when collapsedWidth == 0
- const zeroWidthTrigger = parseFloat(String(collapsedWidth || 0)) === 0 ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- onClick: toggle,
- className: classnames_default()(`${prefixCls}-zero-width-trigger`, `${prefixCls}-zero-width-trigger-${reverseArrow ? 'right' : 'left'}`),
- style: zeroWidthTriggerStyle
- }, trigger || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_BarsOutlined, null))) : null;
- const reverseIcon = direction === 'rtl' === !reverseArrow;
- const iconObj = {
- expanded: reverseIcon ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null),
- collapsed: reverseIcon ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null)
- };
- const status = collapsed ? 'collapsed' : 'expanded';
- const defaultTrigger = iconObj[status];
- const triggerDom = trigger !== null ? zeroWidthTrigger || (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-trigger`,
- onClick: toggle,
- style: {
- width: siderWidth
- }
- }, trigger || defaultTrigger)) : null;
- const divStyle = Object.assign(Object.assign({}, style), {
- flex: `0 0 ${siderWidth}`,
- maxWidth: siderWidth,
- minWidth: siderWidth,
- width: siderWidth
- });
- const siderCls = classnames_default()(prefixCls, `${prefixCls}-${theme}`, {
- [`${prefixCls}-collapsed`]: !!collapsed,
- [`${prefixCls}-has-trigger`]: collapsible && trigger !== null && !zeroWidthTrigger,
- [`${prefixCls}-below`]: !!below,
- [`${prefixCls}-zero-width`]: parseFloat(siderWidth) === 0
- }, className, hashId, cssVarCls);
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- siderCollapsed: collapsed
- }), [collapsed]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SiderContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("aside", Object.assign({
- className: siderCls
- }, divProps, {
- style: divStyle,
- ref: ref
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-children`
- }, children), collapsible || below && zeroWidthTrigger ? triggerDom : null)));
- });
- if (true) {
- Sider.displayName = 'Sider';
- }
- /* harmony default export */ var layout_Sider = (Sider);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/EllipsisOutlined.js
- // This icon file is generated automatically.
- var EllipsisOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "ellipsis", "theme": "outlined" };
- /* harmony default export */ var asn_EllipsisOutlined = (EllipsisOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/EllipsisOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var EllipsisOutlined_EllipsisOutlined = function EllipsisOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_EllipsisOutlined
- }));
- };
- /** */
- var EllipsisOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(EllipsisOutlined_EllipsisOutlined);
- if (true) {
- EllipsisOutlined_RefIcon.displayName = 'EllipsisOutlined';
- }
- /* harmony default export */ var icons_EllipsisOutlined = (EllipsisOutlined_RefIcon);
- ;// ./components/menu/MenuContext.tsx
- const MenuContext_MenuContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)({
- prefixCls: '',
- firstLevel: true,
- inlineCollapsed: false
- });
- /* harmony default export */ var menu_MenuContext = (MenuContext_MenuContext);
- ;// ./components/menu/MenuDivider.tsx
- var MenuDivider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const MenuDivider = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- dashed
- } = props,
- restProps = MenuDivider_rest(props, ["prefixCls", "className", "dashed"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('menu', customizePrefixCls);
- const classString = classnames_default()({
- [`${prefixCls}-item-divider-dashed`]: !!dashed
- }, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Divider, Object.assign({
- className: classString
- }, restProps));
- };
- /* harmony default export */ var menu_MenuDivider = (MenuDivider);
- ;// ./components/menu/MenuItem.tsx
- const MenuItem_MenuItem = props => {
- var _a;
- const {
- className,
- children,
- icon,
- title,
- danger,
- extra
- } = props;
- const {
- prefixCls,
- firstLevel,
- direction,
- disableMenuItemTitleTooltip,
- inlineCollapsed: isInlineCollapsed
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(menu_MenuContext);
- const renderItemChildren = inlineCollapsed => {
- const label = children === null || children === void 0 ? void 0 : children[0];
- const wrapNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${prefixCls}-title-content`, {
- [`${prefixCls}-title-content-with-extra`]: !!extra || extra === 0
- })
- }, children);
- // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span
- // ref: https://github.com/ant-design/ant-design/pull/23456
- if (!icon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(children) && children.type === 'span') {
- if (children && inlineCollapsed && firstLevel && typeof label === 'string') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-inline-collapsed-noicon`
- }, label.charAt(0));
- }
- }
- return wrapNode;
- };
- const {
- siderCollapsed
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(SiderContext);
- let tooltipTitle = title;
- if (typeof title === 'undefined') {
- tooltipTitle = firstLevel ? children : '';
- } else if (title === false) {
- tooltipTitle = '';
- }
- const tooltipProps = {
- title: tooltipTitle
- };
- if (!siderCollapsed && !isInlineCollapsed) {
- tooltipProps.title = null;
- // Reset `open` to fix control mode tooltip display not correct
- // ref: https://github.com/ant-design/ant-design/issues/16742
- tooltipProps.open = false;
- }
- const childrenLength = (0,toArray["default"])(children).length;
- let returnNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_MenuItem, Object.assign({}, (0,omit["default"])(props, ['title', 'icon', 'danger']), {
- className: classnames_default()({
- [`${prefixCls}-item-danger`]: danger,
- [`${prefixCls}-item-only-child`]: (icon ? childrenLength + 1 : childrenLength) === 1
- }, className),
- title: typeof title === 'string' ? title : undefined
- }), (0,reactNode.cloneElement)(icon, {
- className: classnames_default()(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : undefined, `${prefixCls}-item-icon`)
- }), renderItemChildren(isInlineCollapsed));
- if (!disableMenuItemTitleTooltip) {
- returnNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({}, tooltipProps, {
- placement: direction === 'rtl' ? 'left' : 'right',
- classNames: {
- root: `${prefixCls}-inline-collapsed-tooltip`
- }
- }), returnNode);
- }
- return returnNode;
- };
- /* harmony default export */ var menu_MenuItem = (MenuItem_MenuItem);
- ;// ./components/menu/OverrideContext.tsx
- var OverrideContext_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const OverrideContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /** @internal Only used for Dropdown component. Do not use this in your production. */
- const OverrideProvider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- children
- } = props,
- restProps = OverrideContext_rest(props, ["children"]);
- const override = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(OverrideContext);
- const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, override), restProps), [override, restProps.prefixCls,
- // restProps.expandIcon, Not mark as deps since this is a ReactNode
- restProps.mode, restProps.selectable, restProps.rootClassName
- // restProps.validator, Not mark as deps since this is a function
- ]);
- const canRef = (0,es_ref.supportNodeRef)(children);
- const mergedRef = (0,es_ref.useComposeRef)(ref, canRef ? (0,es_ref.getNodeRef)(children) : null);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverrideContext.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- space: true
- }, canRef ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(children, {
- ref: mergedRef
- }) : children));
- });
- /** @internal Only used for Dropdown component. Do not use this in your production. */
- /* harmony default export */ var menu_OverrideContext = (OverrideContext);
- // EXTERNAL MODULE: ./components/menu/style/index.ts + 4 modules
- var menu_style = __webpack_require__("./components/menu/style/index.ts");
- ;// ./components/menu/SubMenu.tsx
- const SubMenu_SubMenu = props => {
- var _a;
- const {
- popupClassName,
- icon,
- title,
- theme: customTheme
- } = props;
- const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(menu_MenuContext);
- const {
- prefixCls,
- inlineCollapsed,
- theme: contextTheme
- } = context;
- const parentPath = useFullPath();
- let titleNode;
- if (!icon) {
- titleNode = inlineCollapsed && !parentPath.length && title && typeof title === 'string' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-inline-collapsed-noicon`
- }, title.charAt(0))) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-title-content`
- }, title));
- } else {
- // inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span
- // ref: https://github.com/ant-design/ant-design/pull/23456
- const titleIsSpan = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(title) && title.type === 'span';
- titleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, (0,reactNode.cloneElement)(icon, {
- className: classnames_default()(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(icon) ? (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className : undefined, `${prefixCls}-item-icon`)
- }), titleIsSpan ? title : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-title-content`
- }, title));
- }
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, context), {
- firstLevel: false
- }), [context]);
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('Menu');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(menu_MenuContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_SubMenu, Object.assign({}, (0,omit["default"])(props, ['icon']), {
- title: titleNode,
- popupClassName: classnames_default()(prefixCls, popupClassName, `${prefixCls}-${customTheme || contextTheme}`),
- popupStyle: Object.assign({
- zIndex
- }, props.popupStyle)
- })));
- };
- /* harmony default export */ var menu_SubMenu = (SubMenu_SubMenu);
- ;// ./components/menu/menu.tsx
- var menu_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function isEmptyIcon(icon) {
- return icon === null || icon === false;
- }
- const MENU_COMPONENTS = {
- item: menu_MenuItem,
- submenu: menu_SubMenu,
- divider: menu_MenuDivider
- };
- const InternalMenu = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- var _a;
- const override = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(menu_OverrideContext);
- const overrideObj = override || {};
- const {
- getPrefixCls,
- getPopupContainer,
- direction,
- menu
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const rootPrefixCls = getPrefixCls();
- const {
- prefixCls: customizePrefixCls,
- className,
- style,
- theme = 'light',
- expandIcon,
- _internalDisableMenuItemTitleTooltip,
- inlineCollapsed,
- siderCollapsed,
- rootClassName,
- mode,
- selectable,
- onClick,
- overflowedIndicatorPopupClassName
- } = props,
- restProps = menu_rest(props, ["prefixCls", "className", "style", "theme", "expandIcon", "_internalDisableMenuItemTitleTooltip", "inlineCollapsed", "siderCollapsed", "rootClassName", "mode", "selectable", "onClick", "overflowedIndicatorPopupClassName"]);
- const passedProps = (0,omit["default"])(restProps, ['collapsedWidth']);
- // ======================== Warning ==========================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Menu');
- true ? warning(!('inlineCollapsed' in props && mode !== 'inline'), 'usage', '`inlineCollapsed` should only be used when `mode` is inline.') : 0;
- warning.deprecated('items' in props && !props.children, 'children', 'items');
- }
- (_a = overrideObj.validator) === null || _a === void 0 ? void 0 : _a.call(overrideObj, {
- mode
- });
- // ========================== Click ==========================
- // Tell dropdown that item clicked
- const onItemClick = (0,useEvent["default"])((...args) => {
- var _a;
- onClick === null || onClick === void 0 ? void 0 : onClick.apply(void 0, args);
- (_a = overrideObj.onClick) === null || _a === void 0 ? void 0 : _a.call(overrideObj);
- });
- // ========================== Mode ===========================
- const mergedMode = overrideObj.mode || mode;
- // ======================= Selectable ========================
- const mergedSelectable = selectable !== null && selectable !== void 0 ? selectable : overrideObj.selectable;
- // ======================== Collapsed ========================
- // Inline Collapsed
- const mergedInlineCollapsed = inlineCollapsed !== null && inlineCollapsed !== void 0 ? inlineCollapsed : siderCollapsed;
- const defaultMotions = {
- horizontal: {
- motionName: `${rootPrefixCls}-slide-up`
- },
- inline: (0,_util_motion["default"])(rootPrefixCls),
- other: {
- motionName: `${rootPrefixCls}-zoom-big`
- }
- };
- const prefixCls = getPrefixCls('menu', customizePrefixCls || overrideObj.prefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,menu_style["default"])(prefixCls, rootCls, !override);
- const menuClassName = classnames_default()(`${prefixCls}-${theme}`, menu === null || menu === void 0 ? void 0 : menu.className, className);
- // ====================== ExpandIcon ========================
- const mergedExpandIcon = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- if (typeof expandIcon === 'function' || isEmptyIcon(expandIcon)) {
- return expandIcon || null;
- }
- if (typeof overrideObj.expandIcon === 'function' || isEmptyIcon(overrideObj.expandIcon)) {
- return overrideObj.expandIcon || null;
- }
- if (typeof (menu === null || menu === void 0 ? void 0 : menu.expandIcon) === 'function' || isEmptyIcon(menu === null || menu === void 0 ? void 0 : menu.expandIcon)) {
- return (menu === null || menu === void 0 ? void 0 : menu.expandIcon) || null;
- }
- const mergedIcon = (_a = expandIcon !== null && expandIcon !== void 0 ? expandIcon : overrideObj === null || overrideObj === void 0 ? void 0 : overrideObj.expandIcon) !== null && _a !== void 0 ? _a : menu === null || menu === void 0 ? void 0 : menu.expandIcon;
- return (0,reactNode.cloneElement)(mergedIcon, {
- className: classnames_default()(`${prefixCls}-submenu-expand-icon`, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mergedIcon) ? (_b = mergedIcon.props) === null || _b === void 0 ? void 0 : _b.className : undefined)
- });
- }, [expandIcon, overrideObj === null || overrideObj === void 0 ? void 0 : overrideObj.expandIcon, menu === null || menu === void 0 ? void 0 : menu.expandIcon, prefixCls]);
- // ======================== Context ==========================
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- prefixCls,
- inlineCollapsed: mergedInlineCollapsed || false,
- direction,
- firstLevel: true,
- theme,
- mode: mergedMode,
- disableMenuItemTitleTooltip: _internalDisableMenuItemTitleTooltip
- }), [prefixCls, mergedInlineCollapsed, direction, _internalDisableMenuItemTitleTooltip, theme]);
- // ========================= Render ==========================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(menu_OverrideContext.Provider, {
- value: null
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(menu_MenuContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_menu_es, Object.assign({
- getPopupContainer: getPopupContainer,
- overflowedIndicator: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EllipsisOutlined, null),
- overflowedIndicatorPopupClassName: classnames_default()(prefixCls, `${prefixCls}-${theme}`, overflowedIndicatorPopupClassName),
- mode: mergedMode,
- selectable: mergedSelectable,
- onClick: onItemClick
- }, passedProps, {
- inlineCollapsed: mergedInlineCollapsed,
- style: Object.assign(Object.assign({}, menu === null || menu === void 0 ? void 0 : menu.style), style),
- className: menuClassName,
- prefixCls: prefixCls,
- direction: direction,
- defaultMotions: defaultMotions,
- expandIcon: mergedExpandIcon,
- ref: ref,
- rootClassName: classnames_default()(rootClassName, hashId, overrideObj.rootClassName, cssVarCls, rootCls),
- _internalComponents: MENU_COMPONENTS
- })))));
- });
- /* harmony default export */ var menu = (InternalMenu);
- ;// ./components/menu/index.tsx
- const menu_Menu = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const menuRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- const context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(SiderContext);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => ({
- menu: menuRef.current,
- focus: options => {
- var _a;
- (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.focus(options);
- }
- }));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(menu, Object.assign({
- ref: menuRef
- }, props, context));
- });
- menu_Menu.Item = menu_MenuItem;
- menu_Menu.SubMenu = menu_SubMenu;
- menu_Menu.Divider = menu_MenuDivider;
- menu_Menu.ItemGroup = es_MenuItemGroup;
- if (true) {
- menu_Menu.displayName = 'Menu';
- }
- /* harmony default export */ var components_menu = (menu_Menu);
- // EXTERNAL MODULE: ./components/dropdown/style/index.ts + 1 modules
- var dropdown_style = __webpack_require__("./components/dropdown/style/index.ts");
- ;// ./components/dropdown/dropdown.tsx
- const _Placements = ['topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight', 'top', 'bottom'];
- const dropdown_Dropdown = props => {
- var _a;
- const {
- menu,
- arrow,
- prefixCls: customizePrefixCls,
- children,
- trigger,
- disabled,
- dropdownRender,
- popupRender,
- getPopupContainer,
- overlayClassName,
- rootClassName,
- overlayStyle,
- open,
- onOpenChange,
- // Deprecated
- visible,
- onVisibleChange,
- mouseEnterDelay = 0.15,
- mouseLeaveDelay = 0.1,
- autoAdjustOverflow = true,
- placement = '',
- overlay,
- transitionName,
- destroyOnHidden,
- destroyPopupOnHide
- } = props;
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- direction,
- dropdown
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const mergedPopupRender = popupRender || dropdownRender;
- // Warning for deprecated usage
- const warning = (0,_util_warning.devUseWarning)('Dropdown');
- if (true) {
- const deprecatedProps = {
- visible: 'open',
- onVisibleChange: 'onOpenChange',
- overlay: 'menu',
- dropdownRender: 'popupRender',
- destroyPopupOnHide: 'destroyOnHidden'
- };
- Object.entries(deprecatedProps).forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- if (placement.includes('Center')) {
- warning.deprecated(!placement.includes('Center'), `placement: ${placement}`, `placement: ${placement.slice(0, placement.indexOf('Center'))}`);
- }
- }
- const memoTransitionName = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const rootPrefixCls = getPrefixCls();
- if (transitionName !== undefined) {
- return transitionName;
- }
- if (placement.includes('top')) {
- return `${rootPrefixCls}-slide-down`;
- }
- return `${rootPrefixCls}-slide-up`;
- }, [getPrefixCls, placement, transitionName]);
- const memoPlacement = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!placement) {
- return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
- }
- if (placement.includes('Center')) {
- return placement.slice(0, placement.indexOf('Center'));
- }
- return placement;
- }, [placement, direction]);
- const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,dropdown_style["default"])(prefixCls, rootCls);
- const [, token] = (0,useToken["default"])();
- const child = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(_util_isPrimitive(children) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, children) : children);
- const popupTrigger = (0,reactNode.cloneElement)(child, {
- className: classnames_default()(`${prefixCls}-trigger`, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, child.props.className),
- disabled: (_a = child.props.disabled) !== null && _a !== void 0 ? _a : disabled
- });
- const triggerActions = disabled ? [] : trigger;
- const alignPoint = !!(triggerActions === null || triggerActions === void 0 ? void 0 : triggerActions.includes('contextMenu'));
- // =========================== Open ============================
- const [mergedOpen, setOpen] = (0,useMergedState["default"])(false, {
- value: open !== null && open !== void 0 ? open : visible
- });
- const onInnerOpenChange = (0,useEvent["default"])(nextOpen => {
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen, {
- source: 'trigger'
- });
- onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(nextOpen);
- setOpen(nextOpen);
- });
- // =========================== Overlay ============================
- const overlayClassNameCustomized = classnames_default()(overlayClassName, rootClassName, hashId, cssVarCls, rootCls, dropdown === null || dropdown === void 0 ? void 0 : dropdown.className, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- });
- const builtinPlacements = getPlacements({
- arrowPointAtCenter: typeof arrow === 'object' && arrow.pointAtCenter,
- autoAdjustOverflow,
- offset: token.marginXXS,
- arrowWidth: arrow ? token.sizePopupArrow : 0,
- borderRadius: token.borderRadius
- });
- const onMenuClick = (0,useEvent["default"])(() => {
- if ((menu === null || menu === void 0 ? void 0 : menu.selectable) && (menu === null || menu === void 0 ? void 0 : menu.multiple)) {
- return;
- }
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false, {
- source: 'menu'
- });
- setOpen(false);
- });
- const renderOverlay = () => {
- // rc-dropdown already can process the function of overlay, but we have check logic here.
- // So we need render the element to check and pass back to rc-dropdown.
- let overlayNode;
- if (menu === null || menu === void 0 ? void 0 : menu.items) {
- overlayNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_menu, Object.assign({}, menu));
- } else if (typeof overlay === 'function') {
- overlayNode = overlay();
- } else {
- overlayNode = overlay;
- }
- if (mergedPopupRender) {
- overlayNode = mergedPopupRender(overlayNode);
- }
- overlayNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.only(typeof overlayNode === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, overlayNode) : overlayNode);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverrideProvider, {
- prefixCls: `${prefixCls}-menu`,
- rootClassName: classnames_default()(cssVarCls, rootCls),
- expandIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-menu-submenu-arrow`
- }, direction === 'rtl' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, {
- className: `${prefixCls}-menu-submenu-arrow-icon`
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], {
- className: `${prefixCls}-menu-submenu-arrow-icon`
- }))),
- mode: "vertical",
- selectable: false,
- onClick: onMenuClick,
- validator: ({
- mode
- }) => {
- // Warning if use other mode
- true ? warning(!mode || mode === 'vertical', 'usage', `mode="${mode}" is not supported for Dropdown's Menu.`) : 0;
- }
- }, overlayNode);
- };
- // =========================== zIndex ============================
- const [zIndex, contextZIndex] = (0,useZIndex.useZIndex)('Dropdown', overlayStyle === null || overlayStyle === void 0 ? void 0 : overlayStyle.zIndex);
- // ============================ Render ============================
- let renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_dropdown_es, Object.assign({
- alignPoint: alignPoint
- }, (0,omit["default"])(props, ['rootClassName']), {
- mouseEnterDelay: mouseEnterDelay,
- mouseLeaveDelay: mouseLeaveDelay,
- visible: mergedOpen,
- builtinPlacements: builtinPlacements,
- arrow: !!arrow,
- overlayClassName: overlayClassNameCustomized,
- prefixCls: prefixCls,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- transitionName: memoTransitionName,
- trigger: triggerActions,
- overlay: renderOverlay,
- placement: memoPlacement,
- onVisibleChange: onInnerOpenChange,
- overlayStyle: Object.assign(Object.assign(Object.assign({}, dropdown === null || dropdown === void 0 ? void 0 : dropdown.style), overlayStyle), {
- zIndex
- }),
- autoDestroy: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyPopupOnHide
- }), popupTrigger);
- if (zIndex) {
- renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(zindexContext["default"].Provider, {
- value: contextZIndex
- }, renderNode);
- }
- return wrapCSSVar(renderNode);
- };
- // We don't care debug panel
- const dropdown_PurePanel = _util_PurePanel(dropdown_Dropdown, 'align', undefined, 'dropdown', prefixCls => prefixCls);
- /* istanbul ignore next */
- const WrapPurePanel = props => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(dropdown_PurePanel, Object.assign({}, props), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null)));
- dropdown_Dropdown._InternalPanelDoNotUseOrYouWillBeFired = WrapPurePanel;
- if (true) {
- dropdown_Dropdown.displayName = 'Dropdown';
- }
- /* harmony default export */ var dropdown = (dropdown_Dropdown);
- ;// ./components/breadcrumb/BreadcrumbSeparator.tsx
- const BreadcrumbSeparator = ({
- children
- }) => {
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('breadcrumb');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- className: `${prefixCls}-separator`,
- "aria-hidden": "true"
- }, children === '' ? children : children || '/');
- };
- BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
- /* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
- ;// ./components/breadcrumb/useItemRender.tsx
- var useItemRender_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getBreadcrumbName(route, params) {
- if (route.title === undefined || route.title === null) {
- return null;
- }
- const paramsKeys = Object.keys(params).join('|');
- return typeof route.title === 'object' ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, 'g'), (replacement, key) => params[key] || replacement);
- }
- function renderItem(prefixCls, item, children, href) {
- if (children === null || children === undefined) {
- return null;
- }
- const {
- className,
- onClick
- } = item,
- restItem = useItemRender_rest(item, ["className", "onClick"]);
- const passedProps = Object.assign(Object.assign({}, (0,pickAttrs["default"])(restItem, {
- data: true,
- aria: true
- })), {
- onClick
- });
- if (href !== undefined) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", Object.assign({}, passedProps, {
- className: classnames_default()(`${prefixCls}-link`, className),
- href: href
- }), children);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({}, passedProps, {
- className: classnames_default()(`${prefixCls}-link`, className)
- }), children);
- }
- function useItemRender(prefixCls, itemRender) {
- const mergedItemRender = (item, params, routes, path, href) => {
- if (itemRender) {
- return itemRender(item, params, routes, path);
- }
- const name = getBreadcrumbName(item, params);
- return renderItem(prefixCls, item, name, href);
- };
- return mergedItemRender;
- }
- ;// ./components/breadcrumb/BreadcrumbItem.tsx
- var BreadcrumbItem_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalBreadcrumbItem = props => {
- const {
- prefixCls,
- separator = '/',
- children,
- menu,
- overlay,
- dropdownProps,
- href
- } = props;
- // Warning for deprecated usage
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Breadcrumb.Item');
- warning.deprecated(!('overlay' in props), 'overlay', 'menu');
- }
- /** If overlay is have Wrap a Dropdown */
- const renderBreadcrumbNode = breadcrumbItem => {
- if (menu || overlay) {
- const mergeDropDownProps = Object.assign({}, dropdownProps);
- if (menu) {
- const _a = menu || {},
- {
- items
- } = _a,
- menuProps = BreadcrumbItem_rest(_a, ["items"]);
- mergeDropDownProps.menu = Object.assign(Object.assign({}, menuProps), {
- items: items === null || items === void 0 ? void 0 : items.map((_a, index) => {
- var {
- key,
- title,
- label,
- path
- } = _a,
- itemProps = BreadcrumbItem_rest(_a, ["key", "title", "label", "path"]);
- let mergedLabel = label !== null && label !== void 0 ? label : title;
- if (path) {
- mergedLabel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- href: `${href}${path}`
- }, mergedLabel);
- }
- return Object.assign(Object.assign({}, itemProps), {
- key: key !== null && key !== void 0 ? key : index,
- label: mergedLabel
- });
- })
- });
- } else if (overlay) {
- mergeDropDownProps.overlay = overlay;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(dropdown, Object.assign({
- placement: "bottom"
- }, mergeDropDownProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-overlay-link`
- }, breadcrumbItem, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DownOutlined, null)));
- }
- return breadcrumbItem;
- };
- // wrap to dropDown
- const link = renderBreadcrumbNode(children);
- if (link !== undefined && link !== null) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", null, link), separator && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(breadcrumb_BreadcrumbSeparator, null, separator));
- }
- return null;
- };
- const BreadcrumbItem = props => {
- const {
- prefixCls: customizePrefixCls,
- children,
- href
- } = props,
- restProps = BreadcrumbItem_rest(props, ["prefixCls", "children", "href"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalBreadcrumbItem, Object.assign({}, restProps, {
- prefixCls: prefixCls
- }), renderItem(prefixCls, restProps, children, href));
- };
- BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
- /* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
- // EXTERNAL MODULE: ./components/breadcrumb/style/index.ts
- var breadcrumb_style = __webpack_require__("./components/breadcrumb/style/index.ts");
- ;// ./components/breadcrumb/useItems.ts
- var useItems_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function route2item(route) {
- const {
- breadcrumbName,
- children
- } = route,
- rest = useItems_rest(route, ["breadcrumbName", "children"]);
- const clone = Object.assign({
- title: breadcrumbName
- }, rest);
- if (children) {
- clone.menu = {
- items: children.map(_a => {
- var {
- breadcrumbName: itemBreadcrumbName
- } = _a,
- itemProps = useItems_rest(_a, ["breadcrumbName"]);
- return Object.assign(Object.assign({}, itemProps), {
- title: itemBreadcrumbName
- });
- })
- };
- }
- return clone;
- }
- function useItems(items, routes) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (items) {
- return items;
- }
- if (routes) {
- return routes.map(route2item);
- }
- return null;
- }, [items, routes]);
- }
- ;// ./components/breadcrumb/Breadcrumb.tsx
- var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const getPath = (params, path) => {
- if (path === undefined) {
- return path;
- }
- let mergedPath = (path || '').replace(/^\//, '');
- Object.keys(params).forEach(key => {
- mergedPath = mergedPath.replace(`:${key}`, params[key]);
- });
- return mergedPath;
- };
- const Breadcrumb = props => {
- const {
- prefixCls: customizePrefixCls,
- separator = '/',
- style,
- className,
- rootClassName,
- routes: legacyRoutes,
- items,
- children,
- itemRender,
- params = {}
- } = props,
- restProps = Breadcrumb_rest(props, ["prefixCls", "separator", "style", "className", "rootClassName", "routes", "items", "children", "itemRender", "params"]);
- const {
- getPrefixCls,
- direction,
- breadcrumb
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- let crumbs;
- const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,breadcrumb_style["default"])(prefixCls);
- const mergedItems = useItems(items, legacyRoutes);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Breadcrumb');
- warning.deprecated(!legacyRoutes, 'routes', 'items');
- // Deprecated warning for breadcrumb children
- if (!mergedItems || mergedItems.length === 0) {
- const childList = (0,toArray["default"])(children);
- warning.deprecated(childList.length === 0, 'Breadcrumb.Item and Breadcrumb.Separator', 'items');
- childList.forEach(element => {
- if (element) {
- true ? warning(element.type && (element.type.__ANT_BREADCRUMB_ITEM === true || element.type.__ANT_BREADCRUMB_SEPARATOR === true), 'usage', "Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children") : 0;
- }
- });
- }
- }
- const mergedItemRender = useItemRender(prefixCls, itemRender);
- if (mergedItems && mergedItems.length > 0) {
- // generated by route
- const paths = [];
- const itemRenderRoutes = items || legacyRoutes;
- crumbs = mergedItems.map((item, index) => {
- const {
- path,
- key,
- type,
- menu,
- overlay,
- onClick,
- className: itemClassName,
- separator: itemSeparator,
- dropdownProps
- } = item;
- const mergedPath = getPath(params, path);
- if (mergedPath !== undefined) {
- paths.push(mergedPath);
- }
- const mergedKey = key !== null && key !== void 0 ? key : index;
- if (type === 'separator') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(breadcrumb_BreadcrumbSeparator, {
- key: mergedKey
- }, itemSeparator);
- }
- const itemProps = {};
- const isLastItem = index === mergedItems.length - 1;
- if (menu) {
- itemProps.menu = menu;
- } else if (overlay) {
- itemProps.overlay = overlay;
- }
- let {
- href
- } = item;
- if (paths.length && mergedPath !== undefined) {
- href = `#/${paths.join('/')}`;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalBreadcrumbItem, Object.assign({
- key: mergedKey
- }, itemProps, (0,pickAttrs["default"])(item, {
- data: true,
- aria: true
- }), {
- className: itemClassName,
- dropdownProps: dropdownProps,
- href: href,
- separator: isLastItem ? '' : separator,
- onClick: onClick,
- prefixCls: prefixCls
- }), mergedItemRender(item, params, itemRenderRoutes, paths, href));
- });
- } else if (children) {
- const childrenLength = (0,toArray["default"])(children).length;
- crumbs = (0,toArray["default"])(children).map((element, index) => {
- if (!element) {
- return element;
- }
- const isLastItem = index === childrenLength - 1;
- return (0,reactNode.cloneElement)(element, {
- separator: isLastItem ? '' : separator,
- // eslint-disable-next-line react/no-array-index-key
- key: index
- });
- });
- }
- const breadcrumbClassName = classnames_default()(prefixCls, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.className, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.style), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("nav", Object.assign({
- className: breadcrumbClassName,
- style: mergedStyle
- }, restProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ol", null, crumbs)));
- };
- Breadcrumb.Item = breadcrumb_BreadcrumbItem;
- Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
- if (true) {
- Breadcrumb.displayName = 'Breadcrumb';
- }
- /* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
- ;// ./components/breadcrumb/index.tsx
- /* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
- // EXTERNAL MODULE: external {"root":"dayjs","commonjs2":"dayjs","commonjs":"dayjs","amd":"dayjs"}
- var external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_ = __webpack_require__("dayjs");
- var external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/weekday.js
- var weekday = __webpack_require__("./node_modules/dayjs/plugin/weekday.js");
- var weekday_default = /*#__PURE__*/__webpack_require__.n(weekday);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/localeData.js
- var localeData = __webpack_require__("./node_modules/dayjs/plugin/localeData.js");
- var localeData_default = /*#__PURE__*/__webpack_require__.n(localeData);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/weekOfYear.js
- var weekOfYear = __webpack_require__("./node_modules/dayjs/plugin/weekOfYear.js");
- var weekOfYear_default = /*#__PURE__*/__webpack_require__.n(weekOfYear);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/weekYear.js
- var weekYear = __webpack_require__("./node_modules/dayjs/plugin/weekYear.js");
- var weekYear_default = /*#__PURE__*/__webpack_require__.n(weekYear);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/advancedFormat.js
- var advancedFormat = __webpack_require__("./node_modules/dayjs/plugin/advancedFormat.js");
- var advancedFormat_default = /*#__PURE__*/__webpack_require__.n(advancedFormat);
- // EXTERNAL MODULE: ./node_modules/dayjs/plugin/customParseFormat.js
- var customParseFormat = __webpack_require__("./node_modules/dayjs/plugin/customParseFormat.js");
- var customParseFormat_default = /*#__PURE__*/__webpack_require__.n(customParseFormat);
- ;// ./node_modules/rc-picker/es/generate/dayjs.js
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((customParseFormat_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((advancedFormat_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((weekday_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((localeData_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((weekOfYear_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend((weekYear_default()));
- external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default().extend(function (o, c) {
- // todo support Wo (ISO week)
- var proto = c.prototype;
- var oldFormat = proto.format;
- proto.format = function f(formatStr) {
- var str = (formatStr || '').replace('Wo', 'wo');
- return oldFormat.bind(this)(str);
- };
- });
- var localeMap = {
- // ar_EG:
- // az_AZ:
- // bg_BG:
- bn_BD: 'bn-bd',
- by_BY: 'be',
- // ca_ES:
- // cs_CZ:
- // da_DK:
- // de_DE:
- // el_GR:
- en_GB: 'en-gb',
- en_US: 'en',
- // es_ES:
- // et_EE:
- // fa_IR:
- // fi_FI:
- fr_BE: 'fr',
- // todo: dayjs has no fr_BE locale, use fr at present
- fr_CA: 'fr-ca',
- // fr_FR:
- // ga_IE:
- // gl_ES:
- // he_IL:
- // hi_IN:
- // hr_HR:
- // hu_HU:
- hy_AM: 'hy-am',
- // id_ID:
- // is_IS:
- // it_IT:
- // ja_JP:
- // ka_GE:
- // kk_KZ:
- // km_KH:
- kmr_IQ: 'ku',
- // kn_IN:
- // ko_KR:
- // ku_IQ: // previous ku in antd
- // lt_LT:
- // lv_LV:
- // mk_MK:
- // ml_IN:
- // mn_MN:
- // ms_MY:
- // nb_NO:
- // ne_NP:
- nl_BE: 'nl-be',
- // nl_NL:
- // pl_PL:
- pt_BR: 'pt-br',
- // pt_PT:
- // ro_RO:
- // ru_RU:
- // sk_SK:
- // sl_SI:
- // sr_RS:
- // sv_SE:
- // ta_IN:
- // th_TH:
- // tr_TR:
- // uk_UA:
- // ur_PK:
- // vi_VN:
- zh_CN: 'zh-cn',
- zh_HK: 'zh-hk',
- zh_TW: 'zh-tw'
- };
- var parseLocale = function parseLocale(locale) {
- var mapLocale = localeMap[locale];
- return mapLocale || locale.split('_')[0];
- };
- /* istanbul ignore next */
- var parseNoMatchNotice = function parseNoMatchNotice() {
- // zombieJ:
- // When user typing, its always miss match format.
- // This check is meaningless.
- // https://github.com/ant-design/ant-design/issues/51839
- // noteOnce(false, 'Not match any format. Please help to fire a issue about this.');
- };
- var generateConfig = {
- // get
- getNow: function getNow() {
- var now = external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()();
- // https://github.com/ant-design/ant-design/discussions/50934
- if (typeof now.tz === 'function') {
- return now.tz(); // use default timezone
- }
- return now;
- },
- getFixedDate: function getFixedDate(string) {
- return external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()(string, ['YYYY-M-DD', 'YYYY-MM-DD']);
- },
- getEndDate: function getEndDate(date) {
- return date.endOf('month');
- },
- getWeekDay: function getWeekDay(date) {
- var clone = date.locale('en');
- return clone.weekday() + clone.localeData().firstDayOfWeek();
- },
- getYear: function getYear(date) {
- return date.year();
- },
- getMonth: function getMonth(date) {
- return date.month();
- },
- getDate: function getDate(date) {
- return date.date();
- },
- getHour: function getHour(date) {
- return date.hour();
- },
- getMinute: function getMinute(date) {
- return date.minute();
- },
- getSecond: function getSecond(date) {
- return date.second();
- },
- getMillisecond: function getMillisecond(date) {
- return date.millisecond();
- },
- // set
- addYear: function addYear(date, diff) {
- return date.add(diff, 'year');
- },
- addMonth: function addMonth(date, diff) {
- return date.add(diff, 'month');
- },
- addDate: function addDate(date, diff) {
- return date.add(diff, 'day');
- },
- setYear: function setYear(date, year) {
- return date.year(year);
- },
- setMonth: function setMonth(date, month) {
- return date.month(month);
- },
- setDate: function setDate(date, num) {
- return date.date(num);
- },
- setHour: function setHour(date, hour) {
- return date.hour(hour);
- },
- setMinute: function setMinute(date, minute) {
- return date.minute(minute);
- },
- setSecond: function setSecond(date, second) {
- return date.second(second);
- },
- setMillisecond: function setMillisecond(date, milliseconds) {
- return date.millisecond(milliseconds);
- },
- // Compare
- isAfter: function isAfter(date1, date2) {
- return date1.isAfter(date2);
- },
- isValidate: function isValidate(date) {
- return date.isValid();
- },
- locale: {
- getWeekFirstDay: function getWeekFirstDay(locale) {
- return external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()().locale(parseLocale(locale)).localeData().firstDayOfWeek();
- },
- getWeekFirstDate: function getWeekFirstDate(locale, date) {
- return date.locale(parseLocale(locale)).weekday(0);
- },
- getWeek: function getWeek(locale, date) {
- return date.locale(parseLocale(locale)).week();
- },
- getShortWeekDays: function getShortWeekDays(locale) {
- return external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()().locale(parseLocale(locale)).localeData().weekdaysMin();
- },
- getShortMonths: function getShortMonths(locale) {
- return external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()().locale(parseLocale(locale)).localeData().monthsShort();
- },
- format: function format(locale, date, _format) {
- return date.locale(parseLocale(locale)).format(_format);
- },
- parse: function parse(locale, text, formats) {
- var localeStr = parseLocale(locale);
- for (var i = 0; i < formats.length; i += 1) {
- var format = formats[i];
- var formatText = text;
- if (format.includes('wo') || format.includes('Wo')) {
- // parse Wo
- var year = formatText.split('-')[0];
- var weekStr = formatText.split('-')[1];
- var firstWeek = external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()(year, 'YYYY').startOf('year').locale(localeStr);
- for (var j = 0; j <= 52; j += 1) {
- var nextWeek = firstWeek.add(j, 'week');
- if (nextWeek.format('Wo') === weekStr) {
- return nextWeek;
- }
- }
- parseNoMatchNotice();
- return null;
- }
- var date = external_root_dayjs_commonjs2_dayjs_commonjs_dayjs_amd_dayjs_default()(formatText, format, true).locale(localeStr);
- if (date.isValid()) {
- return date;
- }
- }
- if (text) {
- parseNoMatchNotice();
- }
- return null;
- }
- }
- };
- /* harmony default export */ var dayjs = (generateConfig);
- ;// ./node_modules/rc-picker/es/utils/uiUtil.js
- // ====================== Mode ======================
- function getRealPlacement(placement, rtl) {
- if (placement !== undefined) {
- return placement;
- }
- return rtl ? 'bottomRight' : 'bottomLeft';
- }
- ;// ./node_modules/rc-picker/es/PickerInput/context.js
- var PickerContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var PickerInput_context = (PickerContext);
- ;// ./node_modules/rc-picker/es/PickerTrigger/index.js
- var BUILT_IN_PLACEMENTS = {
- bottomLeft: {
- points: ['tl', 'bl'],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- bottomRight: {
- points: ['tr', 'br'],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- topLeft: {
- points: ['bl', 'tl'],
- offset: [0, -4],
- overflow: {
- adjustX: 0,
- adjustY: 1
- }
- },
- topRight: {
- points: ['br', 'tr'],
- offset: [0, -4],
- overflow: {
- adjustX: 0,
- adjustY: 1
- }
- }
- };
- function PickerTrigger(_ref) {
- var popupElement = _ref.popupElement,
- popupStyle = _ref.popupStyle,
- popupClassName = _ref.popupClassName,
- popupAlign = _ref.popupAlign,
- transitionName = _ref.transitionName,
- getPopupContainer = _ref.getPopupContainer,
- children = _ref.children,
- range = _ref.range,
- placement = _ref.placement,
- _ref$builtinPlacement = _ref.builtinPlacements,
- builtinPlacements = _ref$builtinPlacement === void 0 ? BUILT_IN_PLACEMENTS : _ref$builtinPlacement,
- direction = _ref.direction,
- visible = _ref.visible,
- onClose = _ref.onClose;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls;
- var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
- var realPlacement = getRealPlacement(placement, direction === 'rtl');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, {
- showAction: [],
- hideAction: ['click'],
- popupPlacement: realPlacement,
- builtinPlacements: builtinPlacements,
- prefixCls: dropdownPrefixCls,
- popupTransitionName: transitionName,
- popup: popupElement,
- popupAlign: popupAlign,
- popupVisible: visible,
- popupClassName: classnames_default()(popupClassName, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(dropdownPrefixCls, "-range"), range), "".concat(dropdownPrefixCls, "-rtl"), direction === 'rtl')),
- popupStyle: popupStyle,
- stretch: "minWidth",
- getPopupContainer: getPopupContainer,
- onPopupVisibleChange: function onPopupVisibleChange(nextVisible) {
- if (!nextVisible) {
- onClose();
- }
- }
- }, children);
- }
- /* harmony default export */ var es_PickerTrigger = (PickerTrigger);
- ;// ./node_modules/rc-picker/es/utils/miscUtil.js
- function leftPad(str, length) {
- var fill = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';
- var current = String(str);
- while (current.length < length) {
- current = "".concat(fill).concat(current);
- }
- return current;
- }
- /**
- * Convert `value` to array. Will provide `[]` if is null or undefined.
- */
- function miscUtil_toArray(val) {
- if (val === null || val === undefined) {
- return [];
- }
- return Array.isArray(val) ? val : [val];
- }
- function fillIndex(ori, index, value) {
- var clone = (0,toConsumableArray["default"])(ori);
- clone[index] = value;
- return clone;
- }
- /** Pick props from the key list. Will filter empty value */
- function pickProps(props, keys) {
- var clone = {};
- var mergedKeys = keys || Object.keys(props);
- mergedKeys.forEach(function (key) {
- if (props[key] !== undefined) {
- clone[key] = props[key];
- }
- });
- return clone;
- }
- function getRowFormat(picker, locale, format) {
- if (format) {
- return format;
- }
- switch (picker) {
- // All from the `locale.fieldXXXFormat` first
- case 'time':
- return locale.fieldTimeFormat;
- case 'datetime':
- return locale.fieldDateTimeFormat;
- case 'month':
- return locale.fieldMonthFormat;
- case 'year':
- return locale.fieldYearFormat;
- case 'quarter':
- return locale.fieldQuarterFormat;
- case 'week':
- return locale.fieldWeekFormat;
- default:
- return locale.fieldDateFormat;
- }
- }
- function getFromDate(calendarValues, activeIndexList, activeIndex) {
- var mergedActiveIndex = activeIndex !== undefined ? activeIndex : activeIndexList[activeIndexList.length - 1];
- var firstValuedIndex = activeIndexList.find(function (index) {
- return calendarValues[index];
- });
- return mergedActiveIndex !== firstValuedIndex ? calendarValues[firstValuedIndex] : undefined;
- }
- ;// ./node_modules/rc-picker/es/PickerTrigger/util.js
- function pickTriggerProps(props) {
- return pickProps(props, ['placement', 'builtinPlacements', 'popupAlign', 'getPopupContainer', 'transitionName', 'direction']);
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useCellRender.js
- function useCellRender(cellRender, dateRender, monthCellRender, range) {
- // ========================= Warn =========================
- if (true) {
- (0,rc_util_es.warning)(!dateRender, "'dateRender' is deprecated. Please use 'cellRender' instead.");
- (0,rc_util_es.warning)(!monthCellRender, "'monthCellRender' is deprecated. Please use 'cellRender' instead.");
- }
- // ======================== Render ========================
- // Merged render
- var mergedCellRender = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (cellRender) {
- return cellRender;
- }
- return function (current, info) {
- var date = current;
- if (dateRender && info.type === 'date') {
- return dateRender(date, info.today);
- }
- if (monthCellRender && info.type === 'month') {
- return monthCellRender(date, info.locale);
- }
- return info.originNode;
- };
- }, [cellRender, monthCellRender, dateRender]);
- // Cell render
- var onInternalCellRender = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (date, info) {
- return mergedCellRender(date, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, info), {}, {
- range: range
- }));
- }, [mergedCellRender, range]);
- return onInternalCellRender;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useFieldsInvalidate.js
- /**
- * Used to control each fields invalidate status
- */
- function useFieldsInvalidate(calendarValue, isInvalidateDate) {
- var allowEmpty = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([false, false]),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- fieldsInvalidates = _React$useState2[0],
- setFieldsInvalidates = _React$useState2[1];
- var onSelectorInvalid = function onSelectorInvalid(invalid, index) {
- setFieldsInvalidates(function (ori) {
- return fillIndex(ori, index, invalid);
- });
- };
- /**
- * For the Selector Input to mark as `aria-disabled`
- */
- var submitInvalidates = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return fieldsInvalidates.map(function (invalid, index) {
- // If typing invalidate
- if (invalid) {
- return true;
- }
- var current = calendarValue[index];
- // Not check if all empty
- if (!current) {
- return false;
- }
- // Not allow empty
- if (!allowEmpty[index] && !current) {
- return true;
- }
- // Invalidate
- if (current && isInvalidateDate(current, {
- activeIndex: index
- })) {
- return true;
- }
- return false;
- });
- }, [calendarValue, fieldsInvalidates, isInvalidateDate, allowEmpty]);
- return [submitInvalidates, onSelectorInvalid];
- }
- ;// ./node_modules/rc-picker/es/hooks/useLocale.js
- function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {
- var timeFormat = '';
- // Base HH:mm:ss
- var cells = [];
- if (showHour) {
- cells.push(showMeridiem ? 'hh' : 'HH');
- }
- if (showMinute) {
- cells.push('mm');
- }
- if (showSecond) {
- cells.push('ss');
- }
- timeFormat = cells.join(':');
- // Millisecond
- if (showMillisecond) {
- timeFormat += '.SSS';
- }
- // Meridiem
- if (showMeridiem) {
- timeFormat += ' A';
- }
- return timeFormat;
- }
- /**
- * Used for `useFilledProps` since it already in the React.useMemo
- */
- function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
- // Not fill `monthFormat` since `locale.shortMonths` handle this
- // Not fill `cellMeridiemFormat` since AM & PM by default
- var fieldDateTimeFormat = locale.fieldDateTimeFormat,
- fieldDateFormat = locale.fieldDateFormat,
- fieldTimeFormat = locale.fieldTimeFormat,
- fieldMonthFormat = locale.fieldMonthFormat,
- fieldYearFormat = locale.fieldYearFormat,
- fieldWeekFormat = locale.fieldWeekFormat,
- fieldQuarterFormat = locale.fieldQuarterFormat,
- yearFormat = locale.yearFormat,
- cellYearFormat = locale.cellYearFormat,
- cellQuarterFormat = locale.cellQuarterFormat,
- dayFormat = locale.dayFormat,
- cellDateFormat = locale.cellDateFormat;
- var timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, locale), {}, {
- fieldDateTimeFormat: fieldDateTimeFormat || "YYYY-MM-DD ".concat(timeFormat),
- fieldDateFormat: fieldDateFormat || 'YYYY-MM-DD',
- fieldTimeFormat: fieldTimeFormat || timeFormat,
- fieldMonthFormat: fieldMonthFormat || 'YYYY-MM',
- fieldYearFormat: fieldYearFormat || 'YYYY',
- fieldWeekFormat: fieldWeekFormat || 'gggg-wo',
- fieldQuarterFormat: fieldQuarterFormat || 'YYYY-[Q]Q',
- yearFormat: yearFormat || 'YYYY',
- cellYearFormat: cellYearFormat || 'YYYY',
- cellQuarterFormat: cellQuarterFormat || '[Q]Q',
- cellDateFormat: cellDateFormat || dayFormat || 'D'
- });
- }
- /**
- * Fill locale format as start up
- */
- function useLocale_useLocale(locale, showProps) {
- var showHour = showProps.showHour,
- showMinute = showProps.showMinute,
- showSecond = showProps.showSecond,
- showMillisecond = showProps.showMillisecond,
- use12Hours = showProps.use12Hours;
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- return fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours);
- }, [locale, showHour, showMinute, showSecond, showMillisecond, use12Hours]);
- }
- ;// ./node_modules/rc-picker/es/hooks/useTimeConfig.js
- function checkShow(format, keywords, show) {
- return show !== null && show !== void 0 ? show : keywords.some(function (keyword) {
- return format.includes(keyword);
- });
- }
- var showTimeKeys = [
- // 'format',
- 'showNow', 'showHour', 'showMinute', 'showSecond', 'showMillisecond', 'use12Hours', 'hourStep', 'minuteStep', 'secondStep', 'millisecondStep', 'hideDisabledOptions', 'defaultValue', 'disabledHours', 'disabledMinutes', 'disabledSeconds', 'disabledMilliseconds', 'disabledTime', 'changeOnScroll', 'defaultOpenValue'];
- /**
- * Get SharedTimeProps from props.
- */
- function pickTimeProps(props) {
- var timeProps = pickProps(props, showTimeKeys);
- var format = props.format,
- picker = props.picker;
- var propFormat = null;
- if (format) {
- propFormat = format;
- if (Array.isArray(propFormat)) {
- propFormat = propFormat[0];
- }
- propFormat = (0,esm_typeof["default"])(propFormat) === 'object' ? propFormat.format : propFormat;
- }
- if (picker === 'time') {
- timeProps.format = propFormat;
- }
- return [timeProps, propFormat];
- }
- function isStringFormat(format) {
- return format && typeof format === 'string';
- }
- /** Check if all the showXXX is `undefined` */
- function existShowConfig(showHour, showMinute, showSecond, showMillisecond) {
- return [showHour, showMinute, showSecond, showMillisecond].some(function (show) {
- return show !== undefined;
- });
- }
- /** Fill the showXXX if needed */
- function fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond) {
- var parsedShowHour = showHour;
- var parsedShowMinute = showMinute;
- var parsedShowSecond = showSecond;
- if (!hasShowConfig && !parsedShowHour && !parsedShowMinute && !parsedShowSecond && !showMillisecond) {
- parsedShowHour = true;
- parsedShowMinute = true;
- parsedShowSecond = true;
- } else if (hasShowConfig) {
- var _parsedShowHour, _parsedShowMinute, _parsedShowSecond;
- var existFalse = [parsedShowHour, parsedShowMinute, parsedShowSecond].some(function (show) {
- return show === false;
- });
- var existTrue = [parsedShowHour, parsedShowMinute, parsedShowSecond].some(function (show) {
- return show === true;
- });
- var defaultShow = existFalse ? true : !existTrue;
- parsedShowHour = (_parsedShowHour = parsedShowHour) !== null && _parsedShowHour !== void 0 ? _parsedShowHour : defaultShow;
- parsedShowMinute = (_parsedShowMinute = parsedShowMinute) !== null && _parsedShowMinute !== void 0 ? _parsedShowMinute : defaultShow;
- parsedShowSecond = (_parsedShowSecond = parsedShowSecond) !== null && _parsedShowSecond !== void 0 ? _parsedShowSecond : defaultShow;
- }
- return [parsedShowHour, parsedShowMinute, parsedShowSecond, showMillisecond];
- }
- /**
- * Get `showHour`, `showMinute`, `showSecond` or other from the props.
- * This is pure function, will not get `showXXX` from the `format` prop.
- */
- function getTimeProps(componentProps) {
- var showTime = componentProps.showTime;
- var _pickTimeProps = pickTimeProps(componentProps),
- _pickTimeProps2 = (0,slicedToArray["default"])(_pickTimeProps, 2),
- pickedProps = _pickTimeProps2[0],
- propFormat = _pickTimeProps2[1];
- var showTimeConfig = showTime && (0,esm_typeof["default"])(showTime) === 'object' ? showTime : {};
- var timeConfig = (0,objectSpread2["default"])((0,objectSpread2["default"])({
- defaultOpenValue: showTimeConfig.defaultOpenValue || showTimeConfig.defaultValue
- }, pickedProps), showTimeConfig);
- var showMillisecond = timeConfig.showMillisecond;
- var showHour = timeConfig.showHour,
- showMinute = timeConfig.showMinute,
- showSecond = timeConfig.showSecond;
- var hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
- var _fillShowConfig = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond);
- var _fillShowConfig2 = (0,slicedToArray["default"])(_fillShowConfig, 3);
- showHour = _fillShowConfig2[0];
- showMinute = _fillShowConfig2[1];
- showSecond = _fillShowConfig2[2];
- return [timeConfig, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, timeConfig), {}, {
- showHour: showHour,
- showMinute: showMinute,
- showSecond: showSecond,
- showMillisecond: showMillisecond
- }), timeConfig.format, propFormat];
- }
- function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, locale) {
- var isTimePicker = picker === 'time';
- if (picker === 'datetime' || isTimePicker) {
- var pickedProps = timeConfig;
- // ====================== BaseFormat ======================
- var defaultLocaleFormat = getRowFormat(picker, locale, null);
- var baselineFormat = defaultLocaleFormat;
- var formatList = [showTimeFormat, propFormat];
- for (var i = 0; i < formatList.length; i += 1) {
- var format = miscUtil_toArray(formatList[i])[0];
- if (isStringFormat(format)) {
- baselineFormat = format;
- break;
- }
- }
- // ========================= Show =========================
- var showHour = pickedProps.showHour,
- showMinute = pickedProps.showMinute,
- showSecond = pickedProps.showSecond,
- showMillisecond = pickedProps.showMillisecond;
- var use12Hours = pickedProps.use12Hours;
- var showMeridiem = checkShow(baselineFormat, ['a', 'A', 'LT', 'LLL', 'LTS'], use12Hours);
- var hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
- // Fill with format, if needed
- if (!hasShowConfig) {
- showHour = checkShow(baselineFormat, ['H', 'h', 'k', 'LT', 'LLL']);
- showMinute = checkShow(baselineFormat, ['m', 'LT', 'LLL']);
- showSecond = checkShow(baselineFormat, ['s', 'LTS']);
- showMillisecond = checkShow(baselineFormat, ['SSS']);
- }
- // Fallback if all can not see
- // ======================== Format ========================
- var _fillShowConfig3 = fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond);
- var _fillShowConfig4 = (0,slicedToArray["default"])(_fillShowConfig3, 3);
- showHour = _fillShowConfig4[0];
- showMinute = _fillShowConfig4[1];
- showSecond = _fillShowConfig4[2];
- var timeFormat = showTimeFormat || fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem);
- // ======================== Props =========================
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, pickedProps), {}, {
- // Format
- format: timeFormat,
- // Show Config
- showHour: showHour,
- showMinute: showMinute,
- showSecond: showSecond,
- showMillisecond: showMillisecond,
- use12Hours: showMeridiem
- });
- }
- return null;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/hooks/useClearIcon.js
- /**
- * Used for `useFilledProps` since it already in the React.useMemo
- */
- function fillClearIcon(prefixCls, allowClear, clearIcon) {
- if ( true && clearIcon) {
- (0,warning["default"])(false, '`clearIcon` will be removed in future. Please use `allowClear` instead.');
- }
- if (allowClear === false) {
- return null;
- }
- var config = allowClear && (0,esm_typeof["default"])(allowClear) === 'object' ? allowClear : {};
- return config.clearIcon || clearIcon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-clear-btn")
- });
- }
- ;// ./node_modules/rc-picker/es/utils/dateUtil.js
- var WEEK_DAY_COUNT = 7;
- /**
- * Wrap the compare logic.
- * This will compare the each of value is empty first.
- * 1. All is empty, return true.
- * 2. One is empty, return false.
- * 3. return customize compare logic.
- */
- function nullableCompare(value1, value2, oriCompareFn) {
- if (!value1 && !value2 || value1 === value2) {
- return true;
- }
- if (!value1 || !value2) {
- return false;
- }
- return oriCompareFn();
- }
- function isSameDecade(generateConfig, decade1, decade2) {
- return nullableCompare(decade1, decade2, function () {
- var num1 = Math.floor(generateConfig.getYear(decade1) / 10);
- var num2 = Math.floor(generateConfig.getYear(decade2) / 10);
- return num1 === num2;
- });
- }
- function isSameYear(generateConfig, year1, year2) {
- return nullableCompare(year1, year2, function () {
- return generateConfig.getYear(year1) === generateConfig.getYear(year2);
- });
- }
- function getQuarter(generateConfig, date) {
- var quota = Math.floor(generateConfig.getMonth(date) / 3);
- return quota + 1;
- }
- function isSameQuarter(generateConfig, quarter1, quarter2) {
- return nullableCompare(quarter1, quarter2, function () {
- return isSameYear(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);
- });
- }
- function isSameMonth(generateConfig, month1, month2) {
- return nullableCompare(month1, month2, function () {
- return isSameYear(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);
- });
- }
- function isSameDate(generateConfig, date1, date2) {
- return nullableCompare(date1, date2, function () {
- return isSameYear(generateConfig, date1, date2) && isSameMonth(generateConfig, date1, date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);
- });
- }
- function isSameTime(generateConfig, time1, time2) {
- return nullableCompare(time1, time2, function () {
- return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);
- });
- }
- /**
- * Check if the Date is all the same of timestamp
- */
- function isSameTimestamp(generateConfig, time1, time2) {
- return nullableCompare(time1, time2, function () {
- return isSameDate(generateConfig, time1, time2) && isSameTime(generateConfig, time1, time2) && generateConfig.getMillisecond(time1) === generateConfig.getMillisecond(time2);
- });
- }
- function isSameWeek(generateConfig, locale, date1, date2) {
- return nullableCompare(date1, date2, function () {
- var weekStartDate1 = generateConfig.locale.getWeekFirstDate(locale, date1);
- var weekStartDate2 = generateConfig.locale.getWeekFirstDate(locale, date2);
- return isSameYear(generateConfig, weekStartDate1, weekStartDate2) && generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);
- });
- }
- function isSame(generateConfig, locale, source, target, type) {
- switch (type) {
- case 'date':
- return isSameDate(generateConfig, source, target);
- case 'week':
- return isSameWeek(generateConfig, locale.locale, source, target);
- case 'month':
- return isSameMonth(generateConfig, source, target);
- case 'quarter':
- return isSameQuarter(generateConfig, source, target);
- case 'year':
- return isSameYear(generateConfig, source, target);
- case 'decade':
- return isSameDecade(generateConfig, source, target);
- case 'time':
- return isSameTime(generateConfig, source, target);
- default:
- return isSameTimestamp(generateConfig, source, target);
- }
- }
- /** Between in date but not equal of date */
- function isInRange(generateConfig, startDate, endDate, current) {
- if (!startDate || !endDate || !current) {
- return false;
- }
- return generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);
- }
- function isSameOrAfter(generateConfig, locale, date1, date2, type) {
- if (isSame(generateConfig, locale, date1, date2, type)) {
- return true;
- }
- return generateConfig.isAfter(date1, date2);
- }
- function getWeekStartDate(locale, generateConfig, value) {
- var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);
- var monthStartDate = generateConfig.setDate(value, 1);
- var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);
- var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);
- if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) {
- alignStartDate = generateConfig.addDate(alignStartDate, -7);
- }
- return alignStartDate;
- }
- function formatValue(value, _ref) {
- var generateConfig = _ref.generateConfig,
- locale = _ref.locale,
- format = _ref.format;
- if (!value) {
- return '';
- }
- return typeof format === 'function' ? format(value) : generateConfig.locale.format(locale.locale, value, format);
- }
- /**
- * Fill the time info into Date if provided.
- */
- function fillTime(generateConfig, date, time) {
- var tmpDate = date;
- var getFn = ['getHour', 'getMinute', 'getSecond', 'getMillisecond'];
- var setFn = ['setHour', 'setMinute', 'setSecond', 'setMillisecond'];
- setFn.forEach(function (fn, index) {
- if (time) {
- tmpDate = generateConfig[fn](tmpDate, generateConfig[getFn[index]](time));
- } else {
- tmpDate = generateConfig[fn](tmpDate, 0);
- }
- });
- return tmpDate;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useDisabledBoundary.js
- /**
- * Merge `disabledDate` with `minDate` & `maxDate`.
- */
- function useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate) {
- var mergedDisabledDate = (0,rc_util_es.useEvent)(function (date, info) {
- if (disabledDate && disabledDate(date, info)) {
- return true;
- }
- if (minDate && generateConfig.isAfter(minDate, date) && !isSame(generateConfig, locale, minDate, date, info.type)) {
- return true;
- }
- if (maxDate && generateConfig.isAfter(date, maxDate) && !isSame(generateConfig, locale, maxDate, date, info.type)) {
- return true;
- }
- return false;
- });
- return mergedDisabledDate;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useFieldFormat.js
- function useFieldFormat(picker, locale, format) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var rawFormat = getRowFormat(picker, locale, format);
- var formatList = miscUtil_toArray(rawFormat);
- var firstFormat = formatList[0];
- var maskFormat = (0,esm_typeof["default"])(firstFormat) === 'object' && firstFormat.type === 'mask' ? firstFormat.format : null;
- return [
- // Format list
- formatList.map(function (config) {
- return typeof config === 'string' || typeof config === 'function' ? config : config.format;
- }),
- // Mask Format
- maskFormat];
- }, [picker, locale, format]);
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useInputReadOnly.js
- function useInputReadOnly(formatList, inputReadOnly, multiple) {
- if (typeof formatList[0] === 'function' || multiple) {
- return true;
- }
- return inputReadOnly;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useInvalidate.js
- /**
- * Check if provided date is valid for the `disabledDate` & `showTime.disabledTime`.
- */
- function useInvalidate(generateConfig, picker, disabledDate, showTime) {
- // Check disabled date
- var isInvalidate = (0,rc_util_es.useEvent)(function (date, info) {
- var outsideInfo = (0,objectSpread2["default"])({
- type: picker
- }, info);
- delete outsideInfo.activeIndex;
- if (
- // Date object is invalid
- !generateConfig.isValidate(date) ||
- // Date is disabled by `disabledDate`
- disabledDate && disabledDate(date, outsideInfo)) {
- return true;
- }
- if ((picker === 'date' || picker === 'time') && showTime) {
- var _showTime$disabledTim;
- var range = info && info.activeIndex === 1 ? 'end' : 'start';
- var _ref = ((_showTime$disabledTim = showTime.disabledTime) === null || _showTime$disabledTim === void 0 ? void 0 : _showTime$disabledTim.call(showTime, date, range, {
- from: outsideInfo.from
- })) || {},
- disabledHours = _ref.disabledHours,
- disabledMinutes = _ref.disabledMinutes,
- disabledSeconds = _ref.disabledSeconds,
- disabledMilliseconds = _ref.disabledMilliseconds;
- var legacyDisabledHours = showTime.disabledHours,
- legacyDisabledMinutes = showTime.disabledMinutes,
- legacyDisabledSeconds = showTime.disabledSeconds;
- var mergedDisabledHours = disabledHours || legacyDisabledHours;
- var mergedDisabledMinutes = disabledMinutes || legacyDisabledMinutes;
- var mergedDisabledSeconds = disabledSeconds || legacyDisabledSeconds;
- var hour = generateConfig.getHour(date);
- var minute = generateConfig.getMinute(date);
- var second = generateConfig.getSecond(date);
- var millisecond = generateConfig.getMillisecond(date);
- if (mergedDisabledHours && mergedDisabledHours().includes(hour)) {
- return true;
- }
- if (mergedDisabledMinutes && mergedDisabledMinutes(hour).includes(minute)) {
- return true;
- }
- if (mergedDisabledSeconds && mergedDisabledSeconds(hour, minute).includes(second)) {
- return true;
- }
- if (disabledMilliseconds && disabledMilliseconds(hour, minute, second).includes(millisecond)) {
- return true;
- }
- }
- return false;
- });
- return isInvalidate;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useFilledProps.js
- function useList(value) {
- var fillMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var values = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var list = value ? miscUtil_toArray(value) : value;
- if (fillMode && list) {
- list[1] = list[1] || list[0];
- }
- return list;
- }, [value, fillMode]);
- return values;
- }
- /**
- * Align the outer props with unique typed and fill undefined props.
- * This is shared with both RangePicker and Picker. This will do:
- * - Convert `value` & `defaultValue` to array
- * - handle the legacy props fill like `clearIcon` + `allowClear` = `clearIcon`
- */
- function useFilledProps(props, updater) {
- var generateConfig = props.generateConfig,
- locale = props.locale,
- _props$picker = props.picker,
- picker = _props$picker === void 0 ? 'date' : _props$picker,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-picker' : _props$prefixCls,
- _props$styles = props.styles,
- styles = _props$styles === void 0 ? {} : _props$styles,
- _props$classNames = props.classNames,
- classNames = _props$classNames === void 0 ? {} : _props$classNames,
- _props$order = props.order,
- order = _props$order === void 0 ? true : _props$order,
- _props$components = props.components,
- components = _props$components === void 0 ? {} : _props$components,
- inputRender = props.inputRender,
- allowClear = props.allowClear,
- clearIcon = props.clearIcon,
- needConfirm = props.needConfirm,
- multiple = props.multiple,
- format = props.format,
- inputReadOnly = props.inputReadOnly,
- disabledDate = props.disabledDate,
- minDate = props.minDate,
- maxDate = props.maxDate,
- showTime = props.showTime,
- value = props.value,
- defaultValue = props.defaultValue,
- pickerValue = props.pickerValue,
- defaultPickerValue = props.defaultPickerValue;
- var values = useList(value);
- var defaultValues = useList(defaultValue);
- var pickerValues = useList(pickerValue);
- var defaultPickerValues = useList(defaultPickerValue);
- // ======================== Picker ========================
- /** Almost same as `picker`, but add `datetime` for `date` with `showTime` */
- var internalPicker = picker === 'date' && showTime ? 'datetime' : picker;
- /** The picker is `datetime` or `time` */
- var multipleInteractivePicker = internalPicker === 'time' || internalPicker === 'datetime';
- var complexPicker = multipleInteractivePicker || multiple;
- var mergedNeedConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : multipleInteractivePicker;
- // ========================== Time ==========================
- // Auto `format` need to check `showTime.showXXX` first.
- // And then merge the `locale` into `mergedShowTime`.
- var _getTimeProps = getTimeProps(props),
- _getTimeProps2 = (0,slicedToArray["default"])(_getTimeProps, 4),
- timeProps = _getTimeProps2[0],
- localeTimeProps = _getTimeProps2[1],
- showTimeFormat = _getTimeProps2[2],
- propFormat = _getTimeProps2[3];
- // ======================= Locales ========================
- var mergedLocale = useLocale_useLocale(locale, localeTimeProps);
- var mergedShowTime = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale);
- }, [internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale]);
- // ======================= Warning ========================
- if ( true && picker === 'time') {
- if (['disabledHours', 'disabledMinutes', 'disabledSeconds'].some(function (key) {
- return props[key];
- })) {
- (0,rc_util_es.warning)(false, "'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.");
- }
- }
- // ======================== Props =========================
- var filledProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- prefixCls: prefixCls,
- locale: mergedLocale,
- picker: picker,
- styles: styles,
- classNames: classNames,
- order: order,
- components: (0,objectSpread2["default"])({
- input: inputRender
- }, components),
- clearIcon: fillClearIcon(prefixCls, allowClear, clearIcon),
- showTime: mergedShowTime,
- value: values,
- defaultValue: defaultValues,
- pickerValue: pickerValues,
- defaultPickerValue: defaultPickerValues
- }, updater === null || updater === void 0 ? void 0 : updater());
- }, [props]);
- // ======================== Format ========================
- var _useFieldFormat = useFieldFormat(internalPicker, mergedLocale, format),
- _useFieldFormat2 = (0,slicedToArray["default"])(_useFieldFormat, 2),
- formatList = _useFieldFormat2[0],
- maskFormat = _useFieldFormat2[1];
- // ======================= ReadOnly =======================
- var mergedInputReadOnly = useInputReadOnly(formatList, inputReadOnly, multiple);
- // ======================= Boundary =======================
- var disabledBoundaryDate = useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate);
- // ====================== Invalidate ======================
- var isInvalidateDate = useInvalidate(generateConfig, picker, disabledBoundaryDate, mergedShowTime);
- // ======================== Merged ========================
- var mergedProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, filledProps), {}, {
- needConfirm: mergedNeedConfirm,
- inputReadOnly: mergedInputReadOnly,
- disabledDate: disabledBoundaryDate
- });
- }, [filledProps, mergedNeedConfirm, mergedInputReadOnly, disabledBoundaryDate]);
- return [mergedProps, internalPicker, complexPicker, formatList, maskFormat, isInvalidateDate];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useDelayState.js
- /**
- * Will be `true` immediately for next effect.
- * But will be `false` for a delay of effect.
- */
- function useDelayState(value, defaultValue, onChange) {
- var _useMergedState = (0,rc_util_es.useMergedState)(defaultValue, {
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- state = _useMergedState2[0],
- setState = _useMergedState2[1];
- var nextValueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(value);
- // ============================= Update =============================
- var rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef();
- var cancelRaf = function cancelRaf() {
- raf["default"].cancel(rafRef.current);
- };
- var doUpdate = (0,rc_util_es.useEvent)(function () {
- setState(nextValueRef.current);
- if (onChange && state !== nextValueRef.current) {
- onChange(nextValueRef.current);
- }
- });
- var updateValue = (0,rc_util_es.useEvent)(function (next, immediately) {
- cancelRaf();
- nextValueRef.current = next;
- if (next || immediately) {
- doUpdate();
- } else {
- rafRef.current = (0,raf["default"])(doUpdate);
- }
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
- return cancelRaf;
- }, []);
- return [state, updateValue];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useOpen.js
- /**
- * Control the open state.
- * Will not close if activeElement is on the popup.
- */
- function useOpen(open, defaultOpen) {
- var disabledList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- var onOpenChange = arguments.length > 3 ? arguments[3] : undefined;
- var mergedOpen = disabledList.every(function (disabled) {
- return disabled;
- }) ? false : open;
- // Delay for handle the open state, in case fast shift from `open` -> `close` -> `open`
- // const [rafOpen, setRafOpen] = useLockState(open, defaultOpen || false, onOpenChange);
- var _useDelayState = useDelayState(mergedOpen, defaultOpen || false, onOpenChange),
- _useDelayState2 = (0,slicedToArray["default"])(_useDelayState, 2),
- rafOpen = _useDelayState2[0],
- setRafOpen = _useDelayState2[1];
- function setOpen(next) {
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (!config.inherit || rafOpen) {
- setRafOpen(next, config.force);
- }
- }
- return [rafOpen, setOpen];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/usePickerRef.js
- function usePickerRef(ref) {
- var selectorRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- var _selectorRef$current;
- return {
- nativeElement: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.nativeElement,
- focus: function focus(options) {
- var _selectorRef$current2;
- (_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 || _selectorRef$current2.focus(options);
- },
- blur: function blur() {
- var _selectorRef$current3;
- (_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 || _selectorRef$current3.blur();
- }
- };
- });
- return selectorRef;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/usePresets.js
- function usePresets(presets, legacyRanges) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (presets) {
- return presets;
- }
- if (legacyRanges) {
- (0,warning["default"])(false, '`ranges` is deprecated. Please use `presets` instead.');
- return Object.entries(legacyRanges).map(function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 2),
- label = _ref2[0],
- value = _ref2[1];
- return {
- label: label,
- value: value
- };
- });
- }
- return [];
- }, [presets, legacyRanges]);
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useLockEffect.js
- /**
- * Trigger `callback` immediately when `condition` is `true`.
- * But trigger `callback` in next frame when `condition` is `false`.
- */
- function useLockEffect(condition, callback) {
- var delayFrames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var callbackRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(callback);
- callbackRef.current = callback;
- (0,useLayoutEffect.useLayoutUpdateEffect)(function () {
- if (condition) {
- callbackRef.current(condition);
- } else {
- var id = (0,raf["default"])(function () {
- callbackRef.current(condition);
- }, delayFrames);
- return function () {
- raf["default"].cancel(id);
- };
- }
- }, [condition]);
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useRangeActive.js
- /**
- * When user first focus one input, any submit will trigger focus another one.
- * When second time focus one input, submit will not trigger focus again.
- * When click outside to close the panel, trigger event if it can trigger onChange.
- */
- function useRangeActive(disabled) {
- var empty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var mergedOpen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeIndex = _React$useState2[0],
- setActiveIndex = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- focused = _React$useState4[0],
- setFocused = _React$useState4[1];
- var activeListRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- var submitIndexRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var lastOperationRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var updateSubmitIndex = function updateSubmitIndex(index) {
- submitIndexRef.current = index;
- };
- var hasActiveSubmitValue = function hasActiveSubmitValue(index) {
- return submitIndexRef.current === index;
- };
- var triggerFocus = function triggerFocus(nextFocus) {
- setFocused(nextFocus);
- };
- // ============================= Record =============================
- var lastOperation = function lastOperation(type) {
- if (type) {
- lastOperationRef.current = type;
- }
- return lastOperationRef.current;
- };
- // ============================ Strategy ============================
- // Trigger when input enter or input blur or panel close
- var nextActiveIndex = function nextActiveIndex(nextValue) {
- var list = activeListRef.current;
- var filledActiveSet = new Set(list.filter(function (index) {
- return nextValue[index] || empty[index];
- }));
- var nextIndex = list[list.length - 1] === 0 ? 1 : 0;
- if (filledActiveSet.size >= 2 || disabled[nextIndex]) {
- return null;
- }
- return nextIndex;
- };
- // ============================= Effect =============================
- // Wait in case it's from the click outside to blur
- useLockEffect(focused || mergedOpen, function () {
- if (!focused) {
- activeListRef.current = [];
- updateSubmitIndex(null);
- }
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (focused) {
- activeListRef.current.push(activeIndex);
- }
- }, [focused, activeIndex]);
- return [focused, triggerFocus, lastOperation, activeIndex, setActiveIndex, nextActiveIndex, activeListRef.current, updateSubmitIndex, hasActiveSubmitValue];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useRangeDisabledDate.js
- /**
- * RangePicker need additional logic to handle the `disabled` case. e.g.
- * [disabled, enabled] should end date not before start date
- */
- function useRangeDisabledDate(values, disabled, activeIndexList, generateConfig, locale, disabledDate) {
- var activeIndex = activeIndexList[activeIndexList.length - 1];
- var rangeDisabledDate = function rangeDisabledDate(date, info) {
- var _values = (0,slicedToArray["default"])(values, 2),
- start = _values[0],
- end = _values[1];
- var mergedInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, info), {}, {
- from: getFromDate(values, activeIndexList)
- });
- // ============================ Disabled ============================
- // Should not select days before the start date
- if (activeIndex === 1 && disabled[0] && start &&
- // Same date isOK
- !isSame(generateConfig, locale, start, date, mergedInfo.type) &&
- // Before start date
- generateConfig.isAfter(start, date)) {
- return true;
- }
- // Should not select days after the end date
- if (activeIndex === 0 && disabled[1] && end &&
- // Same date isOK
- !isSame(generateConfig, locale, end, date, mergedInfo.type) &&
- // After end date
- generateConfig.isAfter(date, end)) {
- return true;
- }
- // ============================= Origin =============================
- return disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date, mergedInfo);
- };
- return rangeDisabledDate;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useRangePickerValue.js
- function offsetPanelDate(generateConfig, picker, date, offset) {
- switch (picker) {
- case 'date':
- case 'week':
- return generateConfig.addMonth(date, offset);
- case 'month':
- case 'quarter':
- return generateConfig.addYear(date, offset);
- case 'year':
- return generateConfig.addYear(date, offset * 10);
- case 'decade':
- return generateConfig.addYear(date, offset * 100);
- default:
- return date;
- }
- }
- var useRangePickerValue_EMPTY_LIST = [];
- function useRangePickerValue(generateConfig, locale, calendarValue, modes, open, activeIndex, pickerMode, multiplePanel) {
- var defaultPickerValue = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : useRangePickerValue_EMPTY_LIST;
- var pickerValue = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : useRangePickerValue_EMPTY_LIST;
- var timeDefaultValue = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : useRangePickerValue_EMPTY_LIST;
- var onPickerValueChange = arguments.length > 11 ? arguments[11] : undefined;
- var minDate = arguments.length > 12 ? arguments[12] : undefined;
- var maxDate = arguments.length > 13 ? arguments[13] : undefined;
- var isTimePicker = pickerMode === 'time';
- // ======================== Active ========================
- // `activeIndex` must be valid to avoid getting empty `pickerValue`
- var mergedActiveIndex = activeIndex || 0;
- // ===================== Picker Value =====================
- var getDefaultPickerValue = function getDefaultPickerValue(index) {
- var now = generateConfig.getNow();
- if (isTimePicker) {
- now = fillTime(generateConfig, now);
- }
- return defaultPickerValue[index] || calendarValue[index] || now;
- };
- // Align `pickerValue` with `showTime.defaultValue`
- var _pickerValue = (0,slicedToArray["default"])(pickerValue, 2),
- startPickerValue = _pickerValue[0],
- endPickerValue = _pickerValue[1];
- // PickerValue state
- var _useMergedState = (0,rc_util_es.useMergedState)(function () {
- return getDefaultPickerValue(0);
- }, {
- value: startPickerValue
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedStartPickerValue = _useMergedState2[0],
- setStartPickerValue = _useMergedState2[1];
- var _useMergedState3 = (0,rc_util_es.useMergedState)(function () {
- return getDefaultPickerValue(1);
- }, {
- value: endPickerValue
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedEndPickerValue = _useMergedState4[0],
- setEndPickerValue = _useMergedState4[1];
- // Current PickerValue
- var currentPickerValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var current = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex];
- // Merge the `showTime.defaultValue` into `pickerValue`
- return isTimePicker ? current : fillTime(generateConfig, current, timeDefaultValue[mergedActiveIndex]);
- }, [isTimePicker, mergedStartPickerValue, mergedEndPickerValue, mergedActiveIndex, generateConfig, timeDefaultValue]);
- var setCurrentPickerValue = function setCurrentPickerValue(nextPickerValue) {
- var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'panel';
- var updater = [setStartPickerValue, setEndPickerValue][mergedActiveIndex];
- updater(nextPickerValue);
- var clone = [mergedStartPickerValue, mergedEndPickerValue];
- clone[mergedActiveIndex] = nextPickerValue;
- if (onPickerValueChange && (!isSame(generateConfig, locale, mergedStartPickerValue, clone[0], pickerMode) || !isSame(generateConfig, locale, mergedEndPickerValue, clone[1], pickerMode))) {
- onPickerValueChange(clone, {
- source: source,
- range: mergedActiveIndex === 1 ? 'end' : 'start',
- mode: modes
- });
- }
- };
- // ======================== Effect ========================
- /**
- * EndDate pickerValue is little different. It should be:
- * - If date picker (without time), endDate is not same year & month as startDate
- * - pickerValue minus one month
- * - Else pass directly
- */
- var getEndDatePickerValue = function getEndDatePickerValue(startDate, endDate) {
- if (multiplePanel) {
- // Basic offset
- var SAME_CHECKER = {
- date: 'month',
- week: 'month',
- month: 'year',
- quarter: 'year'
- };
- var mode = SAME_CHECKER[pickerMode];
- if (mode && !isSame(generateConfig, locale, startDate, endDate, mode)) {
- return offsetPanelDate(generateConfig, pickerMode, endDate, -1);
- }
- // Year offset
- if (pickerMode === 'year' && startDate) {
- var srcYear = Math.floor(generateConfig.getYear(startDate) / 10);
- var tgtYear = Math.floor(generateConfig.getYear(endDate) / 10);
- if (srcYear !== tgtYear) {
- return offsetPanelDate(generateConfig, pickerMode, endDate, -1);
- }
- }
- }
- return endDate;
- };
- // >>> When switch field, reset the picker value as prev field picker value
- var prevActiveIndexRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- (0,useLayoutEffect["default"])(function () {
- if (open) {
- if (!defaultPickerValue[mergedActiveIndex]) {
- var nextPickerValue = isTimePicker ? null : generateConfig.getNow();
- /**
- * 1. If has prevActiveIndex, use it to avoid panel jump
- * 2. If current field has value
- * - If `activeIndex` is 1 and `calendarValue[0]` is not same panel as `calendarValue[1]`,
- * offset `calendarValue[1]` and set it
- * - Else use `calendarValue[activeIndex]`
- * 3. If current field has no value but another field has value, use another field value
- * 4. Else use now (not any `calendarValue` can ref)
- */
- if (prevActiveIndexRef.current !== null && prevActiveIndexRef.current !== mergedActiveIndex) {
- // If from another field, not jump picker value
- nextPickerValue = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex ^ 1];
- } else if (calendarValue[mergedActiveIndex]) {
- // Current field has value
- nextPickerValue = mergedActiveIndex === 0 ? calendarValue[0] : getEndDatePickerValue(calendarValue[0], calendarValue[1]);
- } else if (calendarValue[mergedActiveIndex ^ 1]) {
- // Current field has no value but another field has value
- nextPickerValue = calendarValue[mergedActiveIndex ^ 1];
- }
- // Only sync when has value, this will sync in the `min-max` logic
- if (nextPickerValue) {
- // nextPickerValue < minDate
- if (minDate && generateConfig.isAfter(minDate, nextPickerValue)) {
- nextPickerValue = minDate;
- }
- // maxDate < nextPickerValue
- var offsetPickerValue = multiplePanel ? offsetPanelDate(generateConfig, pickerMode, nextPickerValue, 1) : nextPickerValue;
- if (maxDate && generateConfig.isAfter(offsetPickerValue, maxDate)) {
- nextPickerValue = multiplePanel ? offsetPanelDate(generateConfig, pickerMode, maxDate, -1) : maxDate;
- }
- setCurrentPickerValue(nextPickerValue, 'reset');
- }
- }
- }
- }, [open, mergedActiveIndex, calendarValue[mergedActiveIndex]]);
- // >>> Reset prevActiveIndex when panel closed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (open) {
- prevActiveIndexRef.current = mergedActiveIndex;
- } else {
- prevActiveIndexRef.current = null;
- }
- }, [open, mergedActiveIndex]);
- // >>> defaultPickerValue: Resync to `defaultPickerValue` for each panel focused
- (0,useLayoutEffect["default"])(function () {
- if (open && defaultPickerValue) {
- if (defaultPickerValue[mergedActiveIndex]) {
- setCurrentPickerValue(defaultPickerValue[mergedActiveIndex], 'reset');
- }
- }
- }, [open, mergedActiveIndex]);
- return [currentPickerValue, setCurrentPickerValue];
- }
- ;// ./node_modules/rc-picker/es/hooks/useSyncState.js
- /**
- * Sync value with state.
- * This should only used for internal which not affect outside calculation.
- * Since it's not safe for suspense.
- */
- function useSyncState(defaultValue, controlledValue) {
- var valueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(defaultValue);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- forceUpdate = _React$useState2[1];
- var getter = function getter(useControlledValueFirst) {
- return useControlledValueFirst && controlledValue !== undefined ? controlledValue : valueRef.current;
- };
- var setter = function setter(nextValue) {
- valueRef.current = nextValue;
- forceUpdate({});
- };
- return [getter, setter, getter(true)];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useRangeValue.js
- var EMPTY_VALUE = [];
- // Submit Logic:
- // * ✅ Value:
- // * merged value using controlled value, if not, use stateValue
- // * When merged value change, [1] resync calendar value and submit value
- // * ✅ Calender Value:
- // * 💻 When user typing is validate, change the calendar value
- // * 🌅 When user click on the panel, change the calendar value
- // * Submit Value:
- // * 💻 When user blur the input, flush calendar value to submit value
- // * 🌅 When user click on the panel is no needConfirm, flush calendar value to submit value
- // * 🌅 When user click on the panel is needConfirm and click OK, flush calendar value to submit value
- // * Blur logic & close logic:
- // * ✅ For value, always try flush submit
- // * ✅ If `needConfirm`, reset as [1]
- // * Else (`!needConfirm`)
- // * If has another index field, active another index
- // * ✅ Flush submit:
- // * If all the start & end field is confirmed or all blur or panel closed
- // * Update `needSubmit` mark to true
- // * trigger onChange by `needSubmit` and update stateValue
- function useUtil(generateConfig, locale, formatList) {
- var getDateTexts = function getDateTexts(dates) {
- return dates.map(function (date) {
- return formatValue(date, {
- generateConfig: generateConfig,
- locale: locale,
- format: formatList[0]
- });
- });
- };
- var isSameDates = function isSameDates(source, target) {
- var maxLen = Math.max(source.length, target.length);
- var diffIndex = -1;
- for (var i = 0; i < maxLen; i += 1) {
- var prev = source[i] || null;
- var next = target[i] || null;
- if (prev !== next && !isSameTimestamp(generateConfig, prev, next)) {
- diffIndex = i;
- break;
- }
- }
- return [diffIndex < 0, diffIndex !== 0];
- };
- return [getDateTexts, isSameDates];
- }
- function orderDates(dates, generateConfig) {
- return (0,toConsumableArray["default"])(dates).sort(function (a, b) {
- return generateConfig.isAfter(a, b) ? 1 : -1;
- });
- }
- /**
- * Used for internal value management.
- * It should always use `mergedValue` in render logic
- */
- function useCalendarValue(mergedValue) {
- var _useSyncState = useSyncState(mergedValue),
- _useSyncState2 = (0,slicedToArray["default"])(_useSyncState, 2),
- calendarValue = _useSyncState2[0],
- setCalendarValue = _useSyncState2[1];
- /** Sync calendarValue & submitValue back with value */
- var syncWithValue = (0,rc_util_es.useEvent)(function () {
- setCalendarValue(mergedValue);
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- syncWithValue();
- }, [mergedValue]);
- return [calendarValue, setCalendarValue];
- }
- /**
- * Control the internal `value` align with prop `value` and provide a temp `calendarValue` for ui.
- * `calendarValue` will be reset when blur & focus & open.
- */
- function useInnerValue(generateConfig, locale, formatList, /** Used for RangePicker. `true` means [DateType, DateType] or will be DateType[] */
- rangeValue,
- /**
- * Trigger order when trigger calendar value change.
- * This should only used in SinglePicker with `multiple` mode.
- * So when `rangeValue` is `true`, order will be ignored.
- */
- order, defaultValue, value, onCalendarChange, onOk) {
- // This is the root value which will sync with controlled or uncontrolled value
- var _useMergedState = (0,rc_util_es.useMergedState)(defaultValue, {
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- innerValue = _useMergedState2[0],
- setInnerValue = _useMergedState2[1];
- var mergedValue = innerValue || EMPTY_VALUE;
- // ========================= Inner Values =========================
- var _useCalendarValue = useCalendarValue(mergedValue),
- _useCalendarValue2 = (0,slicedToArray["default"])(_useCalendarValue, 2),
- calendarValue = _useCalendarValue2[0],
- setCalendarValue = _useCalendarValue2[1];
- // ============================ Change ============================
- var _useUtil = useUtil(generateConfig, locale, formatList),
- _useUtil2 = (0,slicedToArray["default"])(_useUtil, 2),
- getDateTexts = _useUtil2[0],
- isSameDates = _useUtil2[1];
- var triggerCalendarChange = (0,rc_util_es.useEvent)(function (nextCalendarValues) {
- var clone = (0,toConsumableArray["default"])(nextCalendarValues);
- if (rangeValue) {
- for (var i = 0; i < 2; i += 1) {
- clone[i] = clone[i] || null;
- }
- } else if (order) {
- clone = orderDates(clone.filter(function (date) {
- return date;
- }), generateConfig);
- }
- // Update merged value
- var _isSameDates = isSameDates(calendarValue(), clone),
- _isSameDates2 = (0,slicedToArray["default"])(_isSameDates, 2),
- isSameMergedDates = _isSameDates2[0],
- isSameStart = _isSameDates2[1];
- if (!isSameMergedDates) {
- setCalendarValue(clone);
- // Trigger calendar change event
- if (onCalendarChange) {
- var cellTexts = getDateTexts(clone);
- onCalendarChange(clone, cellTexts, {
- range: isSameStart ? 'end' : 'start'
- });
- }
- }
- });
- var triggerOk = function triggerOk() {
- if (onOk) {
- onOk(calendarValue());
- }
- };
- return [mergedValue, setInnerValue, calendarValue, triggerCalendarChange, triggerOk];
- }
- function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, open, isInvalidateDate) {
- var generateConfig = info.generateConfig,
- locale = info.locale,
- picker = info.picker,
- onChange = info.onChange,
- allowEmpty = info.allowEmpty,
- order = info.order;
- var orderOnChange = disabled.some(function (d) {
- return d;
- }) ? false : order;
- // ============================= Util =============================
- var _useUtil3 = useUtil(generateConfig, locale, formatList),
- _useUtil4 = (0,slicedToArray["default"])(_useUtil3, 2),
- getDateTexts = _useUtil4[0],
- isSameDates = _useUtil4[1];
- // ============================ Values ============================
- // Used for trigger `onChange` event.
- // Record current value which is wait for submit.
- var _useSyncState3 = useSyncState(mergedValue),
- _useSyncState4 = (0,slicedToArray["default"])(_useSyncState3, 2),
- submitValue = _useSyncState4[0],
- setSubmitValue = _useSyncState4[1];
- /** Sync calendarValue & submitValue back with value */
- var syncWithValue = (0,rc_util_es.useEvent)(function () {
- setSubmitValue(mergedValue);
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- syncWithValue();
- }, [mergedValue]);
- // ============================ Submit ============================
- var triggerSubmit = (0,rc_util_es.useEvent)(function (nextValue) {
- var isNullValue = nextValue === null;
- var clone = (0,toConsumableArray["default"])(nextValue || submitValue());
- // Fill null value
- if (isNullValue) {
- var maxLen = Math.max(disabled.length, clone.length);
- for (var i = 0; i < maxLen; i += 1) {
- if (!disabled[i]) {
- clone[i] = null;
- }
- }
- }
- // Only when exist value to sort
- if (orderOnChange && clone[0] && clone[1]) {
- clone = orderDates(clone, generateConfig);
- }
- // Sync `calendarValue`
- triggerCalendarChange(clone);
- // ========= Validate check =========
- var _clone = clone,
- _clone2 = (0,slicedToArray["default"])(_clone, 2),
- start = _clone2[0],
- end = _clone2[1];
- // >>> Empty
- var startEmpty = !start;
- var endEmpty = !end;
- var validateEmptyDateRange = allowEmpty ?
- // Validate empty start
- (!startEmpty || allowEmpty[0]) && (
- // Validate empty end
- !endEmpty || allowEmpty[1]) : true;
- // >>> Order
- var validateOrder = !order || startEmpty || endEmpty || isSame(generateConfig, locale, start, end, picker) || generateConfig.isAfter(end, start);
- // >>> Invalid
- var validateDates =
- // Validate start
- (disabled[0] || !start || !isInvalidateDate(start, {
- activeIndex: 0
- })) && (
- // Validate end
- disabled[1] || !end || !isInvalidateDate(end, {
- from: start,
- activeIndex: 1
- }));
- // >>> Result
- var allPassed =
- // Null value is from clear button
- isNullValue ||
- // Normal check
- validateEmptyDateRange && validateOrder && validateDates;
- if (allPassed) {
- // Sync value with submit value
- setInnerValue(clone);
- var _isSameDates3 = isSameDates(clone, mergedValue),
- _isSameDates4 = (0,slicedToArray["default"])(_isSameDates3, 1),
- isSameMergedDates = _isSameDates4[0];
- // Trigger `onChange` if needed
- if (onChange && !isSameMergedDates) {
- onChange(
- // Return null directly if all date are empty
- isNullValue && clone.every(function (val) {
- return !val;
- }) ? null : clone, getDateTexts(clone));
- }
- }
- return allPassed;
- });
- // ========================= Flush Submit =========================
- var flushSubmit = (0,rc_util_es.useEvent)(function (index, needTriggerChange) {
- var nextSubmitValue = fillIndex(submitValue(), index, getCalendarValue()[index]);
- setSubmitValue(nextSubmitValue);
- if (needTriggerChange) {
- triggerSubmit();
- }
- });
- // ============================ Effect ============================
- // All finished action trigger after 2 frames
- var interactiveFinished = !focused && !open;
- useLockEffect(!interactiveFinished, function () {
- if (interactiveFinished) {
- // Always try to trigger submit first
- triggerSubmit();
- // Trigger calendar change since this is a effect reset
- // https://github.com/ant-design/ant-design/issues/22351
- triggerCalendarChange(mergedValue);
- // Sync with value anyway
- syncWithValue();
- }
- }, 2);
- // ============================ Return ============================
- return [flushSubmit, triggerSubmit];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/hooks/useShowNow.js
- function useShowNow(picker, mode, showNow, showToday, rangePicker) {
- if (mode !== 'date' && mode !== 'time') {
- return false;
- }
- if (showNow !== undefined) {
- return showNow;
- }
- // Compatible with old version `showToday`
- if (showToday !== undefined) {
- return showToday;
- }
- return !rangePicker && (picker === 'date' || picker === 'time');
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/util.js
- function findValidateTime(date, getHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits, generateConfig) {
- var nextDate = date;
- function alignValidate(getUnitValue, setUnitValue, units) {
- var nextValue = generateConfig[getUnitValue](nextDate);
- var nextUnit = units.find(function (unit) {
- return unit.value === nextValue;
- });
- if (!nextUnit || nextUnit.disabled) {
- // Find most closest unit
- var validateUnits = units.filter(function (unit) {
- return !unit.disabled;
- });
- var reverseEnabledUnits = (0,toConsumableArray["default"])(validateUnits).reverse();
- var validateUnit = reverseEnabledUnits.find(function (unit) {
- return unit.value <= nextValue;
- }) || validateUnits[0];
- if (validateUnit) {
- nextValue = validateUnit.value;
- nextDate = generateConfig[setUnitValue](nextDate, nextValue);
- }
- }
- return nextValue;
- }
- // Find validate hour
- var nextHour = alignValidate('getHour', 'setHour', getHourUnits());
- // Find validate minute
- var nextMinute = alignValidate('getMinute', 'setMinute', getMinuteUnits(nextHour));
- // Find validate second
- var nextSecond = alignValidate('getSecond', 'setSecond', getSecondUnits(nextHour, nextMinute));
- // Find validate millisecond
- alignValidate('getMillisecond', 'setMillisecond', getMillisecondUnits(nextHour, nextMinute, nextSecond));
- return nextDate;
- }
- ;// ./node_modules/rc-picker/es/hooks/useTimeInfo.js
- function emptyDisabled() {
- return [];
- }
- function generateUnits(start, end) {
- var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var hideDisabledOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- var disabledUnits = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
- var pad = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 2;
- var units = [];
- var integerStep = step >= 1 ? step | 0 : 1;
- for (var i = start; i <= end; i += integerStep) {
- var disabled = disabledUnits.includes(i);
- if (!disabled || !hideDisabledOptions) {
- units.push({
- label: leftPad(i, pad),
- value: i,
- disabled: disabled
- });
- }
- }
- return units;
- }
- /**
- * Parse time props to get util info
- */
- function useTimeInfo(generateConfig) {
- var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var date = arguments.length > 2 ? arguments[2] : undefined;
- var _ref = props || {},
- use12Hours = _ref.use12Hours,
- _ref$hourStep = _ref.hourStep,
- hourStep = _ref$hourStep === void 0 ? 1 : _ref$hourStep,
- _ref$minuteStep = _ref.minuteStep,
- minuteStep = _ref$minuteStep === void 0 ? 1 : _ref$minuteStep,
- _ref$secondStep = _ref.secondStep,
- secondStep = _ref$secondStep === void 0 ? 1 : _ref$secondStep,
- _ref$millisecondStep = _ref.millisecondStep,
- millisecondStep = _ref$millisecondStep === void 0 ? 100 : _ref$millisecondStep,
- hideDisabledOptions = _ref.hideDisabledOptions,
- disabledTime = _ref.disabledTime,
- disabledHours = _ref.disabledHours,
- disabledMinutes = _ref.disabledMinutes,
- disabledSeconds = _ref.disabledSeconds;
- var mergedDate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return date || generateConfig.getNow();
- }, [date, generateConfig]);
- // ======================== Warnings ========================
- if (true) {
- var isHourStepValid = 24 % hourStep === 0;
- var isMinuteStepValid = 60 % minuteStep === 0;
- var isSecondStepValid = 60 % secondStep === 0;
- (0,rc_util_es.warning)(isHourStepValid, "`hourStep` ".concat(hourStep, " is invalid. It should be a factor of 24."));
- (0,rc_util_es.warning)(isMinuteStepValid, "`minuteStep` ".concat(minuteStep, " is invalid. It should be a factor of 60."));
- (0,rc_util_es.warning)(isSecondStepValid, "`secondStep` ".concat(secondStep, " is invalid. It should be a factor of 60."));
- }
- // ======================== Disabled ========================
- var getDisabledTimes = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (targetDate) {
- var disabledConfig = (disabledTime === null || disabledTime === void 0 ? void 0 : disabledTime(targetDate)) || {};
- return [disabledConfig.disabledHours || disabledHours || emptyDisabled, disabledConfig.disabledMinutes || disabledMinutes || emptyDisabled, disabledConfig.disabledSeconds || disabledSeconds || emptyDisabled, disabledConfig.disabledMilliseconds || emptyDisabled];
- }, [disabledTime, disabledHours, disabledMinutes, disabledSeconds]);
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getDisabledTimes(mergedDate);
- }, [mergedDate, getDisabledTimes]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 4),
- mergedDisabledHours = _React$useMemo2[0],
- mergedDisabledMinutes = _React$useMemo2[1],
- mergedDisabledSeconds = _React$useMemo2[2],
- mergedDisabledMilliseconds = _React$useMemo2[3];
- // ========================= Column =========================
- var getAllUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (getDisabledHours, getDisabledMinutes, getDisabledSeconds, getDisabledMilliseconds) {
- var hours = generateUnits(0, 23, hourStep, hideDisabledOptions, getDisabledHours());
- // Hours
- var rowHourUnits = use12Hours ? hours.map(function (unit) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, unit), {}, {
- label: leftPad(unit.value % 12 || 12, 2)
- });
- }) : hours;
- // Minutes
- var getMinuteUnits = function getMinuteUnits(nextHour) {
- return generateUnits(0, 59, minuteStep, hideDisabledOptions, getDisabledMinutes(nextHour));
- };
- // Seconds
- var getSecondUnits = function getSecondUnits(nextHour, nextMinute) {
- return generateUnits(0, 59, secondStep, hideDisabledOptions, getDisabledSeconds(nextHour, nextMinute));
- };
- // Milliseconds
- var getMillisecondUnits = function getMillisecondUnits(nextHour, nextMinute, nextSecond) {
- return generateUnits(0, 999, millisecondStep, hideDisabledOptions, getDisabledMilliseconds(nextHour, nextMinute, nextSecond), 3);
- };
- return [rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits];
- }, [hideDisabledOptions, hourStep, use12Hours, millisecondStep, minuteStep, secondStep]);
- var _React$useMemo3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getAllUnits(mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds);
- }, [getAllUnits, mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds]),
- _React$useMemo4 = (0,slicedToArray["default"])(_React$useMemo3, 4),
- rowHourUnits = _React$useMemo4[0],
- getMinuteUnits = _React$useMemo4[1],
- getSecondUnits = _React$useMemo4[2],
- getMillisecondUnits = _React$useMemo4[3];
- // ======================== Validate ========================
- /**
- * Get validate time with `disabledTime`, `certainDate` to specific the date need to check
- */
- var getValidTime = function getValidTime(nextTime, certainDate) {
- var getCheckHourUnits = function getCheckHourUnits() {
- return rowHourUnits;
- };
- var getCheckMinuteUnits = getMinuteUnits;
- var getCheckSecondUnits = getSecondUnits;
- var getCheckMillisecondUnits = getMillisecondUnits;
- if (certainDate) {
- var _getDisabledTimes = getDisabledTimes(certainDate),
- _getDisabledTimes2 = (0,slicedToArray["default"])(_getDisabledTimes, 4),
- targetDisabledHours = _getDisabledTimes2[0],
- targetDisabledMinutes = _getDisabledTimes2[1],
- targetDisabledSeconds = _getDisabledTimes2[2],
- targetDisabledMilliseconds = _getDisabledTimes2[3];
- var _getAllUnits = getAllUnits(targetDisabledHours, targetDisabledMinutes, targetDisabledSeconds, targetDisabledMilliseconds),
- _getAllUnits2 = (0,slicedToArray["default"])(_getAllUnits, 4),
- targetRowHourUnits = _getAllUnits2[0],
- targetGetMinuteUnits = _getAllUnits2[1],
- targetGetSecondUnits = _getAllUnits2[2],
- targetGetMillisecondUnits = _getAllUnits2[3];
- getCheckHourUnits = function getCheckHourUnits() {
- return targetRowHourUnits;
- };
- getCheckMinuteUnits = targetGetMinuteUnits;
- getCheckSecondUnits = targetGetSecondUnits;
- getCheckMillisecondUnits = targetGetMillisecondUnits;
- }
- var validateDate = findValidateTime(nextTime, getCheckHourUnits, getCheckMinuteUnits, getCheckSecondUnits, getCheckMillisecondUnits, generateConfig);
- return validateDate;
- };
- return [
- // getValidTime
- getValidTime,
- // Units
- rowHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Popup/Footer.js
- function Footer_Footer(props) {
- var mode = props.mode,
- internalMode = props.internalMode,
- renderExtraFooter = props.renderExtraFooter,
- showNow = props.showNow,
- showTime = props.showTime,
- onSubmit = props.onSubmit,
- onNow = props.onNow,
- invalid = props.invalid,
- needConfirm = props.needConfirm,
- generateConfig = props.generateConfig,
- disabledDate = props.disabledDate;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls,
- locale = _React$useContext.locale,
- _React$useContext$but = _React$useContext.button,
- Button = _React$useContext$but === void 0 ? 'button' : _React$useContext$but;
- // >>> Now
- var now = generateConfig.getNow();
- var _useTimeInfo = useTimeInfo(generateConfig, showTime, now),
- _useTimeInfo2 = (0,slicedToArray["default"])(_useTimeInfo, 1),
- getValidTime = _useTimeInfo2[0];
- // ======================== Extra =========================
- var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);
- // ======================== Ranges ========================
- var nowDisabled = disabledDate(now, {
- type: mode
- });
- var onInternalNow = function onInternalNow() {
- if (!nowDisabled) {
- var validateNow = getValidTime(now);
- onNow(validateNow);
- }
- };
- var nowPrefixCls = "".concat(prefixCls, "-now");
- var nowBtnPrefixCls = "".concat(nowPrefixCls, "-btn");
- var presetNode = showNow && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- className: nowPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- className: classnames_default()(nowBtnPrefixCls, nowDisabled && "".concat(nowBtnPrefixCls, "-disabled")),
- "aria-disabled": nowDisabled,
- onClick: onInternalNow
- }, internalMode === 'date' ? locale.today : locale.now));
- // >>> OK
- var okNode = needConfirm && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- className: "".concat(prefixCls, "-ok")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Button, {
- disabled: invalid,
- onClick: onSubmit
- }, locale.ok));
- var rangeNode = (presetNode || okNode) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: "".concat(prefixCls, "-ranges")
- }, presetNode, okNode);
- // ======================== Render ========================
- if (!extraNode && !rangeNode) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-footer")
- }, extraNode && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-footer-extra")
- }, extraNode), rangeNode);
- }
- ;// ./node_modules/rc-picker/es/hooks/useToggleDates.js
- /**
- * Toggles the presence of a value in an array.
- * If the value exists in the array, removed it.
- * Else add it.
- */
- function useToggleDates(generateConfig, locale, panelMode) {
- function toggleDates(list, target) {
- var index = list.findIndex(function (date) {
- return isSame(generateConfig, locale, date, target, panelMode);
- });
- if (index === -1) {
- return [].concat((0,toConsumableArray["default"])(list), [target]);
- }
- var sliceList = (0,toConsumableArray["default"])(list);
- sliceList.splice(index, 1);
- return sliceList;
- }
- return toggleDates;
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/context.js
- /** Used for each single Panel. e.g. DatePanel */
- var PanelContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- function usePanelContext() {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PanelContext);
- }
- /**
- * Get shared props for the SharedPanelProps interface.
- */
- function useInfo(props, panelType) {
- var prefixCls = props.prefixCls,
- generateConfig = props.generateConfig,
- locale = props.locale,
- disabledDate = props.disabledDate,
- minDate = props.minDate,
- maxDate = props.maxDate,
- cellRender = props.cellRender,
- hoverValue = props.hoverValue,
- hoverRangeValue = props.hoverRangeValue,
- onHover = props.onHover,
- values = props.values,
- pickerValue = props.pickerValue,
- onSelect = props.onSelect,
- prevIcon = props.prevIcon,
- nextIcon = props.nextIcon,
- superPrevIcon = props.superPrevIcon,
- superNextIcon = props.superNextIcon;
- // ========================= MISC =========================
- var now = generateConfig.getNow();
- // ========================= Info =========================
- var info = {
- now: now,
- values: values,
- pickerValue: pickerValue,
- prefixCls: prefixCls,
- disabledDate: disabledDate,
- minDate: minDate,
- maxDate: maxDate,
- cellRender: cellRender,
- hoverValue: hoverValue,
- hoverRangeValue: hoverRangeValue,
- onHover: onHover,
- locale: locale,
- generateConfig: generateConfig,
- onSelect: onSelect,
- panelType: panelType,
- // Icons
- prevIcon: prevIcon,
- nextIcon: nextIcon,
- superPrevIcon: superPrevIcon,
- superNextIcon: superNextIcon
- };
- return [info, now];
- }
- // ============================== Internal ==============================
- /**
- * Internal usage for RangePicker to not to show the operation arrow
- */
- var PickerHackContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- if (true) {
- PickerHackContext.displayName = 'PickerHackContext';
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/PanelBody.js
- function PanelBody(props) {
- var rowNum = props.rowNum,
- colNum = props.colNum,
- baseDate = props.baseDate,
- getCellDate = props.getCellDate,
- prefixColumn = props.prefixColumn,
- rowClassName = props.rowClassName,
- titleFormat = props.titleFormat,
- getCellText = props.getCellText,
- getCellClassName = props.getCellClassName,
- headerCells = props.headerCells,
- _props$cellSelection = props.cellSelection,
- cellSelection = _props$cellSelection === void 0 ? true : _props$cellSelection,
- disabledDate = props.disabledDate;
- var _usePanelContext = usePanelContext(),
- prefixCls = _usePanelContext.prefixCls,
- type = _usePanelContext.panelType,
- now = _usePanelContext.now,
- contextDisabledDate = _usePanelContext.disabledDate,
- cellRender = _usePanelContext.cellRender,
- onHover = _usePanelContext.onHover,
- hoverValue = _usePanelContext.hoverValue,
- hoverRangeValue = _usePanelContext.hoverRangeValue,
- generateConfig = _usePanelContext.generateConfig,
- values = _usePanelContext.values,
- locale = _usePanelContext.locale,
- onSelect = _usePanelContext.onSelect;
- var mergedDisabledDate = disabledDate || contextDisabledDate;
- var cellPrefixCls = "".concat(prefixCls, "-cell");
- // ============================= Context ==============================
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerHackContext),
- onCellDblClick = _React$useContext.onCellDblClick;
- // ============================== Value ===============================
- var matchValues = function matchValues(date) {
- return values.some(function (singleValue) {
- return singleValue && isSame(generateConfig, locale, date, singleValue, type);
- });
- };
- // =============================== Body ===============================
- var rows = [];
- for (var row = 0; row < rowNum; row += 1) {
- var rowNode = [];
- var rowStartDate = void 0;
- var _loop = function _loop() {
- var offset = row * colNum + col;
- var currentDate = getCellDate(baseDate, offset);
- var disabled = mergedDisabledDate === null || mergedDisabledDate === void 0 ? void 0 : mergedDisabledDate(currentDate, {
- type: type
- });
- // Row Start Cell
- if (col === 0) {
- rowStartDate = currentDate;
- if (prefixColumn) {
- rowNode.push(prefixColumn(rowStartDate));
- }
- }
- // Range
- var inRange = false;
- var rangeStart = false;
- var rangeEnd = false;
- if (cellSelection && hoverRangeValue) {
- var _hoverRangeValue = (0,slicedToArray["default"])(hoverRangeValue, 2),
- hoverStart = _hoverRangeValue[0],
- hoverEnd = _hoverRangeValue[1];
- inRange = isInRange(generateConfig, hoverStart, hoverEnd, currentDate);
- rangeStart = isSame(generateConfig, locale, currentDate, hoverStart, type);
- rangeEnd = isSame(generateConfig, locale, currentDate, hoverEnd, type);
- }
- // Title
- var title = titleFormat ? formatValue(currentDate, {
- locale: locale,
- format: titleFormat,
- generateConfig: generateConfig
- }) : undefined;
- // Render
- var inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(cellPrefixCls, "-inner")
- }, getCellText(currentDate));
- rowNode.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("td", {
- key: col,
- title: title,
- className: classnames_default()(cellPrefixCls, (0,objectSpread2["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function (date) {
- return isSame(generateConfig, locale, currentDate, date, type);
- })), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue &&
- // WeekPicker use row instead
- type !== 'week' && matchValues(currentDate)), getCellClassName(currentDate))),
- onClick: function onClick() {
- if (!disabled) {
- onSelect(currentDate);
- }
- },
- onDoubleClick: function onDoubleClick() {
- if (!disabled && onCellDblClick) {
- onCellDblClick();
- }
- },
- onMouseEnter: function onMouseEnter() {
- if (!disabled) {
- onHover === null || onHover === void 0 || onHover(currentDate);
- }
- },
- onMouseLeave: function onMouseLeave() {
- if (!disabled) {
- onHover === null || onHover === void 0 || onHover(null);
- }
- }
- }, cellRender ? cellRender(currentDate, {
- prefixCls: prefixCls,
- originNode: inner,
- today: now,
- type: type,
- locale: locale
- }) : inner));
- };
- for (var col = 0; col < colNum; col += 1) {
- _loop();
- }
- rows.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", {
- key: row,
- className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowStartDate)
- }, rowNode));
- }
- // ============================== Render ==============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-body")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("table", {
- className: "".concat(prefixCls, "-content")
- }, headerCells && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("thead", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", null, headerCells)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tbody", null, rows)));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/PanelHeader.js
- var HIDDEN_STYLE = {
- visibility: 'hidden'
- };
- function PanelHeader(props) {
- var offset = props.offset,
- superOffset = props.superOffset,
- onChange = props.onChange,
- getStart = props.getStart,
- getEnd = props.getEnd,
- children = props.children;
- var _usePanelContext = usePanelContext(),
- prefixCls = _usePanelContext.prefixCls,
- _usePanelContext$prev = _usePanelContext.prevIcon,
- prevIcon = _usePanelContext$prev === void 0 ? "\u2039" : _usePanelContext$prev,
- _usePanelContext$next = _usePanelContext.nextIcon,
- nextIcon = _usePanelContext$next === void 0 ? "\u203A" : _usePanelContext$next,
- _usePanelContext$supe = _usePanelContext.superPrevIcon,
- superPrevIcon = _usePanelContext$supe === void 0 ? "\xAB" : _usePanelContext$supe,
- _usePanelContext$supe2 = _usePanelContext.superNextIcon,
- superNextIcon = _usePanelContext$supe2 === void 0 ? "\xBB" : _usePanelContext$supe2,
- minDate = _usePanelContext.minDate,
- maxDate = _usePanelContext.maxDate,
- generateConfig = _usePanelContext.generateConfig,
- locale = _usePanelContext.locale,
- pickerValue = _usePanelContext.pickerValue,
- type = _usePanelContext.panelType;
- var headerPrefixCls = "".concat(prefixCls, "-header");
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerHackContext),
- hidePrev = _React$useContext.hidePrev,
- hideNext = _React$useContext.hideNext,
- hideHeader = _React$useContext.hideHeader;
- // ======================= Limitation =======================
- var disabledOffsetPrev = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!minDate || !offset || !getEnd) {
- return false;
- }
- var prevPanelLimitDate = getEnd(offset(-1, pickerValue));
- return !isSameOrAfter(generateConfig, locale, prevPanelLimitDate, minDate, type);
- }, [minDate, offset, pickerValue, getEnd, generateConfig, locale, type]);
- var disabledSuperOffsetPrev = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!minDate || !superOffset || !getEnd) {
- return false;
- }
- var prevPanelLimitDate = getEnd(superOffset(-1, pickerValue));
- return !isSameOrAfter(generateConfig, locale, prevPanelLimitDate, minDate, type);
- }, [minDate, superOffset, pickerValue, getEnd, generateConfig, locale, type]);
- var disabledOffsetNext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!maxDate || !offset || !getStart) {
- return false;
- }
- var nextPanelLimitDate = getStart(offset(1, pickerValue));
- return !isSameOrAfter(generateConfig, locale, maxDate, nextPanelLimitDate, type);
- }, [maxDate, offset, pickerValue, getStart, generateConfig, locale, type]);
- var disabledSuperOffsetNext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!maxDate || !superOffset || !getStart) {
- return false;
- }
- var nextPanelLimitDate = getStart(superOffset(1, pickerValue));
- return !isSameOrAfter(generateConfig, locale, maxDate, nextPanelLimitDate, type);
- }, [maxDate, superOffset, pickerValue, getStart, generateConfig, locale, type]);
- // ========================= Offset =========================
- var onOffset = function onOffset(distance) {
- if (offset) {
- onChange(offset(distance, pickerValue));
- }
- };
- var onSuperOffset = function onSuperOffset(distance) {
- if (superOffset) {
- onChange(superOffset(distance, pickerValue));
- }
- };
- // ========================= Render =========================
- if (hideHeader) {
- return null;
- }
- var prevBtnCls = "".concat(headerPrefixCls, "-prev-btn");
- var nextBtnCls = "".concat(headerPrefixCls, "-next-btn");
- var superPrevBtnCls = "".concat(headerPrefixCls, "-super-prev-btn");
- var superNextBtnCls = "".concat(headerPrefixCls, "-super-next-btn");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: headerPrefixCls
- }, superOffset && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.previousYear,
- onClick: function onClick() {
- return onSuperOffset(-1);
- },
- tabIndex: -1,
- className: classnames_default()(superPrevBtnCls, disabledSuperOffsetPrev && "".concat(superPrevBtnCls, "-disabled")),
- disabled: disabledSuperOffsetPrev,
- style: hidePrev ? HIDDEN_STYLE : {}
- }, superPrevIcon), offset && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.previousMonth,
- onClick: function onClick() {
- return onOffset(-1);
- },
- tabIndex: -1,
- className: classnames_default()(prevBtnCls, disabledOffsetPrev && "".concat(prevBtnCls, "-disabled")),
- disabled: disabledOffsetPrev,
- style: hidePrev ? HIDDEN_STYLE : {}
- }, prevIcon), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(headerPrefixCls, "-view")
- }, children), offset && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.nextMonth,
- onClick: function onClick() {
- return onOffset(1);
- },
- tabIndex: -1,
- className: classnames_default()(nextBtnCls, disabledOffsetNext && "".concat(nextBtnCls, "-disabled")),
- disabled: disabledOffsetNext,
- style: hideNext ? HIDDEN_STYLE : {}
- }, nextIcon), superOffset && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.nextYear,
- onClick: function onClick() {
- return onSuperOffset(1);
- },
- tabIndex: -1,
- className: classnames_default()(superNextBtnCls, disabledSuperOffsetNext && "".concat(superNextBtnCls, "-disabled")),
- disabled: disabledSuperOffsetNext,
- style: hideNext ? HIDDEN_STYLE : {}
- }, superNextIcon));
- }
- /* harmony default export */ var PickerPanel_PanelHeader = (PanelHeader);
- ;// ./node_modules/rc-picker/es/PickerPanel/DatePanel/index.js
- function DatePanel(props) {
- var prefixCls = props.prefixCls,
- _props$panelName = props.panelName,
- panelName = _props$panelName === void 0 ? 'date' : _props$panelName,
- locale = props.locale,
- generateConfig = props.generateConfig,
- pickerValue = props.pickerValue,
- onPickerValueChange = props.onPickerValueChange,
- onModeChange = props.onModeChange,
- _props$mode = props.mode,
- mode = _props$mode === void 0 ? 'date' : _props$mode,
- disabledDate = props.disabledDate,
- onSelect = props.onSelect,
- onHover = props.onHover,
- showWeek = props.showWeek;
- var panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel");
- var cellPrefixCls = "".concat(prefixCls, "-cell");
- var isWeek = mode === 'week';
- // ========================== Base ==========================
- var _useInfo = useInfo(props, mode),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 2),
- info = _useInfo2[0],
- now = _useInfo2[1];
- var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale.locale);
- var monthStartDate = generateConfig.setDate(pickerValue, 1);
- var baseDate = getWeekStartDate(locale.locale, generateConfig, monthStartDate);
- var month = generateConfig.getMonth(pickerValue);
- // =========================== PrefixColumn ===========================
- var showPrefixColumn = showWeek === undefined ? isWeek : showWeek;
- var prefixColumn = showPrefixColumn ? function (date) {
- // >>> Additional check for disabled
- var disabled = disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date, {
- type: 'week'
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("td", {
- key: "week",
- className: classnames_default()(cellPrefixCls, "".concat(cellPrefixCls, "-week"), (0,defineProperty["default"])({}, "".concat(cellPrefixCls, "-disabled"), disabled))
- // Operation: Same as code in PanelBody
- ,
- onClick: function onClick() {
- if (!disabled) {
- onSelect(date);
- }
- },
- onMouseEnter: function onMouseEnter() {
- if (!disabled) {
- onHover === null || onHover === void 0 || onHover(date);
- }
- },
- onMouseLeave: function onMouseLeave() {
- if (!disabled) {
- onHover === null || onHover === void 0 || onHover(null);
- }
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(cellPrefixCls, "-inner")
- }, generateConfig.locale.getWeek(locale.locale, date)));
- } : null;
- // ========================= Cells ==========================
- // >>> Header Cells
- var headerCells = [];
- var weekDaysLocale = locale.shortWeekDays || (generateConfig.locale.getShortWeekDays ? generateConfig.locale.getShortWeekDays(locale.locale) : []);
- if (prefixColumn) {
- headerCells.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("th", {
- key: "empty"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: {
- width: 0,
- height: 0,
- position: 'absolute',
- overflow: 'hidden',
- opacity: 0
- }
- }, locale.week)));
- }
- for (var i = 0; i < WEEK_DAY_COUNT; i += 1) {
- headerCells.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("th", {
- key: i
- }, weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]));
- }
- // >>> Body Cells
- var getCellDate = function getCellDate(date, offset) {
- return generateConfig.addDate(date, offset);
- };
- var getCellText = function getCellText(date) {
- return formatValue(date, {
- locale: locale,
- format: locale.cellDateFormat,
- generateConfig: generateConfig
- });
- };
- var getCellClassName = function getCellClassName(date) {
- var classObj = (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-cell-in-view"), isSameMonth(generateConfig, date, pickerValue)), "".concat(prefixCls, "-cell-today"), isSameDate(generateConfig, date, now));
- return classObj;
- };
- // ========================= Header =========================
- var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);
- var yearNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.yearSelect,
- key: "year",
- onClick: function onClick() {
- onModeChange('year', pickerValue);
- },
- tabIndex: -1,
- className: "".concat(prefixCls, "-year-btn")
- }, formatValue(pickerValue, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }));
- var monthNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": locale.monthSelect,
- key: "month",
- onClick: function onClick() {
- onModeChange('month', pickerValue);
- },
- tabIndex: -1,
- className: "".concat(prefixCls, "-month-btn")
- }, locale.monthFormat ? formatValue(pickerValue, {
- locale: locale,
- format: locale.monthFormat,
- generateConfig: generateConfig
- }) : monthsLocale[month]);
- var monthYearNodes = locale.monthBeforeYear ? [monthNode, yearNode] : [yearNode, monthNode];
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(panelPrefixCls, showWeek && "".concat(panelPrefixCls, "-show-week"))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, {
- offset: function offset(distance) {
- return generateConfig.addMonth(pickerValue, distance);
- },
- superOffset: function superOffset(distance) {
- return generateConfig.addYear(pickerValue, distance);
- },
- onChange: onPickerValueChange
- // Limitation
- ,
- getStart: function getStart(date) {
- return generateConfig.setDate(date, 1);
- },
- getEnd: function getEnd(date) {
- var clone = generateConfig.setDate(date, 1);
- clone = generateConfig.addMonth(clone, 1);
- return generateConfig.addDate(clone, -1);
- }
- }, monthYearNodes), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelBody, (0,esm_extends["default"])({
- titleFormat: locale.fieldDateFormat
- }, props, {
- colNum: WEEK_DAY_COUNT,
- rowNum: 6,
- baseDate: baseDate
- // Header
- ,
- headerCells: headerCells
- // Body
- ,
- getCellDate: getCellDate,
- getCellText: getCellText,
- getCellClassName: getCellClassName,
- prefixColumn: prefixColumn,
- cellSelection: !isWeek
- }))));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js
- var SPEED_PTG = 1 / 3;
- function useScrollTo_useScrollTo(ulRef, value) {
- // ========================= Scroll =========================
- var scrollingRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var scrollRafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var scrollDistRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var isScrolling = function isScrolling() {
- return scrollingRef.current;
- };
- var stopScroll = function stopScroll() {
- raf["default"].cancel(scrollRafRef.current);
- scrollingRef.current = false;
- };
- var scrollRafTimesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var startScroll = function startScroll() {
- var ul = ulRef.current;
- scrollDistRef.current = null;
- scrollRafTimesRef.current = 0;
- if (ul) {
- var targetLi = ul.querySelector("[data-value=\"".concat(value, "\"]"));
- var firstLi = ul.querySelector("li");
- var doScroll = function doScroll() {
- stopScroll();
- scrollingRef.current = true;
- scrollRafTimesRef.current += 1;
- var currentTop = ul.scrollTop;
- var firstLiTop = firstLi.offsetTop;
- var targetLiTop = targetLi.offsetTop;
- var targetTop = targetLiTop - firstLiTop;
- // Wait for element exist. 5 frames is enough
- if (targetLiTop === 0 && targetLi !== firstLi || !isVisible(ul)) {
- if (scrollRafTimesRef.current <= 5) {
- scrollRafRef.current = (0,raf["default"])(doScroll);
- }
- return;
- }
- var nextTop = currentTop + (targetTop - currentTop) * SPEED_PTG;
- var dist = Math.abs(targetTop - nextTop);
- // Break if dist get larger, which means user is scrolling
- if (scrollDistRef.current !== null && scrollDistRef.current < dist) {
- stopScroll();
- return;
- }
- scrollDistRef.current = dist;
- // Stop when dist is less than 1
- if (dist <= 1) {
- ul.scrollTop = targetTop;
- stopScroll();
- return;
- }
- // IE not support `scrollTo`
- ul.scrollTop = nextTop;
- scrollRafRef.current = (0,raf["default"])(doScroll);
- };
- if (targetLi && firstLi) {
- doScroll();
- }
- }
- };
- // ======================== Trigger =========================
- var syncScroll = (0,rc_util_es.useEvent)(startScroll);
- return [syncScroll, stopScroll, isScrolling];
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js
- var SCROLL_DELAY = 300;
- // Not use JSON.stringify to avoid dead loop
- function flattenUnits(units) {
- return units.map(function (_ref) {
- var value = _ref.value,
- label = _ref.label,
- disabled = _ref.disabled;
- return [value, label, disabled].join(',');
- }).join(';');
- }
- function TimeColumn(props) {
- var units = props.units,
- value = props.value,
- optionalValue = props.optionalValue,
- type = props.type,
- onChange = props.onChange,
- onHover = props.onHover,
- onDblClick = props.onDblClick,
- changeOnScroll = props.changeOnScroll;
- var _usePanelContext = usePanelContext(),
- prefixCls = _usePanelContext.prefixCls,
- cellRender = _usePanelContext.cellRender,
- now = _usePanelContext.now,
- locale = _usePanelContext.locale;
- var panelPrefixCls = "".concat(prefixCls, "-time-panel");
- var cellPrefixCls = "".concat(prefixCls, "-time-panel-cell");
- // ========================== Refs ==========================
- var ulRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ========================= Scroll =========================
- var checkDelayRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var clearDelayCheck = function clearDelayCheck() {
- clearTimeout(checkDelayRef.current);
- };
- // ========================== Sync ==========================
- var _useScrollTo = useScrollTo_useScrollTo(ulRef, value !== null && value !== void 0 ? value : optionalValue),
- _useScrollTo2 = (0,slicedToArray["default"])(_useScrollTo, 3),
- syncScroll = _useScrollTo2[0],
- stopScroll = _useScrollTo2[1],
- isScrolling = _useScrollTo2[2];
- // Effect sync value scroll
- (0,useLayoutEffect["default"])(function () {
- syncScroll();
- clearDelayCheck();
- return function () {
- stopScroll();
- clearDelayCheck();
- };
- }, [value, optionalValue, flattenUnits(units)]);
- // ========================= Change =========================
- // Scroll event if sync onScroll
- var onInternalScroll = function onInternalScroll(event) {
- clearDelayCheck();
- var target = event.target;
- if (!isScrolling() && changeOnScroll) {
- checkDelayRef.current = setTimeout(function () {
- var ul = ulRef.current;
- var firstLiTop = ul.querySelector("li").offsetTop;
- var liList = Array.from(ul.querySelectorAll("li"));
- var liTopList = liList.map(function (li) {
- return li.offsetTop - firstLiTop;
- });
- var liDistList = liTopList.map(function (top, index) {
- if (units[index].disabled) {
- return Number.MAX_SAFE_INTEGER;
- }
- return Math.abs(top - target.scrollTop);
- });
- // Find min distance index
- var minDist = Math.min.apply(Math, (0,toConsumableArray["default"])(liDistList));
- var minDistIndex = liDistList.findIndex(function (dist) {
- return dist === minDist;
- });
- var targetUnit = units[minDistIndex];
- if (targetUnit && !targetUnit.disabled) {
- onChange(targetUnit.value);
- }
- }, SCROLL_DELAY);
- }
- };
- // ========================= Render =========================
- var columnPrefixCls = "".concat(panelPrefixCls, "-column");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: columnPrefixCls,
- ref: ulRef,
- "data-type": type,
- onScroll: onInternalScroll
- }, units.map(function (_ref2) {
- var label = _ref2.label,
- unitValue = _ref2.value,
- disabled = _ref2.disabled;
- var inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(cellPrefixCls, "-inner")
- }, label);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- key: unitValue,
- className: classnames_default()(cellPrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(cellPrefixCls, "-selected"), value === unitValue), "".concat(cellPrefixCls, "-disabled"), disabled)),
- onClick: function onClick() {
- if (!disabled) {
- onChange(unitValue);
- }
- },
- onDoubleClick: function onDoubleClick() {
- if (!disabled && onDblClick) {
- onDblClick();
- }
- },
- onMouseEnter: function onMouseEnter() {
- onHover(unitValue);
- },
- onMouseLeave: function onMouseLeave() {
- onHover(null);
- },
- "data-value": unitValue
- }, cellRender ? cellRender(unitValue, {
- prefixCls: prefixCls,
- originNode: inner,
- today: now,
- type: 'time',
- subType: type,
- locale: locale
- }) : inner);
- }));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/index.js
- function isAM(hour) {
- return hour < 12;
- }
- function TimePanelBody(props) {
- var showHour = props.showHour,
- showMinute = props.showMinute,
- showSecond = props.showSecond,
- showMillisecond = props.showMillisecond,
- showMeridiem = props.use12Hours,
- changeOnScroll = props.changeOnScroll;
- var _usePanelContext = usePanelContext(),
- prefixCls = _usePanelContext.prefixCls,
- values = _usePanelContext.values,
- generateConfig = _usePanelContext.generateConfig,
- locale = _usePanelContext.locale,
- onSelect = _usePanelContext.onSelect,
- _usePanelContext$onHo = _usePanelContext.onHover,
- onHover = _usePanelContext$onHo === void 0 ? function () {} : _usePanelContext$onHo,
- pickerValue = _usePanelContext.pickerValue;
- var value = (values === null || values === void 0 ? void 0 : values[0]) || null;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerHackContext),
- onCellDblClick = _React$useContext.onCellDblClick;
- // ========================== Info ==========================
- var _useTimeInfo = useTimeInfo(generateConfig, props, value),
- _useTimeInfo2 = (0,slicedToArray["default"])(_useTimeInfo, 5),
- getValidTime = _useTimeInfo2[0],
- rowHourUnits = _useTimeInfo2[1],
- getMinuteUnits = _useTimeInfo2[2],
- getSecondUnits = _useTimeInfo2[3],
- getMillisecondUnits = _useTimeInfo2[4];
- // ========================= Value ==========================
- // PickerValue will tell which one to align on the top
- var getUnitValue = function getUnitValue(func) {
- var valueUnitVal = value && generateConfig[func](value);
- var pickerUnitValue = pickerValue && generateConfig[func](pickerValue);
- return [valueUnitVal, pickerUnitValue];
- };
- var _getUnitValue = getUnitValue('getHour'),
- _getUnitValue2 = (0,slicedToArray["default"])(_getUnitValue, 2),
- hour = _getUnitValue2[0],
- pickerHour = _getUnitValue2[1];
- var _getUnitValue3 = getUnitValue('getMinute'),
- _getUnitValue4 = (0,slicedToArray["default"])(_getUnitValue3, 2),
- minute = _getUnitValue4[0],
- pickerMinute = _getUnitValue4[1];
- var _getUnitValue5 = getUnitValue('getSecond'),
- _getUnitValue6 = (0,slicedToArray["default"])(_getUnitValue5, 2),
- second = _getUnitValue6[0],
- pickerSecond = _getUnitValue6[1];
- var _getUnitValue7 = getUnitValue('getMillisecond'),
- _getUnitValue8 = (0,slicedToArray["default"])(_getUnitValue7, 2),
- millisecond = _getUnitValue8[0],
- pickerMillisecond = _getUnitValue8[1];
- var meridiem = hour === null ? null : isAM(hour) ? 'am' : 'pm';
- // ========================= Column =========================
- // Hours
- var hourUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!showMeridiem) {
- return rowHourUnits;
- }
- return isAM(hour) ? rowHourUnits.filter(function (h) {
- return isAM(h.value);
- }) : rowHourUnits.filter(function (h) {
- return !isAM(h.value);
- });
- }, [hour, rowHourUnits, showMeridiem]);
- // >>> Pick Fallback
- var getEnabled = function getEnabled(units, val) {
- var _enabledUnits$;
- var enabledUnits = units.filter(function (unit) {
- return !unit.disabled;
- });
- return val !== null && val !== void 0 ? val : // Fallback to enabled value
- enabledUnits === null || enabledUnits === void 0 || (_enabledUnits$ = enabledUnits[0]) === null || _enabledUnits$ === void 0 ? void 0 : _enabledUnits$.value;
- };
- // >>> Minutes
- var validHour = getEnabled(rowHourUnits, hour);
- var minuteUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getMinuteUnits(validHour);
- }, [getMinuteUnits, validHour]);
- // >>> Seconds
- var validMinute = getEnabled(minuteUnits, minute);
- var secondUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getSecondUnits(validHour, validMinute);
- }, [getSecondUnits, validHour, validMinute]);
- // >>> Milliseconds
- var validSecond = getEnabled(secondUnits, second);
- var millisecondUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getMillisecondUnits(validHour, validMinute, validSecond);
- }, [getMillisecondUnits, validHour, validMinute, validSecond]);
- var validMillisecond = getEnabled(millisecondUnits, millisecond);
- // Meridiem
- var meridiemUnits = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!showMeridiem) {
- return [];
- }
- var base = generateConfig.getNow();
- var amDate = generateConfig.setHour(base, 6);
- var pmDate = generateConfig.setHour(base, 18);
- var formatMeridiem = function formatMeridiem(date, defaultLabel) {
- var cellMeridiemFormat = locale.cellMeridiemFormat;
- return cellMeridiemFormat ? formatValue(date, {
- generateConfig: generateConfig,
- locale: locale,
- format: cellMeridiemFormat
- }) : defaultLabel;
- };
- return [{
- label: formatMeridiem(amDate, 'AM'),
- value: 'am',
- disabled: rowHourUnits.every(function (h) {
- return h.disabled || !isAM(h.value);
- })
- }, {
- label: formatMeridiem(pmDate, 'PM'),
- value: 'pm',
- disabled: rowHourUnits.every(function (h) {
- return h.disabled || isAM(h.value);
- })
- }];
- }, [rowHourUnits, showMeridiem, generateConfig, locale]);
- // ========================= Change =========================
- /**
- * Check if time is validate or will match to validate one
- */
- var triggerChange = function triggerChange(nextDate) {
- var validateDate = getValidTime(nextDate);
- onSelect(validateDate);
- };
- // ========================= Column =========================
- // Create a template date for the trigger change event
- var triggerDateTmpl = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var tmpl = value || pickerValue || generateConfig.getNow();
- var isNotNull = function isNotNull(num) {
- return num !== null && num !== undefined;
- };
- if (isNotNull(hour)) {
- tmpl = generateConfig.setHour(tmpl, hour);
- tmpl = generateConfig.setMinute(tmpl, minute);
- tmpl = generateConfig.setSecond(tmpl, second);
- tmpl = generateConfig.setMillisecond(tmpl, millisecond);
- } else if (isNotNull(pickerHour)) {
- tmpl = generateConfig.setHour(tmpl, pickerHour);
- tmpl = generateConfig.setMinute(tmpl, pickerMinute);
- tmpl = generateConfig.setSecond(tmpl, pickerSecond);
- tmpl = generateConfig.setMillisecond(tmpl, pickerMillisecond);
- } else if (isNotNull(validHour)) {
- tmpl = generateConfig.setHour(tmpl, validHour);
- tmpl = generateConfig.setMinute(tmpl, validMinute);
- tmpl = generateConfig.setSecond(tmpl, validSecond);
- tmpl = generateConfig.setMillisecond(tmpl, validMillisecond);
- }
- return tmpl;
- }, [value, pickerValue, hour, minute, second, millisecond, validHour, validMinute, validSecond, validMillisecond, pickerHour, pickerMinute, pickerSecond, pickerMillisecond, generateConfig]);
- // ===================== Columns Change =====================
- var fillColumnValue = function fillColumnValue(val, func) {
- if (val === null) {
- return null;
- }
- return generateConfig[func](triggerDateTmpl, val);
- };
- var getNextHourTime = function getNextHourTime(val) {
- return fillColumnValue(val, 'setHour');
- };
- var getNextMinuteTime = function getNextMinuteTime(val) {
- return fillColumnValue(val, 'setMinute');
- };
- var getNextSecondTime = function getNextSecondTime(val) {
- return fillColumnValue(val, 'setSecond');
- };
- var getNextMillisecondTime = function getNextMillisecondTime(val) {
- return fillColumnValue(val, 'setMillisecond');
- };
- var getMeridiemTime = function getMeridiemTime(val) {
- if (val === null) {
- return null;
- }
- if (val === 'am' && !isAM(hour)) {
- return generateConfig.setHour(triggerDateTmpl, hour - 12);
- } else if (val === 'pm' && isAM(hour)) {
- return generateConfig.setHour(triggerDateTmpl, hour + 12);
- }
- return triggerDateTmpl;
- };
- var onHourChange = function onHourChange(val) {
- triggerChange(getNextHourTime(val));
- };
- var onMinuteChange = function onMinuteChange(val) {
- triggerChange(getNextMinuteTime(val));
- };
- var onSecondChange = function onSecondChange(val) {
- triggerChange(getNextSecondTime(val));
- };
- var onMillisecondChange = function onMillisecondChange(val) {
- triggerChange(getNextMillisecondTime(val));
- };
- var onMeridiemChange = function onMeridiemChange(val) {
- triggerChange(getMeridiemTime(val));
- };
- // ====================== Column Hover ======================
- var onHourHover = function onHourHover(val) {
- onHover(getNextHourTime(val));
- };
- var onMinuteHover = function onMinuteHover(val) {
- onHover(getNextMinuteTime(val));
- };
- var onSecondHover = function onSecondHover(val) {
- onHover(getNextSecondTime(val));
- };
- var onMillisecondHover = function onMillisecondHover(val) {
- onHover(getNextMillisecondTime(val));
- };
- var onMeridiemHover = function onMeridiemHover(val) {
- onHover(getMeridiemTime(val));
- };
- // ========================= Render =========================
- var sharedColumnProps = {
- onDblClick: onCellDblClick,
- changeOnScroll: changeOnScroll
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-content")
- }, showHour && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimeColumn, (0,esm_extends["default"])({
- units: hourUnits,
- value: hour,
- optionalValue: pickerHour,
- type: "hour",
- onChange: onHourChange,
- onHover: onHourHover
- }, sharedColumnProps)), showMinute && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimeColumn, (0,esm_extends["default"])({
- units: minuteUnits,
- value: minute,
- optionalValue: pickerMinute,
- type: "minute",
- onChange: onMinuteChange,
- onHover: onMinuteHover
- }, sharedColumnProps)), showSecond && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimeColumn, (0,esm_extends["default"])({
- units: secondUnits,
- value: second,
- optionalValue: pickerSecond,
- type: "second",
- onChange: onSecondChange,
- onHover: onSecondHover
- }, sharedColumnProps)), showMillisecond && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimeColumn, (0,esm_extends["default"])({
- units: millisecondUnits,
- value: millisecond,
- optionalValue: pickerMillisecond,
- type: "millisecond",
- onChange: onMillisecondChange,
- onHover: onMillisecondHover
- }, sharedColumnProps)), showMeridiem && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimeColumn, (0,esm_extends["default"])({
- units: meridiemUnits,
- value: meridiem,
- type: "meridiem",
- onChange: onMeridiemChange,
- onHover: onMeridiemHover
- }, sharedColumnProps)));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/TimePanel/index.js
- function TimePanel(props) {
- var prefixCls = props.prefixCls,
- value = props.value,
- locale = props.locale,
- generateConfig = props.generateConfig,
- showTime = props.showTime;
- var _ref = showTime || {},
- format = _ref.format;
- var panelPrefixCls = "".concat(prefixCls, "-time-panel");
- // ========================== Base ==========================
- var _useInfo = useInfo(props, 'time'),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 1),
- info = _useInfo2[0];
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(panelPrefixCls)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, null, value ? formatValue(value, {
- locale: locale,
- format: format,
- generateConfig: generateConfig
- }) : "\xA0"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimePanelBody, showTime)));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/DateTimePanel/index.js
- function DateTimePanel(props) {
- var prefixCls = props.prefixCls,
- generateConfig = props.generateConfig,
- showTime = props.showTime,
- onSelect = props.onSelect,
- value = props.value,
- pickerValue = props.pickerValue,
- onHover = props.onHover;
- var panelPrefixCls = "".concat(prefixCls, "-datetime-panel");
- // =============================== Time ===============================
- var _useTimeInfo = useTimeInfo(generateConfig, showTime),
- _useTimeInfo2 = (0,slicedToArray["default"])(_useTimeInfo, 1),
- getValidTime = _useTimeInfo2[0];
- // Merge the time info from `value` or `pickerValue`
- var mergeTime = function mergeTime(date) {
- if (value) {
- return fillTime(generateConfig, date, value);
- }
- return fillTime(generateConfig, date, pickerValue);
- };
- // ============================== Hover ===============================
- var onDateHover = function onDateHover(date) {
- onHover === null || onHover === void 0 || onHover(date ? mergeTime(date) : date);
- };
- // ============================== Select ==============================
- var onDateSelect = function onDateSelect(date) {
- // Merge with current time
- var cloneDate = mergeTime(date);
- onSelect(getValidTime(cloneDate, cloneDate));
- };
- // ============================== Render ==============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: panelPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DatePanel, (0,esm_extends["default"])({}, props, {
- onSelect: onDateSelect,
- onHover: onDateHover
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TimePanel, props));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/DecadePanel/index.js
- function DecadePanel(props) {
- var prefixCls = props.prefixCls,
- locale = props.locale,
- generateConfig = props.generateConfig,
- pickerValue = props.pickerValue,
- disabledDate = props.disabledDate,
- onPickerValueChange = props.onPickerValueChange;
- var panelPrefixCls = "".concat(prefixCls, "-decade-panel");
- // ========================== Base ==========================
- var _useInfo = useInfo(props, 'decade'),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 1),
- info = _useInfo2[0];
- var getStartYear = function getStartYear(date) {
- var startYear = Math.floor(generateConfig.getYear(date) / 100) * 100;
- return generateConfig.setYear(date, startYear);
- };
- var getEndYear = function getEndYear(date) {
- var startYear = getStartYear(date);
- return generateConfig.addYear(startYear, 99);
- };
- var startYearDate = getStartYear(pickerValue);
- var endYearDate = getEndYear(pickerValue);
- var baseDate = generateConfig.addYear(startYearDate, -10);
- // ========================= Cells ==========================
- var getCellDate = function getCellDate(date, offset) {
- return generateConfig.addYear(date, offset * 10);
- };
- var getCellText = function getCellText(date) {
- var cellYearFormat = locale.cellYearFormat;
- var startYearStr = formatValue(date, {
- locale: locale,
- format: cellYearFormat,
- generateConfig: generateConfig
- });
- var endYearStr = formatValue(generateConfig.addYear(date, 9), {
- locale: locale,
- format: cellYearFormat,
- generateConfig: generateConfig
- });
- return "".concat(startYearStr, "-").concat(endYearStr);
- };
- var getCellClassName = function getCellClassName(date) {
- return (0,defineProperty["default"])({}, "".concat(prefixCls, "-cell-in-view"), isSameDecade(generateConfig, date, startYearDate) || isSameDecade(generateConfig, date, endYearDate) || isInRange(generateConfig, startYearDate, endYearDate, date));
- };
- // ======================== Disabled ========================
- var mergedDisabledDate = disabledDate ? function (currentDate, disabledInfo) {
- // Start
- var baseStartDate = generateConfig.setDate(currentDate, 1);
- var baseStartMonth = generateConfig.setMonth(baseStartDate, 0);
- var baseStartYear = generateConfig.setYear(baseStartMonth, Math.floor(generateConfig.getYear(baseStartMonth) / 10) * 10);
- // End
- var baseEndYear = generateConfig.addYear(baseStartYear, 10);
- var baseEndDate = generateConfig.addDate(baseEndYear, -1);
- return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
- } : null;
- // ========================= Header =========================
- var yearNode = "".concat(formatValue(startYearDate, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }), "-").concat(formatValue(endYearDate, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }));
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: panelPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, {
- superOffset: function superOffset(distance) {
- return generateConfig.addYear(pickerValue, distance * 100);
- },
- onChange: onPickerValueChange
- // Limitation
- ,
- getStart: getStartYear,
- getEnd: getEndYear
- }, yearNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelBody, (0,esm_extends["default"])({}, props, {
- disabledDate: mergedDisabledDate,
- colNum: 3,
- rowNum: 4,
- baseDate: baseDate
- // Body
- ,
- getCellDate: getCellDate,
- getCellText: getCellText,
- getCellClassName: getCellClassName
- }))));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/MonthPanel/index.js
- function MonthPanel(props) {
- var prefixCls = props.prefixCls,
- locale = props.locale,
- generateConfig = props.generateConfig,
- pickerValue = props.pickerValue,
- disabledDate = props.disabledDate,
- onPickerValueChange = props.onPickerValueChange,
- onModeChange = props.onModeChange;
- var panelPrefixCls = "".concat(prefixCls, "-month-panel");
- // ========================== Base ==========================
- var _useInfo = useInfo(props, 'month'),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 1),
- info = _useInfo2[0];
- var baseDate = generateConfig.setMonth(pickerValue, 0);
- // ========================= Month ==========================
- var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);
- // ========================= Cells ==========================
- var getCellDate = function getCellDate(date, offset) {
- return generateConfig.addMonth(date, offset);
- };
- var getCellText = function getCellText(date) {
- var month = generateConfig.getMonth(date);
- return locale.monthFormat ? formatValue(date, {
- locale: locale,
- format: locale.monthFormat,
- generateConfig: generateConfig
- }) : monthsLocale[month];
- };
- var getCellClassName = function getCellClassName() {
- return (0,defineProperty["default"])({}, "".concat(prefixCls, "-cell-in-view"), true);
- };
- // ======================== Disabled ========================
- var mergedDisabledDate = disabledDate ? function (currentDate, disabledInfo) {
- var startDate = generateConfig.setDate(currentDate, 1);
- var nextMonthStartDate = generateConfig.setMonth(startDate, generateConfig.getMonth(startDate) + 1);
- var endDate = generateConfig.addDate(nextMonthStartDate, -1);
- return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
- } : null;
- // ========================= Header =========================
- var yearNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- key: "year",
- "aria-label": locale.yearSelect,
- onClick: function onClick() {
- onModeChange('year');
- },
- tabIndex: -1,
- className: "".concat(prefixCls, "-year-btn")
- }, formatValue(pickerValue, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }));
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: panelPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, {
- superOffset: function superOffset(distance) {
- return generateConfig.addYear(pickerValue, distance);
- },
- onChange: onPickerValueChange
- // Limitation
- ,
- getStart: function getStart(date) {
- return generateConfig.setMonth(date, 0);
- },
- getEnd: function getEnd(date) {
- return generateConfig.setMonth(date, 11);
- }
- }, yearNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelBody, (0,esm_extends["default"])({}, props, {
- disabledDate: mergedDisabledDate,
- titleFormat: locale.fieldMonthFormat,
- colNum: 3,
- rowNum: 4,
- baseDate: baseDate
- // Body
- ,
- getCellDate: getCellDate,
- getCellText: getCellText,
- getCellClassName: getCellClassName
- }))));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/QuarterPanel/index.js
- function QuarterPanel(props) {
- var prefixCls = props.prefixCls,
- locale = props.locale,
- generateConfig = props.generateConfig,
- pickerValue = props.pickerValue,
- onPickerValueChange = props.onPickerValueChange,
- onModeChange = props.onModeChange;
- var panelPrefixCls = "".concat(prefixCls, "-quarter-panel");
- // ========================== Base ==========================
- var _useInfo = useInfo(props, 'quarter'),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 1),
- info = _useInfo2[0];
- var baseDate = generateConfig.setMonth(pickerValue, 0);
- // ========================= Cells ==========================
- var getCellDate = function getCellDate(date, offset) {
- return generateConfig.addMonth(date, offset * 3);
- };
- var getCellText = function getCellText(date) {
- return formatValue(date, {
- locale: locale,
- format: locale.cellQuarterFormat,
- generateConfig: generateConfig
- });
- };
- var getCellClassName = function getCellClassName() {
- return (0,defineProperty["default"])({}, "".concat(prefixCls, "-cell-in-view"), true);
- };
- // ========================= Header =========================
- var yearNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- key: "year",
- "aria-label": locale.yearSelect,
- onClick: function onClick() {
- onModeChange('year');
- },
- tabIndex: -1,
- className: "".concat(prefixCls, "-year-btn")
- }, formatValue(pickerValue, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }));
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: panelPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, {
- superOffset: function superOffset(distance) {
- return generateConfig.addYear(pickerValue, distance);
- },
- onChange: onPickerValueChange
- // Limitation
- ,
- getStart: function getStart(date) {
- return generateConfig.setMonth(date, 0);
- },
- getEnd: function getEnd(date) {
- return generateConfig.setMonth(date, 11);
- }
- }, yearNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelBody, (0,esm_extends["default"])({}, props, {
- titleFormat: locale.fieldQuarterFormat,
- colNum: 4,
- rowNum: 1,
- baseDate: baseDate
- // Body
- ,
- getCellDate: getCellDate,
- getCellText: getCellText,
- getCellClassName: getCellClassName
- }))));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/WeekPanel/index.js
- function WeekPanel(props) {
- var prefixCls = props.prefixCls,
- generateConfig = props.generateConfig,
- locale = props.locale,
- value = props.value,
- hoverValue = props.hoverValue,
- hoverRangeValue = props.hoverRangeValue;
- // =============================== Row ================================
- var localeName = locale.locale;
- var rowPrefixCls = "".concat(prefixCls, "-week-panel-row");
- var rowClassName = function rowClassName(currentDate) {
- var rangeCls = {};
- if (hoverRangeValue) {
- var _hoverRangeValue = (0,slicedToArray["default"])(hoverRangeValue, 2),
- rangeStart = _hoverRangeValue[0],
- rangeEnd = _hoverRangeValue[1];
- var isRangeStart = isSameWeek(generateConfig, localeName, rangeStart, currentDate);
- var isRangeEnd = isSameWeek(generateConfig, localeName, rangeEnd, currentDate);
- rangeCls["".concat(rowPrefixCls, "-range-start")] = isRangeStart;
- rangeCls["".concat(rowPrefixCls, "-range-end")] = isRangeEnd;
- rangeCls["".concat(rowPrefixCls, "-range-hover")] = !isRangeStart && !isRangeEnd && isInRange(generateConfig, rangeStart, rangeEnd, currentDate);
- }
- if (hoverValue) {
- rangeCls["".concat(rowPrefixCls, "-hover")] = hoverValue.some(function (date) {
- return isSameWeek(generateConfig, localeName, currentDate, date);
- });
- }
- return classnames_default()(rowPrefixCls, (0,defineProperty["default"])({}, "".concat(rowPrefixCls, "-selected"), !hoverRangeValue && isSameWeek(generateConfig, localeName, value, currentDate)),
- // Patch for hover range
- rangeCls);
- };
- // ============================== Render ==============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DatePanel, (0,esm_extends["default"])({}, props, {
- mode: "week",
- panelName: "week",
- rowClassName: rowClassName
- }));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/YearPanel/index.js
- function YearPanel(props) {
- var prefixCls = props.prefixCls,
- locale = props.locale,
- generateConfig = props.generateConfig,
- pickerValue = props.pickerValue,
- disabledDate = props.disabledDate,
- onPickerValueChange = props.onPickerValueChange,
- onModeChange = props.onModeChange;
- var panelPrefixCls = "".concat(prefixCls, "-year-panel");
- // ========================== Base ==========================
- var _useInfo = useInfo(props, 'year'),
- _useInfo2 = (0,slicedToArray["default"])(_useInfo, 1),
- info = _useInfo2[0];
- var getStartYear = function getStartYear(date) {
- var startYear = Math.floor(generateConfig.getYear(date) / 10) * 10;
- return generateConfig.setYear(date, startYear);
- };
- var getEndYear = function getEndYear(date) {
- var startYear = getStartYear(date);
- return generateConfig.addYear(startYear, 9);
- };
- var startYearDate = getStartYear(pickerValue);
- var endYearDate = getEndYear(pickerValue);
- var baseDate = generateConfig.addYear(startYearDate, -1);
- // ========================= Cells ==========================
- var getCellDate = function getCellDate(date, offset) {
- return generateConfig.addYear(date, offset);
- };
- var getCellText = function getCellText(date) {
- return formatValue(date, {
- locale: locale,
- format: locale.cellYearFormat,
- generateConfig: generateConfig
- });
- };
- var getCellClassName = function getCellClassName(date) {
- return (0,defineProperty["default"])({}, "".concat(prefixCls, "-cell-in-view"), isSameYear(generateConfig, date, startYearDate) || isSameYear(generateConfig, date, endYearDate) || isInRange(generateConfig, startYearDate, endYearDate, date));
- };
- // ======================== Disabled ========================
- var mergedDisabledDate = disabledDate ? function (currentDate, disabledInfo) {
- // Start
- var startMonth = generateConfig.setMonth(currentDate, 0);
- var startDate = generateConfig.setDate(startMonth, 1);
- // End
- var endMonth = generateConfig.addYear(startDate, 1);
- var endDate = generateConfig.addDate(endMonth, -1);
- return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
- } : null;
- // ========================= Header =========================
- var yearNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- key: "decade",
- "aria-label": locale.decadeSelect,
- onClick: function onClick() {
- onModeChange('decade');
- },
- tabIndex: -1,
- className: "".concat(prefixCls, "-decade-btn")
- }, formatValue(startYearDate, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }), "-", formatValue(endYearDate, {
- locale: locale,
- format: locale.yearFormat,
- generateConfig: generateConfig
- }));
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelContext.Provider, {
- value: info
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: panelPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerPanel_PanelHeader, {
- superOffset: function superOffset(distance) {
- return generateConfig.addYear(pickerValue, distance * 10);
- },
- onChange: onPickerValueChange
- // Limitation
- ,
- getStart: getStartYear,
- getEnd: getEndYear
- }, yearNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelBody, (0,esm_extends["default"])({}, props, {
- disabledDate: mergedDisabledDate,
- titleFormat: locale.fieldYearFormat,
- colNum: 3,
- rowNum: 4,
- baseDate: baseDate
- // Body
- ,
- getCellDate: getCellDate,
- getCellText: getCellText,
- getCellClassName: getCellClassName
- }))));
- }
- ;// ./node_modules/rc-picker/es/PickerPanel/index.js
- var DefaultComponents = {
- date: DatePanel,
- datetime: DateTimePanel,
- week: WeekPanel,
- month: MonthPanel,
- quarter: QuarterPanel,
- year: YearPanel,
- decade: DecadePanel,
- time: TimePanel
- };
- function PickerPanel(props, ref) {
- var _React$useContext;
- var locale = props.locale,
- generateConfig = props.generateConfig,
- direction = props.direction,
- prefixCls = props.prefixCls,
- _props$tabIndex = props.tabIndex,
- tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
- multiple = props.multiple,
- defaultValue = props.defaultValue,
- value = props.value,
- onChange = props.onChange,
- onSelect = props.onSelect,
- defaultPickerValue = props.defaultPickerValue,
- pickerValue = props.pickerValue,
- onPickerValueChange = props.onPickerValueChange,
- mode = props.mode,
- onPanelChange = props.onPanelChange,
- _props$picker = props.picker,
- picker = _props$picker === void 0 ? 'date' : _props$picker,
- showTime = props.showTime,
- hoverValue = props.hoverValue,
- hoverRangeValue = props.hoverRangeValue,
- cellRender = props.cellRender,
- dateRender = props.dateRender,
- monthCellRender = props.monthCellRender,
- _props$components = props.components,
- components = _props$components === void 0 ? {} : _props$components,
- hideHeader = props.hideHeader;
- var mergedPrefixCls = ((_React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context)) === null || _React$useContext === void 0 ? void 0 : _React$useContext.prefixCls) || prefixCls || 'rc-picker';
- // ========================== Refs ==========================
- var rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: rootRef.current
- };
- });
- // ========================== Time ==========================
- // Auto `format` need to check `showTime.showXXX` first.
- // And then merge the `locale` into `mergedShowTime`.
- var _getTimeProps = getTimeProps(props),
- _getTimeProps2 = (0,slicedToArray["default"])(_getTimeProps, 4),
- timeProps = _getTimeProps2[0],
- localeTimeProps = _getTimeProps2[1],
- showTimeFormat = _getTimeProps2[2],
- propFormat = _getTimeProps2[3];
- // ========================= Locale =========================
- var filledLocale = useLocale_useLocale(locale, localeTimeProps);
- // ========================= Picker =========================
- var internalPicker = picker === 'date' && showTime ? 'datetime' : picker;
- // ======================== ShowTime ========================
- var mergedShowTime = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, filledLocale);
- }, [internalPicker, showTimeFormat, propFormat, timeProps, filledLocale]);
- // ========================== Now ===========================
- var now = generateConfig.getNow();
- // ========================== Mode ==========================
- var _useMergedState = (0,rc_util_es.useMergedState)(picker, {
- value: mode,
- postState: function postState(val) {
- return val || 'date';
- }
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedMode = _useMergedState2[0],
- setMergedMode = _useMergedState2[1];
- var internalMode = mergedMode === 'date' && mergedShowTime ? 'datetime' : mergedMode;
- // ========================= Toggle =========================
- var toggleDates = useToggleDates(generateConfig, locale, internalPicker);
- // ========================= Value ==========================
- // >>> Real value
- // Interactive with `onChange` event which only trigger when the `mode` is `picker`
- var _useMergedState3 = (0,rc_util_es.useMergedState)(defaultValue, {
- value: value
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- innerValue = _useMergedState4[0],
- setMergedValue = _useMergedState4[1];
- var mergedValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // Clean up `[null]`
- var values = miscUtil_toArray(innerValue).filter(function (val) {
- return val;
- });
- return multiple ? values : values.slice(0, 1);
- }, [innerValue, multiple]);
- // Sync value and only trigger onChange event when changed
- var triggerChange = (0,rc_util_es.useEvent)(function (nextValue) {
- setMergedValue(nextValue);
- if (onChange && (nextValue === null || mergedValue.length !== nextValue.length || mergedValue.some(function (ori, index) {
- return !isSame(generateConfig, locale, ori, nextValue[index], internalPicker);
- }))) {
- onChange === null || onChange === void 0 || onChange(multiple ? nextValue : nextValue[0]);
- }
- });
- // >>> CalendarValue
- // CalendarValue is a temp value for user operation
- // which will only trigger `onCalendarChange` but not `onChange`
- var onInternalSelect = (0,rc_util_es.useEvent)(function (newDate) {
- onSelect === null || onSelect === void 0 || onSelect(newDate);
- if (mergedMode === picker) {
- var nextValues = multiple ? toggleDates(mergedValue, newDate) : [newDate];
- triggerChange(nextValues);
- }
- });
- // >>> PickerValue
- // PickerValue is used to control the current displaying panel
- var _useMergedState5 = (0,rc_util_es.useMergedState)(defaultPickerValue || mergedValue[0] || now, {
- value: pickerValue
- }),
- _useMergedState6 = (0,slicedToArray["default"])(_useMergedState5, 2),
- mergedPickerValue = _useMergedState6[0],
- setInternalPickerValue = _useMergedState6[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (mergedValue[0] && !pickerValue) {
- setInternalPickerValue(mergedValue[0]);
- }
- }, [mergedValue[0]]);
- // Both trigger when manually pickerValue or mode change
- var triggerPanelChange = function triggerPanelChange(viewDate, nextMode) {
- onPanelChange === null || onPanelChange === void 0 || onPanelChange(viewDate || pickerValue, nextMode || mergedMode);
- };
- var setPickerValue = function setPickerValue(nextPickerValue) {
- var triggerPanelEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- setInternalPickerValue(nextPickerValue);
- onPickerValueChange === null || onPickerValueChange === void 0 || onPickerValueChange(nextPickerValue);
- if (triggerPanelEvent) {
- triggerPanelChange(nextPickerValue);
- }
- };
- var triggerModeChange = function triggerModeChange(nextMode, viewDate) {
- setMergedMode(nextMode);
- if (viewDate) {
- setPickerValue(viewDate);
- }
- triggerPanelChange(viewDate, nextMode);
- };
- var onPanelValueSelect = function onPanelValueSelect(nextValue) {
- onInternalSelect(nextValue);
- setPickerValue(nextValue);
- // Update mode if needed
- if (mergedMode !== picker) {
- var decadeYearQueue = ['decade', 'year'];
- var decadeYearMonthQueue = [].concat(decadeYearQueue, ['month']);
- var pickerQueue = {
- quarter: [].concat(decadeYearQueue, ['quarter']),
- week: [].concat((0,toConsumableArray["default"])(decadeYearMonthQueue), ['week']),
- date: [].concat((0,toConsumableArray["default"])(decadeYearMonthQueue), ['date'])
- };
- var queue = pickerQueue[picker] || decadeYearMonthQueue;
- var index = queue.indexOf(mergedMode);
- var nextMode = queue[index + 1];
- if (nextMode) {
- triggerModeChange(nextMode, nextValue);
- }
- }
- };
- // ======================= Hover Date =======================
- var hoverRangeDate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var start;
- var end;
- if (Array.isArray(hoverRangeValue)) {
- var _hoverRangeValue = (0,slicedToArray["default"])(hoverRangeValue, 2);
- start = _hoverRangeValue[0];
- end = _hoverRangeValue[1];
- } else {
- start = hoverRangeValue;
- }
- // Return for not exist
- if (!start && !end) {
- return null;
- }
- // Fill if has empty
- start = start || end;
- end = end || start;
- return generateConfig.isAfter(start, end) ? [end, start] : [start, end];
- }, [hoverRangeValue, generateConfig]);
- // ======================= Components =======================
- // >>> cellRender
- var onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender);
- // ======================= Components =======================
- var PanelComponent = components[internalMode] || DefaultComponents[internalMode] || DatePanel;
- // ======================== Context =========================
- var parentHackContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerHackContext);
- var pickerPanelContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, parentHackContext), {}, {
- hideHeader: hideHeader
- });
- }, [parentHackContext, hideHeader]);
- // ======================== Warnings ========================
- if (true) {
- (0,rc_util_es.warning)(!mergedValue || mergedValue.every(function (val) {
- return generateConfig.isValidate(val);
- }), 'Invalidate date pass to `value` or `defaultValue`.');
- }
- // ========================= Render =========================
- var panelCls = "".concat(mergedPrefixCls, "-panel");
- var panelProps = pickProps(props, [
- // Week
- 'showWeek',
- // Icons
- 'prevIcon', 'nextIcon', 'superPrevIcon', 'superNextIcon',
- // Disabled
- 'disabledDate', 'minDate', 'maxDate',
- // Hover
- 'onHover']);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerHackContext.Provider, {
- value: pickerPanelContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: rootRef,
- tabIndex: tabIndex,
- className: classnames_default()(panelCls, (0,defineProperty["default"])({}, "".concat(panelCls, "-rtl"), direction === 'rtl'))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PanelComponent, (0,esm_extends["default"])({}, panelProps, {
- // Time
- showTime: mergedShowTime
- // MISC
- ,
- prefixCls: mergedPrefixCls,
- locale: filledLocale,
- generateConfig: generateConfig
- // Mode
- ,
- onModeChange: triggerModeChange
- // Value
- ,
- pickerValue: mergedPickerValue,
- onPickerValueChange: function onPickerValueChange(nextPickerValue) {
- setPickerValue(nextPickerValue, true);
- },
- value: mergedValue[0],
- onSelect: onPanelValueSelect,
- values: mergedValue
- // Render
- ,
- cellRender: onInternalCellRender
- // Hover
- ,
- hoverRangeValue: hoverRangeDate,
- hoverValue: hoverValue
- }))));
- }
- var RefPanelPicker = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(PickerPanel));
- if (true) {
- RefPanelPicker.displayName = 'PanelPicker';
- }
- // Make support generic
- /* harmony default export */ var es_PickerPanel = (RefPanelPicker);
- ;// ./node_modules/rc-picker/es/PickerInput/Popup/PopupPanel.js
- function PopupPanel(props) {
- var picker = props.picker,
- multiplePanel = props.multiplePanel,
- pickerValue = props.pickerValue,
- onPickerValueChange = props.onPickerValueChange,
- needConfirm = props.needConfirm,
- onSubmit = props.onSubmit,
- range = props.range,
- hoverValue = props.hoverValue;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls,
- generateConfig = _React$useContext.generateConfig;
- // ======================== Offset ========================
- var internalOffsetDate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (date, offset) {
- return offsetPanelDate(generateConfig, picker, date, offset);
- }, [generateConfig, picker]);
- var nextPickerValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return internalOffsetDate(pickerValue, 1);
- }, [pickerValue, internalOffsetDate]);
- // Outside
- var onSecondPickerValueChange = function onSecondPickerValueChange(nextDate) {
- onPickerValueChange(internalOffsetDate(nextDate, -1));
- };
- // ======================= Context ========================
- var sharedContext = {
- onCellDblClick: function onCellDblClick() {
- if (needConfirm) {
- onSubmit();
- }
- }
- };
- var hideHeader = picker === 'time';
- // ======================== Props =========================
- var pickerProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- hoverValue: null,
- hoverRangeValue: null,
- hideHeader: hideHeader
- });
- if (range) {
- pickerProps.hoverRangeValue = hoverValue;
- } else {
- pickerProps.hoverValue = hoverValue;
- }
- // ======================== Render ========================
- // Multiple
- if (multiplePanel) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-panels")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerHackContext.Provider, {
- value: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, sharedContext), {}, {
- hideNext: true
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerPanel, pickerProps)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerHackContext.Provider, {
- value: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, sharedContext), {}, {
- hidePrev: true
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerPanel, (0,esm_extends["default"])({}, pickerProps, {
- pickerValue: nextPickerValue,
- onPickerValueChange: onSecondPickerValueChange
- }))));
- }
- // Single
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerHackContext.Provider, {
- value: (0,objectSpread2["default"])({}, sharedContext)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerPanel, pickerProps));
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Popup/PresetPanel.js
- function executeValue(value) {
- return typeof value === 'function' ? value() : value;
- }
- function PresetPanel(props) {
- var prefixCls = props.prefixCls,
- presets = props.presets,
- _onClick = props.onClick,
- onHover = props.onHover;
- if (!presets.length) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-presets")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", null, presets.map(function (_ref, index) {
- var label = _ref.label,
- value = _ref.value;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- key: index,
- onClick: function onClick() {
- _onClick(executeValue(value));
- },
- onMouseEnter: function onMouseEnter() {
- onHover(executeValue(value));
- },
- onMouseLeave: function onMouseLeave() {
- onHover(null);
- }
- }, label);
- })));
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Popup/index.js
- function PickerInput_Popup_Popup(props) {
- var panelRender = props.panelRender,
- internalMode = props.internalMode,
- picker = props.picker,
- showNow = props.showNow,
- range = props.range,
- multiple = props.multiple,
- _props$activeInfo = props.activeInfo,
- activeInfo = _props$activeInfo === void 0 ? [0, 0, 0] : _props$activeInfo,
- presets = props.presets,
- onPresetHover = props.onPresetHover,
- onPresetSubmit = props.onPresetSubmit,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onPanelMouseDown = props.onPanelMouseDown,
- direction = props.direction,
- value = props.value,
- onSelect = props.onSelect,
- isInvalid = props.isInvalid,
- defaultOpenValue = props.defaultOpenValue,
- onOk = props.onOk,
- onSubmit = props.onSubmit;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls;
- var panelPrefixCls = "".concat(prefixCls, "-panel");
- var rtl = direction === 'rtl';
- // ========================= Refs =========================
- var arrowRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var wrapperRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ======================== Offset ========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- containerWidth = _React$useState2[0],
- setContainerWidth = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- containerOffset = _React$useState4[0],
- setContainerOffset = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- arrowOffset = _React$useState6[0],
- setArrowOffset = _React$useState6[1];
- var onResize = function onResize(info) {
- if (info.width) {
- setContainerWidth(info.width);
- }
- };
- var _activeInfo = (0,slicedToArray["default"])(activeInfo, 3),
- activeInputLeft = _activeInfo[0],
- activeInputRight = _activeInfo[1],
- selectorWidth = _activeInfo[2];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- retryTimes = _React$useState8[0],
- setRetryTimes = _React$useState8[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setRetryTimes(10);
- }, [activeInputLeft]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // `activeOffset` is always align with the active input element
- // So we need only check container contains the `activeOffset`
- if (range && wrapperRef.current) {
- var _arrowRef$current;
- // Offset in case container has border radius
- var arrowWidth = ((_arrowRef$current = arrowRef.current) === null || _arrowRef$current === void 0 ? void 0 : _arrowRef$current.offsetWidth) || 0;
- // Arrow Offset
- var wrapperRect = wrapperRef.current.getBoundingClientRect();
- if (!wrapperRect.height || wrapperRect.right < 0) {
- setRetryTimes(function (times) {
- return Math.max(0, times - 1);
- });
- return;
- }
- var nextArrowOffset = (rtl ? activeInputRight - arrowWidth : activeInputLeft) - wrapperRect.left;
- setArrowOffset(nextArrowOffset);
- // Container Offset
- if (containerWidth && containerWidth < selectorWidth) {
- var offset = rtl ? wrapperRect.right - (activeInputRight - arrowWidth + containerWidth) : activeInputLeft + arrowWidth - wrapperRect.left - containerWidth;
- var safeOffset = Math.max(0, offset);
- setContainerOffset(safeOffset);
- } else {
- setContainerOffset(0);
- }
- }
- }, [retryTimes, rtl, containerWidth, activeInputLeft, activeInputRight, selectorWidth, range]);
- // ======================== Custom ========================
- function filterEmpty(list) {
- return list.filter(function (item) {
- return item;
- });
- }
- var valueList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return filterEmpty(miscUtil_toArray(value));
- }, [value]);
- var isTimePickerEmptyValue = picker === 'time' && !valueList.length;
- var footerSubmitValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (isTimePickerEmptyValue) {
- return filterEmpty([defaultOpenValue]);
- }
- return valueList;
- }, [isTimePickerEmptyValue, valueList, defaultOpenValue]);
- var popupPanelValue = isTimePickerEmptyValue ? defaultOpenValue : valueList;
- var disableSubmit = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // Empty is invalid
- if (!footerSubmitValue.length) {
- return true;
- }
- return footerSubmitValue.some(function (val) {
- return isInvalid(val);
- });
- }, [footerSubmitValue, isInvalid]);
- var onFooterSubmit = function onFooterSubmit() {
- // For TimePicker, we will additional trigger the value update
- if (isTimePickerEmptyValue) {
- onSelect(defaultOpenValue);
- }
- onOk();
- onSubmit();
- };
- var mergedNodes = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-panel-layout")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PresetPanel, {
- prefixCls: prefixCls,
- presets: presets,
- onClick: onPresetSubmit,
- onHover: onPresetHover
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PopupPanel, (0,esm_extends["default"])({}, props, {
- value: popupPanelValue
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Footer_Footer, (0,esm_extends["default"])({}, props, {
- showNow: multiple ? false : showNow,
- invalid: disableSubmit,
- onSubmit: onFooterSubmit
- }))));
- if (panelRender) {
- mergedNodes = panelRender(mergedNodes);
- }
- // ======================== Render ========================
- var containerPrefixCls = "".concat(panelPrefixCls, "-container");
- var marginLeft = 'marginLeft';
- var marginRight = 'marginRight';
- // Container
- var renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- onMouseDown: onPanelMouseDown,
- tabIndex: -1,
- className: classnames_default()(containerPrefixCls, // Used for Today Button style, safe to remove if no need
- "".concat(prefixCls, "-").concat(internalMode, "-panel-container")),
- style: (0,defineProperty["default"])((0,defineProperty["default"])({}, rtl ? marginRight : marginLeft, containerOffset), rtl ? marginLeft : marginRight, 'auto')
- // Still wish not to lose focus on mouse down
- // onMouseDown={(e) => {
- // // e.preventDefault();
- // }}
- ,
- onFocus: onFocus,
- onBlur: onBlur
- }, mergedNodes);
- if (range) {
- renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- onMouseDown: onPanelMouseDown,
- ref: wrapperRef,
- className: classnames_default()("".concat(prefixCls, "-range-wrapper"), "".concat(prefixCls, "-").concat(picker, "-range-wrapper"))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: arrowRef,
- className: "".concat(prefixCls, "-range-arrow"),
- style: {
- left: arrowOffset
- }
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onResize
- }, renderNode));
- }
- return renderNode;
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/hooks/useInputProps.js
- function useInputProps(props, /** Used for SinglePicker */
- postProps) {
- var format = props.format,
- maskFormat = props.maskFormat,
- generateConfig = props.generateConfig,
- locale = props.locale,
- preserveInvalidOnBlur = props.preserveInvalidOnBlur,
- inputReadOnly = props.inputReadOnly,
- required = props.required,
- ariaRequired = props['aria-required'],
- onSubmit = props.onSubmit,
- _onFocus = props.onFocus,
- _onBlur = props.onBlur,
- onInputChange = props.onInputChange,
- onInvalid = props.onInvalid,
- open = props.open,
- onOpenChange = props.onOpenChange,
- _onKeyDown = props.onKeyDown,
- _onChange = props.onChange,
- activeHelp = props.activeHelp,
- name = props.name,
- autoComplete = props.autoComplete,
- id = props.id,
- value = props.value,
- invalid = props.invalid,
- placeholder = props.placeholder,
- disabled = props.disabled,
- activeIndex = props.activeIndex,
- allHelp = props.allHelp,
- picker = props.picker;
- // ======================== Parser ========================
- var parseDate = function parseDate(str, formatStr) {
- var parsed = generateConfig.locale.parse(locale.locale, str, [formatStr]);
- return parsed && generateConfig.isValidate(parsed) ? parsed : null;
- };
- // ========================= Text =========================
- var firstFormat = format[0];
- var getText = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (date) {
- return formatValue(date, {
- locale: locale,
- format: firstFormat,
- generateConfig: generateConfig
- });
- }, [locale, generateConfig, firstFormat]);
- var valueTexts = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return value.map(getText);
- }, [value, getText]);
- // ========================= Size =========================
- var size = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var defaultSize = picker === 'time' ? 8 : 10;
- var length = typeof firstFormat === 'function' ? firstFormat(generateConfig.getNow()).length : firstFormat.length;
- return Math.max(defaultSize, length) + 2;
- }, [firstFormat, picker, generateConfig]);
- // ======================= Validate =======================
- var _validateFormat = function validateFormat(text) {
- for (var i = 0; i < format.length; i += 1) {
- var singleFormat = format[i];
- // Only support string type
- if (typeof singleFormat === 'string') {
- var parsed = parseDate(text, singleFormat);
- if (parsed) {
- return parsed;
- }
- }
- }
- return false;
- };
- // ======================== Input =========================
- var getInputProps = function getInputProps(index) {
- function getProp(propValue) {
- return index !== undefined ? propValue[index] : propValue;
- }
- var pickedAttrs = (0,pickAttrs["default"])(props, {
- aria: true,
- data: true
- });
- var inputProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, pickedAttrs), {}, {
- // ============== Shared ==============
- format: maskFormat,
- validateFormat: function validateFormat(text) {
- return !!_validateFormat(text);
- },
- preserveInvalidOnBlur: preserveInvalidOnBlur,
- readOnly: inputReadOnly,
- required: required,
- 'aria-required': ariaRequired,
- name: name,
- autoComplete: autoComplete,
- size: size,
- // ============= By Index =============
- id: getProp(id),
- value: getProp(valueTexts) || '',
- invalid: getProp(invalid),
- placeholder: getProp(placeholder),
- active: activeIndex === index,
- helped: allHelp || activeHelp && activeIndex === index,
- disabled: getProp(disabled),
- onFocus: function onFocus(event) {
- _onFocus(event, index);
- },
- onBlur: function onBlur(event) {
- // Blur do not trigger close
- // Since it may focus to the popup panel
- _onBlur(event, index);
- },
- onSubmit: onSubmit,
- // Get validate text value
- onChange: function onChange(text) {
- onInputChange();
- var parsed = _validateFormat(text);
- if (parsed) {
- onInvalid(false, index);
- _onChange(parsed, index);
- return;
- }
- // Tell outer that the value typed is invalid.
- // If text is empty, it means valid.
- onInvalid(!!text, index);
- },
- onHelp: function onHelp() {
- onOpenChange(true, {
- index: index
- });
- },
- onKeyDown: function onKeyDown(event) {
- var prevented = false;
- _onKeyDown === null || _onKeyDown === void 0 || _onKeyDown(event, function () {
- if (true) {
- (0,rc_util_es.warning)(false, '`preventDefault` callback is deprecated. Please call `event.preventDefault` directly.');
- }
- prevented = true;
- });
- if (!event.defaultPrevented && !prevented) {
- switch (event.key) {
- case 'Escape':
- onOpenChange(false, {
- index: index
- });
- break;
- case 'Enter':
- if (!open) {
- onOpenChange(true);
- }
- break;
- }
- }
- }
- }, postProps === null || postProps === void 0 ? void 0 : postProps({
- valueTexts: valueTexts
- }));
- // ============== Clean Up ==============
- Object.keys(inputProps).forEach(function (key) {
- if (inputProps[key] === undefined) {
- delete inputProps[key];
- }
- });
- return inputProps;
- };
- return [getInputProps, getText];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/hooks/useRootProps.js
- var propNames = ['onMouseEnter', 'onMouseLeave'];
- function useRootProps(props) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return pickProps(props, propNames);
- }, [props]);
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/Icon.js
- var Icon_excluded = ["icon", "type"],
- Icon_excluded2 = ["onClear"];
- function Icon_Icon(props) {
- var icon = props.icon,
- type = props.type,
- restProps = (0,objectWithoutProperties["default"])(props, Icon_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls;
- return icon ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", (0,esm_extends["default"])({
- className: "".concat(prefixCls, "-").concat(type)
- }, restProps), icon) : null;
- }
- function ClearIcon(_ref) {
- var onClear = _ref.onClear,
- restProps = (0,objectWithoutProperties["default"])(_ref, Icon_excluded2);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon_Icon, (0,esm_extends["default"])({}, restProps, {
- type: "clear",
- role: "button",
- onMouseDown: function onMouseDown(e) {
- e.preventDefault();
- },
- onClick: function onClick(e) {
- e.stopPropagation();
- onClear();
- }
- }));
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/MaskFormat.js
- var FORMAT_KEYS = ['YYYY', 'MM', 'DD', 'HH', 'mm', 'ss', 'SSS'];
- // Use Chinese character to avoid conflict with the mask format
- var REPLACE_KEY = '顧';
- var MaskFormat = /*#__PURE__*/function () {
- function MaskFormat(format) {
- (0,classCallCheck["default"])(this, MaskFormat);
- (0,defineProperty["default"])(this, "format", void 0);
- (0,defineProperty["default"])(this, "maskFormat", void 0);
- (0,defineProperty["default"])(this, "cells", void 0);
- (0,defineProperty["default"])(this, "maskCells", void 0);
- this.format = format;
- // Generate mask format
- var replaceKeys = FORMAT_KEYS.map(function (key) {
- return "(".concat(key, ")");
- }).join('|');
- var replaceReg = new RegExp(replaceKeys, 'g');
- this.maskFormat = format.replace(replaceReg,
- // Use Chinese character to avoid user use it in format
- function (key) {
- return REPLACE_KEY.repeat(key.length);
- });
- // Generate cells
- var cellReg = new RegExp("(".concat(FORMAT_KEYS.join('|'), ")"));
- var strCells = (format.split(cellReg) || []).filter(function (str) {
- return str;
- });
- var offset = 0;
- this.cells = strCells.map(function (text) {
- var mask = FORMAT_KEYS.includes(text);
- var start = offset;
- var end = offset + text.length;
- offset = end;
- return {
- text: text,
- mask: mask,
- start: start,
- end: end
- };
- });
- // Mask cells
- this.maskCells = this.cells.filter(function (cell) {
- return cell.mask;
- });
- }
- (0,createClass["default"])(MaskFormat, [{
- key: "getSelection",
- value: function getSelection(maskCellIndex) {
- var _ref = this.maskCells[maskCellIndex] || {},
- start = _ref.start,
- end = _ref.end;
- return [start || 0, end || 0];
- }
- /** Check given text match format */
- }, {
- key: "match",
- value: function match(text) {
- for (var i = 0; i < this.maskFormat.length; i += 1) {
- var maskChar = this.maskFormat[i];
- var textChar = text[i];
- if (!textChar || maskChar !== REPLACE_KEY && maskChar !== textChar) {
- return false;
- }
- }
- return true;
- }
- /** Get mask cell count */
- }, {
- key: "size",
- value: function size() {
- return this.maskCells.length;
- }
- }, {
- key: "getMaskCellIndex",
- value: function getMaskCellIndex(anchorIndex) {
- var closetDist = Number.MAX_SAFE_INTEGER;
- var closetIndex = 0;
- for (var i = 0; i < this.maskCells.length; i += 1) {
- var _this$maskCells$i = this.maskCells[i],
- start = _this$maskCells$i.start,
- end = _this$maskCells$i.end;
- if (anchorIndex >= start && anchorIndex <= end) {
- return i;
- }
- var dist = Math.min(Math.abs(anchorIndex - start), Math.abs(anchorIndex - end));
- if (dist < closetDist) {
- closetDist = dist;
- closetIndex = i;
- }
- }
- return closetIndex;
- }
- }]);
- return MaskFormat;
- }();
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/util.js
- function getMaskRange(key) {
- var PresetRange = {
- YYYY: [0, 9999, new Date().getFullYear()],
- MM: [1, 12],
- DD: [1, 31],
- HH: [0, 23],
- mm: [0, 59],
- ss: [0, 59],
- SSS: [0, 999]
- };
- return PresetRange[key];
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/Input.js
- var Selector_Input_excluded = ["active", "showActiveCls", "suffixIcon", "format", "validateFormat", "onChange", "onInput", "helped", "onHelp", "onSubmit", "onKeyDown", "preserveInvalidOnBlur", "invalid", "clearIcon"];
- // Format logic
- //
- // First time on focus:
- // 1. check if the text is valid, if not fill with format
- // 2. set highlight cell to the first cell
- // Cells
- // 1. Selection the index cell, set inner `cacheValue` to ''
- // 2. Key input filter non-number char, patch after the `cacheValue`
- // 1. Replace the `cacheValue` with input align the cell length
- // 2. Re-selection the mask cell
- // 3. If `cacheValue` match the limit length or cell format (like 1 ~ 12 month), go to next cell
- var Selector_Input_Input = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var active = props.active,
- _props$showActiveCls = props.showActiveCls,
- showActiveCls = _props$showActiveCls === void 0 ? true : _props$showActiveCls,
- suffixIcon = props.suffixIcon,
- format = props.format,
- validateFormat = props.validateFormat,
- onChange = props.onChange,
- onInput = props.onInput,
- helped = props.helped,
- onHelp = props.onHelp,
- onSubmit = props.onSubmit,
- onKeyDown = props.onKeyDown,
- _props$preserveInvali = props.preserveInvalidOnBlur,
- preserveInvalidOnBlur = _props$preserveInvali === void 0 ? false : _props$preserveInvali,
- invalid = props.invalid,
- clearIcon = props.clearIcon,
- restProps = (0,objectWithoutProperties["default"])(props, Selector_Input_excluded);
- var value = props.value,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onMouseUp = props.onMouseUp;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls,
- _React$useContext$inp = _React$useContext.input,
- Component = _React$useContext$inp === void 0 ? 'input' : _React$useContext$inp;
- var inputPrefixCls = "".concat(prefixCls, "-input");
- // ======================== Value =========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- focused = _React$useState2[0],
- setFocused = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(value),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- internalInputValue = _React$useState4[0],
- setInputValue = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(''),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- focusCellText = _React$useState6[0],
- setFocusCellText = _React$useState6[1];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- focusCellIndex = _React$useState8[0],
- setFocusCellIndex = _React$useState8[1];
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- forceSelectionSyncMark = _React$useState10[0],
- forceSelectionSync = _React$useState10[1];
- var inputValue = internalInputValue || '';
- // Sync value if needed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setInputValue(value);
- }, [value]);
- // ========================= Refs =========================
- var holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: holderRef.current,
- inputElement: inputRef.current,
- focus: function focus(options) {
- inputRef.current.focus(options);
- },
- blur: function blur() {
- inputRef.current.blur();
- }
- };
- });
- // ======================== Format ========================
- var maskFormat = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return new MaskFormat(format || '');
- }, [format]);
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (helped) {
- return [0, 0];
- }
- return maskFormat.getSelection(focusCellIndex);
- }, [maskFormat, focusCellIndex, helped]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- selectionStart = _React$useMemo2[0],
- selectionEnd = _React$useMemo2[1];
- // ======================== Modify ========================
- // When input modify content, trigger `onHelp` if is not the format
- var onModify = function onModify(text) {
- if (text && text !== format && text !== value) {
- onHelp();
- }
- };
- // ======================== Change ========================
- /**
- * Triggered by paste, keyDown and focus to show format
- */
- var triggerInputChange = (0,rc_util_es.useEvent)(function (text) {
- if (validateFormat(text)) {
- onChange(text);
- }
- setInputValue(text);
- onModify(text);
- });
- // Directly trigger `onChange` if `format` is empty
- var onInternalChange = function onInternalChange(event) {
- // Hack `onChange` with format to do nothing
- if (!format) {
- var text = event.target.value;
- onModify(text);
- setInputValue(text);
- onChange(text);
- }
- };
- var onFormatPaste = function onFormatPaste(event) {
- // Get paste text
- var pasteText = event.clipboardData.getData('text');
- if (validateFormat(pasteText)) {
- triggerInputChange(pasteText);
- }
- };
- // ======================== Mouse =========================
- // When `mouseDown` get focus, it's better to not to change the selection
- // Since the up position maybe not is the first cell
- var mouseDownRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var onFormatMouseDown = function onFormatMouseDown() {
- mouseDownRef.current = true;
- };
- var onFormatMouseUp = function onFormatMouseUp(event) {
- var _ref = event.target,
- start = _ref.selectionStart;
- var closeMaskIndex = maskFormat.getMaskCellIndex(start);
- setFocusCellIndex(closeMaskIndex);
- // Force update the selection
- forceSelectionSync({});
- onMouseUp === null || onMouseUp === void 0 || onMouseUp(event);
- mouseDownRef.current = false;
- };
- // ====================== Focus Blur ======================
- var onFormatFocus = function onFormatFocus(event) {
- setFocused(true);
- setFocusCellIndex(0);
- setFocusCellText('');
- onFocus(event);
- };
- var onSharedBlur = function onSharedBlur(event) {
- onBlur(event);
- };
- var onFormatBlur = function onFormatBlur(event) {
- setFocused(false);
- onSharedBlur(event);
- };
- // ======================== Active ========================
- // Check if blur need reset input value
- useLockEffect(active, function () {
- if (!active && !preserveInvalidOnBlur) {
- setInputValue(value);
- }
- });
- // ======================= Keyboard =======================
- var onSharedKeyDown = function onSharedKeyDown(event) {
- if (event.key === 'Enter' && validateFormat(inputValue)) {
- onSubmit();
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
- };
- var onFormatKeyDown = function onFormatKeyDown(event) {
- onSharedKeyDown(event);
- var key = event.key;
- // Save the cache with cell text
- var nextCellText = null;
- // Fill in the input
- var nextFillText = null;
- var maskCellLen = selectionEnd - selectionStart;
- var cellFormat = format.slice(selectionStart, selectionEnd);
- // Cell Index
- var offsetCellIndex = function offsetCellIndex(offset) {
- setFocusCellIndex(function (idx) {
- var nextIndex = idx + offset;
- nextIndex = Math.max(nextIndex, 0);
- nextIndex = Math.min(nextIndex, maskFormat.size() - 1);
- return nextIndex;
- });
- };
- // Range
- var offsetCellValue = function offsetCellValue(offset) {
- var _getMaskRange = getMaskRange(cellFormat),
- _getMaskRange2 = (0,slicedToArray["default"])(_getMaskRange, 3),
- rangeStart = _getMaskRange2[0],
- rangeEnd = _getMaskRange2[1],
- rangeDefault = _getMaskRange2[2];
- var currentText = inputValue.slice(selectionStart, selectionEnd);
- var currentTextNum = Number(currentText);
- if (isNaN(currentTextNum)) {
- return String(rangeDefault ? rangeDefault : offset > 0 ? rangeStart : rangeEnd);
- }
- var num = currentTextNum + offset;
- var range = rangeEnd - rangeStart + 1;
- return String(rangeStart + (range + num - rangeStart) % range);
- };
- switch (key) {
- // =============== Remove ===============
- case 'Backspace':
- case 'Delete':
- nextCellText = '';
- nextFillText = cellFormat;
- break;
- // =============== Arrows ===============
- // Left key
- case 'ArrowLeft':
- nextCellText = '';
- offsetCellIndex(-1);
- break;
- // Right key
- case 'ArrowRight':
- nextCellText = '';
- offsetCellIndex(1);
- break;
- // Up key
- case 'ArrowUp':
- nextCellText = '';
- nextFillText = offsetCellValue(1);
- break;
- // Down key
- case 'ArrowDown':
- nextCellText = '';
- nextFillText = offsetCellValue(-1);
- break;
- // =============== Number ===============
- default:
- if (!isNaN(Number(key))) {
- nextCellText = focusCellText + key;
- nextFillText = nextCellText;
- }
- break;
- }
- // Update cell text
- if (nextCellText !== null) {
- setFocusCellText(nextCellText);
- if (nextCellText.length >= maskCellLen) {
- // Go to next cell
- offsetCellIndex(1);
- setFocusCellText('');
- }
- }
- // Update the input text
- if (nextFillText !== null) {
- // Replace selection range with `nextCellText`
- var nextFocusValue =
- // before
- inputValue.slice(0, selectionStart) +
- // replace
- leftPad(nextFillText, maskCellLen) +
- // after
- inputValue.slice(selectionEnd);
- triggerInputChange(nextFocusValue.slice(0, format.length));
- }
- // Always trigger selection sync after key down
- forceSelectionSync({});
- };
- // ======================== Format ========================
- var rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- (0,useLayoutEffect["default"])(function () {
- if (!focused || !format || mouseDownRef.current) {
- return;
- }
- // Reset with format if not match
- if (!maskFormat.match(inputValue)) {
- triggerInputChange(format);
- return;
- }
- // Match the selection range
- inputRef.current.setSelectionRange(selectionStart, selectionEnd);
- // Chrome has the bug anchor position looks not correct but actually correct
- rafRef.current = (0,raf["default"])(function () {
- inputRef.current.setSelectionRange(selectionStart, selectionEnd);
- });
- return function () {
- raf["default"].cancel(rafRef.current);
- };
- }, [maskFormat, format, focused, inputValue, focusCellIndex, selectionStart, selectionEnd, forceSelectionSyncMark, triggerInputChange]);
- // ======================== Render ========================
- // Input props for format
- var inputProps = format ? {
- onFocus: onFormatFocus,
- onBlur: onFormatBlur,
- onKeyDown: onFormatKeyDown,
- onMouseDown: onFormatMouseDown,
- onMouseUp: onFormatMouseUp,
- onPaste: onFormatPaste
- } : {};
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: holderRef,
- className: classnames_default()(inputPrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(inputPrefixCls, "-active"), active && showActiveCls), "".concat(inputPrefixCls, "-placeholder"), helped))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({
- ref: inputRef,
- "aria-invalid": invalid,
- autoComplete: "off"
- }, restProps, {
- onKeyDown: onSharedKeyDown,
- onBlur: onSharedBlur
- // Replace with format
- }, inputProps, {
- // Value
- value: inputValue,
- onChange: onInternalChange
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon_Icon, {
- type: "suffix",
- icon: suffixIcon
- }), clearIcon);
- });
- if (true) {
- Selector_Input_Input.displayName = 'Input';
- }
- /* harmony default export */ var PickerInput_Selector_Input = (Selector_Input_Input);
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/RangeSelector.js
- var RangeSelector_excluded = ["id", "prefix", "clearIcon", "suffixIcon", "separator", "activeIndex", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "value", "onChange", "onSubmit", "onInputChange", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onActiveInfo", "placement", "onMouseDown", "required", "aria-required", "autoFocus", "tabIndex"],
- RangeSelector_excluded2 = ["index"];
- function RangeSelector(props, ref) {
- var id = props.id,
- prefix = props.prefix,
- clearIcon = props.clearIcon,
- suffixIcon = props.suffixIcon,
- _props$separator = props.separator,
- separator = _props$separator === void 0 ? '~' : _props$separator,
- activeIndex = props.activeIndex,
- activeHelp = props.activeHelp,
- allHelp = props.allHelp,
- focused = props.focused,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyDown = props.onKeyDown,
- locale = props.locale,
- generateConfig = props.generateConfig,
- placeholder = props.placeholder,
- className = props.className,
- style = props.style,
- onClick = props.onClick,
- onClear = props.onClear,
- value = props.value,
- onChange = props.onChange,
- onSubmit = props.onSubmit,
- onInputChange = props.onInputChange,
- format = props.format,
- maskFormat = props.maskFormat,
- preserveInvalidOnBlur = props.preserveInvalidOnBlur,
- onInvalid = props.onInvalid,
- disabled = props.disabled,
- invalid = props.invalid,
- inputReadOnly = props.inputReadOnly,
- direction = props.direction,
- onOpenChange = props.onOpenChange,
- onActiveInfo = props.onActiveInfo,
- placement = props.placement,
- _onMouseDown = props.onMouseDown,
- required = props.required,
- ariaRequired = props['aria-required'],
- autoFocus = props.autoFocus,
- tabIndex = props.tabIndex,
- restProps = (0,objectWithoutProperties["default"])(props, RangeSelector_excluded);
- var rtl = direction === 'rtl';
- // ======================== Prefix ========================
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls;
- // ========================== Id ==========================
- var ids = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (typeof id === 'string') {
- return [id];
- }
- var mergedId = id || {};
- return [mergedId.start, mergedId.end];
- }, [id]);
- // ========================= Refs =========================
- var rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var inputStartRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var inputEndRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var getInput = function getInput(index) {
- var _index;
- return (_index = [inputStartRef, inputEndRef][index]) === null || _index === void 0 ? void 0 : _index.current;
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: rootRef.current,
- focus: function focus(options) {
- if ((0,esm_typeof["default"])(options) === 'object') {
- var _getInput;
- var _ref = options || {},
- _ref$index = _ref.index,
- _index2 = _ref$index === void 0 ? 0 : _ref$index,
- rest = (0,objectWithoutProperties["default"])(_ref, RangeSelector_excluded2);
- (_getInput = getInput(_index2)) === null || _getInput === void 0 || _getInput.focus(rest);
- } else {
- var _getInput2;
- (_getInput2 = getInput(options !== null && options !== void 0 ? options : 0)) === null || _getInput2 === void 0 || _getInput2.focus();
- }
- },
- blur: function blur() {
- var _getInput3, _getInput4;
- (_getInput3 = getInput(0)) === null || _getInput3 === void 0 || _getInput3.blur();
- (_getInput4 = getInput(1)) === null || _getInput4 === void 0 || _getInput4.blur();
- }
- };
- });
- // ======================== Props =========================
- var rootProps = useRootProps(restProps);
- // ===================== Placeholder ======================
- var mergedPlaceholder = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return Array.isArray(placeholder) ? placeholder : [placeholder, placeholder];
- }, [placeholder]);
- // ======================== Inputs ========================
- var _useInputProps = useInputProps((0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- id: ids,
- placeholder: mergedPlaceholder
- })),
- _useInputProps2 = (0,slicedToArray["default"])(_useInputProps, 1),
- getInputProps = _useInputProps2[0];
- // ====================== ActiveBar =======================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({
- position: 'absolute',
- width: 0
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeBarStyle = _React$useState2[0],
- setActiveBarStyle = _React$useState2[1];
- var syncActiveOffset = (0,rc_util_es.useEvent)(function () {
- var input = getInput(activeIndex);
- if (input) {
- var inputRect = input.nativeElement.getBoundingClientRect();
- var parentRect = rootRef.current.getBoundingClientRect();
- var rectOffset = inputRect.left - parentRect.left;
- setActiveBarStyle(function (ori) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, ori), {}, {
- width: inputRect.width,
- left: rectOffset
- });
- });
- onActiveInfo([inputRect.left, inputRect.right, parentRect.width]);
- }
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- syncActiveOffset();
- }, [activeIndex]);
- // ======================== Clear =========================
- var showClear = clearIcon && (value[0] && !disabled[0] || value[1] && !disabled[1]);
- // ======================= Disabled =======================
- var startAutoFocus = autoFocus && !disabled[0];
- var endAutoFocus = autoFocus && !startAutoFocus && !disabled[1];
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: syncActiveOffset
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, rootProps, {
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-range"), (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-disabled"), disabled.every(function (i) {
- return i;
- })), "".concat(prefixCls, "-invalid"), invalid.some(function (i) {
- return i;
- })), "".concat(prefixCls, "-rtl"), rtl), className),
- style: style,
- ref: rootRef,
- onClick: onClick
- // Not lose current input focus
- ,
- onMouseDown: function onMouseDown(e) {
- var target = e.target;
- if (target !== inputStartRef.current.inputElement && target !== inputEndRef.current.inputElement) {
- e.preventDefault();
- }
- _onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
- }
- }), prefix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-prefix")
- }, prefix), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Selector_Input, (0,esm_extends["default"])({
- ref: inputStartRef
- }, getInputProps(0), {
- autoFocus: startAutoFocus,
- tabIndex: tabIndex,
- "date-range": "start"
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-range-separator")
- }, separator), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Selector_Input, (0,esm_extends["default"])({
- ref: inputEndRef
- }, getInputProps(1), {
- autoFocus: endAutoFocus,
- tabIndex: tabIndex,
- "date-range": "end"
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-active-bar"),
- style: activeBarStyle
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon_Icon, {
- type: "suffix",
- icon: suffixIcon
- }), showClear && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ClearIcon, {
- icon: clearIcon,
- onClear: onClear
- })));
- }
- var RefRangeSelector = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RangeSelector);
- if (true) {
- RefRangeSelector.displayName = 'RangeSelector';
- }
- /* harmony default export */ var Selector_RangeSelector = (RefRangeSelector);
- ;// ./node_modules/rc-picker/es/PickerInput/RangePicker.js
- function separateConfig(config, defaultConfig) {
- var singleConfig = config !== null && config !== void 0 ? config : defaultConfig;
- if (Array.isArray(singleConfig)) {
- return singleConfig;
- }
- return [singleConfig, singleConfig];
- }
- /** Used for change event, it should always be not undefined */
- function getActiveRange(activeIndex) {
- return activeIndex === 1 ? 'end' : 'start';
- }
- function RangePicker(props, ref) {
- // ========================= Prop =========================
- var _useFilledProps = useFilledProps(props, function () {
- var disabled = props.disabled,
- allowEmpty = props.allowEmpty;
- var mergedDisabled = separateConfig(disabled, false);
- var mergedAllowEmpty = separateConfig(allowEmpty, false);
- return {
- disabled: mergedDisabled,
- allowEmpty: mergedAllowEmpty
- };
- }),
- _useFilledProps2 = (0,slicedToArray["default"])(_useFilledProps, 6),
- filledProps = _useFilledProps2[0],
- internalPicker = _useFilledProps2[1],
- complexPicker = _useFilledProps2[2],
- formatList = _useFilledProps2[3],
- maskFormat = _useFilledProps2[4],
- isInvalidateDate = _useFilledProps2[5];
- var prefixCls = filledProps.prefixCls,
- styles = filledProps.styles,
- classNames = filledProps.classNames,
- defaultValue = filledProps.defaultValue,
- value = filledProps.value,
- needConfirm = filledProps.needConfirm,
- onKeyDown = filledProps.onKeyDown,
- disabled = filledProps.disabled,
- allowEmpty = filledProps.allowEmpty,
- disabledDate = filledProps.disabledDate,
- minDate = filledProps.minDate,
- maxDate = filledProps.maxDate,
- defaultOpen = filledProps.defaultOpen,
- open = filledProps.open,
- onOpenChange = filledProps.onOpenChange,
- locale = filledProps.locale,
- generateConfig = filledProps.generateConfig,
- picker = filledProps.picker,
- showNow = filledProps.showNow,
- showToday = filledProps.showToday,
- showTime = filledProps.showTime,
- mode = filledProps.mode,
- onPanelChange = filledProps.onPanelChange,
- onCalendarChange = filledProps.onCalendarChange,
- onOk = filledProps.onOk,
- defaultPickerValue = filledProps.defaultPickerValue,
- pickerValue = filledProps.pickerValue,
- onPickerValueChange = filledProps.onPickerValueChange,
- inputReadOnly = filledProps.inputReadOnly,
- suffixIcon = filledProps.suffixIcon,
- onFocus = filledProps.onFocus,
- onBlur = filledProps.onBlur,
- presets = filledProps.presets,
- ranges = filledProps.ranges,
- components = filledProps.components,
- cellRender = filledProps.cellRender,
- dateRender = filledProps.dateRender,
- monthCellRender = filledProps.monthCellRender,
- onClick = filledProps.onClick;
- // ========================= Refs =========================
- var selectorRef = usePickerRef(ref);
- // ========================= Open =========================
- var _useOpen = useOpen(open, defaultOpen, disabled, onOpenChange),
- _useOpen2 = (0,slicedToArray["default"])(_useOpen, 2),
- mergedOpen = _useOpen2[0],
- setMergeOpen = _useOpen2[1];
- var triggerOpen = function triggerOpen(nextOpen, config) {
- // No need to open if all disabled
- if (disabled.some(function (fieldDisabled) {
- return !fieldDisabled;
- }) || !nextOpen) {
- setMergeOpen(nextOpen, config);
- }
- };
- // ======================== Values ========================
- var _useInnerValue = useInnerValue(generateConfig, locale, formatList, true, false, defaultValue, value, onCalendarChange, onOk),
- _useInnerValue2 = (0,slicedToArray["default"])(_useInnerValue, 5),
- mergedValue = _useInnerValue2[0],
- setInnerValue = _useInnerValue2[1],
- getCalendarValue = _useInnerValue2[2],
- triggerCalendarChange = _useInnerValue2[3],
- triggerOk = _useInnerValue2[4];
- var calendarValue = getCalendarValue();
- // ======================== Active ========================
- var _useRangeActive = useRangeActive(disabled, allowEmpty, mergedOpen),
- _useRangeActive2 = (0,slicedToArray["default"])(_useRangeActive, 9),
- focused = _useRangeActive2[0],
- triggerFocus = _useRangeActive2[1],
- lastOperation = _useRangeActive2[2],
- activeIndex = _useRangeActive2[3],
- setActiveIndex = _useRangeActive2[4],
- nextActiveIndex = _useRangeActive2[5],
- activeIndexList = _useRangeActive2[6],
- updateSubmitIndex = _useRangeActive2[7],
- hasActiveSubmitValue = _useRangeActive2[8];
- var onSharedFocus = function onSharedFocus(event, index) {
- triggerFocus(true);
- onFocus === null || onFocus === void 0 || onFocus(event, {
- range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex)
- });
- };
- var onSharedBlur = function onSharedBlur(event, index) {
- triggerFocus(false);
- onBlur === null || onBlur === void 0 || onBlur(event, {
- range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex)
- });
- };
- // ======================= ShowTime =======================
- /** Used for Popup panel */
- var mergedShowTime = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!showTime) {
- return null;
- }
- var disabledTime = showTime.disabledTime;
- var proxyDisabledTime = disabledTime ? function (date) {
- var range = getActiveRange(activeIndex);
- var fromDate = getFromDate(calendarValue, activeIndexList, activeIndex);
- return disabledTime(date, range, {
- from: fromDate
- });
- } : undefined;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, showTime), {}, {
- disabledTime: proxyDisabledTime
- });
- }, [showTime, activeIndex, calendarValue, activeIndexList]);
- // ========================= Mode =========================
- var _useMergedState = (0,rc_util_es.useMergedState)([picker, picker], {
- value: mode
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- modes = _useMergedState2[0],
- setModes = _useMergedState2[1];
- var mergedMode = modes[activeIndex] || picker;
- /** Extends from `mergedMode` to patch `datetime` mode */
- var internalMode = mergedMode === 'date' && mergedShowTime ? 'datetime' : mergedMode;
- // ====================== PanelCount ======================
- var multiplePanel = internalMode === picker && internalMode !== 'time';
- // ======================= Show Now =======================
- var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday, true);
- // ======================== Value =========================
- var _useRangeValue = useRangeValue(filledProps, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, mergedOpen, isInvalidateDate),
- _useRangeValue2 = (0,slicedToArray["default"])(_useRangeValue, 2),
- /** Trigger `onChange` by check `disabledDate` */
- flushSubmit = _useRangeValue2[0],
- /** Trigger `onChange` directly without check `disabledDate` */
- triggerSubmitChange = _useRangeValue2[1];
- // ===================== DisabledDate =====================
- var mergedDisabledDate = useRangeDisabledDate(calendarValue, disabled, activeIndexList, generateConfig, locale, disabledDate);
- // ======================= Validate =======================
- var _useFieldsInvalidate = useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty),
- _useFieldsInvalidate2 = (0,slicedToArray["default"])(_useFieldsInvalidate, 2),
- submitInvalidates = _useFieldsInvalidate2[0],
- onSelectorInvalid = _useFieldsInvalidate2[1];
- // ===================== Picker Value =====================
- var _useRangePickerValue = useRangePickerValue(generateConfig, locale, calendarValue, modes, mergedOpen, activeIndex, internalPicker, multiplePanel, defaultPickerValue, pickerValue, mergedShowTime === null || mergedShowTime === void 0 ? void 0 : mergedShowTime.defaultOpenValue, onPickerValueChange, minDate, maxDate),
- _useRangePickerValue2 = (0,slicedToArray["default"])(_useRangePickerValue, 2),
- currentPickerValue = _useRangePickerValue2[0],
- setCurrentPickerValue = _useRangePickerValue2[1];
- // >>> Mode need wait for `pickerValue`
- var triggerModeChange = (0,rc_util_es.useEvent)(function (nextPickerValue, nextMode, triggerEvent) {
- var clone = fillIndex(modes, activeIndex, nextMode);
- if (clone[0] !== modes[0] || clone[1] !== modes[1]) {
- setModes(clone);
- }
- // Compatible with `onPanelChange`
- if (onPanelChange && triggerEvent !== false) {
- var clonePickerValue = (0,toConsumableArray["default"])(calendarValue);
- if (nextPickerValue) {
- clonePickerValue[activeIndex] = nextPickerValue;
- }
- onPanelChange(clonePickerValue, clone);
- }
- });
- // ======================== Change ========================
- var fillCalendarValue = function fillCalendarValue(date, index) {
- return (
- // Trigger change only when date changed
- fillIndex(calendarValue, index, date)
- );
- };
- // ======================== Submit ========================
- /**
- * Trigger by confirm operation.
- * This function has already handle the `needConfirm` check logic.
- * - Selector: enter key
- * - Panel: OK button
- */
- var triggerPartConfirm = function triggerPartConfirm(date, skipFocus) {
- var nextValue = calendarValue;
- if (date) {
- nextValue = fillCalendarValue(date, activeIndex);
- }
- updateSubmitIndex(activeIndex);
- // Get next focus index
- var nextIndex = nextActiveIndex(nextValue);
- // Change calendar value and tell flush it
- triggerCalendarChange(nextValue);
- flushSubmit(activeIndex, nextIndex === null);
- if (nextIndex === null) {
- triggerOpen(false, {
- force: true
- });
- } else if (!skipFocus) {
- selectorRef.current.focus({
- index: nextIndex
- });
- }
- };
- // ======================== Click =========================
- var onSelectorClick = function onSelectorClick(event) {
- var _activeElement;
- var rootNode = event.target.getRootNode();
- if (!selectorRef.current.nativeElement.contains((_activeElement = rootNode.activeElement) !== null && _activeElement !== void 0 ? _activeElement : document.activeElement)) {
- // Click to focus the enabled input
- var enabledIndex = disabled.findIndex(function (d) {
- return !d;
- });
- if (enabledIndex >= 0) {
- selectorRef.current.focus({
- index: enabledIndex
- });
- }
- }
- triggerOpen(true);
- onClick === null || onClick === void 0 || onClick(event);
- };
- var onSelectorClear = function onSelectorClear() {
- triggerSubmitChange(null);
- triggerOpen(false, {
- force: true
- });
- };
- // ======================== Hover =========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- hoverSource = _React$useState2[0],
- setHoverSource = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- internalHoverValues = _React$useState4[0],
- setInternalHoverValues = _React$useState4[1];
- var hoverValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return internalHoverValues || calendarValue;
- }, [calendarValue, internalHoverValues]);
- // Clean up `internalHoverValues` when closed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!mergedOpen) {
- setInternalHoverValues(null);
- }
- }, [mergedOpen]);
- // ========================================================
- // == Panels ==
- // ========================================================
- // Save the offset with active bar position
- // const [activeOffset, setActiveOffset] = React.useState(0);
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([0, 0, 0]),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- activeInfo = _React$useState6[0],
- setActiveInfo = _React$useState6[1];
- // ======================= Presets ========================
- var presetList = usePresets(presets, ranges);
- var onPresetHover = function onPresetHover(nextValues) {
- setInternalHoverValues(nextValues);
- setHoverSource('preset');
- };
- var onPresetSubmit = function onPresetSubmit(nextValues) {
- var passed = triggerSubmitChange(nextValues);
- if (passed) {
- triggerOpen(false, {
- force: true
- });
- }
- };
- var onNow = function onNow(now) {
- triggerPartConfirm(now);
- };
- // ======================== Panel =========================
- var onPanelHover = function onPanelHover(date) {
- setInternalHoverValues(date ? fillCalendarValue(date, activeIndex) : null);
- setHoverSource('cell');
- };
- // >>> Focus
- var onPanelFocus = function onPanelFocus(event) {
- triggerOpen(true);
- onSharedFocus(event);
- };
- // >>> MouseDown
- var onPanelMouseDown = function onPanelMouseDown() {
- lastOperation('panel');
- };
- // >>> Calendar
- var onPanelSelect = function onPanelSelect(date) {
- var clone = fillIndex(calendarValue, activeIndex, date);
- // Only trigger calendar event but not update internal `calendarValue` state
- triggerCalendarChange(clone);
- // >>> Trigger next active if !needConfirm
- // Fully logic check `useRangeValue` hook
- if (!needConfirm && !complexPicker && internalPicker === internalMode) {
- triggerPartConfirm(date);
- }
- };
- // >>> Close
- var onPopupClose = function onPopupClose() {
- // Close popup
- triggerOpen(false);
- };
- // >>> cellRender
- var onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender, getActiveRange(activeIndex));
- // >>> Value
- var panelValue = calendarValue[activeIndex] || null;
- // >>> invalid
- var isPopupInvalidateDate = (0,rc_util_es.useEvent)(function (date) {
- return isInvalidateDate(date, {
- activeIndex: activeIndex
- });
- });
- var panelProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var domProps = (0,pickAttrs["default"])(filledProps, false);
- var restProps = (0,omit["default"])(filledProps, [].concat((0,toConsumableArray["default"])(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange', 'disabledTime']));
- return restProps;
- }, [filledProps]);
- // >>> Render
- var panel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Popup_Popup, (0,esm_extends["default"])({}, panelProps, {
- showNow: mergedShowNow,
- showTime: mergedShowTime
- // Range
- ,
- range: true,
- multiplePanel: multiplePanel,
- activeInfo: activeInfo
- // Disabled
- ,
- disabledDate: mergedDisabledDate
- // Focus
- ,
- onFocus: onPanelFocus,
- onBlur: onSharedBlur,
- onPanelMouseDown: onPanelMouseDown
- // Mode
- ,
- picker: picker,
- mode: mergedMode,
- internalMode: internalMode,
- onPanelChange: triggerModeChange
- // Value
- ,
- format: maskFormat,
- value: panelValue,
- isInvalid: isPopupInvalidateDate,
- onChange: null,
- onSelect: onPanelSelect
- // PickerValue
- ,
- pickerValue: currentPickerValue,
- defaultOpenValue: miscUtil_toArray(showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue)[activeIndex],
- onPickerValueChange: setCurrentPickerValue
- // Hover
- ,
- hoverValue: hoverValues,
- onHover: onPanelHover
- // Submit
- ,
- needConfirm: needConfirm,
- onSubmit: triggerPartConfirm,
- onOk: triggerOk
- // Preset
- ,
- presets: presetList,
- onPresetHover: onPresetHover,
- onPresetSubmit: onPresetSubmit
- // Now
- ,
- onNow: onNow
- // Render
- ,
- cellRender: onInternalCellRender
- }));
- // ========================================================
- // == Selector ==
- // ========================================================
- // ======================== Change ========================
- var onSelectorChange = function onSelectorChange(date, index) {
- var clone = fillCalendarValue(date, index);
- triggerCalendarChange(clone);
- };
- var onSelectorInputChange = function onSelectorInputChange() {
- lastOperation('input');
- };
- // ======================= Selector =======================
- var onSelectorFocus = function onSelectorFocus(event, index) {
- // Check if `needConfirm` but user not submit yet
- var activeListLen = activeIndexList.length;
- var lastActiveIndex = activeIndexList[activeListLen - 1];
- if (activeListLen && lastActiveIndex !== index && needConfirm &&
- // Not change index if is not filled
- !allowEmpty[lastActiveIndex] && !hasActiveSubmitValue(lastActiveIndex) && calendarValue[lastActiveIndex]) {
- selectorRef.current.focus({
- index: lastActiveIndex
- });
- return;
- }
- lastOperation('input');
- triggerOpen(true, {
- inherit: true
- });
- // When click input to switch the field, it will not trigger close.
- // Which means it will lose the part confirm and we need fill back.
- // ref: https://github.com/ant-design/ant-design/issues/49512
- if (activeIndex !== index && mergedOpen && !needConfirm && complexPicker) {
- triggerPartConfirm(null, true);
- }
- setActiveIndex(index);
- onSharedFocus(event, index);
- };
- var onSelectorBlur = function onSelectorBlur(event, index) {
- triggerOpen(false);
- if (!needConfirm && lastOperation() === 'input') {
- var nextIndex = nextActiveIndex(calendarValue);
- flushSubmit(activeIndex, nextIndex === null);
- }
- onSharedBlur(event, index);
- };
- var onSelectorKeyDown = function onSelectorKeyDown(event, preventDefault) {
- if (event.key === 'Tab') {
- triggerPartConfirm(null, true);
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, preventDefault);
- };
- // ======================= Context ========================
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- prefixCls: prefixCls,
- locale: locale,
- generateConfig: generateConfig,
- button: components.button,
- input: components.input
- };
- }, [prefixCls, locale, generateConfig, components.button, components.input]);
- // ======================== Effect ========================
- // >>> Mode
- // Reset for every active
- (0,useLayoutEffect["default"])(function () {
- if (mergedOpen && activeIndex !== undefined) {
- // Legacy compatible. This effect update should not trigger `onPanelChange`
- triggerModeChange(null, picker, false);
- }
- }, [mergedOpen, activeIndex, picker]);
- // >>> For complex picker, we need check if need to focus next one
- (0,useLayoutEffect["default"])(function () {
- var lastOp = lastOperation();
- // Trade as confirm on field leave
- if (!mergedOpen && lastOp === 'input') {
- triggerOpen(false);
- triggerPartConfirm(null, true);
- }
- // Submit with complex picker
- if (!mergedOpen && complexPicker && !needConfirm && lastOp === 'panel') {
- triggerOpen(true);
- triggerPartConfirm();
- }
- }, [mergedOpen]);
- // ====================== DevWarning ======================
- if (true) {
- var isIndexEmpty = function isIndexEmpty(index) {
- return (
- // Value is empty
- !(value !== null && value !== void 0 && value[index]) &&
- // DefaultValue is empty
- !(defaultValue !== null && defaultValue !== void 0 && defaultValue[index])
- );
- };
- if (disabled.some(function (fieldDisabled, index) {
- return fieldDisabled && isIndexEmpty(index) && !allowEmpty[index];
- })) {
- (0,warning["default"])(false, '`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead.');
- }
- }
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_context.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerTrigger, (0,esm_extends["default"])({}, pickTriggerProps(filledProps), {
- popupElement: panel,
- popupStyle: styles.popup,
- popupClassName: classNames.popup
- // Visible
- ,
- visible: mergedOpen,
- onClose: onPopupClose
- // Range
- ,
- range: true
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Selector_RangeSelector
- // Shared
- , (0,esm_extends["default"])({}, filledProps, {
- // Ref
- ref: selectorRef
- // Icon
- ,
- suffixIcon: suffixIcon
- // Active
- ,
- activeIndex: focused || mergedOpen ? activeIndex : null,
- activeHelp: !!internalHoverValues,
- allHelp: !!internalHoverValues && hoverSource === 'preset',
- focused: focused,
- onFocus: onSelectorFocus,
- onBlur: onSelectorBlur,
- onKeyDown: onSelectorKeyDown,
- onSubmit: triggerPartConfirm
- // Change
- ,
- value: hoverValues,
- maskFormat: maskFormat,
- onChange: onSelectorChange,
- onInputChange: onSelectorInputChange
- // Format
- ,
- format: formatList,
- inputReadOnly: inputReadOnly
- // Disabled
- ,
- disabled: disabled
- // Open
- ,
- open: mergedOpen,
- onOpenChange: triggerOpen
- // Click
- ,
- onClick: onSelectorClick,
- onClear: onSelectorClear
- // Invalid
- ,
- invalid: submitInvalidates,
- onInvalid: onSelectorInvalid
- // Offset
- ,
- onActiveInfo: setActiveInfo
- }))));
- }
- var RefRangePicker = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RangePicker);
- if (true) {
- RefRangePicker.displayName = 'RefRangePicker';
- }
- /* harmony default export */ var PickerInput_RangePicker = (RefRangePicker);
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js
- function MultipleDates(props) {
- var prefixCls = props.prefixCls,
- value = props.value,
- onRemove = props.onRemove,
- _props$removeIcon = props.removeIcon,
- removeIcon = _props$removeIcon === void 0 ? '×' : _props$removeIcon,
- formatDate = props.formatDate,
- disabled = props.disabled,
- maxTagCount = props.maxTagCount,
- placeholder = props.placeholder;
- var selectorCls = "".concat(prefixCls, "-selector");
- var selectionCls = "".concat(prefixCls, "-selection");
- var overflowCls = "".concat(selectionCls, "-overflow");
- // ========================= Item =========================
- function renderSelector(content, onClose) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()("".concat(selectionCls, "-item")),
- title: typeof content === 'string' ? content : null
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(selectionCls, "-item-content")
- }, content), !disabled && onClose && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- onMouseDown: function onMouseDown(e) {
- e.preventDefault();
- },
- onClick: onClose,
- className: "".concat(selectionCls, "-item-remove")
- }, removeIcon));
- }
- function renderItem(date) {
- var displayLabel = formatDate(date);
- var onClose = function onClose(event) {
- if (event) event.stopPropagation();
- onRemove(date);
- };
- return renderSelector(displayLabel, onClose);
- }
- // ========================= Rest =========================
- function renderRest(omittedValues) {
- var content = "+ ".concat(omittedValues.length, " ...");
- return renderSelector(content);
- }
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: selectorCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_overflow_es, {
- prefixCls: overflowCls,
- data: value,
- renderItem: renderItem,
- renderRest: renderRest
- // suffix={inputNode}
- ,
- itemKey: function itemKey(date) {
- return formatDate(date);
- },
- maxCount: maxTagCount
- }), !value.length && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-selection-placeholder")
- }, placeholder));
- }
- ;// ./node_modules/rc-picker/es/PickerInput/Selector/SingleSelector/index.js
- var SingleSelector_excluded = ["id", "open", "prefix", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required", "autoFocus", "tabIndex", "removeIcon"];
- function SingleSelector_SingleSelector(props, ref) {
- var id = props.id,
- open = props.open,
- prefix = props.prefix,
- clearIcon = props.clearIcon,
- suffixIcon = props.suffixIcon,
- activeHelp = props.activeHelp,
- allHelp = props.allHelp,
- focused = props.focused,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyDown = props.onKeyDown,
- locale = props.locale,
- generateConfig = props.generateConfig,
- placeholder = props.placeholder,
- className = props.className,
- style = props.style,
- onClick = props.onClick,
- onClear = props.onClear,
- internalPicker = props.internalPicker,
- value = props.value,
- onChange = props.onChange,
- onSubmit = props.onSubmit,
- onInputChange = props.onInputChange,
- multiple = props.multiple,
- maxTagCount = props.maxTagCount,
- format = props.format,
- maskFormat = props.maskFormat,
- preserveInvalidOnBlur = props.preserveInvalidOnBlur,
- onInvalid = props.onInvalid,
- disabled = props.disabled,
- invalid = props.invalid,
- inputReadOnly = props.inputReadOnly,
- direction = props.direction,
- onOpenChange = props.onOpenChange,
- _onMouseDown = props.onMouseDown,
- required = props.required,
- ariaRequired = props['aria-required'],
- autoFocus = props.autoFocus,
- tabIndex = props.tabIndex,
- removeIcon = props.removeIcon,
- restProps = (0,objectWithoutProperties["default"])(props, SingleSelector_excluded);
- var rtl = direction === 'rtl';
- // ======================== Prefix ========================
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PickerInput_context),
- prefixCls = _React$useContext.prefixCls;
- // ========================= Refs =========================
- var rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: rootRef.current,
- focus: function focus(options) {
- var _inputRef$current;
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus(options);
- },
- blur: function blur() {
- var _inputRef$current2;
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
- }
- };
- });
- // ======================== Props =========================
- var rootProps = useRootProps(restProps);
- // ======================== Change ========================
- var onSingleChange = function onSingleChange(date) {
- onChange([date]);
- };
- var onMultipleRemove = function onMultipleRemove(date) {
- var nextValues = value.filter(function (oriDate) {
- return oriDate && !isSame(generateConfig, locale, oriDate, date, internalPicker);
- });
- onChange(nextValues);
- // When `open`, it means user is operating the
- if (!open) {
- onSubmit();
- }
- };
- // ======================== Inputs ========================
- var _useInputProps = useInputProps((0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- onChange: onSingleChange
- }), function (_ref) {
- var valueTexts = _ref.valueTexts;
- return {
- value: valueTexts[0] || '',
- active: focused
- };
- }),
- _useInputProps2 = (0,slicedToArray["default"])(_useInputProps, 2),
- getInputProps = _useInputProps2[0],
- getText = _useInputProps2[1];
- // ======================== Clear =========================
- var showClear = !!(clearIcon && value.length && !disabled);
- // ======================= Multiple =======================
- var selectorNode = multiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MultipleDates, {
- prefixCls: prefixCls,
- value: value,
- onRemove: onMultipleRemove,
- formatDate: getText,
- maxTagCount: maxTagCount,
- disabled: disabled,
- removeIcon: removeIcon,
- placeholder: placeholder
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", {
- className: "".concat(prefixCls, "-multiple-input"),
- value: value.map(getText).join(','),
- ref: inputRef,
- readOnly: true,
- autoFocus: autoFocus,
- tabIndex: tabIndex
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Icon_Icon, {
- type: "suffix",
- icon: suffixIcon
- }), showClear && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ClearIcon, {
- icon: clearIcon,
- onClear: onClear
- })) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Selector_Input, (0,esm_extends["default"])({
- ref: inputRef
- }, getInputProps(), {
- autoFocus: autoFocus,
- tabIndex: tabIndex,
- suffixIcon: suffixIcon,
- clearIcon: showClear && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ClearIcon, {
- icon: clearIcon,
- onClear: onClear
- }),
- showActiveCls: false
- }));
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, rootProps, {
- className: classnames_default()(prefixCls, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-multiple"), multiple), "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-invalid"), invalid), "".concat(prefixCls, "-rtl"), rtl), className),
- style: style,
- ref: rootRef,
- onClick: onClick
- // Not lose current input focus
- ,
- onMouseDown: function onMouseDown(e) {
- var _inputRef$current3;
- var target = e.target;
- if (target !== ((_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.inputElement)) {
- e.preventDefault();
- }
- _onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
- }
- }), prefix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-prefix")
- }, prefix), selectorNode);
- }
- var RefSingleSelector = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SingleSelector_SingleSelector);
- if (true) {
- RefSingleSelector.displayName = 'SingleSelector';
- }
- /* harmony default export */ var PickerInput_Selector_SingleSelector = (RefSingleSelector);
- ;// ./node_modules/rc-picker/es/PickerInput/SinglePicker.js
- // TODO: isInvalidateDate with showTime.disabledTime should not provide `range` prop
- /** Internal usage. For cross function get same aligned props */
- function Picker(props, ref) {
- // ========================= Prop =========================
- var _useFilledProps = useFilledProps(props),
- _useFilledProps2 = (0,slicedToArray["default"])(_useFilledProps, 6),
- filledProps = _useFilledProps2[0],
- internalPicker = _useFilledProps2[1],
- complexPicker = _useFilledProps2[2],
- formatList = _useFilledProps2[3],
- maskFormat = _useFilledProps2[4],
- isInvalidateDate = _useFilledProps2[5];
- var _ref = filledProps,
- prefixCls = _ref.prefixCls,
- styles = _ref.styles,
- classNames = _ref.classNames,
- order = _ref.order,
- defaultValue = _ref.defaultValue,
- value = _ref.value,
- needConfirm = _ref.needConfirm,
- onChange = _ref.onChange,
- onKeyDown = _ref.onKeyDown,
- disabled = _ref.disabled,
- disabledDate = _ref.disabledDate,
- minDate = _ref.minDate,
- maxDate = _ref.maxDate,
- defaultOpen = _ref.defaultOpen,
- open = _ref.open,
- onOpenChange = _ref.onOpenChange,
- locale = _ref.locale,
- generateConfig = _ref.generateConfig,
- picker = _ref.picker,
- showNow = _ref.showNow,
- showToday = _ref.showToday,
- showTime = _ref.showTime,
- mode = _ref.mode,
- onPanelChange = _ref.onPanelChange,
- onCalendarChange = _ref.onCalendarChange,
- onOk = _ref.onOk,
- multiple = _ref.multiple,
- defaultPickerValue = _ref.defaultPickerValue,
- pickerValue = _ref.pickerValue,
- onPickerValueChange = _ref.onPickerValueChange,
- inputReadOnly = _ref.inputReadOnly,
- suffixIcon = _ref.suffixIcon,
- removeIcon = _ref.removeIcon,
- onFocus = _ref.onFocus,
- onBlur = _ref.onBlur,
- presets = _ref.presets,
- components = _ref.components,
- cellRender = _ref.cellRender,
- dateRender = _ref.dateRender,
- monthCellRender = _ref.monthCellRender,
- onClick = _ref.onClick;
- // ========================= Refs =========================
- var selectorRef = usePickerRef(ref);
- // ========================= Util =========================
- function pickerParam(values) {
- if (values === null) {
- return null;
- }
- return multiple ? values : values[0];
- }
- var toggleDates = useToggleDates(generateConfig, locale, internalPicker);
- // ========================= Open =========================
- var _useOpen = useOpen(open, defaultOpen, [disabled], onOpenChange),
- _useOpen2 = (0,slicedToArray["default"])(_useOpen, 2),
- mergedOpen = _useOpen2[0],
- triggerOpen = _useOpen2[1];
- // ======================= Calendar =======================
- var onInternalCalendarChange = function onInternalCalendarChange(dates, dateStrings, info) {
- if (onCalendarChange) {
- var filteredInfo = (0,objectSpread2["default"])({}, info);
- delete filteredInfo.range;
- onCalendarChange(pickerParam(dates), pickerParam(dateStrings), filteredInfo);
- }
- };
- var onInternalOk = function onInternalOk(dates) {
- onOk === null || onOk === void 0 || onOk(pickerParam(dates));
- };
- // ======================== Values ========================
- var _useInnerValue = useInnerValue(generateConfig, locale, formatList, false, order, defaultValue, value, onInternalCalendarChange, onInternalOk),
- _useInnerValue2 = (0,slicedToArray["default"])(_useInnerValue, 5),
- mergedValue = _useInnerValue2[0],
- setInnerValue = _useInnerValue2[1],
- getCalendarValue = _useInnerValue2[2],
- triggerCalendarChange = _useInnerValue2[3],
- triggerOk = _useInnerValue2[4];
- var calendarValue = getCalendarValue();
- // ======================== Active ========================
- // In SinglePicker, we will always get `activeIndex` is 0.
- var _useRangeActive = useRangeActive([disabled]),
- _useRangeActive2 = (0,slicedToArray["default"])(_useRangeActive, 4),
- focused = _useRangeActive2[0],
- triggerFocus = _useRangeActive2[1],
- lastOperation = _useRangeActive2[2],
- activeIndex = _useRangeActive2[3];
- var onSharedFocus = function onSharedFocus(event) {
- triggerFocus(true);
- onFocus === null || onFocus === void 0 || onFocus(event, {});
- };
- var onSharedBlur = function onSharedBlur(event) {
- triggerFocus(false);
- onBlur === null || onBlur === void 0 || onBlur(event, {});
- };
- // ========================= Mode =========================
- var _useMergedState = (0,rc_util_es.useMergedState)(picker, {
- value: mode
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedMode = _useMergedState2[0],
- setMode = _useMergedState2[1];
- /** Extends from `mergedMode` to patch `datetime` mode */
- var internalMode = mergedMode === 'date' && showTime ? 'datetime' : mergedMode;
- // ======================= Show Now =======================
- var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday);
- // ======================== Value =========================
- var onInternalChange = onChange && function (dates, dateStrings) {
- onChange(pickerParam(dates), pickerParam(dateStrings));
- };
- var _useRangeValue = useRangeValue((0,objectSpread2["default"])((0,objectSpread2["default"])({}, filledProps), {}, {
- onChange: onInternalChange
- }), mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, [],
- //disabled,
- formatList, focused, mergedOpen, isInvalidateDate),
- _useRangeValue2 = (0,slicedToArray["default"])(_useRangeValue, 2),
- /** Trigger `onChange` directly without check `disabledDate` */
- triggerSubmitChange = _useRangeValue2[1];
- // ======================= Validate =======================
- var _useFieldsInvalidate = useFieldsInvalidate(calendarValue, isInvalidateDate),
- _useFieldsInvalidate2 = (0,slicedToArray["default"])(_useFieldsInvalidate, 2),
- submitInvalidates = _useFieldsInvalidate2[0],
- onSelectorInvalid = _useFieldsInvalidate2[1];
- var submitInvalidate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return submitInvalidates.some(function (invalidated) {
- return invalidated;
- });
- }, [submitInvalidates]);
- // ===================== Picker Value =====================
- // Proxy to single pickerValue
- var onInternalPickerValueChange = function onInternalPickerValueChange(dates, info) {
- if (onPickerValueChange) {
- var cleanInfo = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, info), {}, {
- mode: info.mode[0]
- });
- delete cleanInfo.range;
- onPickerValueChange(dates[0], cleanInfo);
- }
- };
- var _useRangePickerValue = useRangePickerValue(generateConfig, locale, calendarValue, [mergedMode], mergedOpen, activeIndex, internalPicker, false,
- // multiplePanel,
- defaultPickerValue, pickerValue, miscUtil_toArray(showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue), onInternalPickerValueChange, minDate, maxDate),
- _useRangePickerValue2 = (0,slicedToArray["default"])(_useRangePickerValue, 2),
- currentPickerValue = _useRangePickerValue2[0],
- setCurrentPickerValue = _useRangePickerValue2[1];
- // >>> Mode need wait for `pickerValue`
- var triggerModeChange = (0,rc_util_es.useEvent)(function (nextPickerValue, nextMode, triggerEvent) {
- setMode(nextMode);
- // Compatible with `onPanelChange`
- if (onPanelChange && triggerEvent !== false) {
- var lastPickerValue = nextPickerValue || calendarValue[calendarValue.length - 1];
- onPanelChange(lastPickerValue, nextMode);
- }
- });
- // ======================== Submit ========================
- /**
- * Different with RangePicker, confirm should check `multiple` logic.
- * This will never provide `date` instead.
- */
- var triggerConfirm = function triggerConfirm() {
- triggerSubmitChange(getCalendarValue());
- triggerOpen(false, {
- force: true
- });
- };
- // ======================== Click =========================
- var onSelectorClick = function onSelectorClick(event) {
- if (!disabled && !selectorRef.current.nativeElement.contains(document.activeElement)) {
- // Click to focus the enabled input
- selectorRef.current.focus();
- }
- triggerOpen(true);
- onClick === null || onClick === void 0 || onClick(event);
- };
- var onSelectorClear = function onSelectorClear() {
- triggerSubmitChange(null);
- triggerOpen(false, {
- force: true
- });
- };
- // ======================== Hover =========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- hoverSource = _React$useState2[0],
- setHoverSource = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- internalHoverValue = _React$useState4[0],
- setInternalHoverValue = _React$useState4[1];
- var hoverValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var values = [internalHoverValue].concat((0,toConsumableArray["default"])(calendarValue)).filter(function (date) {
- return date;
- });
- return multiple ? values : values.slice(0, 1);
- }, [calendarValue, internalHoverValue, multiple]);
- // Selector values is different with RangePicker
- // which can not use `hoverValue` directly
- var selectorValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!multiple && internalHoverValue) {
- return [internalHoverValue];
- }
- return calendarValue.filter(function (date) {
- return date;
- });
- }, [calendarValue, internalHoverValue, multiple]);
- // Clean up `internalHoverValues` when closed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!mergedOpen) {
- setInternalHoverValue(null);
- }
- }, [mergedOpen]);
- // ========================================================
- // == Panels ==
- // ========================================================
- // ======================= Presets ========================
- var presetList = usePresets(presets);
- var onPresetHover = function onPresetHover(nextValue) {
- setInternalHoverValue(nextValue);
- setHoverSource('preset');
- };
- // TODO: handle this
- var onPresetSubmit = function onPresetSubmit(nextValue) {
- var nextCalendarValues = multiple ? toggleDates(getCalendarValue(), nextValue) : [nextValue];
- var passed = triggerSubmitChange(nextCalendarValues);
- if (passed && !multiple) {
- triggerOpen(false, {
- force: true
- });
- }
- };
- var onNow = function onNow(now) {
- onPresetSubmit(now);
- };
- // ======================== Panel =========================
- var onPanelHover = function onPanelHover(date) {
- setInternalHoverValue(date);
- setHoverSource('cell');
- };
- // >>> Focus
- var onPanelFocus = function onPanelFocus(event) {
- triggerOpen(true);
- onSharedFocus(event);
- };
- // >>> Calendar
- var onPanelSelect = function onPanelSelect(date) {
- lastOperation('panel');
- // Not change values if multiple and current panel is to match with picker
- if (multiple && internalMode !== picker) {
- return;
- }
- var nextValues = multiple ? toggleDates(getCalendarValue(), date) : [date];
- // Only trigger calendar event but not update internal `calendarValue` state
- triggerCalendarChange(nextValues);
- // >>> Trigger next active if !needConfirm
- // Fully logic check `useRangeValue` hook
- if (!needConfirm && !complexPicker && internalPicker === internalMode) {
- triggerConfirm();
- }
- };
- // >>> Close
- var onPopupClose = function onPopupClose() {
- // Close popup
- triggerOpen(false);
- };
- // >>> cellRender
- var onInternalCellRender = useCellRender(cellRender, dateRender, monthCellRender);
- // >>> invalid
- var panelProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var domProps = (0,pickAttrs["default"])(filledProps, false);
- var restProps = (0,omit["default"])(filledProps, [].concat((0,toConsumableArray["default"])(Object.keys(domProps)), ['onChange', 'onCalendarChange', 'style', 'className', 'onPanelChange']));
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, restProps), {}, {
- multiple: filledProps.multiple
- });
- }, [filledProps]);
- // >>> Render
- var panel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Popup_Popup, (0,esm_extends["default"])({}, panelProps, {
- showNow: mergedShowNow,
- showTime: showTime
- // Disabled
- ,
- disabledDate: disabledDate
- // Focus
- ,
- onFocus: onPanelFocus,
- onBlur: onSharedBlur
- // Mode
- ,
- picker: picker,
- mode: mergedMode,
- internalMode: internalMode,
- onPanelChange: triggerModeChange
- // Value
- ,
- format: maskFormat,
- value: calendarValue,
- isInvalid: isInvalidateDate,
- onChange: null,
- onSelect: onPanelSelect
- // PickerValue
- ,
- pickerValue: currentPickerValue,
- defaultOpenValue: showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue,
- onPickerValueChange: setCurrentPickerValue
- // Hover
- ,
- hoverValue: hoverValues,
- onHover: onPanelHover
- // Submit
- ,
- needConfirm: needConfirm,
- onSubmit: triggerConfirm,
- onOk: triggerOk
- // Preset
- ,
- presets: presetList,
- onPresetHover: onPresetHover,
- onPresetSubmit: onPresetSubmit,
- onNow: onNow
- // Render
- ,
- cellRender: onInternalCellRender
- }));
- // ========================================================
- // == Selector ==
- // ========================================================
- // ======================== Change ========================
- var onSelectorChange = function onSelectorChange(date) {
- triggerCalendarChange(date);
- };
- var onSelectorInputChange = function onSelectorInputChange() {
- lastOperation('input');
- };
- // ======================= Selector =======================
- var onSelectorFocus = function onSelectorFocus(event) {
- lastOperation('input');
- triggerOpen(true, {
- inherit: true
- });
- // setActiveIndex(index);
- onSharedFocus(event);
- };
- var onSelectorBlur = function onSelectorBlur(event) {
- triggerOpen(false);
- onSharedBlur(event);
- };
- var onSelectorKeyDown = function onSelectorKeyDown(event, preventDefault) {
- if (event.key === 'Tab') {
- triggerConfirm();
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, preventDefault);
- };
- // ======================= Context ========================
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- prefixCls: prefixCls,
- locale: locale,
- generateConfig: generateConfig,
- button: components.button,
- input: components.input
- };
- }, [prefixCls, locale, generateConfig, components.button, components.input]);
- // ======================== Effect ========================
- // >>> Mode
- // Reset for every active
- (0,useLayoutEffect["default"])(function () {
- if (mergedOpen && activeIndex !== undefined) {
- // Legacy compatible. This effect update should not trigger `onPanelChange`
- triggerModeChange(null, picker, false);
- }
- }, [mergedOpen, activeIndex, picker]);
- // >>> For complex picker, we need check if need to focus next one
- (0,useLayoutEffect["default"])(function () {
- var lastOp = lastOperation();
- // Trade as confirm on field leave
- if (!mergedOpen && lastOp === 'input') {
- triggerOpen(false);
- triggerConfirm();
- }
- // Submit with complex picker
- if (!mergedOpen && complexPicker && !needConfirm && lastOp === 'panel') {
- triggerConfirm();
- }
- }, [mergedOpen]);
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_context.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerTrigger, (0,esm_extends["default"])({}, pickTriggerProps(filledProps), {
- popupElement: panel,
- popupStyle: styles.popup,
- popupClassName: classNames.popup
- // Visible
- ,
- visible: mergedOpen,
- onClose: onPopupClose
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_Selector_SingleSelector
- // Shared
- , (0,esm_extends["default"])({}, filledProps, {
- // Ref
- ref: selectorRef
- // Icon
- ,
- suffixIcon: suffixIcon,
- removeIcon: removeIcon
- // Active
- ,
- activeHelp: !!internalHoverValue,
- allHelp: !!internalHoverValue && hoverSource === 'preset',
- focused: focused,
- onFocus: onSelectorFocus,
- onBlur: onSelectorBlur,
- onKeyDown: onSelectorKeyDown,
- onSubmit: triggerConfirm
- // Change
- ,
- value: selectorValues,
- maskFormat: maskFormat,
- onChange: onSelectorChange,
- onInputChange: onSelectorInputChange,
- internalPicker: internalPicker
- // Format
- ,
- format: formatList,
- inputReadOnly: inputReadOnly
- // Disabled
- ,
- disabled: disabled
- // Open
- ,
- open: mergedOpen,
- onOpenChange: triggerOpen
- // Click
- ,
- onClick: onSelectorClick,
- onClear: onSelectorClear
- // Invalid
- ,
- invalid: submitInvalidate,
- onInvalid: function onInvalid(invalid) {
- // Only `single` mode support type date.
- // `multiple` mode can not typing.
- onSelectorInvalid(invalid, 0);
- }
- }))));
- }
- var RefPicker = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Picker);
- if (true) {
- RefPicker.displayName = 'RefPicker';
- }
- /* harmony default export */ var SinglePicker = (RefPicker);
- ;// ./node_modules/rc-picker/es/index.js
- /**
- * What's new?
- * - Common
- * - [Break] Support special year format, all the year will follow the locale config.
- * - Blur all of field will trigger `onChange` if validate
- * - Support `preserveInvalidOnBlur` to not to clean input if invalid and remove `changeOnBlur`
- * - `pickerValue` is now full controlled
- * - `defaultPickerValue` will take effect on every field active with popup opening.
- * - [Break] clear button return the event with `onClick`
- *
- * - Locale
- * - Remove `dateFormat` since it's never used
- * - Remove `dateTimeFormat` since it's never used
- *
- * - Picker
- * - TimePicker support `changeOnScroll`
- * - TimePicker support `millisecond`
- * - Support cellMeridiemFormat for AM/PM
- * - Get correct `disabledHours` when set `use12Hours`
- * - Support `showWeek`
- *
- * - RangePicker
- * - [Break] RangePicker is now not limit the range of clicked field.
- * - Trigger `onCalendarChange` when type correct
- * - [Break] Not order `value` if given `value` is wrong order.
- * - Hover `presets` will show date in input field.
- * - [Break] RangePicker go to end field, `pickerValue` will follow the start field if not controlled.
- */
- /* harmony default export */ var rc_picker_es = (SinglePicker);
- ;// ./components/radio/context.ts
- const RadioGroupContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- const RadioGroupContextProvider = RadioGroupContext.Provider;
- /* harmony default export */ var radio_context = (RadioGroupContext);
- const RadioOptionTypeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- const RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;
- ;// ./node_modules/rc-checkbox/es/index.js
- var rc_checkbox_es_excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
- var Checkbox = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
- className = props.className,
- style = props.style,
- checked = props.checked,
- disabled = props.disabled,
- _props$defaultChecked = props.defaultChecked,
- defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
- _props$type = props.type,
- type = _props$type === void 0 ? 'checkbox' : _props$type,
- title = props.title,
- onChange = props.onChange,
- inputProps = (0,objectWithoutProperties["default"])(props, rc_checkbox_es_excluded);
- var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var holderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var _useMergedState = (0,useMergedState["default"])(defaultChecked, {
- value: checked
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- rawValue = _useMergedState2[0],
- setRawValue = _useMergedState2[1];
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- return {
- focus: function focus(options) {
- var _inputRef$current;
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus(options);
- },
- blur: function blur() {
- var _inputRef$current2;
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
- },
- input: inputRef.current,
- nativeElement: holderRef.current
- };
- });
- var classString = classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-checked"), rawValue), "".concat(prefixCls, "-disabled"), disabled));
- var handleChange = function handleChange(e) {
- if (disabled) {
- return;
- }
- if (!('checked' in props)) {
- setRawValue(e.target.checked);
- }
- onChange === null || onChange === void 0 || onChange({
- target: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- type: type,
- checked: e.target.checked
- }),
- stopPropagation: function stopPropagation() {
- e.stopPropagation();
- },
- preventDefault: function preventDefault() {
- e.preventDefault();
- },
- nativeEvent: e.nativeEvent
- });
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classString,
- title: title,
- style: style,
- ref: holderRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", (0,esm_extends["default"])({}, inputProps, {
- className: "".concat(prefixCls, "-input"),
- ref: inputRef,
- onChange: handleChange,
- disabled: disabled,
- checked: !!rawValue,
- type: type
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-inner")
- }));
- });
- /* harmony default export */ var rc_checkbox_es = (Checkbox);
- ;// ./components/checkbox/useBubbleLock.ts
- /**
- * When click on the label,
- * the event will be stopped to prevent the label from being clicked twice.
- * label click -> input click -> label click again
- */
- function useBubbleLock(onOriginInputClick) {
- const labelClickLockRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const clearLock = () => {
- raf["default"].cancel(labelClickLockRef.current);
- labelClickLockRef.current = null;
- };
- const onLabelClick = () => {
- clearLock();
- labelClickLockRef.current = (0,raf["default"])(() => {
- labelClickLockRef.current = null;
- });
- };
- const onInputClick = e => {
- if (labelClickLockRef.current) {
- e.stopPropagation();
- clearLock();
- }
- onOriginInputClick === null || onOriginInputClick === void 0 ? void 0 : onOriginInputClick(e);
- };
- return [onLabelClick, onInputClick];
- }
- // EXTERNAL MODULE: ./components/radio/style/index.ts
- var radio_style = __webpack_require__("./components/radio/style/index.ts");
- ;// ./components/radio/radio.tsx
- var radio_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalRadio = (props, ref) => {
- var _a, _b;
- const groupContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(radio_context);
- const radioOptionTypeContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(RadioOptionTypeContext);
- const {
- getPrefixCls,
- direction,
- radio
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const innerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const mergedRef = (0,es_ref.composeRef)(ref, innerRef);
- const {
- isFormItemInput
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Radio');
- true ? warning(!('optionType' in props), 'usage', '`optionType` is only support in Radio.Group.') : 0;
- }
- const onChange = e => {
- var _a, _b;
- (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
- (_b = groupContext === null || groupContext === void 0 ? void 0 : groupContext.onChange) === null || _b === void 0 ? void 0 : _b.call(groupContext, e);
- };
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- children,
- style,
- title
- } = props,
- restProps = radio_rest(props, ["prefixCls", "className", "rootClassName", "children", "style", "title"]);
- const radioPrefixCls = getPrefixCls('radio', customizePrefixCls);
- const isButtonType = ((groupContext === null || groupContext === void 0 ? void 0 : groupContext.optionType) || radioOptionTypeContext) === 'button';
- const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
- // Style
- const rootCls = hooks_useCSSVarCls(radioPrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,radio_style["default"])(radioPrefixCls, rootCls);
- const radioProps = Object.assign({}, restProps);
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- if (groupContext) {
- radioProps.name = groupContext.name;
- radioProps.onChange = onChange;
- radioProps.checked = props.value === groupContext.value;
- radioProps.disabled = (_a = radioProps.disabled) !== null && _a !== void 0 ? _a : groupContext.disabled;
- }
- radioProps.disabled = (_b = radioProps.disabled) !== null && _b !== void 0 ? _b : disabled;
- const wrapperClassString = classnames_default()(`${prefixCls}-wrapper`, {
- [`${prefixCls}-wrapper-checked`]: radioProps.checked,
- [`${prefixCls}-wrapper-disabled`]: radioProps.disabled,
- [`${prefixCls}-wrapper-rtl`]: direction === 'rtl',
- [`${prefixCls}-wrapper-in-form-item`]: isFormItemInput,
- [`${prefixCls}-wrapper-block`]: !!(groupContext === null || groupContext === void 0 ? void 0 : groupContext.block)
- }, radio === null || radio === void 0 ? void 0 : radio.className, className, rootClassName, hashId, cssVarCls, rootCls);
- // ============================ Event Lock ============================
- const [onLabelClick, onInputClick] = useBubbleLock(radioProps.onClick);
- // ============================== Render ==============================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(wave, {
- component: "Radio",
- disabled: radioProps.disabled
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("label", {
- className: wrapperClassString,
- style: Object.assign(Object.assign({}, radio === null || radio === void 0 ? void 0 : radio.style), style),
- onMouseEnter: props.onMouseEnter,
- onMouseLeave: props.onMouseLeave,
- title: title,
- onClick: onLabelClick
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_checkbox_es, Object.assign({}, radioProps, {
- className: classnames_default()(radioProps.className, {
- [TARGET_CLS]: !isButtonType
- }),
- type: "radio",
- prefixCls: prefixCls,
- ref: mergedRef,
- onClick: onInputClick
- })), children !== undefined ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-label`
- }, children) : null)));
- };
- const Radio = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalRadio);
- if (true) {
- Radio.displayName = 'Radio';
- }
- /* harmony default export */ var radio_radio = (Radio);
- ;// ./components/form/util.ts
- // form item name black list. in form ,you can use form.id get the form item element.
- // use object hasOwnProperty will get better performance if black list is longer.
- const formItemNameBlackList = ['parentNode'];
- // default form item id prefix.
- const defaultItemNamePrefixCls = 'form_item';
- function util_toArray(candidate) {
- if (candidate === undefined || candidate === false) return [];
- return Array.isArray(candidate) ? candidate : [candidate];
- }
- function getFieldId(namePath, formName) {
- if (!namePath.length) {
- return undefined;
- }
- const mergedId = namePath.join('_');
- if (formName) {
- return `${formName}_${mergedId}`;
- }
- const isIllegalName = formItemNameBlackList.includes(mergedId);
- return isIllegalName ? `${defaultItemNamePrefixCls}_${mergedId}` : mergedId;
- }
- /**
- * Get merged status by meta or passed `validateStatus`.
- */
- function getStatus(errors, warnings, meta, defaultValidateStatus, hasFeedback, validateStatus) {
- let status = defaultValidateStatus;
- if (validateStatus !== undefined) {
- status = validateStatus;
- } else if (meta.validating) {
- status = 'validating';
- } else if (errors.length) {
- status = 'error';
- } else if (warnings.length) {
- status = 'warning';
- } else if (meta.touched || hasFeedback && meta.validated) {
- // success feedback should display when pass hasFeedback prop and current value is valid value
- status = 'success';
- }
- return status;
- }
- ;// ./components/form/hooks/useForm.ts
- var useForm_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function toNamePathStr(name) {
- const namePath = util_toArray(name);
- return namePath.join('_');
- }
- function getFieldDOMNode(name, wrapForm) {
- const field = wrapForm.getFieldInstance(name);
- const fieldDom = (0,findDOMNode.getDOM)(field);
- if (fieldDom) {
- return fieldDom;
- }
- const fieldId = getFieldId(util_toArray(name), wrapForm.__INTERNAL__.name);
- if (fieldId) {
- return document.getElementById(fieldId);
- }
- }
- function useForm_useForm(form) {
- const [rcForm] = es_useForm();
- const itemsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- const wrapForm = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => form !== null && form !== void 0 ? form : Object.assign(Object.assign({}, rcForm), {
- __INTERNAL__: {
- itemRef: name => node => {
- const namePathStr = toNamePathStr(name);
- if (node) {
- itemsRef.current[namePathStr] = node;
- } else {
- delete itemsRef.current[namePathStr];
- }
- }
- },
- scrollToField: (name, options = {}) => {
- const {
- focus
- } = options,
- restOpt = useForm_rest(options, ["focus"]);
- const node = getFieldDOMNode(name, wrapForm);
- if (node) {
- dist_e(node, Object.assign({
- scrollMode: 'if-needed',
- block: 'nearest'
- }, restOpt));
- // Focus if scroll success
- if (focus) {
- wrapForm.focusField(name);
- }
- }
- },
- focusField: name => {
- var _a, _b;
- const itemRef = wrapForm.getFieldInstance(name);
- if (typeof (itemRef === null || itemRef === void 0 ? void 0 : itemRef.focus) === 'function') {
- itemRef.focus();
- } else {
- (_b = (_a = getFieldDOMNode(name, wrapForm)) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
- }
- },
- getFieldInstance: name => {
- const namePathStr = toNamePathStr(name);
- return itemsRef.current[namePathStr];
- }
- }), [form, rcForm]);
- return [wrapForm];
- }
- ;// ./components/radio/group.tsx
- const RadioGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- name: formItemName
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const defaultName = hooks_useId(toNamePathStr(formItemName));
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- options,
- buttonStyle = 'outline',
- disabled,
- children,
- size: customizeSize,
- style,
- id,
- optionType,
- name = defaultName,
- defaultValue,
- value: customizedValue,
- block = false,
- onChange,
- onMouseEnter,
- onMouseLeave,
- onFocus,
- onBlur
- } = props;
- const [value, setValue] = (0,useMergedState["default"])(defaultValue, {
- value: customizedValue
- });
- const onRadioChange = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(event => {
- const lastValue = value;
- const val = event.target.value;
- if (!('value' in props)) {
- setValue(val);
- }
- if (val !== lastValue) {
- onChange === null || onChange === void 0 ? void 0 : onChange(event);
- }
- }, [value, setValue, onChange]);
- const prefixCls = getPrefixCls('radio', customizePrefixCls);
- const groupPrefixCls = `${prefixCls}-group`;
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,radio_style["default"])(prefixCls, rootCls);
- let childrenToRender = children;
- // 如果存在 options, 优先使用
- if (options && options.length > 0) {
- childrenToRender = options.map(option => {
- if (typeof option === 'string' || typeof option === 'number') {
- // 此处类型自动推导为 string
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(radio_radio, {
- key: option.toString(),
- prefixCls: prefixCls,
- disabled: disabled,
- value: option,
- checked: value === option
- }, option);
- }
- // 此处类型自动推导为 { label: string value: string }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(radio_radio, {
- key: `radio-group-value-options-${option.value}`,
- prefixCls: prefixCls,
- disabled: option.disabled || disabled,
- value: option.value,
- checked: value === option.value,
- title: option.title,
- style: option.style,
- className: option.className,
- id: option.id,
- required: option.required
- }, option.label);
- });
- }
- const mergedSize = (0,useSize["default"])(customizeSize);
- const classString = classnames_default()(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, {
- [`${groupPrefixCls}-${mergedSize}`]: mergedSize,
- [`${groupPrefixCls}-rtl`]: direction === 'rtl',
- [`${groupPrefixCls}-block`]: block
- }, className, rootClassName, hashId, cssVarCls, rootCls);
- const memoizedValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- onChange: onRadioChange,
- value,
- disabled,
- name,
- optionType,
- block
- }), [onRadioChange, value, disabled, name, optionType, block]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, (0,pickAttrs["default"])(props, {
- aria: true,
- data: true
- }), {
- className: classString,
- style: style,
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onFocus: onFocus,
- onBlur: onBlur,
- id: id,
- ref: ref
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RadioGroupContextProvider, {
- value: memoizedValue
- }, childrenToRender)));
- });
- /* harmony default export */ var group = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(RadioGroup));
- ;// ./components/radio/radioButton.tsx
- var radioButton_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const RadioButton = (props, ref) => {
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls
- } = props,
- radioProps = radioButton_rest(props, ["prefixCls"]);
- const prefixCls = getPrefixCls('radio', customizePrefixCls);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RadioOptionTypeContextProvider, {
- value: "button"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(radio_radio, Object.assign({
- prefixCls: prefixCls
- }, radioProps, {
- type: "radio",
- ref: ref
- })));
- };
- /* harmony default export */ var radioButton = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RadioButton));
- ;// ./components/calendar/Header.tsx
- const YEAR_SELECT_OFFSET = 10;
- const YEAR_SELECT_TOTAL = 20;
- function YearSelect(props) {
- const {
- fullscreen,
- validRange,
- generateConfig,
- locale,
- prefixCls,
- value,
- onChange,
- divRef
- } = props;
- const year = generateConfig.getYear(value || generateConfig.getNow());
- let start = year - YEAR_SELECT_OFFSET;
- let end = start + YEAR_SELECT_TOTAL;
- if (validRange) {
- start = generateConfig.getYear(validRange[0]);
- end = generateConfig.getYear(validRange[1]) + 1;
- }
- const suffix = locale && locale.year === '年' ? '年' : '';
- const options = [];
- for (let index = start; index < end; index++) {
- options.push({
- label: `${index}${suffix}`,
- value: index
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_select, {
- size: fullscreen ? undefined : 'small',
- options: options,
- value: year,
- className: `${prefixCls}-year-select`,
- onChange: numYear => {
- let newDate = generateConfig.setYear(value, numYear);
- if (validRange) {
- const [startDate, endDate] = validRange;
- const newYear = generateConfig.getYear(newDate);
- const newMonth = generateConfig.getMonth(newDate);
- if (newYear === generateConfig.getYear(endDate) && newMonth > generateConfig.getMonth(endDate)) {
- newDate = generateConfig.setMonth(newDate, generateConfig.getMonth(endDate));
- }
- if (newYear === generateConfig.getYear(startDate) && newMonth < generateConfig.getMonth(startDate)) {
- newDate = generateConfig.setMonth(newDate, generateConfig.getMonth(startDate));
- }
- }
- onChange(newDate);
- },
- getPopupContainer: () => divRef.current
- });
- }
- function MonthSelect(props) {
- const {
- prefixCls,
- fullscreen,
- validRange,
- value,
- generateConfig,
- locale,
- onChange,
- divRef
- } = props;
- const month = generateConfig.getMonth(value || generateConfig.getNow());
- let start = 0;
- let end = 11;
- if (validRange) {
- const [rangeStart, rangeEnd] = validRange;
- const currentYear = generateConfig.getYear(value);
- if (generateConfig.getYear(rangeEnd) === currentYear) {
- end = generateConfig.getMonth(rangeEnd);
- }
- if (generateConfig.getYear(rangeStart) === currentYear) {
- start = generateConfig.getMonth(rangeStart);
- }
- }
- const months = locale.shortMonths || generateConfig.locale.getShortMonths(locale.locale);
- const options = [];
- for (let index = start; index <= end; index += 1) {
- options.push({
- label: months[index],
- value: index
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_select, {
- size: fullscreen ? undefined : 'small',
- className: `${prefixCls}-month-select`,
- value: month,
- options: options,
- onChange: newMonth => {
- onChange(generateConfig.setMonth(value, newMonth));
- },
- getPopupContainer: () => divRef.current
- });
- }
- function ModeSwitch(props) {
- const {
- prefixCls,
- locale,
- mode,
- fullscreen,
- onModeChange
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(group, {
- onChange: ({
- target: {
- value
- }
- }) => {
- onModeChange(value);
- },
- value: mode,
- size: fullscreen ? undefined : 'small',
- className: `${prefixCls}-mode-switch`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(radioButton, {
- value: "month"
- }, locale.month), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(radioButton, {
- value: "year"
- }, locale.year));
- }
- function CalendarHeader(props) {
- const {
- prefixCls,
- fullscreen,
- mode,
- onChange,
- onModeChange
- } = props;
- const divRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const formItemInputContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const mergedFormItemInputContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => Object.assign(Object.assign({}, formItemInputContext), {
- isFormItemInput: false
- }), [formItemInputContext]);
- const sharedProps = Object.assign(Object.assign({}, props), {
- fullscreen,
- divRef
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-header`,
- ref: divRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemInputContext.Provider, {
- value: mergedFormItemInputContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(YearSelect, Object.assign({}, sharedProps, {
- onChange: v => {
- onChange(v, 'year');
- }
- })), mode === 'month' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MonthSelect, Object.assign({}, sharedProps, {
- onChange: v => {
- onChange(v, 'month');
- }
- })))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ModeSwitch, Object.assign({}, sharedProps, {
- onModeChange: onModeChange
- })));
- }
- /* harmony default export */ var Header = (CalendarHeader);
- // EXTERNAL MODULE: ./components/calendar/locale/en_US.ts
- var locale_en_US = __webpack_require__("./components/calendar/locale/en_US.ts");
- // EXTERNAL MODULE: ./components/calendar/style/index.ts
- var calendar_style = __webpack_require__("./components/calendar/style/index.ts");
- ;// ./components/calendar/generateCalendar.tsx
- const generateCalendar_isSameYear = (date1, date2, config) => {
- const {
- getYear
- } = config;
- return date1 && date2 && getYear(date1) === getYear(date2);
- };
- const generateCalendar_isSameMonth = (date1, date2, config) => {
- const {
- getMonth
- } = config;
- return generateCalendar_isSameYear(date1, date2, config) && getMonth(date1) === getMonth(date2);
- };
- const generateCalendar_isSameDate = (date1, date2, config) => {
- const {
- getDate
- } = config;
- return generateCalendar_isSameMonth(date1, date2, config) && getDate(date1) === getDate(date2);
- };
- const generateCalendar = generateConfig => {
- const Calendar = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- dateFullCellRender,
- dateCellRender,
- monthFullCellRender,
- monthCellRender,
- cellRender,
- fullCellRender,
- headerRender,
- value,
- defaultValue,
- disabledDate,
- mode,
- validRange,
- fullscreen = true,
- showWeek,
- onChange,
- onPanelChange,
- onSelect
- } = props;
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('calendar');
- const prefixCls = getPrefixCls('picker', customizePrefixCls);
- const calendarPrefixCls = `${prefixCls}-calendar`;
- const [wrapCSSVar, hashId, cssVarCls] = (0,calendar_style["default"])(prefixCls, calendarPrefixCls);
- const today = generateConfig.getNow();
- // ====================== Warning =======================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Calendar');
- [['dateFullCellRender', 'fullCellRender'], ['dateCellRender', 'cellRender'], ['monthFullCellRender', 'fullCellRender'], ['monthCellRender', 'cellRender']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- // ====================== State =======================
- // Value
- const [mergedValue, setMergedValue] = (0,useMergedState["default"])(() => value || generateConfig.getNow(), {
- defaultValue,
- value
- });
- // Mode
- const [mergedMode, setMergedMode] = (0,useMergedState["default"])('month', {
- value: mode
- });
- const panelMode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => mergedMode === 'year' ? 'month' : 'date', [mergedMode]);
- // Disabled Date
- const mergedDisabledDate = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(date => {
- const notInRange = validRange ? generateConfig.isAfter(validRange[0], date) || generateConfig.isAfter(date, validRange[1]) : false;
- return notInRange || !!(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date));
- }, [disabledDate, validRange]);
- // ====================== Events ======================
- const triggerPanelChange = (date, newMode) => {
- onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(date, newMode);
- };
- const triggerChange = date => {
- setMergedValue(date);
- if (!generateCalendar_isSameDate(date, mergedValue, generateConfig)) {
- // Trigger when month panel switch month
- if (panelMode === 'date' && !generateCalendar_isSameMonth(date, mergedValue, generateConfig) || panelMode === 'month' && !generateCalendar_isSameYear(date, mergedValue, generateConfig)) {
- triggerPanelChange(date, mergedMode);
- }
- onChange === null || onChange === void 0 ? void 0 : onChange(date);
- }
- };
- const triggerModeChange = newMode => {
- setMergedMode(newMode);
- triggerPanelChange(mergedValue, newMode);
- };
- const onInternalSelect = (date, source) => {
- triggerChange(date);
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(date, {
- source
- });
- };
- // ====================== Render ======================
- const dateRender = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback((date, info) => {
- if (fullCellRender) {
- return fullCellRender(date, info);
- }
- if (dateFullCellRender) {
- return dateFullCellRender(date);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-cell-inner`, `${calendarPrefixCls}-date`, {
- [`${calendarPrefixCls}-date-today`]: generateCalendar_isSameDate(today, date, generateConfig)
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${calendarPrefixCls}-date-value`
- }, String(generateConfig.getDate(date)).padStart(2, '0')), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${calendarPrefixCls}-date-content`
- }, cellRender ? cellRender(date, info) : dateCellRender === null || dateCellRender === void 0 ? void 0 : dateCellRender(date)));
- }, [dateFullCellRender, dateCellRender, cellRender, fullCellRender]);
- const monthRender = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback((date, info) => {
- if (fullCellRender) {
- return fullCellRender(date, info);
- }
- if (monthFullCellRender) {
- return monthFullCellRender(date);
- }
- const months = info.locale.shortMonths || generateConfig.locale.getShortMonths(info.locale.locale);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-cell-inner`, `${calendarPrefixCls}-date`, {
- [`${calendarPrefixCls}-date-today`]: generateCalendar_isSameMonth(today, date, generateConfig)
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${calendarPrefixCls}-date-value`
- }, months[generateConfig.getMonth(date)]), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${calendarPrefixCls}-date-content`
- }, cellRender ? cellRender(date, info) : monthCellRender === null || monthCellRender === void 0 ? void 0 : monthCellRender(date)));
- }, [monthFullCellRender, monthCellRender, cellRender, fullCellRender]);
- const [contextLocale] = (0,useLocale["default"])('Calendar', locale_en_US["default"]);
- const locale = Object.assign(Object.assign({}, contextLocale), props.locale);
- const mergedCellRender = (current, info) => {
- if (info.type === 'date') {
- return dateRender(current, info);
- }
- if (info.type === 'month') {
- return monthRender(current, Object.assign(Object.assign({}, info), {
- locale: locale === null || locale === void 0 ? void 0 : locale.lang
- }));
- }
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(calendarPrefixCls, {
- [`${calendarPrefixCls}-full`]: fullscreen,
- [`${calendarPrefixCls}-mini`]: !fullscreen,
- [`${calendarPrefixCls}-rtl`]: direction === 'rtl'
- }, contextClassName, className, rootClassName, hashId, cssVarCls),
- style: Object.assign(Object.assign({}, contextStyle), style)
- }, headerRender ? headerRender({
- value: mergedValue,
- type: mergedMode,
- onChange: nextDate => {
- onInternalSelect(nextDate, 'customize');
- },
- onTypeChange: triggerModeChange
- }) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Header, {
- prefixCls: calendarPrefixCls,
- value: mergedValue,
- generateConfig: generateConfig,
- mode: mergedMode,
- fullscreen: fullscreen,
- locale: locale === null || locale === void 0 ? void 0 : locale.lang,
- validRange: validRange,
- onChange: onInternalSelect,
- onModeChange: triggerModeChange
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_PickerPanel, {
- value: mergedValue,
- prefixCls: prefixCls,
- locale: locale === null || locale === void 0 ? void 0 : locale.lang,
- generateConfig: generateConfig,
- cellRender: mergedCellRender,
- onSelect: nextDate => {
- onInternalSelect(nextDate, panelMode);
- },
- mode: panelMode,
- picker: panelMode,
- disabledDate: mergedDisabledDate,
- hideHeader: true,
- showWeek: showWeek
- })));
- };
- if (true) {
- Calendar.displayName = 'Calendar';
- }
- return Calendar;
- };
- /* harmony default export */ var calendar_generateCalendar = (generateCalendar);
- ;// ./components/calendar/index.tsx
- const Calendar = calendar_generateCalendar(dayjs);
- Calendar.generateCalendar = calendar_generateCalendar;
- /* harmony default export */ var calendar = (Calendar);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js
- // This icon file is generated automatically.
- var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
- /* harmony default export */ var asn_PlusOutlined = (PlusOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/PlusOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var PlusOutlined_PlusOutlined = function PlusOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_PlusOutlined
- }));
- };
- /** */
- var PlusOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(PlusOutlined_PlusOutlined);
- if (true) {
- PlusOutlined_RefIcon.displayName = 'PlusOutlined';
- }
- /* harmony default export */ var icons_PlusOutlined = (PlusOutlined_RefIcon);
- ;// ./node_modules/rc-tabs/es/TabContext.js
- /* harmony default export */ var TabContext = (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(null));
- ;// ./node_modules/rc-tabs/es/hooks/useIndicator.js
- var useIndicator = function useIndicator(options) {
- var activeTabOffset = options.activeTabOffset,
- horizontal = options.horizontal,
- rtl = options.rtl,
- _options$indicator = options.indicator,
- indicator = _options$indicator === void 0 ? {} : _options$indicator;
- var size = indicator.size,
- _indicator$align = indicator.align,
- align = _indicator$align === void 0 ? 'center' : _indicator$align;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- inkStyle = _useState2[0],
- setInkStyle = _useState2[1];
- var inkBarRafRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var getLength = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useCallback(function (origin) {
- if (typeof size === 'function') {
- return size(origin);
- }
- if (typeof size === 'number') {
- return size;
- }
- return origin;
- }, [size]);
- // Delay set ink style to avoid remove tab blink
- function cleanInkBarRaf() {
- raf["default"].cancel(inkBarRafRef.current);
- }
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var newInkStyle = {};
- if (activeTabOffset) {
- if (horizontal) {
- newInkStyle.width = getLength(activeTabOffset.width);
- var key = rtl ? 'right' : 'left';
- if (align === 'start') {
- newInkStyle[key] = activeTabOffset[key];
- }
- if (align === 'center') {
- newInkStyle[key] = activeTabOffset[key] + activeTabOffset.width / 2;
- newInkStyle.transform = rtl ? 'translateX(50%)' : 'translateX(-50%)';
- }
- if (align === 'end') {
- newInkStyle[key] = activeTabOffset[key] + activeTabOffset.width;
- newInkStyle.transform = 'translateX(-100%)';
- }
- } else {
- newInkStyle.height = getLength(activeTabOffset.height);
- if (align === 'start') {
- newInkStyle.top = activeTabOffset.top;
- }
- if (align === 'center') {
- newInkStyle.top = activeTabOffset.top + activeTabOffset.height / 2;
- newInkStyle.transform = 'translateY(-50%)';
- }
- if (align === 'end') {
- newInkStyle.top = activeTabOffset.top + activeTabOffset.height;
- newInkStyle.transform = 'translateY(-100%)';
- }
- }
- }
- cleanInkBarRaf();
- inkBarRafRef.current = (0,raf["default"])(function () {
- // Avoid jitter caused by tiny numerical differences
- // fix https://github.com/ant-design/ant-design/issues/53378
- var isEqual = inkStyle && newInkStyle && Object.keys(newInkStyle).every(function (key) {
- var newValue = newInkStyle[key];
- var oldValue = inkStyle[key];
- return typeof newValue === 'number' && typeof oldValue === 'number' ? Math.round(newValue) === Math.round(oldValue) : newValue === oldValue;
- });
- if (!isEqual) {
- setInkStyle(newInkStyle);
- }
- });
- return cleanInkBarRaf;
- }, [JSON.stringify(activeTabOffset), horizontal, rtl, align, getLength]);
- return {
- style: inkStyle
- };
- };
- /* harmony default export */ var hooks_useIndicator = (useIndicator);
- ;// ./node_modules/rc-tabs/es/hooks/useOffsets.js
- var DEFAULT_SIZE = {
- width: 0,
- height: 0,
- left: 0,
- top: 0
- };
- function useOffsets(tabs, tabSizes, holderScrollWidth) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var _tabs$;
- var map = new Map();
- var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE;
- var rightOffset = lastOffset.left + lastOffset.width;
- for (var i = 0; i < tabs.length; i += 1) {
- var key = tabs[i].key;
- var data = tabSizes.get(key);
- // Reuse last one when not exist yet
- if (!data) {
- var _tabs;
- data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE;
- }
- var entity = map.get(key) || (0,objectSpread2["default"])({}, data);
- // Right
- entity.right = rightOffset - entity.left - entity.width;
- // Update entity
- map.set(key, entity);
- }
- return map;
- }, [tabs.map(function (tab) {
- return tab.key;
- }).join('_'), tabSizes, holderScrollWidth]);
- }
- ;// ./node_modules/rc-tabs/es/hooks/useSyncState.js
- function useSyncState_useSyncState(defaultState, onChange) {
- var stateRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(defaultState);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- forceUpdate = _React$useState2[1];
- function setState(updater) {
- var newValue = typeof updater === 'function' ? updater(stateRef.current) : updater;
- if (newValue !== stateRef.current) {
- onChange(newValue, stateRef.current);
- }
- stateRef.current = newValue;
- forceUpdate({});
- }
- return [stateRef.current, setState];
- }
- ;// ./node_modules/rc-tabs/es/hooks/useTouchMove.js
- var MIN_SWIPE_DISTANCE = 0.1;
- var STOP_SWIPE_DISTANCE = 0.01;
- var REFRESH_INTERVAL = 20;
- var SPEED_OFF_MULTIPLE = Math.pow(0.995, REFRESH_INTERVAL);
- // ================================= Hook =================================
- function useTouchMove(ref, onOffset) {
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- touchPosition = _useState2[0],
- setTouchPosition = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- lastTimestamp = _useState4[0],
- setLastTimestamp = _useState4[1];
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState6 = (0,slicedToArray["default"])(_useState5, 2),
- lastTimeDiff = _useState6[0],
- setLastTimeDiff = _useState6[1];
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState8 = (0,slicedToArray["default"])(_useState7, 2),
- lastOffset = _useState8[0],
- setLastOffset = _useState8[1];
- var motionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // ========================= Events =========================
- // >>> Touch events
- function onTouchStart(e) {
- var _e$touches$ = e.touches[0],
- screenX = _e$touches$.screenX,
- screenY = _e$touches$.screenY;
- setTouchPosition({
- x: screenX,
- y: screenY
- });
- window.clearInterval(motionRef.current);
- }
- function onTouchMove(e) {
- if (!touchPosition) return;
- // e.preventDefault();
- var _e$touches$2 = e.touches[0],
- screenX = _e$touches$2.screenX,
- screenY = _e$touches$2.screenY;
- setTouchPosition({
- x: screenX,
- y: screenY
- });
- var offsetX = screenX - touchPosition.x;
- var offsetY = screenY - touchPosition.y;
- onOffset(offsetX, offsetY);
- var now = Date.now();
- setLastTimestamp(now);
- setLastTimeDiff(now - lastTimestamp);
- setLastOffset({
- x: offsetX,
- y: offsetY
- });
- }
- function onTouchEnd() {
- if (!touchPosition) return;
- setTouchPosition(null);
- setLastOffset(null);
- // Swipe if needed
- if (lastOffset) {
- var distanceX = lastOffset.x / lastTimeDiff;
- var distanceY = lastOffset.y / lastTimeDiff;
- var absX = Math.abs(distanceX);
- var absY = Math.abs(distanceY);
- // Skip swipe if low distance
- if (Math.max(absX, absY) < MIN_SWIPE_DISTANCE) return;
- var currentX = distanceX;
- var currentY = distanceY;
- motionRef.current = window.setInterval(function () {
- if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) {
- window.clearInterval(motionRef.current);
- return;
- }
- currentX *= SPEED_OFF_MULTIPLE;
- currentY *= SPEED_OFF_MULTIPLE;
- onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL);
- }, REFRESH_INTERVAL);
- }
- }
- // >>> Wheel event
- var lastWheelDirectionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- function onWheel(e) {
- var deltaX = e.deltaX,
- deltaY = e.deltaY;
- // Convert both to x & y since wheel only happened on PC
- var mixed = 0;
- var absX = Math.abs(deltaX);
- var absY = Math.abs(deltaY);
- if (absX === absY) {
- mixed = lastWheelDirectionRef.current === 'x' ? deltaX : deltaY;
- } else if (absX > absY) {
- mixed = deltaX;
- lastWheelDirectionRef.current = 'x';
- } else {
- mixed = deltaY;
- lastWheelDirectionRef.current = 'y';
- }
- if (onOffset(-mixed, -mixed)) {
- e.preventDefault();
- }
- }
- // ========================= Effect =========================
- var touchEventsRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- touchEventsRef.current = {
- onTouchStart: onTouchStart,
- onTouchMove: onTouchMove,
- onTouchEnd: onTouchEnd,
- onWheel: onWheel
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- function onProxyTouchStart(e) {
- touchEventsRef.current.onTouchStart(e);
- }
- function onProxyTouchMove(e) {
- touchEventsRef.current.onTouchMove(e);
- }
- function onProxyTouchEnd(e) {
- touchEventsRef.current.onTouchEnd(e);
- }
- function onProxyWheel(e) {
- touchEventsRef.current.onWheel(e);
- }
- document.addEventListener('touchmove', onProxyTouchMove, {
- passive: false
- });
- document.addEventListener('touchend', onProxyTouchEnd, {
- passive: true
- });
- // No need to clean up since element removed
- ref.current.addEventListener('touchstart', onProxyTouchStart, {
- passive: true
- });
- ref.current.addEventListener('wheel', onProxyWheel, {
- passive: false
- });
- return function () {
- document.removeEventListener('touchmove', onProxyTouchMove);
- document.removeEventListener('touchend', onProxyTouchEnd);
- };
- }, []);
- }
- ;// ./node_modules/rc-tabs/es/hooks/useUpdate.js
- /**
- * Help to merge callback with `useLayoutEffect`.
- * One time will only trigger once.
- */
- function useUpdate(callback) {
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- count = _useState2[0],
- setCount = _useState2[1];
- var effectRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var callbackRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- callbackRef.current = callback;
- // Trigger on `useLayoutEffect`
- (0,useLayoutEffect.useLayoutUpdateEffect)(function () {
- var _callbackRef$current;
- (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 || _callbackRef$current.call(callbackRef);
- }, [count]);
- // Trigger to update count
- return function () {
- if (effectRef.current !== count) {
- return;
- }
- effectRef.current += 1;
- setCount(effectRef.current);
- };
- }
- function useUpdateState(defaultState) {
- var batchRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({}),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- forceUpdate = _useState4[1];
- var state = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(typeof defaultState === 'function' ? defaultState() : defaultState);
- var flushUpdate = useUpdate(function () {
- var current = state.current;
- batchRef.current.forEach(function (callback) {
- current = callback(current);
- });
- batchRef.current = [];
- state.current = current;
- forceUpdate({});
- });
- function updater(callback) {
- batchRef.current.push(callback);
- flushUpdate();
- }
- return [state.current, updater];
- }
- ;// ./node_modules/rc-tabs/es/hooks/useVisibleRange.js
- var useVisibleRange_DEFAULT_SIZE = {
- width: 0,
- height: 0,
- left: 0,
- top: 0,
- right: 0
- };
- function useVisibleRange(tabOffsets, visibleTabContentValue, transform, tabContentSizeValue, addNodeSizeValue, operationNodeSizeValue, _ref) {
- var tabs = _ref.tabs,
- tabPosition = _ref.tabPosition,
- rtl = _ref.rtl;
- var charUnit;
- var position;
- var transformSize;
- if (['top', 'bottom'].includes(tabPosition)) {
- charUnit = 'width';
- position = rtl ? 'right' : 'left';
- transformSize = Math.abs(transform);
- } else {
- charUnit = 'height';
- position = 'top';
- transformSize = -transform;
- }
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if (!tabs.length) {
- return [0, 0];
- }
- var len = tabs.length;
- var endIndex = len;
- for (var i = 0; i < len; i += 1) {
- var offset = tabOffsets.get(tabs[i].key) || useVisibleRange_DEFAULT_SIZE;
- if (Math.floor(offset[position] + offset[charUnit]) > Math.floor(transformSize + visibleTabContentValue)) {
- endIndex = i - 1;
- break;
- }
- }
- var startIndex = 0;
- for (var _i = len - 1; _i >= 0; _i -= 1) {
- var _offset = tabOffsets.get(tabs[_i].key) || useVisibleRange_DEFAULT_SIZE;
- if (_offset[position] < transformSize) {
- startIndex = _i + 1;
- break;
- }
- }
- return startIndex > endIndex ? [0, -1] : [startIndex, endIndex];
- }, [tabOffsets, visibleTabContentValue, tabContentSizeValue, addNodeSizeValue, operationNodeSizeValue, transformSize, tabPosition, tabs.map(function (tab) {
- return tab.key;
- }).join('_'), rtl]);
- }
- ;// ./node_modules/rc-tabs/es/util.js
- /**
- * We trade Map as deps which may change with same value but different ref object.
- * We should make it as hash for deps
- * */
- function util_stringify(obj) {
- var tgt;
- if (obj instanceof Map) {
- tgt = {};
- obj.forEach(function (v, k) {
- tgt[k] = v;
- });
- } else {
- tgt = obj;
- }
- return JSON.stringify(tgt);
- }
- var RC_TABS_DOUBLE_QUOTE = 'TABS_DQ';
- function genDataNodeKey(key) {
- return String(key).replace(/"/g, RC_TABS_DOUBLE_QUOTE);
- }
- function getRemovable(closable, closeIcon, editable, disabled) {
- if (
- // Only editable tabs can be removed
- !editable ||
- // Tabs cannot be removed when disabled
- disabled ||
- // closable is false
- closable === false ||
- // If closable is undefined, the remove button should be hidden when closeIcon is null or false
- closable === undefined && (closeIcon === false || closeIcon === null)) {
- return false;
- }
- return true;
- }
- ;// ./node_modules/rc-tabs/es/TabNavList/AddButton.js
- var AddButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- editable = props.editable,
- locale = props.locale,
- style = props.style;
- if (!editable || editable.showAdd === false) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- ref: ref,
- type: "button",
- className: "".concat(prefixCls, "-nav-add"),
- style: style,
- "aria-label": (locale === null || locale === void 0 ? void 0 : locale.addAriaLabel) || 'Add tab',
- onClick: function onClick(event) {
- editable.onEdit('add', {
- event: event
- });
- }
- }, editable.addIcon || '+');
- });
- /* harmony default export */ var TabNavList_AddButton = (AddButton);
- ;// ./node_modules/rc-tabs/es/TabNavList/ExtraContent.js
- var ExtraContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var position = props.position,
- prefixCls = props.prefixCls,
- extra = props.extra;
- if (!extra) {
- return null;
- }
- var content;
- // Parse extra
- var assertExtra = {};
- if ((0,esm_typeof["default"])(extra) === 'object' && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(extra)) {
- assertExtra = extra;
- } else {
- assertExtra.right = extra;
- }
- if (position === 'right') {
- content = assertExtra.right;
- }
- if (position === 'left') {
- content = assertExtra.left;
- }
- return content ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-extra-content"),
- ref: ref
- }, content) : null;
- });
- if (true) {
- ExtraContent.displayName = 'ExtraContent';
- }
- /* harmony default export */ var TabNavList_ExtraContent = (ExtraContent);
- ;// ./node_modules/rc-tabs/es/TabNavList/OperationNode.js
- var OperationNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- id = props.id,
- tabs = props.tabs,
- locale = props.locale,
- mobile = props.mobile,
- _props$more = props.more,
- moreProps = _props$more === void 0 ? {} : _props$more,
- style = props.style,
- className = props.className,
- editable = props.editable,
- tabBarGutter = props.tabBarGutter,
- rtl = props.rtl,
- removeAriaLabel = props.removeAriaLabel,
- onTabClick = props.onTabClick,
- getPopupContainer = props.getPopupContainer,
- popupClassName = props.popupClassName;
- // ======================== Dropdown ========================
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- open = _useState2[0],
- setOpen = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- selectedKey = _useState4[0],
- setSelectedKey = _useState4[1];
- var _moreProps$icon = moreProps.icon,
- moreIcon = _moreProps$icon === void 0 ? 'More' : _moreProps$icon;
- var popupId = "".concat(id, "-more-popup");
- var dropdownPrefix = "".concat(prefixCls, "-dropdown");
- var selectedItemId = selectedKey !== null ? "".concat(popupId, "-").concat(selectedKey) : null;
- var dropdownAriaLabel = locale === null || locale === void 0 ? void 0 : locale.dropdownAriaLabel;
- function onRemoveTab(event, key) {
- event.preventDefault();
- event.stopPropagation();
- editable.onEdit('remove', {
- key: key,
- event: event
- });
- }
- var menu = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_menu_es, {
- onClick: function onClick(_ref) {
- var key = _ref.key,
- domEvent = _ref.domEvent;
- onTabClick(key, domEvent);
- setOpen(false);
- },
- prefixCls: "".concat(dropdownPrefix, "-menu"),
- id: popupId,
- tabIndex: -1,
- role: "listbox",
- "aria-activedescendant": selectedItemId,
- selectedKeys: [selectedKey],
- "aria-label": dropdownAriaLabel !== undefined ? dropdownAriaLabel : 'expanded dropdown'
- }, tabs.map(function (tab) {
- var closable = tab.closable,
- disabled = tab.disabled,
- closeIcon = tab.closeIcon,
- key = tab.key,
- label = tab.label;
- var removable = getRemovable(closable, closeIcon, editable, disabled);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_MenuItem, {
- key: key,
- id: "".concat(popupId, "-").concat(key),
- role: "option",
- "aria-controls": id && "".concat(id, "-panel-").concat(key),
- disabled: disabled
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, label), removable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- "aria-label": removeAriaLabel || 'remove',
- tabIndex: 0,
- className: "".concat(dropdownPrefix, "-menu-item-remove"),
- onClick: function onClick(e) {
- e.stopPropagation();
- onRemoveTab(e, key);
- }
- }, closeIcon || editable.removeIcon || '×'));
- }));
- function selectOffset(offset) {
- var enabledTabs = tabs.filter(function (tab) {
- return !tab.disabled;
- });
- var selectedIndex = enabledTabs.findIndex(function (tab) {
- return tab.key === selectedKey;
- }) || 0;
- var len = enabledTabs.length;
- for (var i = 0; i < len; i += 1) {
- selectedIndex = (selectedIndex + offset + len) % len;
- var tab = enabledTabs[selectedIndex];
- if (!tab.disabled) {
- setSelectedKey(tab.key);
- return;
- }
- }
- }
- function onKeyDown(e) {
- var which = e.which;
- if (!open) {
- if ([KeyCode["default"].DOWN, KeyCode["default"].SPACE, KeyCode["default"].ENTER].includes(which)) {
- setOpen(true);
- e.preventDefault();
- }
- return;
- }
- switch (which) {
- case KeyCode["default"].UP:
- selectOffset(-1);
- e.preventDefault();
- break;
- case KeyCode["default"].DOWN:
- selectOffset(1);
- e.preventDefault();
- break;
- case KeyCode["default"].ESC:
- setOpen(false);
- break;
- case KeyCode["default"].SPACE:
- case KeyCode["default"].ENTER:
- if (selectedKey !== null) {
- onTabClick(selectedKey, e);
- }
- break;
- }
- }
- // ========================= Effect =========================
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- // We use query element here to avoid React strict warning
- var ele = document.getElementById(selectedItemId);
- if (ele && ele.scrollIntoView) {
- ele.scrollIntoView(false);
- }
- }, [selectedKey]);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (!open) {
- setSelectedKey(null);
- }
- }, [open]);
- // ========================= Render =========================
- var moreStyle = (0,defineProperty["default"])({}, rtl ? 'marginRight' : 'marginLeft', tabBarGutter);
- if (!tabs.length) {
- moreStyle.visibility = 'hidden';
- moreStyle.order = 1;
- }
- var overlayClassName = classnames_default()((0,defineProperty["default"])({}, "".concat(dropdownPrefix, "-rtl"), rtl));
- var moreNode = mobile ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_dropdown_es, (0,esm_extends["default"])({
- prefixCls: dropdownPrefix,
- overlay: menu,
- visible: tabs.length ? open : false,
- onVisibleChange: setOpen,
- overlayClassName: classnames_default()(overlayClassName, popupClassName),
- mouseEnterDelay: 0.1,
- mouseLeaveDelay: 0.1,
- getPopupContainer: getPopupContainer
- }, moreProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- className: "".concat(prefixCls, "-nav-more"),
- style: moreStyle,
- "aria-haspopup": "listbox",
- "aria-controls": popupId,
- id: "".concat(id, "-more"),
- "aria-expanded": open,
- onKeyDown: onKeyDown
- }, moreIcon));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-nav-operations"), className),
- style: style,
- ref: ref
- }, moreNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_AddButton, {
- prefixCls: prefixCls,
- locale: locale,
- editable: editable
- }));
- });
- /* harmony default export */ var TabNavList_OperationNode = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(OperationNode, function (_, next) {
- return (
- // https://github.com/ant-design/ant-design/issues/32544
- // We'd better remove syntactic sugar in `rc-menu` since this has perf issue
- next.tabMoving
- );
- }));
- ;// ./node_modules/rc-tabs/es/TabNavList/TabNode.js
- var TabNode = function TabNode(props) {
- var prefixCls = props.prefixCls,
- id = props.id,
- active = props.active,
- focus = props.focus,
- _props$tab = props.tab,
- key = _props$tab.key,
- label = _props$tab.label,
- disabled = _props$tab.disabled,
- closeIcon = _props$tab.closeIcon,
- icon = _props$tab.icon,
- closable = props.closable,
- renderWrapper = props.renderWrapper,
- removeAriaLabel = props.removeAriaLabel,
- editable = props.editable,
- onClick = props.onClick,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyDown = props.onKeyDown,
- onMouseDown = props.onMouseDown,
- onMouseUp = props.onMouseUp,
- style = props.style,
- tabCount = props.tabCount,
- currentPosition = props.currentPosition;
- var tabPrefix = "".concat(prefixCls, "-tab");
- var removable = getRemovable(closable, closeIcon, editable, disabled);
- function onInternalClick(e) {
- if (disabled) {
- return;
- }
- onClick(e);
- }
- function onRemoveTab(event) {
- event.preventDefault();
- event.stopPropagation();
- editable.onEdit('remove', {
- key: key,
- event: event
- });
- }
- var labelNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return icon && typeof label === 'string' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, label) : label;
- }, [label, icon]);
- var btnRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (focus && btnRef.current) {
- btnRef.current.focus();
- }
- }, [focus]);
- var node = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: key,
- "data-node-key": genDataNodeKey(key),
- className: classnames_default()(tabPrefix, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(tabPrefix, "-with-remove"), removable), "".concat(tabPrefix, "-active"), active), "".concat(tabPrefix, "-disabled"), disabled), "".concat(tabPrefix, "-focus"), focus)),
- style: style,
- onClick: onInternalClick
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: btnRef,
- role: "tab",
- "aria-selected": active,
- id: id && "".concat(id, "-tab-").concat(key),
- className: "".concat(tabPrefix, "-btn"),
- "aria-controls": id && "".concat(id, "-panel-").concat(key),
- "aria-disabled": disabled,
- tabIndex: disabled ? null : active ? 0 : -1,
- onClick: function onClick(e) {
- e.stopPropagation();
- onInternalClick(e);
- },
- onKeyDown: onKeyDown,
- onMouseDown: onMouseDown,
- onMouseUp: onMouseUp,
- onFocus: onFocus,
- onBlur: onBlur
- }, focus && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- "aria-live": "polite",
- style: {
- width: 0,
- height: 0,
- position: 'absolute',
- overflow: 'hidden',
- opacity: 0
- }
- }, "Tab ".concat(currentPosition, " of ").concat(tabCount)), icon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(tabPrefix, "-icon")
- }, icon), label && labelNode), removable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- role: "tab",
- "aria-label": removeAriaLabel || 'remove',
- tabIndex: active ? 0 : -1,
- className: "".concat(tabPrefix, "-remove"),
- onClick: function onClick(e) {
- e.stopPropagation();
- onRemoveTab(e);
- }
- }, closeIcon || editable.removeIcon || '×'));
- return renderWrapper ? renderWrapper(node) : node;
- };
- /* harmony default export */ var TabNavList_TabNode = (TabNode);
- ;// ./node_modules/rc-tabs/es/TabNavList/index.js
- /* eslint-disable react-hooks/exhaustive-deps */
- var getTabSize = function getTabSize(tab, containerRect) {
- // tabListRef
- var offsetWidth = tab.offsetWidth,
- offsetHeight = tab.offsetHeight,
- offsetTop = tab.offsetTop,
- offsetLeft = tab.offsetLeft;
- var _tab$getBoundingClien = tab.getBoundingClientRect(),
- width = _tab$getBoundingClien.width,
- height = _tab$getBoundingClien.height,
- left = _tab$getBoundingClien.left,
- top = _tab$getBoundingClien.top;
- // Use getBoundingClientRect to avoid decimal inaccuracy
- if (Math.abs(width - offsetWidth) < 1) {
- return [width, height, left - containerRect.left, top - containerRect.top];
- }
- return [offsetWidth, offsetHeight, offsetLeft, offsetTop];
- };
- var getSize = function getSize(refObj) {
- var _ref = refObj.current || {},
- _ref$offsetWidth = _ref.offsetWidth,
- offsetWidth = _ref$offsetWidth === void 0 ? 0 : _ref$offsetWidth,
- _ref$offsetHeight = _ref.offsetHeight,
- offsetHeight = _ref$offsetHeight === void 0 ? 0 : _ref$offsetHeight;
- // Use getBoundingClientRect to avoid decimal inaccuracy
- if (refObj.current) {
- var _refObj$current$getBo = refObj.current.getBoundingClientRect(),
- width = _refObj$current$getBo.width,
- height = _refObj$current$getBo.height;
- if (Math.abs(width - offsetWidth) < 1) {
- return [width, height];
- }
- }
- return [offsetWidth, offsetHeight];
- };
- /**
- * Convert `SizeInfo` to unit value. Such as [123, 456] with `top` position get `123`
- */
- var getUnitValue = function getUnitValue(size, tabPositionTopOrBottom) {
- return size[tabPositionTopOrBottom ? 0 : 1];
- };
- var TabNavList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var className = props.className,
- style = props.style,
- id = props.id,
- animated = props.animated,
- activeKey = props.activeKey,
- rtl = props.rtl,
- extra = props.extra,
- editable = props.editable,
- locale = props.locale,
- tabPosition = props.tabPosition,
- tabBarGutter = props.tabBarGutter,
- children = props.children,
- onTabClick = props.onTabClick,
- onTabScroll = props.onTabScroll,
- indicator = props.indicator;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(TabContext),
- prefixCls = _React$useContext.prefixCls,
- tabs = _React$useContext.tabs;
- var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var extraLeftRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var extraRightRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var tabsWrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var tabListRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var operationsRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var innerAddButtonRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';
- var _useSyncState = useSyncState_useSyncState(0, function (next, prev) {
- if (tabPositionTopOrBottom && onTabScroll) {
- onTabScroll({
- direction: next > prev ? 'left' : 'right'
- });
- }
- }),
- _useSyncState2 = (0,slicedToArray["default"])(_useSyncState, 2),
- transformLeft = _useSyncState2[0],
- setTransformLeft = _useSyncState2[1];
- var _useSyncState3 = useSyncState_useSyncState(0, function (next, prev) {
- if (!tabPositionTopOrBottom && onTabScroll) {
- onTabScroll({
- direction: next > prev ? 'top' : 'bottom'
- });
- }
- }),
- _useSyncState4 = (0,slicedToArray["default"])(_useSyncState3, 2),
- transformTop = _useSyncState4[0],
- setTransformTop = _useSyncState4[1];
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([0, 0]),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- containerExcludeExtraSize = _useState2[0],
- setContainerExcludeExtraSize = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([0, 0]),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- tabContentSize = _useState4[0],
- setTabContentSize = _useState4[1];
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([0, 0]),
- _useState6 = (0,slicedToArray["default"])(_useState5, 2),
- addSize = _useState6[0],
- setAddSize = _useState6[1];
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([0, 0]),
- _useState8 = (0,slicedToArray["default"])(_useState7, 2),
- operationSize = _useState8[0],
- setOperationSize = _useState8[1];
- var _useUpdateState = useUpdateState(new Map()),
- _useUpdateState2 = (0,slicedToArray["default"])(_useUpdateState, 2),
- tabSizes = _useUpdateState2[0],
- setTabSizes = _useUpdateState2[1];
- var tabOffsets = useOffsets(tabs, tabSizes, tabContentSize[0]);
- // ========================== Unit =========================
- var containerExcludeExtraSizeValue = getUnitValue(containerExcludeExtraSize, tabPositionTopOrBottom);
- var tabContentSizeValue = getUnitValue(tabContentSize, tabPositionTopOrBottom);
- var addSizeValue = getUnitValue(addSize, tabPositionTopOrBottom);
- var operationSizeValue = getUnitValue(operationSize, tabPositionTopOrBottom);
- var needScroll = Math.floor(containerExcludeExtraSizeValue) < Math.floor(tabContentSizeValue + addSizeValue);
- var visibleTabContentValue = needScroll ? containerExcludeExtraSizeValue - operationSizeValue : containerExcludeExtraSizeValue - addSizeValue;
- // ========================== Util =========================
- var operationsHiddenClassName = "".concat(prefixCls, "-nav-operations-hidden");
- var transformMin = 0;
- var transformMax = 0;
- if (!tabPositionTopOrBottom) {
- transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);
- transformMax = 0;
- } else if (rtl) {
- transformMin = 0;
- transformMax = Math.max(0, tabContentSizeValue - visibleTabContentValue);
- } else {
- transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);
- transformMax = 0;
- }
- function alignInRange(value) {
- if (value < transformMin) {
- return transformMin;
- }
- if (value > transformMax) {
- return transformMax;
- }
- return value;
- }
- // ========================= Mobile ========================
- var touchMovingRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState10 = (0,slicedToArray["default"])(_useState9, 2),
- lockAnimation = _useState10[0],
- setLockAnimation = _useState10[1];
- function doLockAnimation() {
- setLockAnimation(Date.now());
- }
- function clearTouchMoving() {
- if (touchMovingRef.current) {
- clearTimeout(touchMovingRef.current);
- }
- }
- useTouchMove(tabsWrapperRef, function (offsetX, offsetY) {
- function doMove(setState, offset) {
- setState(function (value) {
- var newValue = alignInRange(value + offset);
- return newValue;
- });
- }
- // Skip scroll if place is enough
- if (!needScroll) {
- return false;
- }
- if (tabPositionTopOrBottom) {
- doMove(setTransformLeft, offsetX);
- } else {
- doMove(setTransformTop, offsetY);
- }
- clearTouchMoving();
- doLockAnimation();
- return true;
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- clearTouchMoving();
- if (lockAnimation) {
- touchMovingRef.current = setTimeout(function () {
- setLockAnimation(0);
- }, 100);
- }
- return clearTouchMoving;
- }, [lockAnimation]);
- // ===================== Visible Range =====================
- // Render tab node & collect tab offset
- var _useVisibleRange = useVisibleRange(tabOffsets,
- // Container
- visibleTabContentValue,
- // Transform
- tabPositionTopOrBottom ? transformLeft : transformTop,
- // Tabs
- tabContentSizeValue,
- // Add
- addSizeValue,
- // Operation
- operationSizeValue, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- tabs: tabs
- })),
- _useVisibleRange2 = (0,slicedToArray["default"])(_useVisibleRange, 2),
- visibleStart = _useVisibleRange2[0],
- visibleEnd = _useVisibleRange2[1];
- // ========================= Scroll ========================
- var scrollToTab = (0,useEvent["default"])(function () {
- var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;
- var tabOffset = tabOffsets.get(key) || {
- width: 0,
- height: 0,
- left: 0,
- right: 0,
- top: 0
- };
- if (tabPositionTopOrBottom) {
- // ============ Align with top & bottom ============
- var newTransform = transformLeft;
- // RTL
- if (rtl) {
- if (tabOffset.right < transformLeft) {
- newTransform = tabOffset.right;
- } else if (tabOffset.right + tabOffset.width > transformLeft + visibleTabContentValue) {
- newTransform = tabOffset.right + tabOffset.width - visibleTabContentValue;
- }
- }
- // LTR
- else if (tabOffset.left < -transformLeft) {
- newTransform = -tabOffset.left;
- } else if (tabOffset.left + tabOffset.width > -transformLeft + visibleTabContentValue) {
- newTransform = -(tabOffset.left + tabOffset.width - visibleTabContentValue);
- }
- setTransformTop(0);
- setTransformLeft(alignInRange(newTransform));
- } else {
- // ============ Align with left & right ============
- var _newTransform = transformTop;
- if (tabOffset.top < -transformTop) {
- _newTransform = -tabOffset.top;
- } else if (tabOffset.top + tabOffset.height > -transformTop + visibleTabContentValue) {
- _newTransform = -(tabOffset.top + tabOffset.height - visibleTabContentValue);
- }
- setTransformLeft(0);
- setTransformTop(alignInRange(_newTransform));
- }
- });
- // ========================= Focus =========================
- var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),
- _useState12 = (0,slicedToArray["default"])(_useState11, 2),
- focusKey = _useState12[0],
- setFocusKey = _useState12[1];
- var _useState13 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState14 = (0,slicedToArray["default"])(_useState13, 2),
- isMouse = _useState14[0],
- setIsMouse = _useState14[1];
- var enabledTabs = tabs.filter(function (tab) {
- return !tab.disabled;
- }).map(function (tab) {
- return tab.key;
- });
- var onOffset = function onOffset(offset) {
- var currentIndex = enabledTabs.indexOf(focusKey || activeKey);
- var len = enabledTabs.length;
- var nextIndex = (currentIndex + offset + len) % len;
- var newKey = enabledTabs[nextIndex];
- setFocusKey(newKey);
- };
- var handleRemoveTab = function handleRemoveTab(removalTabKey, e) {
- var removeIndex = enabledTabs.indexOf(removalTabKey);
- var removeTab = tabs.find(function (tab) {
- return tab.key === removalTabKey;
- });
- var removable = getRemovable(removeTab === null || removeTab === void 0 ? void 0 : removeTab.closable, removeTab === null || removeTab === void 0 ? void 0 : removeTab.closeIcon, editable, removeTab === null || removeTab === void 0 ? void 0 : removeTab.disabled);
- if (removable) {
- e.preventDefault();
- e.stopPropagation();
- editable.onEdit('remove', {
- key: removalTabKey,
- event: e
- });
- // when remove last tab, focus previous tab
- if (removeIndex === enabledTabs.length - 1) {
- onOffset(-1);
- } else {
- onOffset(1);
- }
- }
- };
- var handleMouseDown = function handleMouseDown(key, e) {
- setIsMouse(true);
- // Middle mouse button
- if (e.button === 1) {
- handleRemoveTab(key, e);
- }
- };
- var handleKeyDown = function handleKeyDown(e) {
- var code = e.code;
- var isRTL = rtl && tabPositionTopOrBottom;
- var firstEnabledTab = enabledTabs[0];
- var lastEnabledTab = enabledTabs[enabledTabs.length - 1];
- switch (code) {
- // LEFT
- case 'ArrowLeft':
- {
- if (tabPositionTopOrBottom) {
- onOffset(isRTL ? 1 : -1);
- }
- break;
- }
- // RIGHT
- case 'ArrowRight':
- {
- if (tabPositionTopOrBottom) {
- onOffset(isRTL ? -1 : 1);
- }
- break;
- }
- // UP
- case 'ArrowUp':
- {
- e.preventDefault();
- if (!tabPositionTopOrBottom) {
- onOffset(-1);
- }
- break;
- }
- // DOWN
- case 'ArrowDown':
- {
- e.preventDefault();
- if (!tabPositionTopOrBottom) {
- onOffset(1);
- }
- break;
- }
- // HOME
- case 'Home':
- {
- e.preventDefault();
- setFocusKey(firstEnabledTab);
- break;
- }
- // END
- case 'End':
- {
- e.preventDefault();
- setFocusKey(lastEnabledTab);
- break;
- }
- // Enter & Space
- case 'Enter':
- case 'Space':
- {
- e.preventDefault();
- onTabClick(focusKey !== null && focusKey !== void 0 ? focusKey : activeKey, e);
- break;
- }
- // Backspace
- case 'Backspace':
- case 'Delete':
- {
- handleRemoveTab(focusKey, e);
- break;
- }
- }
- };
- // ========================== Tab ==========================
- var tabNodeStyle = {};
- if (tabPositionTopOrBottom) {
- tabNodeStyle[rtl ? 'marginRight' : 'marginLeft'] = tabBarGutter;
- } else {
- tabNodeStyle.marginTop = tabBarGutter;
- }
- var tabNodes = tabs.map(function (tab, i) {
- var key = tab.key;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_TabNode, {
- id: id,
- prefixCls: prefixCls,
- key: key,
- tab: tab
- /* first node should not have margin left */,
- style: i === 0 ? undefined : tabNodeStyle,
- closable: tab.closable,
- editable: editable,
- active: key === activeKey,
- focus: key === focusKey,
- renderWrapper: children,
- removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,
- tabCount: enabledTabs.length,
- currentPosition: i + 1,
- onClick: function onClick(e) {
- onTabClick(key, e);
- },
- onKeyDown: handleKeyDown,
- onFocus: function onFocus() {
- if (!isMouse) {
- setFocusKey(key);
- }
- scrollToTab(key);
- doLockAnimation();
- if (!tabsWrapperRef.current) {
- return;
- }
- // Focus element will make scrollLeft change which we should reset back
- if (!rtl) {
- tabsWrapperRef.current.scrollLeft = 0;
- }
- tabsWrapperRef.current.scrollTop = 0;
- },
- onBlur: function onBlur() {
- setFocusKey(undefined);
- },
- onMouseDown: function onMouseDown(e) {
- return handleMouseDown(key, e);
- },
- onMouseUp: function onMouseUp() {
- setIsMouse(false);
- }
- });
- });
- // Update buttons records
- var updateTabSizes = function updateTabSizes() {
- return setTabSizes(function () {
- var _tabListRef$current;
- var newSizes = new Map();
- var listRect = (_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.getBoundingClientRect();
- tabs.forEach(function (_ref2) {
- var _tabListRef$current2;
- var key = _ref2.key;
- var btnNode = (_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.querySelector("[data-node-key=\"".concat(genDataNodeKey(key), "\"]"));
- if (btnNode) {
- var _getTabSize = getTabSize(btnNode, listRect),
- _getTabSize2 = (0,slicedToArray["default"])(_getTabSize, 4),
- width = _getTabSize2[0],
- height = _getTabSize2[1],
- left = _getTabSize2[2],
- top = _getTabSize2[3];
- newSizes.set(key, {
- width: width,
- height: height,
- left: left,
- top: top
- });
- }
- });
- return newSizes;
- });
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- updateTabSizes();
- }, [tabs.map(function (tab) {
- return tab.key;
- }).join('_')]);
- var onListHolderResize = useUpdate(function () {
- // Update wrapper records
- var containerSize = getSize(containerRef);
- var extraLeftSize = getSize(extraLeftRef);
- var extraRightSize = getSize(extraRightRef);
- setContainerExcludeExtraSize([containerSize[0] - extraLeftSize[0] - extraRightSize[0], containerSize[1] - extraLeftSize[1] - extraRightSize[1]]);
- var newAddSize = getSize(innerAddButtonRef);
- setAddSize(newAddSize);
- var newOperationSize = getSize(operationsRef);
- setOperationSize(newOperationSize);
- // Which includes add button size
- var tabContentFullSize = getSize(tabListRef);
- setTabContentSize([tabContentFullSize[0] - newAddSize[0], tabContentFullSize[1] - newAddSize[1]]);
- // Update buttons records
- updateTabSizes();
- });
- // ======================== Dropdown =======================
- var startHiddenTabs = tabs.slice(0, visibleStart);
- var endHiddenTabs = tabs.slice(visibleEnd + 1);
- var hiddenTabs = [].concat((0,toConsumableArray["default"])(startHiddenTabs), (0,toConsumableArray["default"])(endHiddenTabs));
- // =================== Link & Operations ===================
- var activeTabOffset = tabOffsets.get(activeKey);
- var _useIndicator = hooks_useIndicator({
- activeTabOffset: activeTabOffset,
- horizontal: tabPositionTopOrBottom,
- indicator: indicator,
- rtl: rtl
- }),
- indicatorStyle = _useIndicator.style;
- // ========================= Effect ========================
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- scrollToTab();
- }, [activeKey, transformMin, transformMax, util_stringify(activeTabOffset), util_stringify(tabOffsets), tabPositionTopOrBottom]);
- // Should recalculate when rtl changed
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- onListHolderResize();
- // eslint-disable-next-line
- }, [rtl]);
- // ========================= Render ========================
- var hasDropdown = !!hiddenTabs.length;
- var wrapPrefix = "".concat(prefixCls, "-nav-wrap");
- var pingLeft;
- var pingRight;
- var pingTop;
- var pingBottom;
- if (tabPositionTopOrBottom) {
- if (rtl) {
- pingRight = transformLeft > 0;
- pingLeft = transformLeft !== transformMax;
- } else {
- pingLeft = transformLeft < 0;
- pingRight = transformLeft !== transformMin;
- }
- } else {
- pingTop = transformTop < 0;
- pingBottom = transformTop !== transformMin;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onListHolderResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: (0,es_ref.useComposeRef)(ref, containerRef),
- role: "tablist",
- "aria-orientation": tabPositionTopOrBottom ? 'horizontal' : 'vertical',
- className: classnames_default()("".concat(prefixCls, "-nav"), className),
- style: style,
- onKeyDown: function onKeyDown() {
- // No need animation when use keyboard
- doLockAnimation();
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_ExtraContent, {
- ref: extraLeftRef,
- position: "left",
- extra: extra,
- prefixCls: prefixCls
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onListHolderResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(wrapPrefix, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(wrapPrefix, "-ping-left"), pingLeft), "".concat(wrapPrefix, "-ping-right"), pingRight), "".concat(wrapPrefix, "-ping-top"), pingTop), "".concat(wrapPrefix, "-ping-bottom"), pingBottom)),
- ref: tabsWrapperRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onListHolderResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: tabListRef,
- className: "".concat(prefixCls, "-nav-list"),
- style: {
- transform: "translate(".concat(transformLeft, "px, ").concat(transformTop, "px)"),
- transition: lockAnimation ? 'none' : undefined
- }
- }, tabNodes, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_AddButton, {
- ref: innerAddButtonRef,
- prefixCls: prefixCls,
- locale: locale,
- editable: editable,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, tabNodes.length === 0 ? undefined : tabNodeStyle), {}, {
- visibility: hasDropdown ? 'hidden' : null
- })
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-ink-bar"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-ink-bar-animated"), animated.inkBar)),
- style: indicatorStyle
- }))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_OperationNode, (0,esm_extends["default"])({}, props, {
- removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,
- ref: operationsRef,
- prefixCls: prefixCls,
- tabs: hiddenTabs,
- className: !hasDropdown && operationsHiddenClassName,
- tabMoving: !!lockAnimation
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_ExtraContent, {
- ref: extraRightRef,
- position: "right",
- extra: extra,
- prefixCls: prefixCls
- })));
- /* eslint-enable */
- });
- /* harmony default export */ var es_TabNavList = (TabNavList);
- ;// ./node_modules/rc-tabs/es/TabPanelList/TabPane.js
- var TabPane = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- className = props.className,
- style = props.style,
- id = props.id,
- active = props.active,
- tabKey = props.tabKey,
- children = props.children;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- id: id && "".concat(id, "-panel-").concat(tabKey),
- role: "tabpanel",
- tabIndex: active ? 0 : -1,
- "aria-labelledby": id && "".concat(id, "-tab-").concat(tabKey),
- "aria-hidden": !active,
- style: style,
- className: classnames_default()(prefixCls, active && "".concat(prefixCls, "-active"), className),
- ref: ref
- }, children);
- });
- if (true) {
- TabPane.displayName = 'TabPane';
- }
- /* harmony default export */ var TabPanelList_TabPane = (TabPane);
- ;// ./node_modules/rc-tabs/es/TabNavList/Wrapper.js
- var Wrapper_excluded = ["renderTabBar"],
- Wrapper_excluded2 = ["label", "key"];
- // zombieJ: To compatible with `renderTabBar` usage.
- // We have to create a TabNavList components.
- var TabNavListWrapper = function TabNavListWrapper(_ref) {
- var renderTabBar = _ref.renderTabBar,
- restProps = (0,objectWithoutProperties["default"])(_ref, Wrapper_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(TabContext),
- tabs = _React$useContext.tabs;
- if (renderTabBar) {
- var tabNavBarProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, restProps), {}, {
- // Legacy support. We do not use this actually
- panes: tabs.map(function (_ref2) {
- var label = _ref2.label,
- key = _ref2.key,
- restTabProps = (0,objectWithoutProperties["default"])(_ref2, Wrapper_excluded2);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabPanelList_TabPane, (0,esm_extends["default"])({
- tab: label,
- key: key,
- tabKey: key
- }, restTabProps));
- })
- });
- return renderTabBar(tabNavBarProps, es_TabNavList);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TabNavList, restProps);
- };
- if (true) {
- TabNavListWrapper.displayName = 'TabNavListWrapper';
- }
- /* harmony default export */ var TabNavList_Wrapper = (TabNavListWrapper);
- ;// ./node_modules/rc-tabs/es/TabPanelList/index.js
- var TabPanelList_excluded = ["key", "forceRender", "style", "className", "destroyInactiveTabPane"];
- var TabPanelList = function TabPanelList(props) {
- var id = props.id,
- activeKey = props.activeKey,
- animated = props.animated,
- tabPosition = props.tabPosition,
- destroyInactiveTabPane = props.destroyInactiveTabPane;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(TabContext),
- prefixCls = _React$useContext.prefixCls,
- tabs = _React$useContext.tabs;
- var tabPaneAnimated = animated.tabPane;
- var tabPanePrefixCls = "".concat(prefixCls, "-tabpane");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content-holder"))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content"), "".concat(prefixCls, "-content-").concat(tabPosition), (0,defineProperty["default"])({}, "".concat(prefixCls, "-content-animated"), tabPaneAnimated))
- }, tabs.map(function (item) {
- var key = item.key,
- forceRender = item.forceRender,
- paneStyle = item.style,
- paneClassName = item.className,
- itemDestroyInactiveTabPane = item.destroyInactiveTabPane,
- restTabProps = (0,objectWithoutProperties["default"])(item, TabPanelList_excluded);
- var active = key === activeKey;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- key: key,
- visible: active,
- forceRender: forceRender,
- removeOnLeave: !!(destroyInactiveTabPane || itemDestroyInactiveTabPane),
- leavedClassName: "".concat(tabPanePrefixCls, "-hidden")
- }, animated.tabPaneMotion), function (_ref, ref) {
- var motionStyle = _ref.style,
- motionClassName = _ref.className;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabPanelList_TabPane, (0,esm_extends["default"])({}, restTabProps, {
- prefixCls: tabPanePrefixCls,
- id: id,
- tabKey: key,
- animated: tabPaneAnimated,
- active: active,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, paneStyle), motionStyle),
- className: classnames_default()(paneClassName, motionClassName),
- ref: ref
- }));
- });
- })));
- };
- /* harmony default export */ var es_TabPanelList = (TabPanelList);
- ;// ./node_modules/rc-tabs/es/hooks/useAnimateConfig.js
- function useAnimateConfig() {
- var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
- inkBar: true,
- tabPane: false
- };
- var mergedAnimated;
- if (animated === false) {
- mergedAnimated = {
- inkBar: false,
- tabPane: false
- };
- } else if (animated === true) {
- mergedAnimated = {
- inkBar: true,
- tabPane: false
- };
- } else {
- mergedAnimated = (0,objectSpread2["default"])({
- inkBar: true
- }, (0,esm_typeof["default"])(animated) === 'object' ? animated : {});
- }
- // Enable tabPane animation if provide motion
- if (mergedAnimated.tabPaneMotion && mergedAnimated.tabPane === undefined) {
- mergedAnimated.tabPane = true;
- }
- if (!mergedAnimated.tabPaneMotion && mergedAnimated.tabPane) {
- if (true) {
- (0,warning["default"])(false, '`animated.tabPane` is true but `animated.tabPaneMotion` is not provided. Motion will not work.');
- }
- mergedAnimated.tabPane = false;
- }
- return mergedAnimated;
- }
- ;// ./node_modules/rc-tabs/es/Tabs.js
- var Tabs_excluded = ["id", "prefixCls", "className", "items", "direction", "activeKey", "defaultActiveKey", "editable", "animated", "tabPosition", "tabBarGutter", "tabBarStyle", "tabBarExtraContent", "locale", "more", "destroyInactiveTabPane", "renderTabBar", "onChange", "onTabClick", "onTabScroll", "getPopupContainer", "popupClassName", "indicator"];
- // Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role
- /**
- * Should added antd:
- * - type
- *
- * Removed:
- * - onNextClick
- * - onPrevClick
- * - keyboard
- */
- // Used for accessibility
- var Tabs_uuid = 0;
- var Tabs = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var id = props.id,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-tabs' : _props$prefixCls,
- className = props.className,
- items = props.items,
- direction = props.direction,
- activeKey = props.activeKey,
- defaultActiveKey = props.defaultActiveKey,
- editable = props.editable,
- animated = props.animated,
- _props$tabPosition = props.tabPosition,
- tabPosition = _props$tabPosition === void 0 ? 'top' : _props$tabPosition,
- tabBarGutter = props.tabBarGutter,
- tabBarStyle = props.tabBarStyle,
- tabBarExtraContent = props.tabBarExtraContent,
- locale = props.locale,
- more = props.more,
- destroyInactiveTabPane = props.destroyInactiveTabPane,
- renderTabBar = props.renderTabBar,
- onChange = props.onChange,
- onTabClick = props.onTabClick,
- onTabScroll = props.onTabScroll,
- getPopupContainer = props.getPopupContainer,
- popupClassName = props.popupClassName,
- indicator = props.indicator,
- restProps = (0,objectWithoutProperties["default"])(props, Tabs_excluded);
- var tabs = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (items || []).filter(function (item) {
- return item && (0,esm_typeof["default"])(item) === 'object' && 'key' in item;
- });
- }, [items]);
- var rtl = direction === 'rtl';
- var mergedAnimated = useAnimateConfig(animated);
- // ======================== Mobile ========================
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- mobile = _useState2[0],
- setMobile = _useState2[1];
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- // Only update on the client side
- setMobile(isMobile());
- }, []);
- // ====================== Active Key ======================
- var _useMergedState = (0,useMergedState["default"])(function () {
- var _tabs$;
- return (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key;
- }, {
- value: activeKey,
- defaultValue: defaultActiveKey
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedActiveKey = _useMergedState2[0],
- setMergedActiveKey = _useMergedState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function () {
- return tabs.findIndex(function (tab) {
- return tab.key === mergedActiveKey;
- });
- }),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- activeIndex = _useState4[0],
- setActiveIndex = _useState4[1];
- // Reset active key if not exist anymore
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var newActiveIndex = tabs.findIndex(function (tab) {
- return tab.key === mergedActiveKey;
- });
- if (newActiveIndex === -1) {
- var _tabs$newActiveIndex;
- newActiveIndex = Math.max(0, Math.min(activeIndex, tabs.length - 1));
- setMergedActiveKey((_tabs$newActiveIndex = tabs[newActiveIndex]) === null || _tabs$newActiveIndex === void 0 ? void 0 : _tabs$newActiveIndex.key);
- }
- setActiveIndex(newActiveIndex);
- }, [tabs.map(function (tab) {
- return tab.key;
- }).join('_'), mergedActiveKey, activeIndex]);
- // ===================== Accessibility ====================
- var _useMergedState3 = (0,useMergedState["default"])(null, {
- value: id
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedId = _useMergedState4[0],
- setMergedId = _useMergedState4[1];
- // Async generate id to avoid ssr mapping failed
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (!id) {
- setMergedId("rc-tabs-".concat( false ? 0 : Tabs_uuid));
- Tabs_uuid += 1;
- }
- }, []);
- // ======================== Events ========================
- function onInternalTabClick(key, e) {
- onTabClick === null || onTabClick === void 0 || onTabClick(key, e);
- var isActiveChanged = key !== mergedActiveKey;
- setMergedActiveKey(key);
- if (isActiveChanged) {
- onChange === null || onChange === void 0 || onChange(key);
- }
- }
- // ======================== Render ========================
- var sharedProps = {
- id: mergedId,
- activeKey: mergedActiveKey,
- animated: mergedAnimated,
- tabPosition: tabPosition,
- rtl: rtl,
- mobile: mobile
- };
- var tabNavBarProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, sharedProps), {}, {
- editable: editable,
- locale: locale,
- more: more,
- tabBarGutter: tabBarGutter,
- onTabClick: onInternalTabClick,
- onTabScroll: onTabScroll,
- extra: tabBarExtraContent,
- style: tabBarStyle,
- panes: null,
- getPopupContainer: getPopupContainer,
- popupClassName: popupClassName,
- indicator: indicator
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabContext.Provider, {
- value: {
- tabs: tabs,
- prefixCls: prefixCls
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- ref: ref,
- id: id,
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(tabPosition), (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-mobile"), mobile), "".concat(prefixCls, "-editable"), editable), "".concat(prefixCls, "-rtl"), rtl), className)
- }, restProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TabNavList_Wrapper, (0,esm_extends["default"])({}, tabNavBarProps, {
- renderTabBar: renderTabBar
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TabPanelList, (0,esm_extends["default"])({
- destroyInactiveTabPane: destroyInactiveTabPane
- }, sharedProps, {
- animated: mergedAnimated
- }))));
- });
- if (true) {
- Tabs.displayName = 'Tabs';
- }
- /* harmony default export */ var es_Tabs = (Tabs);
- ;// ./node_modules/rc-tabs/es/index.js
- /* harmony default export */ var rc_tabs_es = (es_Tabs);
- ;// ./components/tabs/hooks/useAnimateConfig.ts
- const motion = {
- motionAppear: false,
- motionEnter: true,
- motionLeave: true
- };
- function useAnimateConfig_useAnimateConfig(prefixCls, animated = {
- inkBar: true,
- tabPane: false
- }) {
- let mergedAnimated;
- if (animated === false) {
- mergedAnimated = {
- inkBar: false,
- tabPane: false
- };
- } else if (animated === true) {
- mergedAnimated = {
- inkBar: true,
- tabPane: true
- };
- } else {
- mergedAnimated = Object.assign({
- inkBar: true
- }, typeof animated === 'object' ? animated : {});
- }
- if (mergedAnimated.tabPane) {
- mergedAnimated.tabPaneMotion = Object.assign(Object.assign({}, motion), {
- motionName: (0,_util_motion.getTransitionName)(prefixCls, 'switch')
- });
- }
- return mergedAnimated;
- }
- ;// ./components/tabs/hooks/useLegacyItems.ts
- var useLegacyItems_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function filter(items) {
- return items.filter(item => item);
- }
- function useLegacyItems(items, children) {
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Tabs');
- warning.deprecated(!children, 'Tabs.TabPane', 'items');
- }
- if (items) {
- return items.map(item => {
- var _a;
- const mergedDestroyOnHidden = (_a = item.destroyOnHidden) !== null && _a !== void 0 ? _a : item.destroyInactiveTabPane;
- return Object.assign(Object.assign({}, item), {
- // TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
- destroyInactiveTabPane: mergedDestroyOnHidden
- });
- });
- }
- const childrenItems = (0,toArray["default"])(children).map(node => {
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node)) {
- const {
- key,
- props
- } = node;
- const _a = props || {},
- {
- tab
- } = _a,
- restProps = useLegacyItems_rest(_a, ["tab"]);
- const item = Object.assign(Object.assign({
- key: String(key)
- }, restProps), {
- label: tab
- });
- return item;
- }
- return null;
- });
- return filter(childrenItems);
- }
- /* harmony default export */ var hooks_useLegacyItems = (useLegacyItems);
- // EXTERNAL MODULE: ./components/tabs/style/index.ts + 1 modules
- var tabs_style = __webpack_require__("./components/tabs/style/index.ts");
- ;// ./components/tabs/TabPane.ts
- const TabPane_TabPane = () => null;
- if (true) {
- TabPane_TabPane.displayName = 'DeprecatedTabPane';
- }
- /* harmony default export */ var tabs_TabPane = (TabPane_TabPane);
- ;// ./components/tabs/index.tsx
- var tabs_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalTabs = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
- const {
- type,
- className,
- rootClassName,
- size: customSize,
- onEdit,
- hideAdd,
- centered,
- addIcon,
- removeIcon,
- moreIcon,
- more,
- popupClassName,
- children,
- items,
- animated,
- style,
- indicatorSize,
- indicator,
- destroyInactiveTabPane,
- destroyOnHidden
- } = props,
- otherProps = tabs_rest(props, ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator", "destroyInactiveTabPane", "destroyOnHidden"]);
- const {
- prefixCls: customizePrefixCls
- } = otherProps;
- const {
- direction,
- tabs,
- getPrefixCls,
- getPopupContainer
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('tabs', customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,tabs_style["default"])(prefixCls, rootCls);
- const tabsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- nativeElement: tabsRef.current
- }));
- let editable;
- if (type === 'editable-card') {
- editable = {
- onEdit: (editType, {
- key,
- event
- }) => {
- onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === 'add' ? event : key, editType);
- },
- removeIcon: (_a = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a !== void 0 ? _a : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, null),
- addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_PlusOutlined, null),
- showAdd: hideAdd !== true
- };
- }
- const rootPrefixCls = getPrefixCls();
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Tabs');
- true ? warning(!('onPrevClick' in props) && !('onNextClick' in props), 'breaking', '`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.') : 0;
- true ? warning(!(indicatorSize || (tabs === null || tabs === void 0 ? void 0 : tabs.indicatorSize)), 'deprecated', '`indicatorSize` has been deprecated. Please use `indicator={{ size: ... }}` instead.') : 0;
- warning.deprecated(!('destroyInactiveTabPane' in props || (items === null || items === void 0 ? void 0 : items.some(item => 'destroyInactiveTabPane' in item))), 'destroyInactiveTabPane', 'destroyOnHidden');
- }
- const size = (0,useSize["default"])(customSize);
- const mergedItems = hooks_useLegacyItems(items, children);
- const mergedAnimated = useAnimateConfig_useAnimateConfig(prefixCls, animated);
- const mergedStyle = Object.assign(Object.assign({}, tabs === null || tabs === void 0 ? void 0 : tabs.style), style);
- const mergedIndicator = {
- align: (_b = indicator === null || indicator === void 0 ? void 0 : indicator.align) !== null && _b !== void 0 ? _b : (_c = tabs === null || tabs === void 0 ? void 0 : tabs.indicator) === null || _c === void 0 ? void 0 : _c.align,
- size: (_g = (_e = (_d = indicator === null || indicator === void 0 ? void 0 : indicator.size) !== null && _d !== void 0 ? _d : indicatorSize) !== null && _e !== void 0 ? _e : (_f = tabs === null || tabs === void 0 ? void 0 : tabs.indicator) === null || _f === void 0 ? void 0 : _f.size) !== null && _g !== void 0 ? _g : tabs === null || tabs === void 0 ? void 0 : tabs.indicatorSize
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_tabs_es, Object.assign({
- ref: tabsRef,
- direction: direction,
- getPopupContainer: getPopupContainer
- }, otherProps, {
- items: mergedItems,
- className: classnames_default()({
- [`${prefixCls}-${size}`]: size,
- [`${prefixCls}-card`]: ['card', 'editable-card'].includes(type),
- [`${prefixCls}-editable-card`]: type === 'editable-card',
- [`${prefixCls}-centered`]: centered
- }, tabs === null || tabs === void 0 ? void 0 : tabs.className, className, rootClassName, hashId, cssVarCls, rootCls),
- popupClassName: classnames_default()(popupClassName, hashId, cssVarCls, rootCls),
- style: mergedStyle,
- editable: editable,
- more: Object.assign({
- icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EllipsisOutlined, null),
- transitionName: `${rootPrefixCls}-slide-up`
- }, more),
- prefixCls: prefixCls,
- animated: mergedAnimated,
- indicator: mergedIndicator,
- // TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
- destroyInactiveTabPane: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyInactiveTabPane
- })));
- });
- const tabs_Tabs = InternalTabs;
- tabs_Tabs.TabPane = tabs_TabPane;
- if (true) {
- tabs_Tabs.displayName = 'Tabs';
- }
- /* harmony default export */ var components_tabs = (tabs_Tabs);
- ;// ./components/card/Grid.tsx
- var Grid_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Grid = _a => {
- var {
- prefixCls,
- className,
- hoverable = true
- } = _a,
- props = Grid_rest(_a, ["prefixCls", "className", "hoverable"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefix = getPrefixCls('card', prefixCls);
- const classString = classnames_default()(`${prefix}-grid`, className, {
- [`${prefix}-grid-hoverable`]: hoverable
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, props, {
- className: classString
- }));
- };
- /* harmony default export */ var card_Grid = (Grid);
- // EXTERNAL MODULE: ./components/card/style/index.ts
- var card_style = __webpack_require__("./components/card/style/index.ts");
- ;// ./components/card/Card.tsx
- var Card_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const ActionNode = props => {
- const {
- actionClasses,
- actions = [],
- actionStyle
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: actionClasses,
- style: actionStyle
- }, actions.map((action, index) => {
- // Move this out since eslint not allow index key
- // And eslint-disable makes conflict with rollup
- // ref https://github.com/ant-design/ant-design/issues/46022
- const key = `action-${index}`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- style: {
- width: `${100 / actions.length}%`
- },
- key: key
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, action));
- }));
- };
- const Card = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- extra,
- headStyle = {},
- bodyStyle = {},
- title,
- loading,
- bordered,
- variant: customVariant,
- size: customizeSize,
- type,
- cover,
- actions,
- tabList,
- children,
- activeTabKey,
- defaultActiveTabKey,
- tabBarExtraContent,
- hoverable,
- tabProps = {},
- classNames: customClassNames,
- styles: customStyles
- } = props,
- others = Card_rest(props, ["prefixCls", "className", "rootClassName", "style", "extra", "headStyle", "bodyStyle", "title", "loading", "bordered", "variant", "size", "type", "cover", "actions", "tabList", "children", "activeTabKey", "defaultActiveTabKey", "tabBarExtraContent", "hoverable", "tabProps", "classNames", "styles"]);
- const {
- getPrefixCls,
- direction,
- card
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [variant] = useVariants('card', customVariant, bordered);
- // =================Warning===================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Card');
- [['headStyle', 'styles.header'], ['bodyStyle', 'styles.body'], ['bordered', 'variant']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- const onTabChange = key => {
- var _a;
- (_a = props.onTabChange) === null || _a === void 0 ? void 0 : _a.call(props, key);
- };
- const moduleClass = moduleName => {
- var _a;
- return classnames_default()((_a = card === null || card === void 0 ? void 0 : card.classNames) === null || _a === void 0 ? void 0 : _a[moduleName], customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames[moduleName]);
- };
- const moduleStyle = moduleName => {
- var _a;
- return Object.assign(Object.assign({}, (_a = card === null || card === void 0 ? void 0 : card.styles) === null || _a === void 0 ? void 0 : _a[moduleName]), customStyles === null || customStyles === void 0 ? void 0 : customStyles[moduleName]);
- };
- const isContainGrid = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- let containGrid = false;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.forEach(children, element => {
- if ((element === null || element === void 0 ? void 0 : element.type) === card_Grid) {
- containGrid = true;
- }
- });
- return containGrid;
- }, [children]);
- const prefixCls = getPrefixCls('card', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,card_style["default"])(prefixCls);
- const loadingBlock = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton, {
- loading: true,
- active: true,
- paragraph: {
- rows: 4
- },
- title: false
- }, children);
- const hasActiveTabKey = activeTabKey !== undefined;
- const extraProps = Object.assign(Object.assign({}, tabProps), {
- [hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey ? activeTabKey : defaultActiveTabKey,
- tabBarExtraContent
- });
- let head;
- const mergedSize = (0,useSize["default"])(customizeSize);
- const tabSize = !mergedSize || mergedSize === 'default' ? 'large' : mergedSize;
- const tabs = tabList ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tabs, Object.assign({
- size: tabSize
- }, extraProps, {
- className: `${prefixCls}-head-tabs`,
- onChange: onTabChange,
- items: tabList.map(_a => {
- var {
- tab
- } = _a,
- item = Card_rest(_a, ["tab"]);
- return Object.assign({
- label: tab
- }, item);
- })
- }))) : null;
- if (title || extra || tabs) {
- const headClasses = classnames_default()(`${prefixCls}-head`, moduleClass('header'));
- const titleClasses = classnames_default()(`${prefixCls}-head-title`, moduleClass('title'));
- const extraClasses = classnames_default()(`${prefixCls}-extra`, moduleClass('extra'));
- const mergedHeadStyle = Object.assign(Object.assign({}, headStyle), moduleStyle('header'));
- head = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: headClasses,
- style: mergedHeadStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-head-wrapper`
- }, title && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: titleClasses,
- style: moduleStyle('title')
- }, title)), extra && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: extraClasses,
- style: moduleStyle('extra')
- }, extra))), tabs);
- }
- const coverClasses = classnames_default()(`${prefixCls}-cover`, moduleClass('cover'));
- const coverDom = cover ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: coverClasses,
- style: moduleStyle('cover')
- }, cover)) : null;
- const bodyClasses = classnames_default()(`${prefixCls}-body`, moduleClass('body'));
- const mergedBodyStyle = Object.assign(Object.assign({}, bodyStyle), moduleStyle('body'));
- const body = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: bodyClasses,
- style: mergedBodyStyle
- }, loading ? loadingBlock : children);
- const actionClasses = classnames_default()(`${prefixCls}-actions`, moduleClass('actions'));
- const actionDom = (actions === null || actions === void 0 ? void 0 : actions.length) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ActionNode, {
- actionClasses: actionClasses,
- actionStyle: moduleStyle('actions'),
- actions: actions
- })) : null;
- const divProps = (0,omit["default"])(others, ['onTabChange']);
- const classString = classnames_default()(prefixCls, card === null || card === void 0 ? void 0 : card.className, {
- [`${prefixCls}-loading`]: loading,
- [`${prefixCls}-bordered`]: variant !== 'borderless',
- [`${prefixCls}-hoverable`]: hoverable,
- [`${prefixCls}-contain-grid`]: isContainGrid,
- [`${prefixCls}-contain-tabs`]: tabList === null || tabList === void 0 ? void 0 : tabList.length,
- [`${prefixCls}-${mergedSize}`]: mergedSize,
- [`${prefixCls}-type-${type}`]: !!type,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, card === null || card === void 0 ? void 0 : card.style), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- ref: ref
- }, divProps, {
- className: classString,
- style: mergedStyle
- }), head, coverDom, body, actionDom));
- });
- /* harmony default export */ var card_Card = (Card);
- ;// ./components/card/Meta.tsx
- var Meta_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Meta = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- avatar,
- title,
- description
- } = props,
- others = Meta_rest(props, ["prefixCls", "className", "avatar", "title", "description"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('card', customizePrefixCls);
- const classString = classnames_default()(`${prefixCls}-meta`, className);
- const avatarDom = avatar ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-meta-avatar`
- }, avatar)) : null;
- const titleDom = title ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-meta-title`
- }, title)) : null;
- const descriptionDom = description ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-meta-description`
- }, description)) : null;
- const MetaDetail = titleDom || descriptionDom ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-meta-detail`
- }, titleDom, descriptionDom)) : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, others, {
- className: classString
- }), avatarDom, MetaDetail);
- };
- /* harmony default export */ var card_Meta = (Meta);
- ;// ./components/card/index.tsx
- const components_card_Card = card_Card;
- components_card_Card.Grid = card_Grid;
- components_card_Card.Meta = card_Meta;
- if (true) {
- components_card_Card.displayName = 'Card';
- }
- /* harmony default export */ var card = (components_card_Card);
- ;// ./node_modules/@ant-design/react-slick/es/initial-state.js
- var initialState = {
- animating: false,
- autoplaying: null,
- currentDirection: 0,
- currentLeft: null,
- currentSlide: 0,
- direction: 1,
- dragging: false,
- edgeDragged: false,
- initialized: false,
- lazyLoadedList: [],
- listHeight: null,
- listWidth: null,
- scrolling: false,
- slideCount: null,
- slideHeight: null,
- slideWidth: null,
- swipeLeft: null,
- swiped: false,
- // used by swipeEvent. differentites between touch and swipe.
- swiping: false,
- touchObject: {
- startX: 0,
- startY: 0,
- curX: 0,
- curY: 0
- },
- trackStyle: {},
- trackWidth: 0,
- targetSlide: 0
- };
- /* harmony default export */ var initial_state = (initialState);
- ;// ./node_modules/throttle-debounce/esm/index.js
- /* eslint-disable no-undefined,no-param-reassign,no-shadow */
- /**
- * Throttle execution of a function. Especially useful for rate limiting
- * execution of handlers on events like resize and scroll.
- *
- * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
- * are most useful.
- * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
- * as-is, to `callback` when the throttled-function is executed.
- * @param {object} [options] - An object to configure options.
- * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
- * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
- * one final time after the last throttled-function call. (After the throttled-function has not been called for
- * `delay` milliseconds, the internal counter is reset).
- * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
- * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
- * callback will never executed if both noLeading = true and noTrailing = true.
- * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
- * false (at end), schedule `callback` to execute after `delay` ms.
- *
- * @returns {Function} A new, throttled, function.
- */
- function esm_throttle (delay, callback, options) {
- var _ref = options || {},
- _ref$noTrailing = _ref.noTrailing,
- noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
- _ref$noLeading = _ref.noLeading,
- noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
- _ref$debounceMode = _ref.debounceMode,
- debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
- /*
- * After wrapper has stopped being called, this timeout ensures that
- * `callback` is executed at the proper times in `throttle` and `end`
- * debounce modes.
- */
- var timeoutID;
- var cancelled = false;
- // Keep track of the last time `callback` was executed.
- var lastExec = 0;
- // Function to clear existing timeout
- function clearExistingTimeout() {
- if (timeoutID) {
- clearTimeout(timeoutID);
- }
- }
- // Function to cancel next exec
- function cancel(options) {
- var _ref2 = options || {},
- _ref2$upcomingOnly = _ref2.upcomingOnly,
- upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
- clearExistingTimeout();
- cancelled = !upcomingOnly;
- }
- /*
- * The `wrapper` function encapsulates all of the throttling / debouncing
- * functionality and when executed will limit the rate at which `callback`
- * is executed.
- */
- function wrapper() {
- for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
- arguments_[_key] = arguments[_key];
- }
- var self = this;
- var elapsed = Date.now() - lastExec;
- if (cancelled) {
- return;
- }
- // Execute `callback` and update the `lastExec` timestamp.
- function exec() {
- lastExec = Date.now();
- callback.apply(self, arguments_);
- }
- /*
- * If `debounceMode` is true (at begin) this is used to clear the flag
- * to allow future `callback` executions.
- */
- function clear() {
- timeoutID = undefined;
- }
- if (!noLeading && debounceMode && !timeoutID) {
- /*
- * Since `wrapper` is being called for the first time and
- * `debounceMode` is true (at begin), execute `callback`
- * and noLeading != true.
- */
- exec();
- }
- clearExistingTimeout();
- if (debounceMode === undefined && elapsed > delay) {
- if (noLeading) {
- /*
- * In throttle mode with noLeading, if `delay` time has
- * been exceeded, update `lastExec` and schedule `callback`
- * to execute after `delay` ms.
- */
- lastExec = Date.now();
- if (!noTrailing) {
- timeoutID = setTimeout(debounceMode ? clear : exec, delay);
- }
- } else {
- /*
- * In throttle mode without noLeading, if `delay` time has been exceeded, execute
- * `callback`.
- */
- exec();
- }
- } else if (noTrailing !== true) {
- /*
- * In trailing throttle mode, since `delay` time has not been
- * exceeded, schedule `callback` to execute `delay` ms after most
- * recent execution.
- *
- * If `debounceMode` is true (at begin), schedule `clear` to execute
- * after `delay` ms.
- *
- * If `debounceMode` is false (at end), schedule `callback` to
- * execute after `delay` ms.
- */
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
- }
- }
- wrapper.cancel = cancel;
- // Return the wrapper function.
- return wrapper;
- }
- /* eslint-disable no-undefined */
- /**
- * Debounce execution of a function. Debouncing, unlike throttling,
- * guarantees that a function is only executed a single time, either at the
- * very beginning of a series of calls, or at the very end.
- *
- * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
- * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
- * to `callback` when the debounced-function is executed.
- * @param {object} [options] - An object to configure options.
- * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
- * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
- * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
- *
- * @returns {Function} A new, debounced function.
- */
- function debounce (delay, callback, options) {
- var _ref = options || {},
- _ref$atBegin = _ref.atBegin,
- atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
- return esm_throttle(delay, callback, {
- debounceMode: atBegin !== false
- });
- }
- //# sourceMappingURL=index.js.map
- ;// ./node_modules/@ant-design/react-slick/es/default-props.js
- var defaultProps = {
- accessibility: true,
- adaptiveHeight: false,
- afterChange: null,
- appendDots: function appendDots(dots) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
- style: {
- display: "block"
- }
- }, dots);
- },
- arrows: true,
- autoplay: false,
- autoplaySpeed: 3000,
- beforeChange: null,
- centerMode: false,
- centerPadding: "50px",
- className: "",
- cssEase: "ease",
- customPaging: function customPaging(i) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", null, i + 1);
- },
- dots: false,
- dotsClass: "slick-dots",
- draggable: true,
- easing: "linear",
- edgeFriction: 0.35,
- fade: false,
- focusOnSelect: false,
- infinite: true,
- initialSlide: 0,
- lazyLoad: null,
- nextArrow: null,
- onEdge: null,
- onInit: null,
- onLazyLoadError: null,
- onReInit: null,
- pauseOnDotsHover: false,
- pauseOnFocus: false,
- pauseOnHover: true,
- prevArrow: null,
- responsive: null,
- rows: 1,
- rtl: false,
- slide: "div",
- slidesPerRow: 1,
- slidesToScroll: 1,
- slidesToShow: 1,
- speed: 500,
- swipe: true,
- swipeEvent: null,
- swipeToSlide: false,
- touchMove: true,
- touchThreshold: 5,
- useCSS: true,
- useTransform: true,
- variableWidth: false,
- vertical: false,
- waitForAnimate: true,
- asNavFor: null
- };
- /* harmony default export */ var default_props = (defaultProps);
- ;// ./node_modules/@ant-design/react-slick/es/utils/innerSliderUtils.js
- function clamp(number, lowerBound, upperBound) {
- return Math.max(lowerBound, Math.min(number, upperBound));
- }
- var safePreventDefault = function safePreventDefault(event) {
- var passiveEvents = ["onTouchStart", "onTouchMove", "onWheel"];
- if (!passiveEvents.includes(event._reactName)) {
- event.preventDefault();
- }
- };
- var getOnDemandLazySlides = function getOnDemandLazySlides(spec) {
- var onDemandSlides = [];
- var startIndex = lazyStartIndex(spec);
- var endIndex = lazyEndIndex(spec);
- for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) {
- if (spec.lazyLoadedList.indexOf(slideIndex) < 0) {
- onDemandSlides.push(slideIndex);
- }
- }
- return onDemandSlides;
- };
- // return list of slides that need to be present
- var getRequiredLazySlides = function getRequiredLazySlides(spec) {
- var requiredSlides = [];
- var startIndex = lazyStartIndex(spec);
- var endIndex = lazyEndIndex(spec);
- for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) {
- requiredSlides.push(slideIndex);
- }
- return requiredSlides;
- };
- // startIndex that needs to be present
- var lazyStartIndex = function lazyStartIndex(spec) {
- return spec.currentSlide - lazySlidesOnLeft(spec);
- };
- var lazyEndIndex = function lazyEndIndex(spec) {
- return spec.currentSlide + lazySlidesOnRight(spec);
- };
- var lazySlidesOnLeft = function lazySlidesOnLeft(spec) {
- return spec.centerMode ? Math.floor(spec.slidesToShow / 2) + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : 0;
- };
- var lazySlidesOnRight = function lazySlidesOnRight(spec) {
- return spec.centerMode ? Math.floor((spec.slidesToShow - 1) / 2) + 1 + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : spec.slidesToShow;
- };
- // get width of an element
- var innerSliderUtils_getWidth = function getWidth(elem) {
- return elem && elem.offsetWidth || 0;
- };
- var getHeight = function getHeight(elem) {
- return elem && elem.offsetHeight || 0;
- };
- var getSwipeDirection = function getSwipeDirection(touchObject) {
- var verticalSwiping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var xDist, yDist, r, swipeAngle;
- xDist = touchObject.startX - touchObject.curX;
- yDist = touchObject.startY - touchObject.curY;
- r = Math.atan2(yDist, xDist);
- swipeAngle = Math.round(r * 180 / Math.PI);
- if (swipeAngle < 0) {
- swipeAngle = 360 - Math.abs(swipeAngle);
- }
- if (swipeAngle <= 45 && swipeAngle >= 0 || swipeAngle <= 360 && swipeAngle >= 315) {
- return "left";
- }
- if (swipeAngle >= 135 && swipeAngle <= 225) {
- return "right";
- }
- if (verticalSwiping === true) {
- if (swipeAngle >= 35 && swipeAngle <= 135) {
- return "up";
- } else {
- return "down";
- }
- }
- return "vertical";
- };
- // whether or not we can go next
- var canGoNext = function canGoNext(spec) {
- var canGo = true;
- if (!spec.infinite) {
- if (spec.centerMode && spec.currentSlide >= spec.slideCount - 1) {
- canGo = false;
- } else if (spec.slideCount <= spec.slidesToShow || spec.currentSlide >= spec.slideCount - spec.slidesToShow) {
- canGo = false;
- }
- }
- return canGo;
- };
- // given an object and a list of keys, return new object with given keys
- var extractObject = function extractObject(spec, keys) {
- var newObject = {};
- keys.forEach(function (key) {
- return newObject[key] = spec[key];
- });
- return newObject;
- };
- // get initialized state
- var initializedState = function initializedState(spec) {
- // spec also contains listRef, trackRef
- var slideCount = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(spec.children);
- var listNode = spec.listRef;
- var listWidth = Math.ceil(innerSliderUtils_getWidth(listNode));
- var trackNode = spec.trackRef && spec.trackRef.node;
- var trackWidth = Math.ceil(innerSliderUtils_getWidth(trackNode));
- var slideWidth;
- if (!spec.vertical) {
- var centerPaddingAdj = spec.centerMode && parseInt(spec.centerPadding) * 2;
- if (typeof spec.centerPadding === "string" && spec.centerPadding.slice(-1) === "%") {
- centerPaddingAdj *= listWidth / 100;
- }
- slideWidth = Math.ceil((listWidth - centerPaddingAdj) / spec.slidesToShow);
- } else {
- slideWidth = listWidth;
- }
- var slideHeight = listNode && getHeight(listNode.querySelector('[data-index="0"]'));
- var listHeight = slideHeight * spec.slidesToShow;
- var currentSlide = spec.currentSlide === undefined ? spec.initialSlide : spec.currentSlide;
- if (spec.rtl && spec.currentSlide === undefined) {
- currentSlide = slideCount - 1 - spec.initialSlide;
- }
- var lazyLoadedList = spec.lazyLoadedList || [];
- var slidesToLoad = getOnDemandLazySlides((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- currentSlide: currentSlide,
- lazyLoadedList: lazyLoadedList
- }));
- lazyLoadedList = lazyLoadedList.concat(slidesToLoad);
- var state = {
- slideCount: slideCount,
- slideWidth: slideWidth,
- listWidth: listWidth,
- trackWidth: trackWidth,
- currentSlide: currentSlide,
- slideHeight: slideHeight,
- listHeight: listHeight,
- lazyLoadedList: lazyLoadedList
- };
- if (spec.autoplaying === null && spec.autoplay) {
- state["autoplaying"] = "playing";
- }
- return state;
- };
- var slideHandler = function slideHandler(spec) {
- var waitForAnimate = spec.waitForAnimate,
- animating = spec.animating,
- fade = spec.fade,
- infinite = spec.infinite,
- index = spec.index,
- slideCount = spec.slideCount,
- lazyLoad = spec.lazyLoad,
- currentSlide = spec.currentSlide,
- centerMode = spec.centerMode,
- slidesToScroll = spec.slidesToScroll,
- slidesToShow = spec.slidesToShow,
- useCSS = spec.useCSS;
- var lazyLoadedList = spec.lazyLoadedList;
- if (waitForAnimate && animating) return {};
- var animationSlide = index,
- finalSlide,
- animationLeft,
- finalLeft;
- var state = {},
- nextState = {};
- var targetSlide = infinite ? index : clamp(index, 0, slideCount - 1);
- if (fade) {
- if (!infinite && (index < 0 || index >= slideCount)) return {};
- if (index < 0) {
- animationSlide = index + slideCount;
- } else if (index >= slideCount) {
- animationSlide = index - slideCount;
- }
- if (lazyLoad && lazyLoadedList.indexOf(animationSlide) < 0) {
- lazyLoadedList = lazyLoadedList.concat(animationSlide);
- }
- state = {
- animating: true,
- currentSlide: animationSlide,
- lazyLoadedList: lazyLoadedList,
- targetSlide: animationSlide
- };
- nextState = {
- animating: false,
- targetSlide: animationSlide
- };
- } else {
- finalSlide = animationSlide;
- if (animationSlide < 0) {
- finalSlide = animationSlide + slideCount;
- if (!infinite) finalSlide = 0;else if (slideCount % slidesToScroll !== 0) finalSlide = slideCount - slideCount % slidesToScroll;
- } else if (!canGoNext(spec) && animationSlide > currentSlide) {
- animationSlide = finalSlide = currentSlide;
- } else if (centerMode && animationSlide >= slideCount) {
- animationSlide = infinite ? slideCount : slideCount - 1;
- finalSlide = infinite ? 0 : slideCount - 1;
- } else if (animationSlide >= slideCount) {
- finalSlide = animationSlide - slideCount;
- if (!infinite) finalSlide = slideCount - slidesToShow;else if (slideCount % slidesToScroll !== 0) finalSlide = 0;
- }
- if (!infinite && animationSlide + slidesToShow >= slideCount) {
- finalSlide = slideCount - slidesToShow;
- }
- animationLeft = getTrackLeft((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- slideIndex: animationSlide
- }));
- finalLeft = getTrackLeft((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- slideIndex: finalSlide
- }));
- if (!infinite) {
- if (animationLeft === finalLeft) animationSlide = finalSlide;
- animationLeft = finalLeft;
- }
- if (lazyLoad) {
- lazyLoadedList = lazyLoadedList.concat(getOnDemandLazySlides((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- currentSlide: animationSlide
- })));
- }
- if (!useCSS) {
- state = {
- currentSlide: finalSlide,
- trackStyle: getTrackCSS((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: finalLeft
- })),
- lazyLoadedList: lazyLoadedList,
- targetSlide: targetSlide
- };
- } else {
- state = {
- animating: true,
- currentSlide: finalSlide,
- trackStyle: getTrackAnimateCSS((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: animationLeft
- })),
- lazyLoadedList: lazyLoadedList,
- targetSlide: targetSlide
- };
- nextState = {
- animating: false,
- currentSlide: finalSlide,
- trackStyle: getTrackCSS((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: finalLeft
- })),
- swipeLeft: null,
- targetSlide: targetSlide
- };
- }
- }
- return {
- state: state,
- nextState: nextState
- };
- };
- var changeSlide = function changeSlide(spec, options) {
- var indexOffset, previousInt, slideOffset, unevenOffset, targetSlide;
- var slidesToScroll = spec.slidesToScroll,
- slidesToShow = spec.slidesToShow,
- slideCount = spec.slideCount,
- currentSlide = spec.currentSlide,
- previousTargetSlide = spec.targetSlide,
- lazyLoad = spec.lazyLoad,
- infinite = spec.infinite;
- unevenOffset = slideCount % slidesToScroll !== 0;
- indexOffset = unevenOffset ? 0 : (slideCount - currentSlide) % slidesToScroll;
- if (options.message === "previous") {
- slideOffset = indexOffset === 0 ? slidesToScroll : slidesToShow - indexOffset;
- targetSlide = currentSlide - slideOffset;
- if (lazyLoad && !infinite) {
- previousInt = currentSlide - slideOffset;
- targetSlide = previousInt === -1 ? slideCount - 1 : previousInt;
- }
- if (!infinite) {
- targetSlide = previousTargetSlide - slidesToScroll;
- }
- } else if (options.message === "next") {
- slideOffset = indexOffset === 0 ? slidesToScroll : indexOffset;
- targetSlide = currentSlide + slideOffset;
- if (lazyLoad && !infinite) {
- targetSlide = (currentSlide + slidesToScroll) % slideCount + indexOffset;
- }
- if (!infinite) {
- targetSlide = previousTargetSlide + slidesToScroll;
- }
- } else if (options.message === "dots") {
- // Click on dots
- targetSlide = options.index * options.slidesToScroll;
- } else if (options.message === "children") {
- // Click on the slides
- targetSlide = options.index;
- if (infinite) {
- var direction = siblingDirection((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- targetSlide: targetSlide
- }));
- if (targetSlide > options.currentSlide && direction === "left") {
- targetSlide = targetSlide - slideCount;
- } else if (targetSlide < options.currentSlide && direction === "right") {
- targetSlide = targetSlide + slideCount;
- }
- }
- } else if (options.message === "index") {
- targetSlide = Number(options.index);
- }
- return targetSlide;
- };
- var keyHandler = function keyHandler(e, accessibility, rtl) {
- if (e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !accessibility) return "";
- if (e.keyCode === 37) return rtl ? "next" : "previous";
- if (e.keyCode === 39) return rtl ? "previous" : "next";
- return "";
- };
- var swipeStart = function swipeStart(e, swipe, draggable) {
- e.target.tagName === "IMG" && safePreventDefault(e);
- if (!swipe || !draggable && e.type.indexOf("mouse") !== -1) return "";
- return {
- dragging: true,
- touchObject: {
- startX: e.touches ? e.touches[0].pageX : e.clientX,
- startY: e.touches ? e.touches[0].pageY : e.clientY,
- curX: e.touches ? e.touches[0].pageX : e.clientX,
- curY: e.touches ? e.touches[0].pageY : e.clientY
- }
- };
- };
- var swipeMove = function swipeMove(e, spec) {
- // spec also contains, trackRef and slideIndex
- var scrolling = spec.scrolling,
- animating = spec.animating,
- vertical = spec.vertical,
- swipeToSlide = spec.swipeToSlide,
- verticalSwiping = spec.verticalSwiping,
- rtl = spec.rtl,
- currentSlide = spec.currentSlide,
- edgeFriction = spec.edgeFriction,
- edgeDragged = spec.edgeDragged,
- onEdge = spec.onEdge,
- swiped = spec.swiped,
- swiping = spec.swiping,
- slideCount = spec.slideCount,
- slidesToScroll = spec.slidesToScroll,
- infinite = spec.infinite,
- touchObject = spec.touchObject,
- swipeEvent = spec.swipeEvent,
- listHeight = spec.listHeight,
- listWidth = spec.listWidth;
- if (scrolling) return;
- if (animating) return safePreventDefault(e);
- if (vertical && swipeToSlide && verticalSwiping) safePreventDefault(e);
- var swipeLeft,
- state = {};
- var curLeft = getTrackLeft(spec);
- touchObject.curX = e.touches ? e.touches[0].pageX : e.clientX;
- touchObject.curY = e.touches ? e.touches[0].pageY : e.clientY;
- touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curX - touchObject.startX, 2)));
- var verticalSwipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2)));
- if (!verticalSwiping && !swiping && verticalSwipeLength > 10) {
- return {
- scrolling: true
- };
- }
- if (verticalSwiping) touchObject.swipeLength = verticalSwipeLength;
- var positionOffset = (!rtl ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1);
- if (verticalSwiping) positionOffset = touchObject.curY > touchObject.startY ? 1 : -1;
- var dotCount = Math.ceil(slideCount / slidesToScroll);
- var swipeDirection = getSwipeDirection(spec.touchObject, verticalSwiping);
- var touchSwipeLength = touchObject.swipeLength;
- if (!infinite) {
- if (currentSlide === 0 && (swipeDirection === "right" || swipeDirection === "down") || currentSlide + 1 >= dotCount && (swipeDirection === "left" || swipeDirection === "up") || !canGoNext(spec) && (swipeDirection === "left" || swipeDirection === "up")) {
- touchSwipeLength = touchObject.swipeLength * edgeFriction;
- if (edgeDragged === false && onEdge) {
- onEdge(swipeDirection);
- state["edgeDragged"] = true;
- }
- }
- }
- if (!swiped && swipeEvent) {
- swipeEvent(swipeDirection);
- state["swiped"] = true;
- }
- if (!vertical) {
- if (!rtl) {
- swipeLeft = curLeft + touchSwipeLength * positionOffset;
- } else {
- swipeLeft = curLeft - touchSwipeLength * positionOffset;
- }
- } else {
- swipeLeft = curLeft + touchSwipeLength * (listHeight / listWidth) * positionOffset;
- }
- if (verticalSwiping) {
- swipeLeft = curLeft + touchSwipeLength * positionOffset;
- }
- state = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, state), {}, {
- touchObject: touchObject,
- swipeLeft: swipeLeft,
- trackStyle: getTrackCSS((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: swipeLeft
- }))
- });
- if (Math.abs(touchObject.curX - touchObject.startX) < Math.abs(touchObject.curY - touchObject.startY) * 0.8) {
- return state;
- }
- if (touchObject.swipeLength > 10) {
- state["swiping"] = true;
- safePreventDefault(e);
- }
- return state;
- };
- var swipeEnd = function swipeEnd(e, spec) {
- var dragging = spec.dragging,
- swipe = spec.swipe,
- touchObject = spec.touchObject,
- listWidth = spec.listWidth,
- touchThreshold = spec.touchThreshold,
- verticalSwiping = spec.verticalSwiping,
- listHeight = spec.listHeight,
- swipeToSlide = spec.swipeToSlide,
- scrolling = spec.scrolling,
- onSwipe = spec.onSwipe,
- targetSlide = spec.targetSlide,
- currentSlide = spec.currentSlide,
- infinite = spec.infinite;
- if (!dragging) {
- if (swipe) safePreventDefault(e);
- return {};
- }
- var minSwipe = verticalSwiping ? listHeight / touchThreshold : listWidth / touchThreshold;
- var swipeDirection = getSwipeDirection(touchObject, verticalSwiping);
- // reset the state of touch related state variables.
- var state = {
- dragging: false,
- edgeDragged: false,
- scrolling: false,
- swiping: false,
- swiped: false,
- swipeLeft: null,
- touchObject: {}
- };
- if (scrolling) {
- return state;
- }
- if (!touchObject.swipeLength) {
- return state;
- }
- if (touchObject.swipeLength > minSwipe) {
- safePreventDefault(e);
- if (onSwipe) {
- onSwipe(swipeDirection);
- }
- var slideCount, newSlide;
- var activeSlide = infinite ? currentSlide : targetSlide;
- switch (swipeDirection) {
- case "left":
- case "up":
- newSlide = activeSlide + getSlideCount(spec);
- slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
- state["currentDirection"] = 0;
- break;
- case "right":
- case "down":
- newSlide = activeSlide - getSlideCount(spec);
- slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
- state["currentDirection"] = 1;
- break;
- default:
- slideCount = activeSlide;
- }
- state["triggerSlideHandler"] = slideCount;
- } else {
- // Adjust the track back to it's original position.
- var currentLeft = getTrackLeft(spec);
- state["trackStyle"] = getTrackAnimateCSS((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: currentLeft
- }));
- }
- return state;
- };
- var getNavigableIndexes = function getNavigableIndexes(spec) {
- var max = spec.infinite ? spec.slideCount * 2 : spec.slideCount;
- var breakpoint = spec.infinite ? spec.slidesToShow * -1 : 0;
- var counter = spec.infinite ? spec.slidesToShow * -1 : 0;
- var indexes = [];
- while (breakpoint < max) {
- indexes.push(breakpoint);
- breakpoint = counter + spec.slidesToScroll;
- counter += Math.min(spec.slidesToScroll, spec.slidesToShow);
- }
- return indexes;
- };
- var checkNavigable = function checkNavigable(spec, index) {
- var navigables = getNavigableIndexes(spec);
- var prevNavigable = 0;
- if (index > navigables[navigables.length - 1]) {
- index = navigables[navigables.length - 1];
- } else {
- for (var n in navigables) {
- if (index < navigables[n]) {
- index = prevNavigable;
- break;
- }
- prevNavigable = navigables[n];
- }
- }
- return index;
- };
- var getSlideCount = function getSlideCount(spec) {
- var centerOffset = spec.centerMode ? spec.slideWidth * Math.floor(spec.slidesToShow / 2) : 0;
- if (spec.swipeToSlide) {
- var swipedSlide;
- var slickList = spec.listRef;
- var slides = slickList.querySelectorAll && slickList.querySelectorAll(".slick-slide") || [];
- Array.from(slides).every(function (slide) {
- if (!spec.vertical) {
- if (slide.offsetLeft - centerOffset + innerSliderUtils_getWidth(slide) / 2 > spec.swipeLeft * -1) {
- swipedSlide = slide;
- return false;
- }
- } else {
- if (slide.offsetTop + getHeight(slide) / 2 > spec.swipeLeft * -1) {
- swipedSlide = slide;
- return false;
- }
- }
- return true;
- });
- if (!swipedSlide) {
- return 0;
- }
- var currentIndex = spec.rtl === true ? spec.slideCount - spec.currentSlide : spec.currentSlide;
- var slidesTraversed = Math.abs(swipedSlide.dataset.index - currentIndex) || 1;
- return slidesTraversed;
- } else {
- return spec.slidesToScroll;
- }
- };
- var checkSpecKeys = function checkSpecKeys(spec, keysArray) {
- return (
- // eslint-disable-next-line no-prototype-builtins
- keysArray.reduce(function (value, key) {
- return value && spec.hasOwnProperty(key);
- }, true) ? null : console.error("Keys Missing:", spec)
- );
- };
- var getTrackCSS = function getTrackCSS(spec) {
- checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth"]);
- var trackWidth, trackHeight;
- if (!spec.vertical) {
- trackWidth = getTotalSlides(spec) * spec.slideWidth;
- } else {
- var trackChildren = spec.unslick ? spec.slideCount : spec.slideCount + 2 * spec.slidesToShow;
- trackHeight = trackChildren * spec.slideHeight;
- }
- var style = {
- opacity: 1,
- transition: "",
- WebkitTransition: ""
- };
- if (spec.useTransform) {
- var WebkitTransform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
- var transform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
- var msTransform = !spec.vertical ? "translateX(" + spec.left + "px)" : "translateY(" + spec.left + "px)";
- style = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), {}, {
- WebkitTransform: WebkitTransform,
- transform: transform,
- msTransform: msTransform
- });
- } else {
- if (spec.vertical) {
- style["top"] = spec.left;
- } else {
- style["left"] = spec.left;
- }
- }
- if (spec.fade) style = {
- opacity: 1
- };
- if (trackWidth) style.width = trackWidth;
- if (trackHeight) style.height = trackHeight;
- // Fallback for IE8
- if (window && !window.addEventListener && window.attachEvent) {
- if (!spec.vertical) {
- style.marginLeft = spec.left + "px";
- } else {
- style.marginTop = spec.left + "px";
- }
- }
- return style;
- };
- var getTrackAnimateCSS = function getTrackAnimateCSS(spec) {
- checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth", "speed", "cssEase"]);
- var style = getTrackCSS(spec);
- // useCSS is true by default so it can be undefined
- if (spec.useTransform) {
- style.WebkitTransition = "-webkit-transform " + spec.speed + "ms " + spec.cssEase;
- style.transition = "transform " + spec.speed + "ms " + spec.cssEase;
- } else {
- if (spec.vertical) {
- style.transition = "top " + spec.speed + "ms " + spec.cssEase;
- } else {
- style.transition = "left " + spec.speed + "ms " + spec.cssEase;
- }
- }
- return style;
- };
- var getTrackLeft = function getTrackLeft(spec) {
- if (spec.unslick) {
- return 0;
- }
- checkSpecKeys(spec, ["slideIndex", "trackRef", "infinite", "centerMode", "slideCount", "slidesToShow", "slidesToScroll", "slideWidth", "listWidth", "variableWidth", "slideHeight"]);
- var slideIndex = spec.slideIndex,
- trackRef = spec.trackRef,
- infinite = spec.infinite,
- centerMode = spec.centerMode,
- slideCount = spec.slideCount,
- slidesToShow = spec.slidesToShow,
- slidesToScroll = spec.slidesToScroll,
- slideWidth = spec.slideWidth,
- listWidth = spec.listWidth,
- variableWidth = spec.variableWidth,
- slideHeight = spec.slideHeight,
- fade = spec.fade,
- vertical = spec.vertical;
- var slideOffset = 0;
- var targetLeft;
- var targetSlide;
- var verticalOffset = 0;
- if (fade || spec.slideCount === 1) {
- return 0;
- }
- var slidesToOffset = 0;
- if (infinite) {
- slidesToOffset = -getPreClones(spec); // bring active slide to the beginning of visual area
- // if next scroll doesn't have enough children, just reach till the end of original slides instead of shifting slidesToScroll children
- if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) {
- slidesToOffset = -(slideIndex > slideCount ? slidesToShow - (slideIndex - slideCount) : slideCount % slidesToScroll);
- }
- // shift current slide to center of the frame
- if (centerMode) {
- slidesToOffset += parseInt(slidesToShow / 2);
- }
- } else {
- if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) {
- slidesToOffset = slidesToShow - slideCount % slidesToScroll;
- }
- if (centerMode) {
- slidesToOffset = parseInt(slidesToShow / 2);
- }
- }
- slideOffset = slidesToOffset * slideWidth;
- verticalOffset = slidesToOffset * slideHeight;
- if (!vertical) {
- targetLeft = slideIndex * slideWidth * -1 + slideOffset;
- } else {
- targetLeft = slideIndex * slideHeight * -1 + verticalOffset;
- }
- if (variableWidth === true) {
- var targetSlideIndex;
- var trackElem = trackRef && trackRef.node;
- targetSlideIndex = slideIndex + getPreClones(spec);
- targetSlide = trackElem && trackElem.childNodes[targetSlideIndex];
- targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0;
- if (centerMode === true) {
- targetSlideIndex = infinite ? slideIndex + getPreClones(spec) : slideIndex;
- targetSlide = trackElem && trackElem.children[targetSlideIndex];
- targetLeft = 0;
- for (var slide = 0; slide < targetSlideIndex; slide++) {
- targetLeft -= trackElem && trackElem.children[slide] && trackElem.children[slide].offsetWidth;
- }
- targetLeft -= parseInt(spec.centerPadding);
- targetLeft += targetSlide && (listWidth - targetSlide.offsetWidth) / 2;
- }
- }
- return targetLeft;
- };
- var getPreClones = function getPreClones(spec) {
- if (spec.unslick || !spec.infinite) {
- return 0;
- }
- if (spec.variableWidth) {
- return spec.slideCount;
- }
- return spec.slidesToShow + (spec.centerMode ? 1 : 0);
- };
- var getPostClones = function getPostClones(spec) {
- if (spec.unslick || !spec.infinite) {
- return 0;
- }
- return spec.slideCount;
- };
- var getTotalSlides = function getTotalSlides(spec) {
- return spec.slideCount === 1 ? 1 : getPreClones(spec) + spec.slideCount + getPostClones(spec);
- };
- var siblingDirection = function siblingDirection(spec) {
- if (spec.targetSlide > spec.currentSlide) {
- if (spec.targetSlide > spec.currentSlide + slidesOnRight(spec)) {
- return "left";
- }
- return "right";
- } else {
- if (spec.targetSlide < spec.currentSlide - slidesOnLeft(spec)) {
- return "right";
- }
- return "left";
- }
- };
- var slidesOnRight = function slidesOnRight(_ref) {
- var slidesToShow = _ref.slidesToShow,
- centerMode = _ref.centerMode,
- rtl = _ref.rtl,
- centerPadding = _ref.centerPadding;
- // returns no of slides on the right of active slide
- if (centerMode) {
- var right = (slidesToShow - 1) / 2 + 1;
- if (parseInt(centerPadding) > 0) right += 1;
- if (rtl && slidesToShow % 2 === 0) right += 1;
- return right;
- }
- if (rtl) {
- return 0;
- }
- return slidesToShow - 1;
- };
- var slidesOnLeft = function slidesOnLeft(_ref2) {
- var slidesToShow = _ref2.slidesToShow,
- centerMode = _ref2.centerMode,
- rtl = _ref2.rtl,
- centerPadding = _ref2.centerPadding;
- // returns no of slides on the left of active slide
- if (centerMode) {
- var left = (slidesToShow - 1) / 2 + 1;
- if (parseInt(centerPadding) > 0) left += 1;
- if (!rtl && slidesToShow % 2 === 0) left += 1;
- return left;
- }
- if (rtl) {
- return slidesToShow - 1;
- }
- return 0;
- };
- var canUseDOM = function canUseDOM() {
- return !!(typeof window !== "undefined" && window.document && window.document.createElement);
- };
- var validSettings = Object.keys(default_props);
- function filterSettings(settings) {
- return validSettings.reduce(function (acc, settingName) {
- if (settings.hasOwnProperty(settingName)) {
- acc[settingName] = settings[settingName];
- }
- return acc;
- }, {});
- }
- ;// ./node_modules/@ant-design/react-slick/es/track.js
- function track_callSuper(t, o, e) { return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e)); }
- // given specifications/props for a slide, fetch all the classes that need to be applied to the slide
- var getSlideClasses = function getSlideClasses(spec) {
- var slickActive, slickCenter, slickCloned;
- var centerOffset, index;
- if (spec.rtl) {
- index = spec.slideCount - 1 - spec.index;
- } else {
- index = spec.index;
- }
- slickCloned = index < 0 || index >= spec.slideCount;
- if (spec.centerMode) {
- centerOffset = Math.floor(spec.slidesToShow / 2);
- slickCenter = (index - spec.currentSlide) % spec.slideCount === 0;
- if (index > spec.currentSlide - centerOffset - 1 && index <= spec.currentSlide + centerOffset) {
- slickActive = true;
- }
- } else {
- slickActive = spec.currentSlide <= index && index < spec.currentSlide + spec.slidesToShow;
- }
- var focusedSlide;
- if (spec.targetSlide < 0) {
- focusedSlide = spec.targetSlide + spec.slideCount;
- } else if (spec.targetSlide >= spec.slideCount) {
- focusedSlide = spec.targetSlide - spec.slideCount;
- } else {
- focusedSlide = spec.targetSlide;
- }
- var slickCurrent = index === focusedSlide;
- return {
- "slick-slide": true,
- "slick-active": slickActive,
- "slick-center": slickCenter,
- "slick-cloned": slickCloned,
- "slick-current": slickCurrent // dubious in case of RTL
- };
- };
- var getSlideStyle = function getSlideStyle(spec) {
- var style = {};
- if (spec.variableWidth === undefined || spec.variableWidth === false) {
- style.width = spec.slideWidth;
- }
- if (spec.fade) {
- style.position = "relative";
- if (spec.vertical && spec.slideHeight) {
- style.top = -spec.index * parseInt(spec.slideHeight);
- } else {
- style.left = -spec.index * parseInt(spec.slideWidth);
- }
- style.opacity = spec.currentSlide === spec.index ? 1 : 0;
- style.zIndex = spec.currentSlide === spec.index ? 999 : 998;
- if (spec.useCSS) {
- style.transition = "opacity " + spec.speed + "ms " + spec.cssEase + ", " + "visibility " + spec.speed + "ms " + spec.cssEase;
- }
- }
- return style;
- };
- var track_getKey = function getKey(child, fallbackKey) {
- return child.key + "-" + fallbackKey;
- };
- var renderSlides = function renderSlides(spec) {
- var key;
- var slides = [];
- var preCloneSlides = [];
- var postCloneSlides = [];
- var childrenCount = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(spec.children);
- var startIndex = lazyStartIndex(spec);
- var endIndex = lazyEndIndex(spec);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.forEach(spec.children, function (elem, index) {
- var child;
- var childOnClickOptions = {
- message: "children",
- index: index,
- slidesToScroll: spec.slidesToScroll,
- currentSlide: spec.currentSlide
- };
- // in case of lazyLoad, whether or not we want to fetch the slide
- if (!spec.lazyLoad || spec.lazyLoad && spec.lazyLoadedList.indexOf(index) >= 0) {
- child = elem;
- } else {
- child = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", null);
- }
- var childStyle = getSlideStyle((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- index: index
- }));
- var slideClass = child.props.className || "";
- var slideClasses = getSlideClasses((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- index: index
- }));
- // push a cloned element of the desired slide
- slides.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, {
- key: "original" + track_getKey(child, index),
- "data-index": index,
- className: classnames_default()(slideClasses, slideClass),
- tabIndex: "-1",
- "aria-hidden": !slideClasses["slick-active"],
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({
- outline: "none"
- }, child.props.style || {}), childStyle),
- onClick: function onClick(e) {
- child.props && child.props.onClick && child.props.onClick(e);
- if (spec.focusOnSelect) {
- spec.focusOnSelect(childOnClickOptions);
- }
- }
- }));
- // if slide needs to be precloned or postcloned
- if (spec.infinite && childrenCount > 1 && spec.fade === false && !spec.unslick) {
- var preCloneNo = childrenCount - index;
- if (preCloneNo <= getPreClones(spec)) {
- key = -preCloneNo;
- if (key >= startIndex) {
- child = elem;
- }
- slideClasses = getSlideClasses((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- index: key
- }));
- preCloneSlides.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, {
- key: "precloned" + track_getKey(child, key),
- "data-index": key,
- tabIndex: "-1",
- className: classnames_default()(slideClasses, slideClass),
- "aria-hidden": !slideClasses["slick-active"],
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, child.props.style || {}), childStyle),
- onClick: function onClick(e) {
- child.props && child.props.onClick && child.props.onClick(e);
- if (spec.focusOnSelect) {
- spec.focusOnSelect(childOnClickOptions);
- }
- }
- }));
- }
- key = childrenCount + index;
- if (key < endIndex) {
- child = elem;
- }
- slideClasses = getSlideClasses((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- index: key
- }));
- postCloneSlides.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(child, {
- key: "postcloned" + track_getKey(child, key),
- "data-index": key,
- tabIndex: "-1",
- className: classnames_default()(slideClasses, slideClass),
- "aria-hidden": !slideClasses["slick-active"],
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, child.props.style || {}), childStyle),
- onClick: function onClick(e) {
- child.props && child.props.onClick && child.props.onClick(e);
- if (spec.focusOnSelect) {
- spec.focusOnSelect(childOnClickOptions);
- }
- }
- }));
- }
- });
- if (spec.rtl) {
- return preCloneSlides.concat(slides, postCloneSlides).reverse();
- } else {
- return preCloneSlides.concat(slides, postCloneSlides);
- }
- };
- var Track = /*#__PURE__*/function (_React$PureComponent) {
- function Track() {
- var _this;
- (0,classCallCheck["default"])(this, Track);
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _this = track_callSuper(this, Track, [].concat(args));
- (0,defineProperty["default"])(_this, "node", null);
- (0,defineProperty["default"])(_this, "handleRef", function (ref) {
- _this.node = ref;
- });
- return _this;
- }
- (0,inherits["default"])(Track, _React$PureComponent);
- return (0,createClass["default"])(Track, [{
- key: "render",
- value: function render() {
- var slides = renderSlides(this.props);
- var _this$props = this.props,
- onMouseEnter = _this$props.onMouseEnter,
- onMouseOver = _this$props.onMouseOver,
- onMouseLeave = _this$props.onMouseLeave;
- var mouseEvents = {
- onMouseEnter: onMouseEnter,
- onMouseOver: onMouseOver,
- onMouseLeave: onMouseLeave
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- ref: this.handleRef,
- className: "slick-track",
- style: this.props.trackStyle
- }, mouseEvents), slides);
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent);
- ;// ./node_modules/@ant-design/react-slick/es/dots.js
- function dots_callSuper(t, o, e) { return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e)); }
- var getDotCount = function getDotCount(spec) {
- var dots;
- if (spec.infinite) {
- dots = Math.ceil(spec.slideCount / spec.slidesToScroll);
- } else {
- dots = Math.ceil((spec.slideCount - spec.slidesToShow) / spec.slidesToScroll) + 1;
- }
- return dots;
- };
- var Dots = /*#__PURE__*/function (_React$PureComponent) {
- function Dots() {
- (0,classCallCheck["default"])(this, Dots);
- return dots_callSuper(this, Dots, arguments);
- }
- (0,inherits["default"])(Dots, _React$PureComponent);
- return (0,createClass["default"])(Dots, [{
- key: "clickHandler",
- value: function clickHandler(options, e) {
- // In Autoplay the focus stays on clicked button even after transition
- // to next slide. That only goes away by click somewhere outside
- e.preventDefault();
- this.props.clickHandler(options);
- }
- }, {
- key: "render",
- value: function render() {
- var _this$props = this.props,
- onMouseEnter = _this$props.onMouseEnter,
- onMouseOver = _this$props.onMouseOver,
- onMouseLeave = _this$props.onMouseLeave,
- infinite = _this$props.infinite,
- slidesToScroll = _this$props.slidesToScroll,
- slidesToShow = _this$props.slidesToShow,
- slideCount = _this$props.slideCount,
- currentSlide = _this$props.currentSlide;
- var dotCount = getDotCount({
- slideCount: slideCount,
- slidesToScroll: slidesToScroll,
- slidesToShow: slidesToShow,
- infinite: infinite
- });
- var mouseEvents = {
- onMouseEnter: onMouseEnter,
- onMouseOver: onMouseOver,
- onMouseLeave: onMouseLeave
- };
- var dots = [];
- for (var i = 0; i < dotCount; i++) {
- var _rightBound = (i + 1) * slidesToScroll - 1;
- var rightBound = infinite ? _rightBound : clamp(_rightBound, 0, slideCount - 1);
- var _leftBound = rightBound - (slidesToScroll - 1);
- var leftBound = infinite ? _leftBound : clamp(_leftBound, 0, slideCount - 1);
- var className = classnames_default()({
- "slick-active": infinite ? currentSlide >= leftBound && currentSlide <= rightBound : currentSlide === leftBound
- });
- var dotOptions = {
- message: "dots",
- index: i,
- slidesToScroll: slidesToScroll,
- currentSlide: currentSlide
- };
- var onClick = this.clickHandler.bind(this, dotOptions);
- dots = dots.concat( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- key: i,
- className: className
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(this.props.customPaging(i), {
- onClick: onClick
- })));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(this.props.appendDots(dots), (0,objectSpread2["default"])({
- className: this.props.dotsClass
- }, mouseEvents));
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent);
- ;// ./node_modules/@ant-design/react-slick/es/arrows.js
- function arrows_callSuper(t, o, e) { return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e)); }
- var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
- function PrevArrow() {
- (0,classCallCheck["default"])(this, PrevArrow);
- return arrows_callSuper(this, PrevArrow, arguments);
- }
- (0,inherits["default"])(PrevArrow, _React$PureComponent);
- return (0,createClass["default"])(PrevArrow, [{
- key: "clickHandler",
- value: function clickHandler(options, e) {
- if (e) {
- e.preventDefault();
- }
- this.props.clickHandler(options, e);
- }
- }, {
- key: "render",
- value: function render() {
- var prevClasses = {
- "slick-arrow": true,
- "slick-prev": true
- };
- var prevHandler = this.clickHandler.bind(this, {
- message: "previous"
- });
- if (!this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow)) {
- prevClasses["slick-disabled"] = true;
- prevHandler = null;
- }
- var prevArrowProps = {
- key: "0",
- "data-role": "none",
- className: classnames_default()(prevClasses),
- style: {
- display: "block"
- },
- onClick: prevHandler
- };
- var customProps = {
- currentSlide: this.props.currentSlide,
- slideCount: this.props.slideCount
- };
- var prevArrow;
- if (this.props.prevArrow) {
- prevArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(this.props.prevArrow, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, prevArrowProps), customProps));
- } else {
- prevArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", (0,esm_extends["default"])({
- key: "0",
- type: "button"
- }, prevArrowProps), " ", "Previous");
- }
- return prevArrow;
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent);
- var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
- function NextArrow() {
- (0,classCallCheck["default"])(this, NextArrow);
- return arrows_callSuper(this, NextArrow, arguments);
- }
- (0,inherits["default"])(NextArrow, _React$PureComponent2);
- return (0,createClass["default"])(NextArrow, [{
- key: "clickHandler",
- value: function clickHandler(options, e) {
- if (e) {
- e.preventDefault();
- }
- this.props.clickHandler(options, e);
- }
- }, {
- key: "render",
- value: function render() {
- var nextClasses = {
- "slick-arrow": true,
- "slick-next": true
- };
- var nextHandler = this.clickHandler.bind(this, {
- message: "next"
- });
- if (!canGoNext(this.props)) {
- nextClasses["slick-disabled"] = true;
- nextHandler = null;
- }
- var nextArrowProps = {
- key: "1",
- "data-role": "none",
- className: classnames_default()(nextClasses),
- style: {
- display: "block"
- },
- onClick: nextHandler
- };
- var customProps = {
- currentSlide: this.props.currentSlide,
- slideCount: this.props.slideCount
- };
- var nextArrow;
- if (this.props.nextArrow) {
- nextArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(this.props.nextArrow, (0,objectSpread2["default"])((0,objectSpread2["default"])({}, nextArrowProps), customProps));
- } else {
- nextArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", (0,esm_extends["default"])({
- key: "1",
- type: "button"
- }, nextArrowProps), " ", "Next");
- }
- return nextArrow;
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent);
- ;// ./node_modules/@ant-design/react-slick/es/inner-slider.js
- var inner_slider_excluded = ["animating"];
- function inner_slider_callSuper(t, o, e) { return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e)); }
- var InnerSlider = /*#__PURE__*/function (_React$Component) {
- function InnerSlider(props) {
- var _this;
- (0,classCallCheck["default"])(this, InnerSlider);
- _this = inner_slider_callSuper(this, InnerSlider, [props]);
- (0,defineProperty["default"])(_this, "listRefHandler", function (ref) {
- return _this.list = ref;
- });
- (0,defineProperty["default"])(_this, "trackRefHandler", function (ref) {
- return _this.track = ref;
- });
- (0,defineProperty["default"])(_this, "adaptHeight", function () {
- if (_this.props.adaptiveHeight && _this.list) {
- var elem = _this.list.querySelector("[data-index=\"".concat(_this.state.currentSlide, "\"]"));
- _this.list.style.height = getHeight(elem) + "px";
- }
- });
- (0,defineProperty["default"])(_this, "componentDidMount", function () {
- _this.props.onInit && _this.props.onInit();
- if (_this.props.lazyLoad) {
- var slidesToLoad = getOnDemandLazySlides((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state));
- if (slidesToLoad.length > 0) {
- _this.setState(function (prevState) {
- return {
- lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad)
- };
- });
- if (_this.props.onLazyLoad) {
- _this.props.onLazyLoad(slidesToLoad);
- }
- }
- }
- var spec = (0,objectSpread2["default"])({
- listRef: _this.list,
- trackRef: _this.track
- }, _this.props);
- _this.updateState(spec, true, function () {
- _this.adaptHeight();
- _this.props.autoplay && _this.autoPlay("playing");
- });
- if (_this.props.lazyLoad === "progressive") {
- _this.lazyLoadTimer = setInterval(_this.progressiveLazyLoad, 1000);
- }
- _this.ro = new ResizeObserver_es(function () {
- if (_this.state.animating) {
- _this.onWindowResized(false); // don't set trackStyle hence don't break animation
- _this.callbackTimers.push(setTimeout(function () {
- return _this.onWindowResized();
- }, _this.props.speed));
- } else {
- _this.onWindowResized();
- }
- });
- _this.ro.observe(_this.list);
- document.querySelectorAll && Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"), function (slide) {
- slide.onfocus = _this.props.pauseOnFocus ? _this.onSlideFocus : null;
- slide.onblur = _this.props.pauseOnFocus ? _this.onSlideBlur : null;
- });
- if (window.addEventListener) {
- window.addEventListener("resize", _this.onWindowResized);
- } else {
- window.attachEvent("onresize", _this.onWindowResized);
- }
- });
- (0,defineProperty["default"])(_this, "componentWillUnmount", function () {
- if (_this.animationEndCallback) {
- clearTimeout(_this.animationEndCallback);
- }
- if (_this.lazyLoadTimer) {
- clearInterval(_this.lazyLoadTimer);
- }
- if (_this.callbackTimers.length) {
- _this.callbackTimers.forEach(function (timer) {
- return clearTimeout(timer);
- });
- _this.callbackTimers = [];
- }
- if (window.addEventListener) {
- window.removeEventListener("resize", _this.onWindowResized);
- } else {
- window.detachEvent("onresize", _this.onWindowResized);
- }
- if (_this.autoplayTimer) {
- clearInterval(_this.autoplayTimer);
- }
- _this.ro.disconnect();
- });
- (0,defineProperty["default"])(_this, "componentDidUpdate", function (prevProps) {
- _this.checkImagesLoad();
- _this.props.onReInit && _this.props.onReInit();
- if (_this.props.lazyLoad) {
- var slidesToLoad = getOnDemandLazySlides((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state));
- if (slidesToLoad.length > 0) {
- _this.setState(function (prevState) {
- return {
- lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad)
- };
- });
- if (_this.props.onLazyLoad) {
- _this.props.onLazyLoad(slidesToLoad);
- }
- }
- }
- // if (this.props.onLazyLoad) {
- // this.props.onLazyLoad([leftMostSlide])
- // }
- _this.adaptHeight();
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({
- listRef: _this.list,
- trackRef: _this.track
- }, _this.props), _this.state);
- var setTrackStyle = _this.didPropsChange(prevProps);
- setTrackStyle && _this.updateState(spec, setTrackStyle, function () {
- if (_this.state.currentSlide >= external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(_this.props.children)) {
- _this.changeSlide({
- message: "index",
- index: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(_this.props.children) - _this.props.slidesToShow,
- currentSlide: _this.state.currentSlide
- });
- }
- if (prevProps.autoplay !== _this.props.autoplay || prevProps.autoplaySpeed !== _this.props.autoplaySpeed) {
- if (!prevProps.autoplay && _this.props.autoplay) {
- _this.autoPlay("playing");
- } else if (_this.props.autoplay) {
- _this.autoPlay("update");
- } else {
- _this.pause("paused");
- }
- }
- });
- });
- (0,defineProperty["default"])(_this, "onWindowResized", function (setTrackStyle) {
- if (_this.debouncedResize) _this.debouncedResize.cancel();
- _this.debouncedResize = debounce(50, function () {
- return _this.resizeWindow(setTrackStyle);
- });
- _this.debouncedResize();
- });
- (0,defineProperty["default"])(_this, "resizeWindow", function () {
- var setTrackStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- var isTrackMounted = Boolean(_this.track && _this.track.node);
- // prevent warning: setting state on unmounted component (server side rendering)
- if (!isTrackMounted) return;
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({
- listRef: _this.list,
- trackRef: _this.track
- }, _this.props), _this.state);
- _this.updateState(spec, setTrackStyle, function () {
- if (_this.props.autoplay) _this.autoPlay("update");else _this.pause("paused");
- });
- // animating state should be cleared while resizing, otherwise autoplay stops working
- _this.setState({
- animating: false
- });
- clearTimeout(_this.animationEndCallback);
- delete _this.animationEndCallback;
- });
- (0,defineProperty["default"])(_this, "updateState", function (spec, setTrackStyle, callback) {
- var updatedState = initializedState(spec);
- spec = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), updatedState), {}, {
- slideIndex: updatedState.currentSlide
- });
- var targetLeft = getTrackLeft(spec);
- spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, spec), {}, {
- left: targetLeft
- });
- var trackStyle = getTrackCSS(spec);
- if (setTrackStyle || external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(_this.props.children) !== external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(spec.children)) {
- updatedState["trackStyle"] = trackStyle;
- }
- _this.setState(updatedState, callback);
- });
- (0,defineProperty["default"])(_this, "ssrInit", function () {
- if (_this.props.variableWidth) {
- var _trackWidth = 0,
- _trackLeft = 0;
- var childrenWidths = [];
- var preClones = getPreClones((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state), {}, {
- slideCount: _this.props.children.length
- }));
- var postClones = getPostClones((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state), {}, {
- slideCount: _this.props.children.length
- }));
- _this.props.children.forEach(function (child) {
- childrenWidths.push(child.props.style.width);
- _trackWidth += child.props.style.width;
- });
- for (var i = 0; i < preClones; i++) {
- _trackLeft += childrenWidths[childrenWidths.length - 1 - i];
- _trackWidth += childrenWidths[childrenWidths.length - 1 - i];
- }
- for (var _i = 0; _i < postClones; _i++) {
- _trackWidth += childrenWidths[_i];
- }
- for (var _i2 = 0; _i2 < _this.state.currentSlide; _i2++) {
- _trackLeft += childrenWidths[_i2];
- }
- var _trackStyle = {
- width: _trackWidth + "px",
- left: -_trackLeft + "px"
- };
- if (_this.props.centerMode) {
- var currentWidth = "".concat(childrenWidths[_this.state.currentSlide], "px");
- _trackStyle.left = "calc(".concat(_trackStyle.left, " + (100% - ").concat(currentWidth, ") / 2 ) ");
- }
- return {
- trackStyle: _trackStyle
- };
- }
- var childrenCount = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(_this.props.children);
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state), {}, {
- slideCount: childrenCount
- });
- var slideCount = getPreClones(spec) + getPostClones(spec) + childrenCount;
- var trackWidth = 100 / _this.props.slidesToShow * slideCount;
- var slideWidth = 100 / slideCount;
- var trackLeft = -slideWidth * (getPreClones(spec) + _this.state.currentSlide) * trackWidth / 100;
- if (_this.props.centerMode) {
- trackLeft += (100 - slideWidth * trackWidth / 100) / 2;
- }
- var trackStyle = {
- width: trackWidth + "%",
- left: trackLeft + "%"
- };
- return {
- slideWidth: slideWidth + "%",
- trackStyle: trackStyle
- };
- });
- (0,defineProperty["default"])(_this, "checkImagesLoad", function () {
- var images = _this.list && _this.list.querySelectorAll && _this.list.querySelectorAll(".slick-slide img") || [];
- var imagesCount = images.length,
- loadedCount = 0;
- Array.prototype.forEach.call(images, function (image) {
- var handler = function handler() {
- return ++loadedCount && loadedCount >= imagesCount && _this.onWindowResized();
- };
- if (!image.onclick) {
- image.onclick = function () {
- return image.parentNode.focus();
- };
- } else {
- var prevClickHandler = image.onclick;
- image.onclick = function (e) {
- prevClickHandler(e);
- image.parentNode.focus();
- };
- }
- if (!image.onload) {
- if (_this.props.lazyLoad) {
- image.onload = function () {
- _this.adaptHeight();
- _this.callbackTimers.push(setTimeout(_this.onWindowResized, _this.props.speed));
- };
- } else {
- image.onload = handler;
- image.onerror = function () {
- handler();
- _this.props.onLazyLoadError && _this.props.onLazyLoadError();
- };
- }
- }
- });
- });
- (0,defineProperty["default"])(_this, "progressiveLazyLoad", function () {
- var slidesToLoad = [];
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state);
- for (var index = _this.state.currentSlide; index < _this.state.slideCount + getPostClones(spec); index++) {
- if (_this.state.lazyLoadedList.indexOf(index) < 0) {
- slidesToLoad.push(index);
- break;
- }
- }
- for (var _index = _this.state.currentSlide - 1; _index >= -getPreClones(spec); _index--) {
- if (_this.state.lazyLoadedList.indexOf(_index) < 0) {
- slidesToLoad.push(_index);
- break;
- }
- }
- if (slidesToLoad.length > 0) {
- _this.setState(function (state) {
- return {
- lazyLoadedList: state.lazyLoadedList.concat(slidesToLoad)
- };
- });
- if (_this.props.onLazyLoad) {
- _this.props.onLazyLoad(slidesToLoad);
- }
- } else {
- if (_this.lazyLoadTimer) {
- clearInterval(_this.lazyLoadTimer);
- delete _this.lazyLoadTimer;
- }
- }
- });
- (0,defineProperty["default"])(_this, "slideHandler", function (index) {
- var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var _this$props = _this.props,
- asNavFor = _this$props.asNavFor,
- beforeChange = _this$props.beforeChange,
- onLazyLoad = _this$props.onLazyLoad,
- speed = _this$props.speed,
- afterChange = _this$props.afterChange;
- // capture currentslide before state is updated
- var currentSlide = _this.state.currentSlide;
- var _slideHandler = slideHandler((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({
- index: index
- }, _this.props), _this.state), {}, {
- trackRef: _this.track,
- useCSS: _this.props.useCSS && !dontAnimate
- })),
- state = _slideHandler.state,
- nextState = _slideHandler.nextState;
- if (!state) return;
- beforeChange && beforeChange(currentSlide, state.currentSlide);
- var slidesToLoad = state.lazyLoadedList.filter(function (value) {
- return _this.state.lazyLoadedList.indexOf(value) < 0;
- });
- onLazyLoad && slidesToLoad.length > 0 && onLazyLoad(slidesToLoad);
- if (!_this.props.waitForAnimate && _this.animationEndCallback) {
- clearTimeout(_this.animationEndCallback);
- afterChange && afterChange(currentSlide);
- delete _this.animationEndCallback;
- }
- _this.setState(state, function () {
- // asNavForIndex check is to avoid recursive calls of slideHandler in waitForAnimate=false mode
- if (asNavFor && _this.asNavForIndex !== index) {
- _this.asNavForIndex = index;
- asNavFor.innerSlider.slideHandler(index);
- }
- if (!nextState) return;
- _this.animationEndCallback = setTimeout(function () {
- var animating = nextState.animating,
- firstBatch = (0,objectWithoutProperties["default"])(nextState, inner_slider_excluded);
- _this.setState(firstBatch, function () {
- _this.callbackTimers.push(setTimeout(function () {
- return _this.setState({
- animating: animating
- });
- }, 10));
- afterChange && afterChange(state.currentSlide);
- delete _this.animationEndCallback;
- });
- }, speed);
- });
- });
- (0,defineProperty["default"])(_this, "changeSlide", function (options) {
- var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state);
- var targetSlide = changeSlide(spec, options);
- if (targetSlide !== 0 && !targetSlide) return;
- if (dontAnimate === true) {
- _this.slideHandler(targetSlide, dontAnimate);
- } else {
- _this.slideHandler(targetSlide);
- }
- _this.props.autoplay && _this.autoPlay("update");
- if (_this.props.focusOnSelect) {
- var nodes = _this.list.querySelectorAll(".slick-current");
- nodes[0] && nodes[0].focus();
- }
- });
- (0,defineProperty["default"])(_this, "clickHandler", function (e) {
- if (_this.clickable === false) {
- e.stopPropagation();
- e.preventDefault();
- }
- _this.clickable = true;
- });
- (0,defineProperty["default"])(_this, "keyHandler", function (e) {
- var dir = keyHandler(e, _this.props.accessibility, _this.props.rtl);
- dir !== "" && _this.changeSlide({
- message: dir
- });
- });
- (0,defineProperty["default"])(_this, "selectHandler", function (options) {
- _this.changeSlide(options);
- });
- (0,defineProperty["default"])(_this, "disableBodyScroll", function () {
- var preventDefault = function preventDefault(e) {
- e = e || window.event;
- if (e.preventDefault) e.preventDefault();
- e.returnValue = false;
- };
- window.ontouchmove = preventDefault;
- });
- (0,defineProperty["default"])(_this, "enableBodyScroll", function () {
- window.ontouchmove = null;
- });
- (0,defineProperty["default"])(_this, "swipeStart", function (e) {
- if (_this.props.verticalSwiping) {
- _this.disableBodyScroll();
- }
- var state = swipeStart(e, _this.props.swipe, _this.props.draggable);
- state !== "" && _this.setState(state);
- });
- (0,defineProperty["default"])(_this, "swipeMove", function (e) {
- var state = swipeMove(e, (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state), {}, {
- trackRef: _this.track,
- listRef: _this.list,
- slideIndex: _this.state.currentSlide
- }));
- if (!state) return;
- if (state["swiping"]) {
- _this.clickable = false;
- }
- _this.setState(state);
- });
- (0,defineProperty["default"])(_this, "swipeEnd", function (e) {
- var state = swipeEnd(e, (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state), {}, {
- trackRef: _this.track,
- listRef: _this.list,
- slideIndex: _this.state.currentSlide
- }));
- if (!state) return;
- var triggerSlideHandler = state["triggerSlideHandler"];
- delete state["triggerSlideHandler"];
- _this.setState(state);
- if (triggerSlideHandler === undefined) return;
- _this.slideHandler(triggerSlideHandler);
- if (_this.props.verticalSwiping) {
- _this.enableBodyScroll();
- }
- });
- (0,defineProperty["default"])(_this, "touchEnd", function (e) {
- _this.swipeEnd(e);
- _this.clickable = true;
- });
- (0,defineProperty["default"])(_this, "slickPrev", function () {
- // this and fellow methods are wrapped in setTimeout
- // to make sure initialize setState has happened before
- // any of such methods are called
- _this.callbackTimers.push(setTimeout(function () {
- return _this.changeSlide({
- message: "previous"
- });
- }, 0));
- });
- (0,defineProperty["default"])(_this, "slickNext", function () {
- _this.callbackTimers.push(setTimeout(function () {
- return _this.changeSlide({
- message: "next"
- });
- }, 0));
- });
- (0,defineProperty["default"])(_this, "slickGoTo", function (slide) {
- var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- slide = Number(slide);
- if (isNaN(slide)) return "";
- _this.callbackTimers.push(setTimeout(function () {
- return _this.changeSlide({
- message: "index",
- index: slide,
- currentSlide: _this.state.currentSlide
- }, dontAnimate);
- }, 0));
- });
- (0,defineProperty["default"])(_this, "play", function () {
- var nextIndex;
- if (_this.props.rtl) {
- nextIndex = _this.state.currentSlide - _this.props.slidesToScroll;
- } else {
- if (canGoNext((0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state))) {
- nextIndex = _this.state.currentSlide + _this.props.slidesToScroll;
- } else {
- return false;
- }
- }
- _this.slideHandler(nextIndex);
- });
- (0,defineProperty["default"])(_this, "autoPlay", function (playType) {
- if (_this.autoplayTimer) {
- clearInterval(_this.autoplayTimer);
- }
- var autoplaying = _this.state.autoplaying;
- if (playType === "update") {
- if (autoplaying === "hovered" || autoplaying === "focused" || autoplaying === "paused") {
- return;
- }
- } else if (playType === "leave") {
- if (autoplaying === "paused" || autoplaying === "focused") {
- return;
- }
- } else if (playType === "blur") {
- if (autoplaying === "paused" || autoplaying === "hovered") {
- return;
- }
- }
- _this.autoplayTimer = setInterval(_this.play, _this.props.autoplaySpeed + 50);
- _this.setState({
- autoplaying: "playing"
- });
- });
- (0,defineProperty["default"])(_this, "pause", function (pauseType) {
- if (_this.autoplayTimer) {
- clearInterval(_this.autoplayTimer);
- _this.autoplayTimer = null;
- }
- var autoplaying = _this.state.autoplaying;
- if (pauseType === "paused") {
- _this.setState({
- autoplaying: "paused"
- });
- } else if (pauseType === "focused") {
- if (autoplaying === "hovered" || autoplaying === "playing") {
- _this.setState({
- autoplaying: "focused"
- });
- }
- } else {
- // pauseType is 'hovered'
- if (autoplaying === "playing") {
- _this.setState({
- autoplaying: "hovered"
- });
- }
- }
- });
- (0,defineProperty["default"])(_this, "onDotsOver", function () {
- return _this.props.autoplay && _this.pause("hovered");
- });
- (0,defineProperty["default"])(_this, "onDotsLeave", function () {
- return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
- });
- (0,defineProperty["default"])(_this, "onTrackOver", function () {
- return _this.props.autoplay && _this.pause("hovered");
- });
- (0,defineProperty["default"])(_this, "onTrackLeave", function () {
- return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
- });
- (0,defineProperty["default"])(_this, "onSlideFocus", function () {
- return _this.props.autoplay && _this.pause("focused");
- });
- (0,defineProperty["default"])(_this, "onSlideBlur", function () {
- return _this.props.autoplay && _this.state.autoplaying === "focused" && _this.autoPlay("blur");
- });
- (0,defineProperty["default"])(_this, "render", function () {
- var className = classnames_default()("slick-slider", _this.props.className, {
- "slick-vertical": _this.props.vertical,
- "slick-initialized": true
- });
- var spec = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.props), _this.state);
- var trackProps = extractObject(spec, ["fade", "cssEase", "speed", "infinite", "centerMode", "focusOnSelect", "currentSlide", "lazyLoad", "lazyLoadedList", "rtl", "slideWidth", "slideHeight", "listHeight", "vertical", "slidesToShow", "slidesToScroll", "slideCount", "trackStyle", "variableWidth", "unslick", "centerPadding", "targetSlide", "useCSS"]);
- var pauseOnHover = _this.props.pauseOnHover;
- trackProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, trackProps), {}, {
- onMouseEnter: pauseOnHover ? _this.onTrackOver : null,
- onMouseLeave: pauseOnHover ? _this.onTrackLeave : null,
- onMouseOver: pauseOnHover ? _this.onTrackOver : null,
- focusOnSelect: _this.props.focusOnSelect && _this.clickable ? _this.selectHandler : null
- });
- var dots;
- if (_this.props.dots === true && _this.state.slideCount >= _this.props.slidesToShow) {
- var dotProps = extractObject(spec, ["dotsClass", "slideCount", "slidesToShow", "currentSlide", "slidesToScroll", "clickHandler", "children", "customPaging", "infinite", "appendDots"]);
- var pauseOnDotsHover = _this.props.pauseOnDotsHover;
- dotProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, dotProps), {}, {
- clickHandler: _this.changeSlide,
- onMouseEnter: pauseOnDotsHover ? _this.onDotsLeave : null,
- onMouseOver: pauseOnDotsHover ? _this.onDotsOver : null,
- onMouseLeave: pauseOnDotsHover ? _this.onDotsLeave : null
- });
- dots = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Dots, dotProps);
- }
- var prevArrow, nextArrow;
- var arrowProps = extractObject(spec, ["infinite", "centerMode", "currentSlide", "slideCount", "slidesToShow", "prevArrow", "nextArrow"]);
- arrowProps.clickHandler = _this.changeSlide;
- if (_this.props.arrows) {
- prevArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PrevArrow, arrowProps);
- nextArrow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(NextArrow, arrowProps);
- }
- var verticalHeightStyle = null;
- if (_this.props.vertical) {
- verticalHeightStyle = {
- height: _this.state.listHeight
- };
- }
- var centerPaddingStyle = null;
- if (_this.props.vertical === false) {
- if (_this.props.centerMode === true) {
- centerPaddingStyle = {
- padding: "0px " + _this.props.centerPadding
- };
- }
- } else {
- if (_this.props.centerMode === true) {
- centerPaddingStyle = {
- padding: _this.props.centerPadding + " 0px"
- };
- }
- }
- var listStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, verticalHeightStyle), centerPaddingStyle);
- var touchMove = _this.props.touchMove;
- var listProps = {
- className: "slick-list",
- style: listStyle,
- onClick: _this.clickHandler,
- onMouseDown: touchMove ? _this.swipeStart : null,
- onMouseMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
- onMouseUp: touchMove ? _this.swipeEnd : null,
- onMouseLeave: _this.state.dragging && touchMove ? _this.swipeEnd : null,
- onTouchStart: touchMove ? _this.swipeStart : null,
- onTouchMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
- onTouchEnd: touchMove ? _this.touchEnd : null,
- onTouchCancel: _this.state.dragging && touchMove ? _this.swipeEnd : null,
- onKeyDown: _this.props.accessibility ? _this.keyHandler : null
- };
- var innerSliderProps = {
- className: className,
- dir: "ltr",
- style: _this.props.style
- };
- if (_this.props.unslick) {
- listProps = {
- className: "slick-list"
- };
- innerSliderProps = {
- className: className,
- style: _this.props.style
- };
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- ref: _this.listRefHandler
- }, listProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Track, (0,esm_extends["default"])({
- ref: _this.trackRefHandler
- }, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : "");
- });
- _this.list = null;
- _this.track = null;
- _this.state = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, initial_state), {}, {
- currentSlide: _this.props.initialSlide,
- targetSlide: _this.props.initialSlide ? _this.props.initialSlide : 0,
- slideCount: external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(_this.props.children)
- });
- _this.callbackTimers = [];
- _this.clickable = true;
- _this.debouncedResize = null;
- var ssrState = _this.ssrInit();
- _this.state = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, _this.state), ssrState);
- return _this;
- }
- (0,inherits["default"])(InnerSlider, _React$Component);
- return (0,createClass["default"])(InnerSlider, [{
- key: "didPropsChange",
- value: function didPropsChange(prevProps) {
- var setTrackStyle = false;
- for (var _i3 = 0, _Object$keys = Object.keys(this.props); _i3 < _Object$keys.length; _i3++) {
- var key = _Object$keys[_i3];
- // eslint-disable-next-line no-prototype-builtins
- if (!prevProps.hasOwnProperty(key)) {
- setTrackStyle = true;
- break;
- }
- if ((0,esm_typeof["default"])(prevProps[key]) === "object" || typeof prevProps[key] === "function" || isNaN(prevProps[key])) {
- continue;
- }
- if (prevProps[key] !== this.props[key]) {
- setTrackStyle = true;
- break;
- }
- }
- return setTrackStyle || external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(this.props.children) !== external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.count(prevProps.children);
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Component);
- // EXTERNAL MODULE: ./node_modules/json2mq/index.js
- var json2mq = __webpack_require__("./node_modules/json2mq/index.js");
- var json2mq_default = /*#__PURE__*/__webpack_require__.n(json2mq);
- ;// ./node_modules/@ant-design/react-slick/es/slider.js
- function slider_callSuper(t, o, e) { return o = (0,getPrototypeOf["default"])(o), (0,possibleConstructorReturn["default"])(t, (0,isNativeReflectConstruct["default"])() ? Reflect.construct(o, e || [], (0,getPrototypeOf["default"])(t).constructor) : o.apply(t, e)); }
- var Slider = /*#__PURE__*/function (_React$Component) {
- function Slider(props) {
- var _this;
- (0,classCallCheck["default"])(this, Slider);
- _this = slider_callSuper(this, Slider, [props]);
- (0,defineProperty["default"])(_this, "innerSliderRefHandler", function (ref) {
- return _this.innerSlider = ref;
- });
- (0,defineProperty["default"])(_this, "slickPrev", function () {
- return _this.innerSlider.slickPrev();
- });
- (0,defineProperty["default"])(_this, "slickNext", function () {
- return _this.innerSlider.slickNext();
- });
- (0,defineProperty["default"])(_this, "slickGoTo", function (slide) {
- var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- return _this.innerSlider.slickGoTo(slide, dontAnimate);
- });
- (0,defineProperty["default"])(_this, "slickPause", function () {
- return _this.innerSlider.pause("paused");
- });
- (0,defineProperty["default"])(_this, "slickPlay", function () {
- return _this.innerSlider.autoPlay("play");
- });
- _this.state = {
- breakpoint: null
- };
- _this._responsiveMediaHandlers = [];
- return _this;
- }
- (0,inherits["default"])(Slider, _React$Component);
- return (0,createClass["default"])(Slider, [{
- key: "media",
- value: function media(query, handler) {
- // javascript handler for css media query
- var mql = window.matchMedia(query);
- var listener = function listener(_ref) {
- var matches = _ref.matches;
- if (matches) {
- handler();
- }
- };
- mql.addListener(listener);
- listener(mql);
- this._responsiveMediaHandlers.push({
- mql: mql,
- query: query,
- listener: listener
- });
- }
- // handles responsive breakpoints
- }, {
- key: "componentDidMount",
- value: function componentDidMount() {
- var _this2 = this;
- // performance monitoring
- //if (process.env.NODE_ENV !== 'production') {
- //const { whyDidYouUpdate } = require('why-did-you-update')
- //whyDidYouUpdate(React)
- //}
- if (this.props.responsive) {
- var breakpoints = this.props.responsive.map(function (breakpt) {
- return breakpt.breakpoint;
- });
- // sort them in increasing order of their numerical value
- breakpoints.sort(function (x, y) {
- return x - y;
- });
- breakpoints.forEach(function (breakpoint, index) {
- // media query for each breakpoint
- var bQuery;
- if (index === 0) {
- bQuery = json2mq_default()({
- minWidth: 0,
- maxWidth: breakpoint
- });
- } else {
- bQuery = json2mq_default()({
- minWidth: breakpoints[index - 1] + 1,
- maxWidth: breakpoint
- });
- }
- // when not using server side rendering
- canUseDOM() && _this2.media(bQuery, function () {
- _this2.setState({
- breakpoint: breakpoint
- });
- });
- });
- // Register media query for full screen. Need to support resize from small to large
- // convert javascript object to media query string
- var query = json2mq_default()({
- minWidth: breakpoints.slice(-1)[0]
- });
- canUseDOM() && this.media(query, function () {
- _this2.setState({
- breakpoint: null
- });
- });
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this._responsiveMediaHandlers.forEach(function (obj) {
- obj.mql.removeListener(obj.listener);
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this3 = this;
- var settings;
- var newProps;
- if (this.state.breakpoint) {
- newProps = this.props.responsive.filter(function (resp) {
- return resp.breakpoint === _this3.state.breakpoint;
- });
- settings = newProps[0].settings === "unslick" ? "unslick" : (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, default_props), this.props), newProps[0].settings);
- } else {
- settings = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, default_props), this.props);
- }
- // force scrolling by one if centerMode is on
- if (settings.centerMode) {
- if (settings.slidesToScroll > 1 && "development" !== "production") {
- console.warn("slidesToScroll should be equal to 1 in centerMode, you are using ".concat(settings.slidesToScroll));
- }
- settings.slidesToScroll = 1;
- }
- // force showing one slide and scrolling by one if the fade mode is on
- if (settings.fade) {
- if (settings.slidesToShow > 1 && "development" !== "production") {
- console.warn("slidesToShow should be equal to 1 when fade is true, you're using ".concat(settings.slidesToShow));
- }
- if (settings.slidesToScroll > 1 && "development" !== "production") {
- console.warn("slidesToScroll should be equal to 1 when fade is true, you're using ".concat(settings.slidesToScroll));
- }
- settings.slidesToShow = 1;
- settings.slidesToScroll = 1;
- }
- // makes sure that children is an array, even when there is only 1 child
- var children = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.toArray(this.props.children);
- // Children may contain false or null, so we should filter them
- // children may also contain string filled with spaces (in certain cases where we use jsx strings)
- children = children.filter(function (child) {
- if (typeof child === "string") {
- return !!child.trim();
- }
- return !!child;
- });
- // rows and slidesPerRow logic is handled here
- if (settings.variableWidth && (settings.rows > 1 || settings.slidesPerRow > 1)) {
- console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1");
- settings.variableWidth = false;
- }
- var newChildren = [];
- var currentWidth = null;
- for (var i = 0; i < children.length; i += settings.rows * settings.slidesPerRow) {
- var newSlide = [];
- for (var j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) {
- var row = [];
- for (var k = j; k < j + settings.slidesPerRow; k += 1) {
- if (settings.variableWidth && children[k].props.style) {
- currentWidth = children[k].props.style.width;
- }
- if (k >= children.length) break;
- row.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children[k], {
- key: 100 * i + 10 * j + k,
- tabIndex: -1,
- style: {
- width: "".concat(100 / settings.slidesPerRow, "%"),
- display: "inline-block"
- }
- }));
- }
- newSlide.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- key: 10 * i + j
- }, row));
- }
- if (settings.variableWidth) {
- newChildren.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- key: i,
- style: {
- width: currentWidth
- }
- }, newSlide));
- } else {
- newChildren.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- key: i
- }, newSlide));
- }
- }
- if (settings === "unslick") {
- var className = "regular slider " + (this.props.className || "");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: className
- }, children);
- } else if (newChildren.length <= settings.slidesToShow && !settings.infinite) {
- settings.unslick = true;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(InnerSlider, (0,esm_extends["default"])({
- style: this.props.style,
- ref: this.innerSliderRefHandler
- }, filterSettings(settings)), newChildren);
- }
- }]);
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Component);
- ;// ./node_modules/@ant-design/react-slick/es/index.js
- /* harmony default export */ var react_slick_es = (Slider);
- // EXTERNAL MODULE: ./components/carousel/style/index.ts
- var carousel_style = __webpack_require__("./components/carousel/style/index.ts");
- ;// ./components/carousel/index.tsx
- var carousel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const dotsClass = 'slick-dots';
- const ArrowButton = _a => {
- var {
- currentSlide,
- slideCount
- } = _a,
- rest = carousel_rest(_a, ["currentSlide", "slideCount"]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", Object.assign({
- type: "button"
- }, rest));
- };
- const Carousel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- dots = true,
- arrows = false,
- prevArrow,
- nextArrow,
- draggable = false,
- waitForAnimate = false,
- dotPosition = 'bottom',
- vertical = dotPosition === 'left' || dotPosition === 'right',
- rootClassName,
- className: customClassName,
- style,
- id,
- autoplay = false,
- autoplaySpeed = 3000,
- rtl
- } = props,
- otherProps = carousel_rest(props, ["dots", "arrows", "prevArrow", "nextArrow", "draggable", "waitForAnimate", "dotPosition", "vertical", "rootClassName", "className", "style", "id", "autoplay", "autoplaySpeed", "rtl"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('carousel');
- const slickRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const goTo = (slide, dontAnimate = false) => {
- slickRef.current.slickGoTo(slide, dontAnimate);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- goTo,
- autoPlay: slickRef.current.innerSlider.autoPlay,
- innerSlider: slickRef.current.innerSlider,
- prev: slickRef.current.slickPrev,
- next: slickRef.current.slickNext
- }), [slickRef.current]);
- const {
- children,
- initialSlide = 0
- } = props;
- const count = external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.count(children);
- const isRTL = (rtl !== null && rtl !== void 0 ? rtl : direction === 'rtl') && !vertical;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (count > 0) {
- const newIndex = isRTL ? count - initialSlide - 1 : initialSlide;
- goTo(newIndex, false);
- }
- }, [count, initialSlide, isRTL]);
- const newProps = Object.assign({
- vertical,
- className: classnames_default()(customClassName, contextClassName),
- style: Object.assign(Object.assign({}, contextStyle), style),
- autoplay: !!autoplay
- }, otherProps);
- if (newProps.effect === 'fade') {
- newProps.fade = true;
- }
- const prefixCls = getPrefixCls('carousel', newProps.prefixCls);
- const enableDots = !!dots;
- const dsClass = classnames_default()(dotsClass, `${dotsClass}-${dotPosition}`, typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);
- const [wrapCSSVar, hashId, cssVarCls] = (0,carousel_style["default"])(prefixCls);
- const className = classnames_default()(prefixCls, {
- [`${prefixCls}-rtl`]: isRTL,
- [`${prefixCls}-vertical`]: newProps.vertical
- }, hashId, cssVarCls, rootClassName);
- const mergedShowDuration = autoplay && (typeof autoplay === 'object' ? autoplay.dotDuration : false);
- const dotDurationStyle = mergedShowDuration ? {
- [carousel_style.DotDuration]: `${autoplaySpeed}ms`
- } : {};
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className,
- id: id,
- style: dotDurationStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(react_slick_es, Object.assign({
- ref: slickRef
- }, newProps, {
- dots: enableDots,
- dotsClass: dsClass,
- arrows: arrows,
- prevArrow: prevArrow !== null && prevArrow !== void 0 ? prevArrow : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ArrowButton, {
- "aria-label": isRTL ? 'next' : 'prev'
- }),
- nextArrow: nextArrow !== null && nextArrow !== void 0 ? nextArrow : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ArrowButton, {
- "aria-label": isRTL ? 'prev' : 'next'
- }),
- draggable: draggable,
- verticalSwiping: vertical,
- autoplaySpeed: autoplaySpeed,
- waitForAnimate: waitForAnimate,
- rtl: isRTL
- }))));
- });
- if (true) {
- Carousel.displayName = 'Carousel';
- }
- /* harmony default export */ var carousel = (Carousel);
- ;// ./node_modules/rc-cascader/es/context.js
- var CascaderContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- /* harmony default export */ var rc_cascader_es_context = (CascaderContext);
- ;// ./node_modules/rc-cascader/es/hooks/useSearchOptions.js
- var SEARCH_MARK = '__rc_cascader_search_mark__';
- var defaultFilter = function defaultFilter(search, options, _ref) {
- var _ref$label = _ref.label,
- label = _ref$label === void 0 ? '' : _ref$label;
- return options.some(function (opt) {
- return String(opt[label]).toLowerCase().includes(search.toLowerCase());
- });
- };
- var defaultRender = function defaultRender(inputValue, path, prefixCls, fieldNames) {
- return path.map(function (opt) {
- return opt[fieldNames.label];
- }).join(' / ');
- };
- var useSearchOptions = function useSearchOptions(search, options, fieldNames, prefixCls, config, enableHalfPath) {
- var _config$filter = config.filter,
- filter = _config$filter === void 0 ? defaultFilter : _config$filter,
- _config$render = config.render,
- render = _config$render === void 0 ? defaultRender : _config$render,
- _config$limit = config.limit,
- limit = _config$limit === void 0 ? 50 : _config$limit,
- sort = config.sort;
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var filteredOptions = [];
- if (!search) {
- return [];
- }
- function dig(list, pathOptions) {
- var parentDisabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- list.forEach(function (option) {
- // Perf saving when `sort` is disabled and `limit` is provided
- if (!sort && limit !== false && limit > 0 && filteredOptions.length >= limit) {
- return;
- }
- var connectedPathOptions = [].concat((0,toConsumableArray["default"])(pathOptions), [option]);
- var children = option[fieldNames.children];
- var mergedDisabled = parentDisabled || option.disabled;
- // If current option is filterable
- if (
- // If is leaf option
- !children || children.length === 0 ||
- // If is changeOnSelect or multiple
- enableHalfPath) {
- if (filter(search, connectedPathOptions, {
- label: fieldNames.label
- })) {
- var _objectSpread2;
- filteredOptions.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, option), {}, (_objectSpread2 = {
- disabled: mergedDisabled
- }, (0,defineProperty["default"])(_objectSpread2, fieldNames.label, render(search, connectedPathOptions, prefixCls, fieldNames)), (0,defineProperty["default"])(_objectSpread2, SEARCH_MARK, connectedPathOptions), (0,defineProperty["default"])(_objectSpread2, fieldNames.children, undefined), _objectSpread2)));
- }
- }
- if (children) {
- dig(option[fieldNames.children], connectedPathOptions, mergedDisabled);
- }
- });
- }
- dig(options, []);
- // Do sort
- if (sort) {
- filteredOptions.sort(function (a, b) {
- return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);
- });
- }
- return limit !== false && limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
- }, [search, options, fieldNames, prefixCls, render, enableHalfPath, filter, sort, limit]);
- };
- /* harmony default export */ var hooks_useSearchOptions = (useSearchOptions);
- ;// ./node_modules/rc-cascader/es/utils/commonUtil.js
- var VALUE_SPLIT = '__RC_CASCADER_SPLIT__';
- var SHOW_PARENT = 'SHOW_PARENT';
- var SHOW_CHILD = 'SHOW_CHILD';
- /**
- * Will convert value to string, and join with `VALUE_SPLIT`
- */
- function toPathKey(value) {
- return value.join(VALUE_SPLIT);
- }
- /**
- * Batch convert value to string, and join with `VALUE_SPLIT`
- */
- function toPathKeys(value) {
- return value.map(toPathKey);
- }
- function toPathValueStr(pathKey) {
- return pathKey.split(VALUE_SPLIT);
- }
- function commonUtil_fillFieldNames(fieldNames) {
- var _ref = fieldNames || {},
- label = _ref.label,
- value = _ref.value,
- children = _ref.children;
- var val = value || 'value';
- return {
- label: label || 'label',
- value: val,
- key: val,
- children: children || 'children'
- };
- }
- function isLeaf(option, fieldNames) {
- var _option$isLeaf, _option;
- return (_option$isLeaf = option.isLeaf) !== null && _option$isLeaf !== void 0 ? _option$isLeaf : !((_option = option[fieldNames.children]) !== null && _option !== void 0 && _option.length);
- }
- function scrollIntoParentView(element) {
- var parent = element.parentElement;
- if (!parent) {
- return;
- }
- var elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.
- if (elementToParent - parent.scrollTop < 0) {
- parent.scrollTo({
- top: elementToParent
- });
- } else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) {
- parent.scrollTo({
- top: elementToParent + element.offsetHeight - parent.offsetHeight
- });
- }
- }
- function getFullPathKeys(options, fieldNames) {
- return options.map(function (item) {
- var _item$SEARCH_MARK;
- return (_item$SEARCH_MARK = item[SEARCH_MARK]) === null || _item$SEARCH_MARK === void 0 ? void 0 : _item$SEARCH_MARK.map(function (opt) {
- return opt[fieldNames.value];
- });
- });
- }
- function isMultipleValue(value) {
- return Array.isArray(value) && Array.isArray(value[0]);
- }
- function toRawValues(value) {
- if (!value) {
- return [];
- }
- if (isMultipleValue(value)) {
- return value;
- }
- return (value.length === 0 ? [] : [value]).map(function (val) {
- return Array.isArray(val) ? val : [val];
- });
- }
- ;// ./node_modules/rc-cascader/es/utils/treeUtil.js
- function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {
- var valueSet = new Set(pathKeys);
- var keyPathEntities = getKeyPathEntities();
- return pathKeys.filter(function (key) {
- var entity = keyPathEntities[key];
- var parent = entity ? entity.parent : null;
- var children = entity ? entity.children : null;
- if (entity && entity.node.disabled) {
- return true;
- }
- return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {
- return child.key && valueSet.has(child.key);
- })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));
- });
- }
- function toPathOptions(valueCells, options, fieldNames) {
- var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- var currentList = options;
- var valueOptions = [];
- var _loop = function _loop() {
- var _currentList, _currentList2, _foundOption$fieldNam;
- var valueCell = valueCells[i];
- var foundIndex = (_currentList = currentList) === null || _currentList === void 0 ? void 0 : _currentList.findIndex(function (option) {
- var val = option[fieldNames.value];
- return stringMode ? String(val) === String(valueCell) : val === valueCell;
- });
- var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _currentList2 === void 0 ? void 0 : _currentList2[foundIndex] : null;
- valueOptions.push({
- value: (_foundOption$fieldNam = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _foundOption$fieldNam !== void 0 ? _foundOption$fieldNam : valueCell,
- index: foundIndex,
- option: foundOption
- });
- currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];
- };
- for (var i = 0; i < valueCells.length; i += 1) {
- _loop();
- }
- return valueOptions;
- }
- ;// ./node_modules/rc-cascader/es/hooks/useDisplayValues.js
- /* harmony default export */ var useDisplayValues = (function (rawValues, options, fieldNames, multiple, displayRender) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var mergedDisplayRender = displayRender ||
- // Default displayRender
- function (labels) {
- var mergedLabels = multiple ? labels.slice(-1) : labels;
- var SPLIT = ' / ';
- if (mergedLabels.every(function (label) {
- return ['string', 'number'].includes((0,esm_typeof["default"])(label));
- })) {
- return mergedLabels.join(SPLIT);
- }
- // If exist non-string value, use ReactNode instead
- return mergedLabels.reduce(function (list, label, index) {
- var keyedLabel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(label) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(label, {
- key: index
- }) : label;
- if (index === 0) {
- return [keyedLabel];
- }
- return [].concat((0,toConsumableArray["default"])(list), [SPLIT, keyedLabel]);
- }, []);
- };
- return rawValues.map(function (valueCells) {
- var _valueOptions;
- var valueOptions = toPathOptions(valueCells, options, fieldNames);
- var label = mergedDisplayRender(valueOptions.map(function (_ref) {
- var _option$fieldNames$la;
- var option = _ref.option,
- value = _ref.value;
- return (_option$fieldNames$la = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _option$fieldNames$la !== void 0 ? _option$fieldNames$la : value;
- }), valueOptions.map(function (_ref2) {
- var option = _ref2.option;
- return option;
- }));
- var value = toPathKey(valueCells);
- return {
- label: label,
- value: value,
- key: value,
- valueCells: valueCells,
- disabled: (_valueOptions = valueOptions[valueOptions.length - 1]) === null || _valueOptions === void 0 || (_valueOptions = _valueOptions.option) === null || _valueOptions === void 0 ? void 0 : _valueOptions.disabled
- };
- });
- }, [rawValues, options, fieldNames, displayRender, multiple]);
- });
- ;// ./node_modules/rc-cascader/es/hooks/useMissingValues.js
- function useMissingValues(options, fieldNames) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (rawValues) {
- var missingValues = [];
- var existsValues = [];
- rawValues.forEach(function (valueCell) {
- var pathOptions = toPathOptions(valueCell, options, fieldNames);
- if (pathOptions.every(function (opt) {
- return opt.option;
- })) {
- existsValues.push(valueCell);
- } else {
- missingValues.push(valueCell);
- }
- });
- return [existsValues, missingValues];
- }, [options, fieldNames]);
- }
- ;// ./node_modules/rc-tree/es/utils/keyUtil.js
- function getEntity(keyEntities, key) {
- return keyEntities[key];
- }
- ;// ./node_modules/rc-tree/es/utils/treeUtil.js
- var treeUtil_excluded = ["children"];
- function getPosition(level, index) {
- return "".concat(level, "-").concat(index);
- }
- function isTreeNode(node) {
- return node && node.type && node.type.isTreeNode;
- }
- function treeUtil_getKey(key, pos) {
- if (key !== null && key !== undefined) {
- return key;
- }
- return pos;
- }
- function treeUtil_fillFieldNames(fieldNames) {
- var _ref = fieldNames || {},
- title = _ref.title,
- _title = _ref._title,
- key = _ref.key,
- children = _ref.children;
- var mergedTitle = title || 'title';
- return {
- title: mergedTitle,
- _title: _title || [mergedTitle],
- key: key || 'key',
- children: children || 'children'
- };
- }
- /**
- * Warning if TreeNode do not provides key
- */
- function warningWithoutKey(treeData, fieldNames) {
- var keys = new Map();
- function dig(list) {
- var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- (list || []).forEach(function (treeNode) {
- var key = treeNode[fieldNames.key];
- var children = treeNode[fieldNames.children];
- (0,warning["default"])(key !== null && key !== undefined, "Tree node must have a certain key: [".concat(path).concat(key, "]"));
- var recordKey = String(key);
- (0,warning["default"])(!keys.has(recordKey) || key === null || key === undefined, "Same 'key' exist in the Tree: ".concat(recordKey));
- keys.set(recordKey, true);
- dig(children, "".concat(path).concat(recordKey, " > "));
- });
- }
- dig(treeData);
- }
- /**
- * Convert `children` of Tree into `treeData` structure.
- */
- function convertTreeToData(rootNodes) {
- function dig(node) {
- var treeNodes = (0,toArray["default"])(node);
- return treeNodes.map(function (treeNode) {
- // Filter invalidate node
- if (!isTreeNode(treeNode)) {
- (0,warning["default"])(!treeNode, 'Tree/TreeNode can only accept TreeNode as children.');
- return null;
- }
- var key = treeNode.key;
- var _treeNode$props = treeNode.props,
- children = _treeNode$props.children,
- rest = (0,objectWithoutProperties["default"])(_treeNode$props, treeUtil_excluded);
- var dataNode = (0,objectSpread2["default"])({
- key: key
- }, rest);
- var parsedChildren = dig(children);
- if (parsedChildren.length) {
- dataNode.children = parsedChildren;
- }
- return dataNode;
- }).filter(function (dataNode) {
- return dataNode;
- });
- }
- return dig(rootNodes);
- }
- /**
- * Flat nest tree data into flatten list. This is used for virtual list render.
- * @param treeNodeList Origin data node list
- * @param expandedKeys
- * need expanded keys, provides `true` means all expanded (used in `rc-tree-select`).
- */
- function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
- var _fillFieldNames = treeUtil_fillFieldNames(fieldNames),
- fieldTitles = _fillFieldNames._title,
- fieldKey = _fillFieldNames.key,
- fieldChildren = _fillFieldNames.children;
- var expandedKeySet = new Set(expandedKeys === true ? [] : expandedKeys);
- var flattenList = [];
- function dig(list) {
- var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- return list.map(function (treeNode, index) {
- var pos = getPosition(parent ? parent.pos : '0', index);
- var mergedKey = treeUtil_getKey(treeNode[fieldKey], pos);
- // Pick matched title in field title list
- var mergedTitle;
- for (var i = 0; i < fieldTitles.length; i += 1) {
- var fieldTitle = fieldTitles[i];
- if (treeNode[fieldTitle] !== undefined) {
- mergedTitle = treeNode[fieldTitle];
- break;
- }
- }
- // Add FlattenDataNode into list
- // We use `Object.assign` here to save perf since babel's `objectSpread` has perf issue
- var flattenNode = Object.assign((0,omit["default"])(treeNode, [].concat((0,toConsumableArray["default"])(fieldTitles), [fieldKey, fieldChildren])), {
- title: mergedTitle,
- key: mergedKey,
- parent: parent,
- pos: pos,
- children: null,
- data: treeNode,
- isStart: [].concat((0,toConsumableArray["default"])(parent ? parent.isStart : []), [index === 0]),
- isEnd: [].concat((0,toConsumableArray["default"])(parent ? parent.isEnd : []), [index === list.length - 1])
- });
- flattenList.push(flattenNode);
- // Loop treeNode children
- if (expandedKeys === true || expandedKeySet.has(mergedKey)) {
- flattenNode.children = dig(treeNode[fieldChildren] || [], flattenNode);
- } else {
- flattenNode.children = [];
- }
- return flattenNode;
- });
- }
- dig(treeNodeList);
- return flattenList;
- }
- /**
- * Traverse all the data by `treeData`.
- * Please not use it out of the `rc-tree` since we may refactor this code.
- */
- function traverseDataNodes(dataNodes, callback,
- // To avoid too many params, let use config instead of origin param
- config) {
- var mergedConfig = {};
- if ((0,esm_typeof["default"])(config) === 'object') {
- mergedConfig = config;
- } else {
- mergedConfig = {
- externalGetKey: config
- };
- }
- mergedConfig = mergedConfig || {};
- // Init config
- var _mergedConfig = mergedConfig,
- childrenPropName = _mergedConfig.childrenPropName,
- externalGetKey = _mergedConfig.externalGetKey,
- fieldNames = _mergedConfig.fieldNames;
- var _fillFieldNames2 = treeUtil_fillFieldNames(fieldNames),
- fieldKey = _fillFieldNames2.key,
- fieldChildren = _fillFieldNames2.children;
- var mergeChildrenPropName = childrenPropName || fieldChildren;
- // Get keys
- var syntheticGetKey;
- if (externalGetKey) {
- if (typeof externalGetKey === 'string') {
- syntheticGetKey = function syntheticGetKey(node) {
- return node[externalGetKey];
- };
- } else if (typeof externalGetKey === 'function') {
- syntheticGetKey = function syntheticGetKey(node) {
- return externalGetKey(node);
- };
- }
- } else {
- syntheticGetKey = function syntheticGetKey(node, pos) {
- return treeUtil_getKey(node[fieldKey], pos);
- };
- }
- // Process
- function processNode(node, index, parent, pathNodes) {
- var children = node ? node[mergeChildrenPropName] : dataNodes;
- var pos = node ? getPosition(parent.pos, index) : '0';
- var connectNodes = node ? [].concat((0,toConsumableArray["default"])(pathNodes), [node]) : [];
- // Process node if is not root
- if (node) {
- var key = syntheticGetKey(node, pos);
- var _data = {
- node: node,
- index: index,
- pos: pos,
- key: key,
- parentPos: parent.node ? parent.pos : null,
- level: parent.level + 1,
- nodes: connectNodes
- };
- callback(_data);
- }
- // Process children node
- if (children) {
- children.forEach(function (subNode, subIndex) {
- processNode(subNode, subIndex, {
- node: node,
- pos: pos,
- level: parent ? parent.level + 1 : -1
- }, connectNodes);
- });
- }
- }
- processNode(null);
- }
- /**
- * Convert `treeData` into entity records.
- */
- function convertDataToEntities(dataNodes) {
- var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- initWrapper = _ref2.initWrapper,
- processEntity = _ref2.processEntity,
- onProcessFinished = _ref2.onProcessFinished,
- externalGetKey = _ref2.externalGetKey,
- childrenPropName = _ref2.childrenPropName,
- fieldNames = _ref2.fieldNames;
- var /** @deprecated Use `config.externalGetKey` instead */
- legacyExternalGetKey = arguments.length > 2 ? arguments[2] : undefined;
- // Init config
- var mergedExternalGetKey = externalGetKey || legacyExternalGetKey;
- var posEntities = {};
- var keyEntities = {};
- var wrapper = {
- posEntities: posEntities,
- keyEntities: keyEntities
- };
- if (initWrapper) {
- wrapper = initWrapper(wrapper) || wrapper;
- }
- traverseDataNodes(dataNodes, function (item) {
- var node = item.node,
- index = item.index,
- pos = item.pos,
- key = item.key,
- parentPos = item.parentPos,
- level = item.level,
- nodes = item.nodes;
- var entity = {
- node: node,
- nodes: nodes,
- index: index,
- key: key,
- pos: pos,
- level: level
- };
- var mergedKey = treeUtil_getKey(key, pos);
- posEntities[pos] = entity;
- keyEntities[mergedKey] = entity;
- // Fill children
- entity.parent = posEntities[parentPos];
- if (entity.parent) {
- entity.parent.children = entity.parent.children || [];
- entity.parent.children.push(entity);
- }
- if (processEntity) {
- processEntity(entity, wrapper);
- }
- }, {
- externalGetKey: mergedExternalGetKey,
- childrenPropName: childrenPropName,
- fieldNames: fieldNames
- });
- if (onProcessFinished) {
- onProcessFinished(wrapper);
- }
- return wrapper;
- }
- /**
- * Get TreeNode props with Tree props.
- */
- function getTreeNodeProps(key, _ref3) {
- var expandedKeys = _ref3.expandedKeys,
- selectedKeys = _ref3.selectedKeys,
- loadedKeys = _ref3.loadedKeys,
- loadingKeys = _ref3.loadingKeys,
- checkedKeys = _ref3.checkedKeys,
- halfCheckedKeys = _ref3.halfCheckedKeys,
- dragOverNodeKey = _ref3.dragOverNodeKey,
- dropPosition = _ref3.dropPosition,
- keyEntities = _ref3.keyEntities;
- var entity = getEntity(keyEntities, key);
- var treeNodeProps = {
- eventKey: key,
- expanded: expandedKeys.indexOf(key) !== -1,
- selected: selectedKeys.indexOf(key) !== -1,
- loaded: loadedKeys.indexOf(key) !== -1,
- loading: loadingKeys.indexOf(key) !== -1,
- checked: checkedKeys.indexOf(key) !== -1,
- halfChecked: halfCheckedKeys.indexOf(key) !== -1,
- pos: String(entity ? entity.pos : ''),
- // [Legacy] Drag props
- // Since the interaction of drag is changed, the semantic of the props are
- // not accuracy, I think it should be finally removed
- dragOver: dragOverNodeKey === key && dropPosition === 0,
- dragOverGapTop: dragOverNodeKey === key && dropPosition === -1,
- dragOverGapBottom: dragOverNodeKey === key && dropPosition === 1
- };
- return treeNodeProps;
- }
- function convertNodePropsToEventData(props) {
- var data = props.data,
- expanded = props.expanded,
- selected = props.selected,
- checked = props.checked,
- loaded = props.loaded,
- loading = props.loading,
- halfChecked = props.halfChecked,
- dragOver = props.dragOver,
- dragOverGapTop = props.dragOverGapTop,
- dragOverGapBottom = props.dragOverGapBottom,
- pos = props.pos,
- active = props.active,
- eventKey = props.eventKey;
- var eventData = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, data), {}, {
- expanded: expanded,
- selected: selected,
- checked: checked,
- loaded: loaded,
- loading: loading,
- halfChecked: halfChecked,
- dragOver: dragOver,
- dragOverGapTop: dragOverGapTop,
- dragOverGapBottom: dragOverGapBottom,
- pos: pos,
- active: active,
- key: eventKey
- });
- if (!('props' in eventData)) {
- Object.defineProperty(eventData, 'props', {
- get: function get() {
- (0,warning["default"])(false, 'Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.');
- return props;
- }
- });
- }
- return eventData;
- }
- ;// ./node_modules/rc-cascader/es/hooks/useEntities.js
- /** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
- /* harmony default export */ var useEntities = (function (options, fieldNames) {
- var cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- options: [],
- info: {
- keyEntities: {},
- pathKeyEntities: {}
- }
- });
- var getEntities = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function () {
- if (cacheRef.current.options !== options) {
- cacheRef.current.options = options;
- cacheRef.current.info = convertDataToEntities(options, {
- fieldNames: fieldNames,
- initWrapper: function initWrapper(wrapper) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, wrapper), {}, {
- pathKeyEntities: {}
- });
- },
- processEntity: function processEntity(entity, wrapper) {
- var pathKey = entity.nodes.map(function (node) {
- return node[fieldNames.value];
- }).join(VALUE_SPLIT);
- wrapper.pathKeyEntities[pathKey] = entity;
- // Overwrite origin key.
- // this is very hack but we need let conduct logic work with connect path
- entity.key = pathKey;
- }
- });
- }
- return cacheRef.current.info.pathKeyEntities;
- }, [fieldNames, options]);
- return getEntities;
- });
- ;// ./node_modules/rc-cascader/es/hooks/useOptions.js
- function useOptions_useOptions(mergedFieldNames, options) {
- var mergedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return options || [];
- }, [options]);
- // Only used in multiple mode, this fn will not call in single mode
- var getPathKeyEntities = useEntities(mergedOptions, mergedFieldNames);
- /** Convert path key back to value format */
- var getValueByKeyPath = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (pathKeys) {
- var keyPathEntities = getPathKeyEntities();
- return pathKeys.map(function (pathKey) {
- var nodes = keyPathEntities[pathKey].nodes;
- return nodes.map(function (node) {
- return node[mergedFieldNames.value];
- });
- });
- }, [getPathKeyEntities, mergedFieldNames]);
- return [mergedOptions, getPathKeyEntities, getValueByKeyPath];
- }
- ;// ./node_modules/rc-cascader/es/hooks/useSearchConfig.js
- // Convert `showSearch` to unique config
- function useSearchConfig(showSearch) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!showSearch) {
- return [false, {}];
- }
- var searchConfig = {
- matchInputWidth: true,
- limit: 50
- };
- if (showSearch && (0,esm_typeof["default"])(showSearch) === 'object') {
- searchConfig = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, searchConfig), showSearch);
- }
- if (searchConfig.limit <= 0) {
- searchConfig.limit = false;
- if (true) {
- (0,warning["default"])(false, "'limit' of showSearch should be positive number or false.");
- }
- }
- return [true, searchConfig];
- }, [showSearch]);
- }
- ;// ./node_modules/rc-tree/es/utils/conductUtil.js
- function removeFromCheckedKeys(halfCheckedKeys, checkedKeys) {
- var filteredKeys = new Set();
- halfCheckedKeys.forEach(function (key) {
- if (!checkedKeys.has(key)) {
- filteredKeys.add(key);
- }
- });
- return filteredKeys;
- }
- function isCheckDisabled(node) {
- var _ref = node || {},
- disabled = _ref.disabled,
- disableCheckbox = _ref.disableCheckbox,
- checkable = _ref.checkable;
- return !!(disabled || disableCheckbox) || checkable === false;
- }
- // Fill miss keys
- function fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
- var checkedKeys = new Set(keys);
- var halfCheckedKeys = new Set();
- // Add checked keys top to bottom
- for (var level = 0; level <= maxLevel; level += 1) {
- var entities = levelEntities.get(level) || new Set();
- entities.forEach(function (entity) {
- var key = entity.key,
- node = entity.node,
- _entity$children = entity.children,
- children = _entity$children === void 0 ? [] : _entity$children;
- if (checkedKeys.has(key) && !syntheticGetCheckDisabled(node)) {
- children.filter(function (childEntity) {
- return !syntheticGetCheckDisabled(childEntity.node);
- }).forEach(function (childEntity) {
- checkedKeys.add(childEntity.key);
- });
- }
- });
- }
- // Add checked keys from bottom to top
- var visitedKeys = new Set();
- for (var _level = maxLevel; _level >= 0; _level -= 1) {
- var _entities = levelEntities.get(_level) || new Set();
- _entities.forEach(function (entity) {
- var parent = entity.parent,
- node = entity.node;
- // Skip if no need to check
- if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) {
- return;
- }
- // Skip if parent is disabled
- if (syntheticGetCheckDisabled(entity.parent.node)) {
- visitedKeys.add(parent.key);
- return;
- }
- var allChecked = true;
- var partialChecked = false;
- (parent.children || []).filter(function (childEntity) {
- return !syntheticGetCheckDisabled(childEntity.node);
- }).forEach(function (_ref2) {
- var key = _ref2.key;
- var checked = checkedKeys.has(key);
- if (allChecked && !checked) {
- allChecked = false;
- }
- if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
- partialChecked = true;
- }
- });
- if (allChecked) {
- checkedKeys.add(parent.key);
- }
- if (partialChecked) {
- halfCheckedKeys.add(parent.key);
- }
- visitedKeys.add(parent.key);
- });
- }
- return {
- checkedKeys: Array.from(checkedKeys),
- halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
- };
- }
- // Remove useless key
- function cleanConductCheck(keys, halfKeys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
- var checkedKeys = new Set(keys);
- var halfCheckedKeys = new Set(halfKeys);
- // Remove checked keys from top to bottom
- for (var level = 0; level <= maxLevel; level += 1) {
- var entities = levelEntities.get(level) || new Set();
- entities.forEach(function (entity) {
- var key = entity.key,
- node = entity.node,
- _entity$children2 = entity.children,
- children = _entity$children2 === void 0 ? [] : _entity$children2;
- if (!checkedKeys.has(key) && !halfCheckedKeys.has(key) && !syntheticGetCheckDisabled(node)) {
- children.filter(function (childEntity) {
- return !syntheticGetCheckDisabled(childEntity.node);
- }).forEach(function (childEntity) {
- checkedKeys.delete(childEntity.key);
- });
- }
- });
- }
- // Remove checked keys form bottom to top
- halfCheckedKeys = new Set();
- var visitedKeys = new Set();
- for (var _level2 = maxLevel; _level2 >= 0; _level2 -= 1) {
- var _entities2 = levelEntities.get(_level2) || new Set();
- _entities2.forEach(function (entity) {
- var parent = entity.parent,
- node = entity.node;
- // Skip if no need to check
- if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) {
- return;
- }
- // Skip if parent is disabled
- if (syntheticGetCheckDisabled(entity.parent.node)) {
- visitedKeys.add(parent.key);
- return;
- }
- var allChecked = true;
- var partialChecked = false;
- (parent.children || []).filter(function (childEntity) {
- return !syntheticGetCheckDisabled(childEntity.node);
- }).forEach(function (_ref3) {
- var key = _ref3.key;
- var checked = checkedKeys.has(key);
- if (allChecked && !checked) {
- allChecked = false;
- }
- if (!partialChecked && (checked || halfCheckedKeys.has(key))) {
- partialChecked = true;
- }
- });
- if (!allChecked) {
- checkedKeys.delete(parent.key);
- }
- if (partialChecked) {
- halfCheckedKeys.add(parent.key);
- }
- visitedKeys.add(parent.key);
- });
- }
- return {
- checkedKeys: Array.from(checkedKeys),
- halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
- };
- }
- /**
- * Conduct with keys.
- * @param keyList current key list
- * @param keyEntities key - dataEntity map
- * @param mode `fill` to fill missing key, `clean` to remove useless key
- */
- function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
- var warningMissKeys = [];
- var syntheticGetCheckDisabled;
- if (getCheckDisabled) {
- syntheticGetCheckDisabled = getCheckDisabled;
- } else {
- syntheticGetCheckDisabled = isCheckDisabled;
- }
- // We only handle exist keys
- var keys = new Set(keyList.filter(function (key) {
- var hasEntity = !!getEntity(keyEntities, key);
- if (!hasEntity) {
- warningMissKeys.push(key);
- }
- return hasEntity;
- }));
- var levelEntities = new Map();
- var maxLevel = 0;
- // Convert entities by level for calculation
- Object.keys(keyEntities).forEach(function (key) {
- var entity = keyEntities[key];
- var level = entity.level;
- var levelSet = levelEntities.get(level);
- if (!levelSet) {
- levelSet = new Set();
- levelEntities.set(level, levelSet);
- }
- levelSet.add(entity);
- maxLevel = Math.max(maxLevel, level);
- });
- (0,warning["default"])(!warningMissKeys.length, "Tree missing follow keys: ".concat(warningMissKeys.slice(0, 100).map(function (key) {
- return "'".concat(key, "'");
- }).join(', ')));
- var result;
- if (checked === true) {
- result = fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled);
- } else {
- result = cleanConductCheck(keys, checked.halfCheckedKeys, levelEntities, maxLevel, syntheticGetCheckDisabled);
- }
- return result;
- }
- ;// ./node_modules/rc-cascader/es/hooks/useSelect.js
- function useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy) {
- return function (valuePath) {
- if (!multiple) {
- triggerChange(valuePath);
- } else {
- // Prepare conduct required info
- var pathKey = toPathKey(valuePath);
- var checkedPathKeys = toPathKeys(checkedValues);
- var halfCheckedPathKeys = toPathKeys(halfCheckedValues);
- var existInChecked = checkedPathKeys.includes(pathKey);
- var existInMissing = missingCheckedValues.some(function (valueCells) {
- return toPathKey(valueCells) === pathKey;
- });
- // Do update
- var nextCheckedValues = checkedValues;
- var nextMissingValues = missingCheckedValues;
- if (existInMissing && !existInChecked) {
- // Missing value only do filter
- nextMissingValues = missingCheckedValues.filter(function (valueCells) {
- return toPathKey(valueCells) !== pathKey;
- });
- } else {
- // Update checked key first
- var nextRawCheckedKeys = existInChecked ? checkedPathKeys.filter(function (key) {
- return key !== pathKey;
- }) : [].concat((0,toConsumableArray["default"])(checkedPathKeys), [pathKey]);
- var pathKeyEntities = getPathKeyEntities();
- // Conduction by selected or not
- var checkedKeys;
- if (existInChecked) {
- var _conductCheck = conductCheck(nextRawCheckedKeys, {
- checked: false,
- halfCheckedKeys: halfCheckedPathKeys
- }, pathKeyEntities);
- checkedKeys = _conductCheck.checkedKeys;
- } else {
- var _conductCheck2 = conductCheck(nextRawCheckedKeys, true, pathKeyEntities);
- checkedKeys = _conductCheck2.checkedKeys;
- }
- // Roll up to parent level keys
- var deDuplicatedKeys = formatStrategyValues(checkedKeys, getPathKeyEntities, showCheckedStrategy);
- nextCheckedValues = getValueByKeyPath(deDuplicatedKeys);
- }
- triggerChange([].concat((0,toConsumableArray["default"])(nextMissingValues), (0,toConsumableArray["default"])(nextCheckedValues)));
- }
- };
- }
- ;// ./node_modules/rc-cascader/es/hooks/useValues.js
- function useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues) {
- // Fill `rawValues` with checked conduction values
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var _getMissingValues = getMissingValues(rawValues),
- _getMissingValues2 = (0,slicedToArray["default"])(_getMissingValues, 2),
- existValues = _getMissingValues2[0],
- missingValues = _getMissingValues2[1];
- if (!multiple || !rawValues.length) {
- return [existValues, [], missingValues];
- }
- var keyPathValues = toPathKeys(existValues);
- var keyPathEntities = getPathKeyEntities();
- var _conductCheck = conductCheck(keyPathValues, true, keyPathEntities),
- checkedKeys = _conductCheck.checkedKeys,
- halfCheckedKeys = _conductCheck.halfCheckedKeys;
- // Convert key back to value cells
- return [getValueByKeyPath(checkedKeys), getValueByKeyPath(halfCheckedKeys), missingValues];
- }, [multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues]);
- }
- ;// ./node_modules/rc-cascader/es/OptionList/CacheContent.js
- var CacheContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(function (_ref) {
- var children = _ref.children;
- return children;
- }, function (_, next) {
- return !next.open;
- });
- if (true) {
- CacheContent.displayName = 'CacheContent';
- }
- /* harmony default export */ var OptionList_CacheContent = (CacheContent);
- ;// ./node_modules/rc-cascader/es/OptionList/Checkbox.js
- function Checkbox_Checkbox(_ref) {
- var _classNames;
- var prefixCls = _ref.prefixCls,
- checked = _ref.checked,
- halfChecked = _ref.halfChecked,
- disabled = _ref.disabled,
- onClick = _ref.onClick,
- disableCheckbox = _ref.disableCheckbox;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_cascader_es_context),
- checkable = _React$useContext.checkable;
- var customCheckbox = typeof checkable !== 'boolean' ? checkable : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()("".concat(prefixCls), (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-checked"), checked), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-indeterminate"), !checked && halfChecked), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-disabled"), disabled || disableCheckbox), _classNames)),
- onClick: onClick
- }, customCheckbox);
- }
- ;// ./node_modules/rc-cascader/es/OptionList/Column.js
- var FIX_LABEL = '__cascader_fix_label__';
- function Column(_ref) {
- var prefixCls = _ref.prefixCls,
- multiple = _ref.multiple,
- options = _ref.options,
- activeValue = _ref.activeValue,
- prevValuePath = _ref.prevValuePath,
- onToggleOpen = _ref.onToggleOpen,
- onSelect = _ref.onSelect,
- onActive = _ref.onActive,
- checkedSet = _ref.checkedSet,
- halfCheckedSet = _ref.halfCheckedSet,
- loadingKeys = _ref.loadingKeys,
- isSelectable = _ref.isSelectable,
- propsDisabled = _ref.disabled;
- var menuPrefixCls = "".concat(prefixCls, "-menu");
- var menuItemPrefixCls = "".concat(prefixCls, "-menu-item");
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_cascader_es_context),
- fieldNames = _React$useContext.fieldNames,
- changeOnSelect = _React$useContext.changeOnSelect,
- expandTrigger = _React$useContext.expandTrigger,
- expandIcon = _React$useContext.expandIcon,
- loadingIcon = _React$useContext.loadingIcon,
- dropdownMenuColumnStyle = _React$useContext.dropdownMenuColumnStyle,
- optionRender = _React$useContext.optionRender;
- var hoverOpen = expandTrigger === 'hover';
- var isOptionDisabled = function isOptionDisabled(disabled) {
- return propsDisabled || disabled;
- };
- // ============================ Option ============================
- var optionInfoList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return options.map(function (option) {
- var _option$FIX_LABEL;
- var disabled = option.disabled,
- disableCheckbox = option.disableCheckbox;
- var searchOptions = option[SEARCH_MARK];
- var label = (_option$FIX_LABEL = option[FIX_LABEL]) !== null && _option$FIX_LABEL !== void 0 ? _option$FIX_LABEL : option[fieldNames.label];
- var value = option[fieldNames.value];
- var isMergedLeaf = isLeaf(option, fieldNames);
- // Get real value of option. Search option is different way.
- var fullPath = searchOptions ? searchOptions.map(function (opt) {
- return opt[fieldNames.value];
- }) : [].concat((0,toConsumableArray["default"])(prevValuePath), [value]);
- var fullPathKey = toPathKey(fullPath);
- var isLoading = loadingKeys.includes(fullPathKey);
- // >>>>> checked
- var checked = checkedSet.has(fullPathKey);
- // >>>>> halfChecked
- var halfChecked = halfCheckedSet.has(fullPathKey);
- return {
- disabled: disabled,
- label: label,
- value: value,
- isLeaf: isMergedLeaf,
- isLoading: isLoading,
- checked: checked,
- halfChecked: halfChecked,
- option: option,
- disableCheckbox: disableCheckbox,
- fullPath: fullPath,
- fullPathKey: fullPathKey
- };
- });
- }, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
- // ============================ Render ============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: menuPrefixCls,
- role: "menu"
- }, optionInfoList.map(function (_ref2) {
- var _classNames;
- var disabled = _ref2.disabled,
- label = _ref2.label,
- value = _ref2.value,
- isMergedLeaf = _ref2.isLeaf,
- isLoading = _ref2.isLoading,
- checked = _ref2.checked,
- halfChecked = _ref2.halfChecked,
- option = _ref2.option,
- fullPath = _ref2.fullPath,
- fullPathKey = _ref2.fullPathKey,
- disableCheckbox = _ref2.disableCheckbox;
- // >>>>> Open
- var triggerOpenPath = function triggerOpenPath() {
- if (isOptionDisabled(disabled)) {
- return;
- }
- var nextValueCells = (0,toConsumableArray["default"])(fullPath);
- if (hoverOpen && isMergedLeaf) {
- nextValueCells.pop();
- }
- onActive(nextValueCells);
- };
- // >>>>> Selection
- var triggerSelect = function triggerSelect() {
- if (isSelectable(option) && !isOptionDisabled(disabled)) {
- onSelect(fullPath, isMergedLeaf);
- }
- };
- // >>>>> Title
- var title;
- if (typeof option.title === 'string') {
- title = option.title;
- } else if (typeof label === 'string') {
- title = label;
- }
- // >>>>> Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", {
- key: fullPathKey,
- className: classnames_default()(menuItemPrefixCls, (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(menuItemPrefixCls, "-expand"), !isMergedLeaf), (0,defineProperty["default"])(_classNames, "".concat(menuItemPrefixCls, "-active"), activeValue === value || activeValue === fullPathKey), (0,defineProperty["default"])(_classNames, "".concat(menuItemPrefixCls, "-disabled"), isOptionDisabled(disabled)), (0,defineProperty["default"])(_classNames, "".concat(menuItemPrefixCls, "-loading"), isLoading), _classNames)),
- style: dropdownMenuColumnStyle,
- role: "menuitemcheckbox",
- title: title,
- "aria-checked": checked,
- "data-path-key": fullPathKey,
- onClick: function onClick() {
- triggerOpenPath();
- if (disableCheckbox) {
- return;
- }
- if (!multiple || isMergedLeaf) {
- triggerSelect();
- }
- },
- onDoubleClick: function onDoubleClick() {
- if (changeOnSelect) {
- onToggleOpen(false);
- }
- },
- onMouseEnter: function onMouseEnter() {
- if (hoverOpen) {
- triggerOpenPath();
- }
- },
- onMouseDown: function onMouseDown(e) {
- // Prevent selector from blurring
- e.preventDefault();
- }
- }, multiple && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Checkbox_Checkbox, {
- prefixCls: "".concat(prefixCls, "-checkbox"),
- checked: checked,
- halfChecked: halfChecked,
- disabled: isOptionDisabled(disabled) || disableCheckbox,
- disableCheckbox: disableCheckbox,
- onClick: function onClick(e) {
- if (disableCheckbox) {
- return;
- }
- e.stopPropagation();
- triggerSelect();
- }
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(menuItemPrefixCls, "-content")
- }, optionRender ? optionRender(option) : label), !isLoading && expandIcon && !isMergedLeaf && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(menuItemPrefixCls, "-expand-icon")
- }, expandIcon), isLoading && loadingIcon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(menuItemPrefixCls, "-loading-icon")
- }, loadingIcon));
- }));
- }
- ;// ./node_modules/rc-cascader/es/OptionList/useActive.js
- /**
- * Control the active open options path.
- */
- var useActive_useActive = function useActive(multiple, open) {
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_cascader_es_context),
- values = _React$useContext.values;
- var firstValueCells = values[0];
- // Record current dropdown active options
- // This also control the open status
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeValueCells = _React$useState2[0],
- setActiveValueCells = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!multiple) {
- setActiveValueCells(firstValueCells || []);
- }
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [open, firstValueCells]
- /* eslint-enable react-hooks/exhaustive-deps */);
- return [activeValueCells, setActiveValueCells];
- };
- /* harmony default export */ var OptionList_useActive = (useActive_useActive);
- ;// ./node_modules/rc-cascader/es/OptionList/useKeyboard.js
- /* harmony default export */ var useKeyboard = (function (ref, options, fieldNames, activeValueCells, setActiveValueCells, onKeyBoardSelect, contextProps) {
- var direction = contextProps.direction,
- searchValue = contextProps.searchValue,
- toggleOpen = contextProps.toggleOpen,
- open = contextProps.open;
- var rtl = direction === 'rtl';
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var activeIndex = -1;
- var currentOptions = options;
- var mergedActiveIndexes = [];
- var mergedActiveValueCells = [];
- var len = activeValueCells.length;
- var pathKeys = getFullPathKeys(options, fieldNames);
- // Fill validate active value cells and index
- var _loop = function _loop(i) {
- // Mark the active index for current options
- var nextActiveIndex = currentOptions.findIndex(function (option, index) {
- return (pathKeys[index] ? toPathKey(pathKeys[index]) : option[fieldNames.value]) === activeValueCells[i];
- });
- if (nextActiveIndex === -1) {
- return 1; // break
- }
- activeIndex = nextActiveIndex;
- mergedActiveIndexes.push(activeIndex);
- mergedActiveValueCells.push(activeValueCells[i]);
- currentOptions = currentOptions[activeIndex][fieldNames.children];
- };
- for (var i = 0; i < len && currentOptions; i += 1) {
- if (_loop(i)) break;
- }
- // Fill last active options
- var activeOptions = options;
- for (var _i = 0; _i < mergedActiveIndexes.length - 1; _i += 1) {
- activeOptions = activeOptions[mergedActiveIndexes[_i]][fieldNames.children];
- }
- return [mergedActiveValueCells, activeIndex, activeOptions, pathKeys];
- }, [activeValueCells, fieldNames, options]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 4),
- validActiveValueCells = _React$useMemo2[0],
- lastActiveIndex = _React$useMemo2[1],
- lastActiveOptions = _React$useMemo2[2],
- fullPathKeys = _React$useMemo2[3];
- // Update active value cells and scroll to target element
- var internalSetActiveValueCells = function internalSetActiveValueCells(next) {
- setActiveValueCells(next);
- };
- // Same options offset
- var offsetActiveOption = function offsetActiveOption(offset) {
- var len = lastActiveOptions.length;
- var currentIndex = lastActiveIndex;
- if (currentIndex === -1 && offset < 0) {
- currentIndex = len;
- }
- for (var i = 0; i < len; i += 1) {
- currentIndex = (currentIndex + offset + len) % len;
- var _option = lastActiveOptions[currentIndex];
- if (_option && !_option.disabled) {
- var nextActiveCells = validActiveValueCells.slice(0, -1).concat(fullPathKeys[currentIndex] ? toPathKey(fullPathKeys[currentIndex]) : _option[fieldNames.value]);
- internalSetActiveValueCells(nextActiveCells);
- return;
- }
- }
- };
- // Different options offset
- var prevColumn = function prevColumn() {
- if (validActiveValueCells.length > 1) {
- var nextActiveCells = validActiveValueCells.slice(0, -1);
- internalSetActiveValueCells(nextActiveCells);
- } else {
- toggleOpen(false);
- }
- };
- var nextColumn = function nextColumn() {
- var _lastActiveOptions$la;
- var nextOptions = ((_lastActiveOptions$la = lastActiveOptions[lastActiveIndex]) === null || _lastActiveOptions$la === void 0 ? void 0 : _lastActiveOptions$la[fieldNames.children]) || [];
- var nextOption = nextOptions.find(function (option) {
- return !option.disabled;
- });
- if (nextOption) {
- var nextActiveCells = [].concat((0,toConsumableArray["default"])(validActiveValueCells), [nextOption[fieldNames.value]]);
- internalSetActiveValueCells(nextActiveCells);
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- // scrollTo: treeRef.current?.scrollTo,
- onKeyDown: function onKeyDown(event) {
- var which = event.which;
- switch (which) {
- // >>> Arrow keys
- case KeyCode["default"].UP:
- case KeyCode["default"].DOWN:
- {
- var offset = 0;
- if (which === KeyCode["default"].UP) {
- offset = -1;
- } else if (which === KeyCode["default"].DOWN) {
- offset = 1;
- }
- if (offset !== 0) {
- offsetActiveOption(offset);
- }
- break;
- }
- case KeyCode["default"].LEFT:
- {
- if (searchValue) {
- break;
- }
- if (rtl) {
- nextColumn();
- } else {
- prevColumn();
- }
- break;
- }
- case KeyCode["default"].RIGHT:
- {
- if (searchValue) {
- break;
- }
- if (rtl) {
- prevColumn();
- } else {
- nextColumn();
- }
- break;
- }
- case KeyCode["default"].BACKSPACE:
- {
- if (!searchValue) {
- prevColumn();
- }
- break;
- }
- // >>> Select
- case KeyCode["default"].ENTER:
- {
- if (validActiveValueCells.length) {
- var _option2 = lastActiveOptions[lastActiveIndex];
- // Search option should revert back of origin options
- var originOptions = (_option2 === null || _option2 === void 0 ? void 0 : _option2[SEARCH_MARK]) || [];
- if (originOptions.length) {
- onKeyBoardSelect(originOptions.map(function (opt) {
- return opt[fieldNames.value];
- }), originOptions[originOptions.length - 1]);
- } else {
- onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
- }
- }
- break;
- }
- // >>> Close
- case KeyCode["default"].ESC:
- {
- toggleOpen(false);
- if (open) {
- event.stopPropagation();
- }
- }
- }
- },
- onKeyUp: function onKeyUp() {}
- };
- });
- });
- ;// ./node_modules/rc-cascader/es/OptionList/List.js
- /* eslint-disable default-case */
- var RawOptionList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _optionColumns$, _ref3, _classNames;
- var prefixCls = props.prefixCls,
- multiple = props.multiple,
- searchValue = props.searchValue,
- toggleOpen = props.toggleOpen,
- notFoundContent = props.notFoundContent,
- direction = props.direction,
- open = props.open,
- disabled = props.disabled;
- var containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var rtl = direction === 'rtl';
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_cascader_es_context),
- options = _React$useContext.options,
- values = _React$useContext.values,
- halfValues = _React$useContext.halfValues,
- fieldNames = _React$useContext.fieldNames,
- changeOnSelect = _React$useContext.changeOnSelect,
- onSelect = _React$useContext.onSelect,
- searchOptions = _React$useContext.searchOptions,
- dropdownPrefixCls = _React$useContext.dropdownPrefixCls,
- loadData = _React$useContext.loadData,
- expandTrigger = _React$useContext.expandTrigger;
- var mergedPrefixCls = dropdownPrefixCls || prefixCls;
- // ========================= loadData =========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- loadingKeys = _React$useState2[0],
- setLoadingKeys = _React$useState2[1];
- var internalLoadData = function internalLoadData(valueCells) {
- // Do not load when search
- if (!loadData || searchValue) {
- return;
- }
- var optionList = toPathOptions(valueCells, options, fieldNames);
- var rawOptions = optionList.map(function (_ref) {
- var option = _ref.option;
- return option;
- });
- var lastOption = rawOptions[rawOptions.length - 1];
- if (lastOption && !isLeaf(lastOption, fieldNames)) {
- var pathKey = toPathKey(valueCells);
- setLoadingKeys(function (keys) {
- return [].concat((0,toConsumableArray["default"])(keys), [pathKey]);
- });
- loadData(rawOptions);
- }
- };
- // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (loadingKeys.length) {
- loadingKeys.forEach(function (loadingKey) {
- var valueStrCells = toPathValueStr(loadingKey);
- var optionList = toPathOptions(valueStrCells, options, fieldNames, true).map(function (_ref2) {
- var option = _ref2.option;
- return option;
- });
- var lastOption = optionList[optionList.length - 1];
- if (!lastOption || lastOption[fieldNames.children] || isLeaf(lastOption, fieldNames)) {
- setLoadingKeys(function (keys) {
- return keys.filter(function (key) {
- return key !== loadingKey;
- });
- });
- }
- });
- }
- }, [options, loadingKeys, fieldNames]);
- // ========================== Values ==========================
- var checkedSet = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return new Set(toPathKeys(values));
- }, [values]);
- var halfCheckedSet = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return new Set(toPathKeys(halfValues));
- }, [halfValues]);
- // ====================== Accessibility =======================
- var _useActive = OptionList_useActive(multiple, open),
- _useActive2 = (0,slicedToArray["default"])(_useActive, 2),
- activeValueCells = _useActive2[0],
- setActiveValueCells = _useActive2[1];
- // =========================== Path ===========================
- var onPathOpen = function onPathOpen(nextValueCells) {
- setActiveValueCells(nextValueCells);
- // Trigger loadData
- internalLoadData(nextValueCells);
- };
- var isSelectable = function isSelectable(option) {
- if (disabled) {
- return false;
- }
- var optionDisabled = option.disabled;
- var isMergedLeaf = isLeaf(option, fieldNames);
- return !optionDisabled && (isMergedLeaf || changeOnSelect || multiple);
- };
- var onPathSelect = function onPathSelect(valuePath, leaf) {
- var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- onSelect(valuePath);
- if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {
- toggleOpen(false);
- }
- };
- // ========================== Option ==========================
- var mergedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (searchValue) {
- return searchOptions;
- }
- return options;
- }, [searchValue, searchOptions, options]);
- // ========================== Column ==========================
- var optionColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var optionList = [{
- options: mergedOptions
- }];
- var currentList = mergedOptions;
- var fullPathKeys = getFullPathKeys(currentList, fieldNames);
- var _loop = function _loop() {
- var activeValueCell = activeValueCells[i];
- var currentOption = currentList.find(function (option, index) {
- return (fullPathKeys[index] ? toPathKey(fullPathKeys[index]) : option[fieldNames.value]) === activeValueCell;
- });
- var subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];
- if (!(subOptions !== null && subOptions !== void 0 && subOptions.length)) {
- return 1; // break
- }
- currentList = subOptions;
- optionList.push({
- options: subOptions
- });
- };
- for (var i = 0; i < activeValueCells.length; i += 1) {
- if (_loop()) break;
- }
- return optionList;
- }, [mergedOptions, activeValueCells, fieldNames]);
- // ========================= Keyboard =========================
- var onKeyboardSelect = function onKeyboardSelect(selectValueCells, option) {
- if (isSelectable(option)) {
- onPathSelect(selectValueCells, isLeaf(option, fieldNames), true);
- }
- };
- useKeyboard(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect, {
- direction: direction,
- searchValue: searchValue,
- toggleOpen: toggleOpen,
- open: open
- });
- // >>>>> Active Scroll
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (searchValue) {
- return;
- }
- for (var i = 0; i < activeValueCells.length; i += 1) {
- var _containerRef$current;
- var cellPath = activeValueCells.slice(0, i + 1);
- var cellKeyPath = toPathKey(cellPath);
- var ele = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelector("li[data-path-key=\"".concat(cellKeyPath.replace(/\\{0,2}"/g, '\\"'), "\"]") // matches unescaped double quotes
- );
- if (ele) {
- scrollIntoParentView(ele);
- }
- }
- }, [activeValueCells, searchValue]);
- // ========================== Render ==========================
- // >>>>> Empty
- var isEmpty = !((_optionColumns$ = optionColumns[0]) !== null && _optionColumns$ !== void 0 && (_optionColumns$ = _optionColumns$.options) !== null && _optionColumns$ !== void 0 && _optionColumns$.length);
- var emptyList = [(_ref3 = {}, (0,defineProperty["default"])(_ref3, fieldNames.value, '__EMPTY__'), (0,defineProperty["default"])(_ref3, FIX_LABEL, notFoundContent), (0,defineProperty["default"])(_ref3, "disabled", true), _ref3)];
- var columnProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- multiple: !isEmpty && multiple,
- onSelect: onPathSelect,
- onActive: onPathOpen,
- onToggleOpen: toggleOpen,
- checkedSet: checkedSet,
- halfCheckedSet: halfCheckedSet,
- loadingKeys: loadingKeys,
- isSelectable: isSelectable
- });
- // >>>>> Columns
- var mergedOptionColumns = isEmpty ? [{
- options: emptyList
- }] : optionColumns;
- var columnNodes = mergedOptionColumns.map(function (col, index) {
- var prevValuePath = activeValueCells.slice(0, index);
- var activeValue = activeValueCells[index];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Column, (0,esm_extends["default"])({
- key: index
- }, columnProps, {
- prefixCls: mergedPrefixCls,
- options: col.options,
- prevValuePath: prevValuePath,
- activeValue: activeValue
- }));
- });
- // >>>>> Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OptionList_CacheContent, {
- open: open
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(mergedPrefixCls, "-menus"), (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(mergedPrefixCls, "-menu-empty"), isEmpty), (0,defineProperty["default"])(_classNames, "".concat(mergedPrefixCls, "-rtl"), rtl), _classNames)),
- ref: containerRef
- }, columnNodes));
- });
- if (true) {
- RawOptionList.displayName = 'RawOptionList';
- }
- /* harmony default export */ var OptionList_List = (RawOptionList);
- ;// ./node_modules/rc-cascader/es/OptionList/index.js
- var OptionList_RefOptionList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var baseProps = useBaseProps();
- // >>>>> Render
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OptionList_List, (0,esm_extends["default"])({}, props, baseProps, {
- ref: ref
- }));
- });
- /* harmony default export */ var rc_cascader_es_OptionList = (OptionList_RefOptionList);
- ;// ./node_modules/rc-cascader/es/Panel.js
- function noop() {}
- function Panel_Panel(props) {
- var _classNames;
- var _ref = props,
- _ref$prefixCls = _ref.prefixCls,
- prefixCls = _ref$prefixCls === void 0 ? 'rc-cascader' : _ref$prefixCls,
- style = _ref.style,
- className = _ref.className,
- options = _ref.options,
- checkable = _ref.checkable,
- defaultValue = _ref.defaultValue,
- value = _ref.value,
- fieldNames = _ref.fieldNames,
- changeOnSelect = _ref.changeOnSelect,
- onChange = _ref.onChange,
- showCheckedStrategy = _ref.showCheckedStrategy,
- loadData = _ref.loadData,
- expandTrigger = _ref.expandTrigger,
- _ref$expandIcon = _ref.expandIcon,
- expandIcon = _ref$expandIcon === void 0 ? '>' : _ref$expandIcon,
- loadingIcon = _ref.loadingIcon,
- direction = _ref.direction,
- _ref$notFoundContent = _ref.notFoundContent,
- notFoundContent = _ref$notFoundContent === void 0 ? 'Not Found' : _ref$notFoundContent,
- disabled = _ref.disabled;
- // ======================== Multiple ========================
- var multiple = !!checkable;
- // ========================= Values =========================
- var _useMergedState = (0,rc_util_es.useMergedState)(defaultValue, {
- value: value,
- postState: toRawValues
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- rawValues = _useMergedState2[0],
- setRawValues = _useMergedState2[1];
- // ========================= FieldNames =========================
- var mergedFieldNames = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return commonUtil_fillFieldNames(fieldNames);
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [JSON.stringify(fieldNames)]
- /* eslint-enable react-hooks/exhaustive-deps */);
- // =========================== Option ===========================
- var _useOptions = useOptions_useOptions(mergedFieldNames, options),
- _useOptions2 = (0,slicedToArray["default"])(_useOptions, 3),
- mergedOptions = _useOptions2[0],
- getPathKeyEntities = _useOptions2[1],
- getValueByKeyPath = _useOptions2[2];
- // ========================= Values =========================
- var getMissingValues = useMissingValues(mergedOptions, mergedFieldNames);
- // Fill `rawValues` with checked conduction values
- var _useValues = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues),
- _useValues2 = (0,slicedToArray["default"])(_useValues, 3),
- checkedValues = _useValues2[0],
- halfCheckedValues = _useValues2[1],
- missingCheckedValues = _useValues2[2];
- // =========================== Change ===========================
- var triggerChange = (0,rc_util_es.useEvent)(function (nextValues) {
- setRawValues(nextValues);
- // Save perf if no need trigger event
- if (onChange) {
- var nextRawValues = toRawValues(nextValues);
- var valueOptions = nextRawValues.map(function (valueCells) {
- return toPathOptions(valueCells, mergedOptions, mergedFieldNames).map(function (valueOpt) {
- return valueOpt.option;
- });
- });
- var triggerValues = multiple ? nextRawValues : nextRawValues[0];
- var triggerOptions = multiple ? valueOptions : valueOptions[0];
- onChange(triggerValues, triggerOptions);
- }
- });
- // =========================== Select ===========================
- var handleSelection = useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);
- var onInternalSelect = (0,rc_util_es.useEvent)(function (valuePath) {
- handleSelection(valuePath);
- });
- // ======================== Context =========================
- var cascaderContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- options: mergedOptions,
- fieldNames: mergedFieldNames,
- values: checkedValues,
- halfValues: halfCheckedValues,
- changeOnSelect: changeOnSelect,
- onSelect: onInternalSelect,
- checkable: checkable,
- searchOptions: [],
- dropdownPrefixCls: undefined,
- loadData: loadData,
- expandTrigger: expandTrigger,
- expandIcon: expandIcon,
- loadingIcon: loadingIcon,
- dropdownMenuColumnStyle: undefined
- };
- }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, loadData, expandTrigger, expandIcon, loadingIcon]);
- // ========================= Render =========================
- var panelPrefixCls = "".concat(prefixCls, "-panel");
- var isEmpty = !mergedOptions.length;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_cascader_es_context.Provider, {
- value: cascaderContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(panelPrefixCls, (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(panelPrefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty["default"])(_classNames, "".concat(panelPrefixCls, "-empty"), isEmpty), _classNames), className),
- style: style
- }, isEmpty ? notFoundContent : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OptionList_List, {
- prefixCls: prefixCls,
- searchValue: "",
- multiple: multiple,
- toggleOpen: noop,
- open: true,
- direction: direction,
- disabled: disabled
- })));
- }
- ;// ./node_modules/rc-cascader/es/utils/warningPropsUtil.js
- function warningPropsUtil_warningProps(props) {
- var onPopupVisibleChange = props.onPopupVisibleChange,
- popupVisible = props.popupVisible,
- popupClassName = props.popupClassName,
- popupPlacement = props.popupPlacement,
- onDropdownVisibleChange = props.onDropdownVisibleChange;
- (0,warning["default"])(!onPopupVisibleChange, '`onPopupVisibleChange` is deprecated. Please use `onOpenChange` instead.');
- (0,warning["default"])(!onDropdownVisibleChange, '`onDropdownVisibleChange` is deprecated. Please use `onOpenChange` instead.');
- (0,warning["default"])(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.');
- (0,warning["default"])(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.');
- (0,warning["default"])(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.');
- }
- // value in Cascader options should not be null
- function warningPropsUtil_warningNullOptions(options, fieldNames) {
- if (options) {
- var recursiveOptions = function recursiveOptions(optionsList) {
- for (var i = 0; i < optionsList.length; i++) {
- var option = optionsList[i];
- if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
- (0,warning["default"])(false, '`value` in Cascader options should not be `null`.');
- return true;
- }
- if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) {
- return true;
- }
- }
- };
- recursiveOptions(options);
- }
- }
- /* harmony default export */ var utils_warningPropsUtil = (warningPropsUtil_warningProps);
- ;// ./node_modules/rc-cascader/es/Cascader.js
- var Cascader_excluded = ["id", "prefixCls", "fieldNames", "defaultValue", "value", "changeOnSelect", "onChange", "displayRender", "checkable", "autoClearSearchValue", "searchValue", "onSearch", "showSearch", "expandTrigger", "options", "dropdownPrefixCls", "loadData", "popupVisible", "open", "popupClassName", "dropdownClassName", "dropdownMenuColumnStyle", "dropdownStyle", "popupPlacement", "placement", "onDropdownVisibleChange", "onPopupVisibleChange", "onOpenChange", "expandIcon", "loadingIcon", "children", "dropdownMatchSelectWidth", "showCheckedStrategy", "optionRender"];
- var Cascader = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var id = props.id,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-cascader' : _props$prefixCls,
- fieldNames = props.fieldNames,
- defaultValue = props.defaultValue,
- value = props.value,
- changeOnSelect = props.changeOnSelect,
- onChange = props.onChange,
- displayRender = props.displayRender,
- checkable = props.checkable,
- _props$autoClearSearc = props.autoClearSearchValue,
- autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
- searchValue = props.searchValue,
- onSearch = props.onSearch,
- showSearch = props.showSearch,
- expandTrigger = props.expandTrigger,
- options = props.options,
- dropdownPrefixCls = props.dropdownPrefixCls,
- loadData = props.loadData,
- popupVisible = props.popupVisible,
- open = props.open,
- popupClassName = props.popupClassName,
- dropdownClassName = props.dropdownClassName,
- dropdownMenuColumnStyle = props.dropdownMenuColumnStyle,
- customDropdownStyle = props.dropdownStyle,
- popupPlacement = props.popupPlacement,
- placement = props.placement,
- onDropdownVisibleChange = props.onDropdownVisibleChange,
- onPopupVisibleChange = props.onPopupVisibleChange,
- onOpenChange = props.onOpenChange,
- _props$expandIcon = props.expandIcon,
- expandIcon = _props$expandIcon === void 0 ? '>' : _props$expandIcon,
- loadingIcon = props.loadingIcon,
- children = props.children,
- _props$dropdownMatchS = props.dropdownMatchSelectWidth,
- dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? false : _props$dropdownMatchS,
- _props$showCheckedStr = props.showCheckedStrategy,
- showCheckedStrategy = _props$showCheckedStr === void 0 ? SHOW_PARENT : _props$showCheckedStr,
- optionRender = props.optionRender,
- restProps = (0,objectWithoutProperties["default"])(props, Cascader_excluded);
- var mergedId = useId_useId(id);
- var multiple = !!checkable;
- // =========================== Values ===========================
- var _useMergedState = (0,useMergedState["default"])(defaultValue, {
- value: value,
- postState: toRawValues
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- rawValues = _useMergedState2[0],
- setRawValues = _useMergedState2[1];
- // ========================= FieldNames =========================
- var mergedFieldNames = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return commonUtil_fillFieldNames(fieldNames);
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [JSON.stringify(fieldNames)]
- /* eslint-enable react-hooks/exhaustive-deps */);
- // =========================== Option ===========================
- var _useOptions = useOptions_useOptions(mergedFieldNames, options),
- _useOptions2 = (0,slicedToArray["default"])(_useOptions, 3),
- mergedOptions = _useOptions2[0],
- getPathKeyEntities = _useOptions2[1],
- getValueByKeyPath = _useOptions2[2];
- // =========================== Search ===========================
- var _useMergedState3 = (0,useMergedState["default"])('', {
- value: searchValue,
- postState: function postState(search) {
- return search || '';
- }
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedSearchValue = _useMergedState4[0],
- setSearchValue = _useMergedState4[1];
- var onInternalSearch = function onInternalSearch(searchText, info) {
- setSearchValue(searchText);
- if (info.source !== 'blur' && onSearch) {
- onSearch(searchText);
- }
- };
- var _useSearchConfig = useSearchConfig(showSearch),
- _useSearchConfig2 = (0,slicedToArray["default"])(_useSearchConfig, 2),
- mergedShowSearch = _useSearchConfig2[0],
- searchConfig = _useSearchConfig2[1];
- var searchOptions = hooks_useSearchOptions(mergedSearchValue, mergedOptions, mergedFieldNames, dropdownPrefixCls || prefixCls, searchConfig, changeOnSelect || multiple);
- // =========================== Values ===========================
- var getMissingValues = useMissingValues(mergedOptions, mergedFieldNames);
- // Fill `rawValues` with checked conduction values
- var _useValues = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues),
- _useValues2 = (0,slicedToArray["default"])(_useValues, 3),
- checkedValues = _useValues2[0],
- halfCheckedValues = _useValues2[1],
- missingCheckedValues = _useValues2[2];
- var deDuplicatedValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var checkedKeys = toPathKeys(checkedValues);
- var deduplicateKeys = formatStrategyValues(checkedKeys, getPathKeyEntities, showCheckedStrategy);
- return [].concat((0,toConsumableArray["default"])(missingCheckedValues), (0,toConsumableArray["default"])(getValueByKeyPath(deduplicateKeys)));
- }, [checkedValues, getPathKeyEntities, getValueByKeyPath, missingCheckedValues, showCheckedStrategy]);
- var displayValues = useDisplayValues(deDuplicatedValues, mergedOptions, mergedFieldNames, multiple, displayRender);
- // =========================== Change ===========================
- var triggerChange = (0,useEvent["default"])(function (nextValues) {
- setRawValues(nextValues);
- // Save perf if no need trigger event
- if (onChange) {
- var nextRawValues = toRawValues(nextValues);
- var valueOptions = nextRawValues.map(function (valueCells) {
- return toPathOptions(valueCells, mergedOptions, mergedFieldNames).map(function (valueOpt) {
- return valueOpt.option;
- });
- });
- var triggerValues = multiple ? nextRawValues : nextRawValues[0];
- var triggerOptions = multiple ? valueOptions : valueOptions[0];
- onChange(triggerValues, triggerOptions);
- }
- });
- // =========================== Select ===========================
- var handleSelection = useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);
- var onInternalSelect = (0,useEvent["default"])(function (valuePath) {
- if (!multiple || autoClearSearchValue) {
- setSearchValue('');
- }
- handleSelection(valuePath);
- });
- // Display Value change logic
- var onDisplayValuesChange = function onDisplayValuesChange(_, info) {
- if (info.type === 'clear') {
- triggerChange([]);
- return;
- }
- // Cascader do not support `add` type. Only support `remove`
- var _ref = info.values[0],
- valueCells = _ref.valueCells;
- onInternalSelect(valueCells);
- };
- // ============================ Open ============================
- var mergedOpen = open !== undefined ? open : popupVisible;
- var mergedDropdownClassName = dropdownClassName || popupClassName;
- var mergedPlacement = placement || popupPlacement;
- var onInternalDropdownVisibleChange = function onInternalDropdownVisibleChange(nextVisible) {
- onOpenChange === null || onOpenChange === void 0 || onOpenChange(nextVisible);
- onDropdownVisibleChange === null || onDropdownVisibleChange === void 0 || onDropdownVisibleChange(nextVisible);
- onPopupVisibleChange === null || onPopupVisibleChange === void 0 || onPopupVisibleChange(nextVisible);
- };
- // ========================== Warning ===========================
- if (true) {
- utils_warningPropsUtil(props);
- warningPropsUtil_warningNullOptions(mergedOptions, mergedFieldNames);
- }
- // ========================== Context ===========================
- var cascaderContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- options: mergedOptions,
- fieldNames: mergedFieldNames,
- values: checkedValues,
- halfValues: halfCheckedValues,
- changeOnSelect: changeOnSelect,
- onSelect: onInternalSelect,
- checkable: checkable,
- searchOptions: searchOptions,
- dropdownPrefixCls: dropdownPrefixCls,
- loadData: loadData,
- expandTrigger: expandTrigger,
- expandIcon: expandIcon,
- loadingIcon: loadingIcon,
- dropdownMenuColumnStyle: dropdownMenuColumnStyle,
- optionRender: optionRender
- };
- }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, searchOptions, dropdownPrefixCls, loadData, expandTrigger, expandIcon, loadingIcon, dropdownMenuColumnStyle, optionRender]);
- // ==============================================================
- // == Render ==
- // ==============================================================
- var emptyOptions = !(mergedSearchValue ? searchOptions : mergedOptions).length;
- var dropdownStyle =
- // Search to match width
- mergedSearchValue && searchConfig.matchInputWidth ||
- // Empty keep the width
- emptyOptions ? {} : {
- minWidth: 'auto'
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_cascader_es_context.Provider, {
- value: cascaderContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_BaseSelect, (0,esm_extends["default"])({}, restProps, {
- // MISC
- ref: ref,
- id: mergedId,
- prefixCls: prefixCls,
- autoClearSearchValue: autoClearSearchValue,
- dropdownMatchSelectWidth: dropdownMatchSelectWidth,
- dropdownStyle: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, dropdownStyle), customDropdownStyle)
- // Value
- ,
- displayValues: displayValues,
- onDisplayValuesChange: onDisplayValuesChange,
- mode: multiple ? 'multiple' : undefined
- // Search
- ,
- searchValue: mergedSearchValue,
- onSearch: onInternalSearch,
- showSearch: mergedShowSearch
- // Options
- ,
- OptionList: rc_cascader_es_OptionList,
- emptyOptions: emptyOptions
- // Open
- ,
- open: mergedOpen,
- dropdownClassName: mergedDropdownClassName,
- placement: mergedPlacement,
- onDropdownVisibleChange: onInternalDropdownVisibleChange
- // Children
- ,
- getRawInputElement: function getRawInputElement() {
- return children;
- }
- })));
- });
- if (true) {
- Cascader.displayName = 'Cascader';
- }
- Cascader.SHOW_PARENT = SHOW_PARENT;
- Cascader.SHOW_CHILD = SHOW_CHILD;
- Cascader.Panel = Panel_Panel;
- /* harmony default export */ var es_Cascader = (Cascader);
- ;// ./node_modules/rc-cascader/es/index.js
- /* harmony default export */ var rc_cascader_es = (es_Cascader);
- ;// ./components/cascader/hooks/useBase.ts
- function useBase(customizePrefixCls, direction) {
- const {
- getPrefixCls,
- direction: rootDirection,
- renderEmpty
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const mergedDirection = direction || rootDirection;
- const prefixCls = getPrefixCls('select', customizePrefixCls);
- const cascaderPrefixCls = getPrefixCls('cascader', customizePrefixCls);
- return [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty];
- }
- /* harmony default export */ var hooks_useBase = (useBase);
- ;// ./components/cascader/hooks/useCheckable.tsx
- function useCheckable(cascaderPrefixCls, multiple) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => multiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${cascaderPrefixCls}-checkbox-inner`
- }) : false, [multiple]);
- }
- ;// ./components/cascader/hooks/useColumnIcons.tsx
- const useColumnIcons = (prefixCls, rtl, expandIcon) => {
- let mergedExpandIcon = expandIcon;
- if (!expandIcon) {
- mergedExpandIcon = rtl ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null);
- }
- const loadingIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-menu-item-loading-icon`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, {
- spin: true
- }));
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => [mergedExpandIcon, loadingIcon], [mergedExpandIcon]);
- };
- /* harmony default export */ var hooks_useColumnIcons = (useColumnIcons);
- // EXTERNAL MODULE: ./components/cascader/style/index.ts
- var cascader_style = __webpack_require__("./components/cascader/style/index.ts");
- // EXTERNAL MODULE: ./components/cascader/style/columns.ts
- var columns = __webpack_require__("./components/cascader/style/columns.ts");
- ;// ./components/cascader/style/panel.ts
- // ============================== Panel ===============================
- const genPanelStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-panel`]: [(0,columns["default"])(token), {
- display: 'inline-flex',
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- borderRadius: token.borderRadiusLG,
- overflowX: 'auto',
- maxWidth: '100%',
- [`${componentCls}-menus`]: {
- alignItems: 'stretch'
- },
- [`${componentCls}-menu`]: {
- height: 'auto'
- },
- '&-empty': {
- padding: token.paddingXXS
- }
- }]
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var panel = ((0,genStyleUtils.genComponentStyleHook)(['Cascader', 'Panel'], genPanelStyle, cascader_style.prepareComponentToken));
- ;// ./components/cascader/Panel.tsx
- function CascaderPanel(props) {
- const {
- prefixCls: customizePrefixCls,
- className,
- multiple,
- rootClassName,
- notFoundContent,
- direction,
- expandIcon,
- disabled: customDisabled
- } = props;
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty] = hooks_useBase(customizePrefixCls, direction);
- const rootCls = hooks_useCSSVarCls(cascaderPrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,cascader_style["default"])(cascaderPrefixCls, rootCls);
- panel(cascaderPrefixCls);
- const isRtl = mergedDirection === 'rtl';
- // ===================== Icon ======================
- const [mergedExpandIcon, loadingIcon] = hooks_useColumnIcons(prefixCls, isRtl, expandIcon);
- // ===================== Empty =====================
- const mergedNotFoundContent = notFoundContent || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Cascader')) || (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Cascader"
- }));
- // =================== Multiple ====================
- const checkable = useCheckable(cascaderPrefixCls, multiple);
- // ==================== Render =====================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Panel_Panel, Object.assign({}, props, {
- checkable: checkable,
- prefixCls: cascaderPrefixCls,
- className: classnames_default()(className, hashId, rootClassName, cssVarCls, rootCls),
- notFoundContent: mergedNotFoundContent,
- direction: mergedDirection,
- expandIcon: mergedExpandIcon,
- loadingIcon: loadingIcon,
- disabled: mergedDisabled
- })));
- }
- /* harmony default export */ var cascader_Panel = (CascaderPanel);
- ;// ./components/cascader/index.tsx
- var cascader_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const {
- SHOW_CHILD: cascader_SHOW_CHILD,
- SHOW_PARENT: cascader_SHOW_PARENT
- } = rc_cascader_es;
- function highlightKeyword(str, lowerKeyword, prefixCls) {
- const cells = str.toLowerCase().split(lowerKeyword).reduce((list, cur, index) => index === 0 ? [cur] : [].concat((0,toConsumableArray["default"])(list), [lowerKeyword, cur]), []);
- const fillCells = [];
- let start = 0;
- cells.forEach((cell, index) => {
- const end = start + cell.length;
- let originWorld = str.slice(start, end);
- start = end;
- if (index % 2 === 1) {
- originWorld =
- /*#__PURE__*/
- // eslint-disable-next-line react/no-array-index-key
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-menu-item-keyword`,
- key: `separator-${index}`
- }, originWorld);
- }
- fillCells.push(originWorld);
- });
- return fillCells;
- }
- const defaultSearchRender = (inputValue, path, prefixCls, fieldNames) => {
- const optionList = [];
- // We do lower here to save perf
- const lower = inputValue.toLowerCase();
- path.forEach((node, index) => {
- if (index !== 0) {
- optionList.push(' / ');
- }
- let label = node[fieldNames.label];
- const type = typeof label;
- if (type === 'string' || type === 'number') {
- label = highlightKeyword(String(label), lower, prefixCls);
- }
- optionList.push(label);
- });
- return optionList;
- };
- const cascader_Cascader = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b, _c, _d;
- const {
- prefixCls: customizePrefixCls,
- size: customizeSize,
- disabled: customDisabled,
- className,
- rootClassName,
- multiple,
- bordered = true,
- transitionName,
- choiceTransitionName = '',
- popupClassName,
- dropdownClassName,
- expandIcon,
- placement,
- showSearch,
- allowClear = true,
- notFoundContent,
- direction,
- getPopupContainer,
- status: customStatus,
- showArrow,
- builtinPlacements,
- style,
- variant: customVariant,
- dropdownRender,
- onDropdownVisibleChange,
- dropdownMenuColumnStyle,
- popupRender,
- dropdownStyle,
- popupMenuColumnStyle,
- onOpenChange,
- styles,
- classNames
- } = props,
- rest = cascader_rest(props, ["prefixCls", "size", "disabled", "className", "rootClassName", "multiple", "bordered", "transitionName", "choiceTransitionName", "popupClassName", "dropdownClassName", "expandIcon", "placement", "showSearch", "allowClear", "notFoundContent", "direction", "getPopupContainer", "status", "showArrow", "builtinPlacements", "style", "variant", "dropdownRender", "onDropdownVisibleChange", "dropdownMenuColumnStyle", "popupRender", "dropdownStyle", "popupMenuColumnStyle", "onOpenChange", "styles", "classNames"]);
- const restProps = (0,omit["default"])(rest, ['suffixIcon']);
- const {
- getPrefixCls,
- getPopupContainer: getContextPopupContainer,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('cascader');
- const {
- popupOverflow
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- // =================== Form =====================
- const {
- status: contextStatus,
- hasFeedback,
- isFormItemInput,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Cascader');
- // v5 deprecated dropdown api
- const deprecatedProps = {
- dropdownClassName: 'classNames.popup.root',
- dropdownStyle: 'styles.popup.root',
- dropdownRender: 'popupRender',
- dropdownMenuColumnStyle: 'popupMenuColumnStyle',
- onDropdownVisibleChange: 'onOpenChange',
- bordered: 'variant'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- true ? warning(!('showArrow' in props), 'deprecated', '`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.') : 0;
- }
- // ==================== Prefix =====================
- const [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty] = hooks_useBase(customizePrefixCls, direction);
- const isRtl = mergedDirection === 'rtl';
- const rootPrefixCls = getPrefixCls();
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapSelectCSSVar, hashId, cssVarCls] = (0,select_style["default"])(prefixCls, rootCls);
- const cascaderRootCls = hooks_useCSSVarCls(cascaderPrefixCls);
- const [wrapCascaderCSSVar] = (0,cascader_style["default"])(cascaderPrefixCls, cascaderRootCls);
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const [variant, enableVariantCls] = useVariants('cascader', customVariant, bordered);
- // =================== No Found ====================
- const mergedNotFoundContent = notFoundContent || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Cascader')) || (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Cascader"
- }));
- // =================== Dropdown ====================
- const mergedPopupClassName = classnames_default()(((_a = classNames === null || classNames === void 0 ? void 0 : classNames.popup) === null || _a === void 0 ? void 0 : _a.root) || ((_b = contextClassNames.popup) === null || _b === void 0 ? void 0 : _b.root) || popupClassName || dropdownClassName, `${cascaderPrefixCls}-dropdown`, {
- [`${cascaderPrefixCls}-dropdown-rtl`]: mergedDirection === 'rtl'
- }, rootClassName, rootCls, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cascaderRootCls, hashId, cssVarCls);
- const mergedPopupRender = select_usePopupRender(popupRender || dropdownRender);
- const mergedPopupMenuColumnStyle = popupMenuColumnStyle || dropdownMenuColumnStyle;
- const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
- const mergedPopupStyle = ((_c = styles === null || styles === void 0 ? void 0 : styles.popup) === null || _c === void 0 ? void 0 : _c.root) || ((_d = contextStyles.popup) === null || _d === void 0 ? void 0 : _d.root) || dropdownStyle;
- // ==================== Search =====================
- const mergedShowSearch = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!showSearch) {
- return showSearch;
- }
- let searchConfig = {
- render: defaultSearchRender
- };
- if (typeof showSearch === 'object') {
- searchConfig = Object.assign(Object.assign({}, searchConfig), showSearch);
- }
- return searchConfig;
- }, [showSearch]);
- // ===================== Size ======================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- // ===================== Icon ======================
- const [mergedExpandIcon, loadingIcon] = hooks_useColumnIcons(prefixCls, isRtl, expandIcon);
- // =================== Multiple ====================
- const checkable = useCheckable(cascaderPrefixCls, multiple);
- // ===================== Icons =====================
- const showSuffixIcon = useShowArrow(props.suffixIcon, showArrow);
- const {
- suffixIcon,
- removeIcon,
- clearIcon
- } = useIcons(Object.assign(Object.assign({}, props), {
- hasFeedback,
- feedbackIcon,
- showSuffixIcon,
- multiple,
- prefixCls,
- componentName: 'Cascader'
- }));
- // ===================== Placement =====================
- const memoPlacement = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (placement !== undefined) {
- return placement;
- }
- return isRtl ? 'bottomRight' : 'bottomLeft';
- }, [placement, isRtl]);
- const mergedAllowClear = allowClear === true ? {
- clearIcon
- } : allowClear;
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex);
- // ==================== Render =====================
- const renderNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_cascader_es, Object.assign({
- prefixCls: prefixCls,
- className: classnames_default()(!customizePrefixCls && cascaderPrefixCls, {
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-rtl`]: isRtl,
- [`${prefixCls}-${variant}`]: enableVariantCls,
- [`${prefixCls}-in-form-item`]: isFormItemInput
- }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, rootClassName, classNames === null || classNames === void 0 ? void 0 : classNames.root, contextClassNames.root, rootCls, cascaderRootCls, hashId, cssVarCls),
- disabled: mergedDisabled,
- style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), contextStyle), style)
- }, restProps, {
- builtinPlacements: select_mergedBuiltinPlacements(builtinPlacements, popupOverflow),
- direction: mergedDirection,
- placement: memoPlacement,
- notFoundContent: mergedNotFoundContent,
- allowClear: mergedAllowClear,
- showSearch: mergedShowSearch,
- expandIcon: mergedExpandIcon,
- suffixIcon: suffixIcon,
- removeIcon: removeIcon,
- loadingIcon: loadingIcon,
- checkable: checkable,
- dropdownClassName: mergedPopupClassName,
- dropdownPrefixCls: customizePrefixCls || cascaderPrefixCls,
- dropdownStyle: Object.assign(Object.assign({}, mergedPopupStyle), {
- zIndex
- }),
- dropdownRender: mergedPopupRender,
- dropdownMenuColumnStyle: mergedPopupMenuColumnStyle,
- onOpenChange: mergedOnOpenChange,
- choiceTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, '', choiceTransitionName),
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'slide-up', transitionName),
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- ref: ref
- }));
- return wrapCascaderCSSVar(wrapSelectCSSVar(renderNode));
- });
- if (true) {
- cascader_Cascader.displayName = 'Cascader';
- }
- // We don't care debug panel
- /* istanbul ignore next */
- const cascader_PurePanel = _util_PurePanel(cascader_Cascader, 'dropdownAlign', props => (0,omit["default"])(props, ['visible']));
- cascader_Cascader.SHOW_PARENT = cascader_SHOW_PARENT;
- cascader_Cascader.SHOW_CHILD = cascader_SHOW_CHILD;
- cascader_Cascader.Panel = cascader_Panel;
- cascader_Cascader._InternalPanelDoNotUseOrYouWillBeFired = cascader_PurePanel;
- /* harmony default export */ var cascader = (cascader_Cascader);
- ;// ./components/checkbox/GroupContext.ts
- const GroupContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(null);
- /* harmony default export */ var checkbox_GroupContext = (GroupContext);
- // EXTERNAL MODULE: ./components/checkbox/style/index.ts
- var checkbox_style = __webpack_require__("./components/checkbox/style/index.ts");
- ;// ./components/checkbox/Checkbox.tsx
- var Checkbox_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalCheckbox = (props, ref) => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- children,
- indeterminate = false,
- style,
- onMouseEnter,
- onMouseLeave,
- skipGroup = false,
- disabled
- } = props,
- restProps = Checkbox_rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
- const {
- getPrefixCls,
- direction,
- checkbox
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const checkboxGroup = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(checkbox_GroupContext);
- const {
- isFormItemInput
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const contextDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
- const prevValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(restProps.value);
- const checkboxRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const mergedRef = (0,es_ref.composeRef)(ref, checkboxRef);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Checkbox');
- true ? warning('checked' in restProps || !!checkboxGroup || !('value' in restProps), 'usage', '`value` is not a valid prop, do you mean `checked`?') : 0;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (skipGroup) {
- return;
- }
- if (restProps.value !== prevValue.current) {
- checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
- checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
- prevValue.current = restProps.value;
- }
- return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
- }, [restProps.value]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- var _a;
- if ((_a = checkboxRef.current) === null || _a === void 0 ? void 0 : _a.input) {
- checkboxRef.current.input.indeterminate = indeterminate;
- }
- }, [indeterminate]);
- const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,checkbox_style["default"])(prefixCls, rootCls);
- const checkboxProps = Object.assign({}, restProps);
- if (checkboxGroup && !skipGroup) {
- checkboxProps.onChange = (...args) => {
- if (restProps.onChange) {
- restProps.onChange.apply(restProps, args);
- }
- if (checkboxGroup.toggleOption) {
- checkboxGroup.toggleOption({
- label: children,
- value: restProps.value
- });
- }
- };
- checkboxProps.name = checkboxGroup.name;
- checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
- }
- const classString = classnames_default()(`${prefixCls}-wrapper`, {
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
- [`${prefixCls}-wrapper-disabled`]: mergedDisabled,
- [`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
- }, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, cssVarCls, rootCls, hashId);
- const checkboxClass = classnames_default()({
- [`${prefixCls}-indeterminate`]: indeterminate
- }, TARGET_CLS, hashId);
- // ============================ Event Lock ============================
- const [onLabelClick, onInputClick] = useBubbleLock(checkboxProps.onClick);
- // ============================== Render ==============================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(wave, {
- component: "Checkbox",
- disabled: mergedDisabled
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("label", {
- className: classString,
- style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onClick: onLabelClick
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_checkbox_es, Object.assign({}, checkboxProps, {
- onClick: onInputClick,
- prefixCls: prefixCls,
- className: checkboxClass,
- disabled: mergedDisabled,
- ref: mergedRef
- })), children !== undefined && children !== null && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-label`
- }, children)))));
- };
- const checkbox_Checkbox_Checkbox = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalCheckbox);
- if (true) {
- checkbox_Checkbox_Checkbox.displayName = 'Checkbox';
- }
- /* harmony default export */ var checkbox_Checkbox = (checkbox_Checkbox_Checkbox);
- ;// ./components/checkbox/Group.tsx
- var Group_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const CheckboxGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- defaultValue,
- children,
- options = [],
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- onChange
- } = props,
- restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [value, setValue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(restProps.value || defaultValue || []);
- const [registeredValues, setRegisteredValues] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if ('value' in restProps) {
- setValue(restProps.value || []);
- }
- }, [restProps.value]);
- const memoizedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => options.map(option => {
- if (typeof option === 'string' || typeof option === 'number') {
- return {
- label: option,
- value: option
- };
- }
- return option;
- }), [options]);
- const cancelValue = val => {
- setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
- };
- const registerValue = val => {
- setRegisteredValues(prevValues => [].concat((0,toConsumableArray["default"])(prevValues), [val]));
- };
- const toggleOption = option => {
- const optionIndex = value.indexOf(option.value);
- const newValue = (0,toConsumableArray["default"])(value);
- if (optionIndex === -1) {
- newValue.push(option.value);
- } else {
- newValue.splice(optionIndex, 1);
- }
- if (!('value' in restProps)) {
- setValue(newValue);
- }
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
- const indexA = memoizedOptions.findIndex(opt => opt.value === a);
- const indexB = memoizedOptions.findIndex(opt => opt.value === b);
- return indexA - indexB;
- }));
- };
- const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
- const groupPrefixCls = `${prefixCls}-group`;
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,checkbox_style["default"])(prefixCls, rootCls);
- const domProps = (0,omit["default"])(restProps, ['value', 'disabled']);
- const childrenNode = options.length ? memoizedOptions.map(option => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(checkbox_Checkbox, {
- prefixCls: prefixCls,
- key: option.value.toString(),
- disabled: 'disabled' in option ? option.disabled : restProps.disabled,
- value: option.value,
- checked: value.includes(option.value),
- onChange: option.onChange,
- className: classnames_default()(`${groupPrefixCls}-item`, option.className),
- style: option.style,
- title: option.title,
- id: option.id,
- required: option.required
- }, option.label))) : children;
- const memoizedContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- toggleOption,
- value,
- disabled: restProps.disabled,
- name: restProps.name,
- // https://github.com/ant-design/ant-design/issues/16376
- registerValue,
- cancelValue
- }), [toggleOption, value, restProps.disabled, restProps.name, registerValue, cancelValue]);
- const classString = classnames_default()(groupPrefixCls, {
- [`${groupPrefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, cssVarCls, rootCls, hashId);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- className: classString,
- style: style
- }, domProps, {
- ref: ref
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(checkbox_GroupContext.Provider, {
- value: memoizedContext
- }, childrenNode)));
- });
- /* harmony default export */ var Group = (CheckboxGroup);
- ;// ./components/checkbox/index.tsx
- const components_checkbox_Checkbox = checkbox_Checkbox;
- components_checkbox_Checkbox.Group = Group;
- components_checkbox_Checkbox.__ANT_CHECKBOX = true;
- if (true) {
- components_checkbox_Checkbox.displayName = 'Checkbox';
- }
- /* harmony default export */ var components_checkbox = (components_checkbox_Checkbox);
- ;// ./components/grid/RowContext.ts
- const RowContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)({});
- /* harmony default export */ var grid_RowContext = (RowContext);
- // EXTERNAL MODULE: ./components/grid/style/index.ts
- var grid_style = __webpack_require__("./components/grid/style/index.ts");
- ;// ./components/grid/col.tsx
- var col_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function parseFlex(flex) {
- if (typeof flex === 'number') {
- return `${flex} ${flex} auto`;
- }
- if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
- return `0 0 ${flex}`;
- }
- return flex;
- }
- const sizes = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
- const Col = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- gutter,
- wrap
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(grid_RowContext);
- const {
- prefixCls: customizePrefixCls,
- span,
- order,
- offset,
- push,
- pull,
- className,
- children,
- flex,
- style
- } = props,
- others = col_rest(props, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]);
- const prefixCls = getPrefixCls('col', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,grid_style.useColStyle)(prefixCls);
- // ===================== Size ======================
- const sizeStyle = {};
- let sizeClassObj = {};
- sizes.forEach(size => {
- let sizeProps = {};
- const propSize = props[size];
- if (typeof propSize === 'number') {
- sizeProps.span = propSize;
- } else if (typeof propSize === 'object') {
- sizeProps = propSize || {};
- }
- delete others[size];
- sizeClassObj = Object.assign(Object.assign({}, sizeClassObj), {
- [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== undefined,
- [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
- [`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
- [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
- [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- });
- // Responsive flex layout
- if (sizeProps.flex) {
- sizeClassObj[`${prefixCls}-${size}-flex`] = true;
- sizeStyle[`--${prefixCls}-${size}-flex`] = parseFlex(sizeProps.flex);
- }
- });
- // ==================== Normal =====================
- const classes = classnames_default()(prefixCls, {
- [`${prefixCls}-${span}`]: span !== undefined,
- [`${prefixCls}-order-${order}`]: order,
- [`${prefixCls}-offset-${offset}`]: offset,
- [`${prefixCls}-push-${push}`]: push,
- [`${prefixCls}-pull-${pull}`]: pull
- }, className, sizeClassObj, hashId, cssVarCls);
- const mergedStyle = {};
- // Horizontal gutter use padding
- if (gutter && gutter[0] > 0) {
- const horizontalGutter = gutter[0] / 2;
- mergedStyle.paddingLeft = horizontalGutter;
- mergedStyle.paddingRight = horizontalGutter;
- }
- if (flex) {
- mergedStyle.flex = parseFlex(flex);
- // Hack for Firefox to avoid size issue
- // https://github.com/ant-design/ant-design/pull/20023#issuecomment-564389553
- if (wrap === false && !mergedStyle.minWidth) {
- mergedStyle.minWidth = 0;
- }
- }
- // ==================== Render =====================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, others, {
- style: Object.assign(Object.assign(Object.assign({}, mergedStyle), style), sizeStyle),
- className: classes,
- ref: ref
- }), children));
- });
- if (true) {
- Col.displayName = 'Col';
- }
- /* harmony default export */ var col = (Col);
- ;// ./components/col/index.tsx
- /* harmony default export */ var components_col = (col);
- // EXTERNAL MODULE: ./components/collapse/index.tsx + 7 modules
- var collapse = __webpack_require__("./components/collapse/index.tsx");
- // EXTERNAL MODULE: ./components/color-picker/color.ts
- var color = __webpack_require__("./components/color-picker/color.ts");
- // EXTERNAL MODULE: ./components/divider/style/index.ts
- var divider_style = __webpack_require__("./components/divider/style/index.ts");
- ;// ./components/divider/index.tsx
- var divider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const sizeClassNameMap = {
- small: 'sm',
- middle: 'md'
- };
- const divider_Divider = props => {
- const {
- getPrefixCls,
- direction,
- className: dividerClassName,
- style: dividerStyle
- } = (0,config_provider_context.useComponentConfig)('divider');
- const {
- prefixCls: customizePrefixCls,
- type = 'horizontal',
- orientation = 'center',
- orientationMargin,
- className,
- rootClassName,
- children,
- dashed,
- variant = 'solid',
- plain,
- style,
- size: customSize
- } = props,
- restProps = divider_rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "variant", "plain", "style", "size"]);
- const prefixCls = getPrefixCls('divider', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,divider_style["default"])(prefixCls);
- const sizeFullName = (0,useSize["default"])(customSize);
- const sizeCls = sizeClassNameMap[sizeFullName];
- const hasChildren = !!children;
- const mergedOrientation = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (orientation === 'left') {
- return direction === 'rtl' ? 'end' : 'start';
- }
- if (orientation === 'right') {
- return direction === 'rtl' ? 'start' : 'end';
- }
- return orientation;
- }, [direction, orientation]);
- const hasMarginStart = mergedOrientation === 'start' && orientationMargin != null;
- const hasMarginEnd = mergedOrientation === 'end' && orientationMargin != null;
- const classString = classnames_default()(prefixCls, dividerClassName, hashId, cssVarCls, `${prefixCls}-${type}`, {
- [`${prefixCls}-with-text`]: hasChildren,
- [`${prefixCls}-with-text-${mergedOrientation}`]: hasChildren,
- [`${prefixCls}-dashed`]: !!dashed,
- [`${prefixCls}-${variant}`]: variant !== 'solid',
- [`${prefixCls}-plain`]: !!plain,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-no-default-orientation-margin-start`]: hasMarginStart,
- [`${prefixCls}-no-default-orientation-margin-end`]: hasMarginEnd,
- [`${prefixCls}-${sizeCls}`]: !!sizeCls
- }, className, rootClassName);
- const memoizedOrientationMargin = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (typeof orientationMargin === 'number') {
- return orientationMargin;
- }
- if (/^\d+$/.test(orientationMargin)) {
- return Number(orientationMargin);
- }
- return orientationMargin;
- }, [orientationMargin]);
- const innerStyle = {
- marginInlineStart: hasMarginStart ? memoizedOrientationMargin : undefined,
- marginInlineEnd: hasMarginEnd ? memoizedOrientationMargin : undefined
- };
- // Warning children not work in vertical mode
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Divider');
- true ? warning(!children || type !== 'vertical', 'usage', '`children` not working in `vertical` mode.') : 0;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- className: classString,
- style: Object.assign(Object.assign({}, dividerStyle), style)
- }, restProps, {
- role: "separator"
- }), children && type !== 'vertical' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-inner-text`,
- style: innerStyle
- }, children))));
- };
- if (true) {
- divider_Divider.displayName = 'Divider';
- }
- /* harmony default export */ var divider = (divider_Divider);
- // EXTERNAL MODULE: ./node_modules/@rc-component/color-picker/es/index.js + 14 modules
- var color_picker_es = __webpack_require__("./node_modules/@rc-component/color-picker/es/index.js");
- ;// ./node_modules/rc-segmented/es/MotionThumb.js
- var calcThumbStyle = function calcThumbStyle(targetElement, vertical) {
- if (!targetElement) return null;
- var style = {
- left: targetElement.offsetLeft,
- right: targetElement.parentElement.clientWidth - targetElement.clientWidth - targetElement.offsetLeft,
- width: targetElement.clientWidth,
- top: targetElement.offsetTop,
- bottom: targetElement.parentElement.clientHeight - targetElement.clientHeight - targetElement.offsetTop,
- height: targetElement.clientHeight
- };
- if (vertical) {
- // Adjusts positioning and size for vertical layout by setting horizontal properties to 0 and using vertical properties from the style object.
- return {
- left: 0,
- right: 0,
- width: 0,
- top: style.top,
- bottom: style.bottom,
- height: style.height
- };
- }
- return {
- left: style.left,
- right: style.right,
- width: style.width,
- top: 0,
- bottom: 0,
- height: 0
- };
- };
- var toPX = function toPX(value) {
- return value !== undefined ? "".concat(value, "px") : undefined;
- };
- function MotionThumb(props) {
- var prefixCls = props.prefixCls,
- containerRef = props.containerRef,
- value = props.value,
- getValueIndex = props.getValueIndex,
- motionName = props.motionName,
- onMotionStart = props.onMotionStart,
- onMotionEnd = props.onMotionEnd,
- direction = props.direction,
- _props$vertical = props.vertical,
- vertical = _props$vertical === void 0 ? false : _props$vertical;
- var thumbRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(value),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- prevValue = _React$useState2[0],
- setPrevValue = _React$useState2[1];
- // =========================== Effect ===========================
- var findValueElement = function findValueElement(val) {
- var _containerRef$current;
- var index = getValueIndex(val);
- var ele = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelectorAll(".".concat(prefixCls, "-item"))[index];
- return (ele === null || ele === void 0 ? void 0 : ele.offsetParent) && ele;
- };
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- prevStyle = _React$useState4[0],
- setPrevStyle = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- nextStyle = _React$useState6[0],
- setNextStyle = _React$useState6[1];
- (0,useLayoutEffect["default"])(function () {
- if (prevValue !== value) {
- var prev = findValueElement(prevValue);
- var next = findValueElement(value);
- var calcPrevStyle = calcThumbStyle(prev, vertical);
- var calcNextStyle = calcThumbStyle(next, vertical);
- setPrevValue(value);
- setPrevStyle(calcPrevStyle);
- setNextStyle(calcNextStyle);
- if (prev && next) {
- onMotionStart();
- } else {
- onMotionEnd();
- }
- }
- }, [value]);
- var thumbStart = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (vertical) {
- var _prevStyle$top;
- return toPX((_prevStyle$top = prevStyle === null || prevStyle === void 0 ? void 0 : prevStyle.top) !== null && _prevStyle$top !== void 0 ? _prevStyle$top : 0);
- }
- if (direction === 'rtl') {
- return toPX(-(prevStyle === null || prevStyle === void 0 ? void 0 : prevStyle.right));
- }
- return toPX(prevStyle === null || prevStyle === void 0 ? void 0 : prevStyle.left);
- }, [vertical, direction, prevStyle]);
- var thumbActive = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (vertical) {
- var _nextStyle$top;
- return toPX((_nextStyle$top = nextStyle === null || nextStyle === void 0 ? void 0 : nextStyle.top) !== null && _nextStyle$top !== void 0 ? _nextStyle$top : 0);
- }
- if (direction === 'rtl') {
- return toPX(-(nextStyle === null || nextStyle === void 0 ? void 0 : nextStyle.right));
- }
- return toPX(nextStyle === null || nextStyle === void 0 ? void 0 : nextStyle.left);
- }, [vertical, direction, nextStyle]);
- // =========================== Motion ===========================
- var onAppearStart = function onAppearStart() {
- if (vertical) {
- return {
- transform: 'translateY(var(--thumb-start-top))',
- height: 'var(--thumb-start-height)'
- };
- }
- return {
- transform: 'translateX(var(--thumb-start-left))',
- width: 'var(--thumb-start-width)'
- };
- };
- var onAppearActive = function onAppearActive() {
- if (vertical) {
- return {
- transform: 'translateY(var(--thumb-active-top))',
- height: 'var(--thumb-active-height)'
- };
- }
- return {
- transform: 'translateX(var(--thumb-active-left))',
- width: 'var(--thumb-active-width)'
- };
- };
- var onVisibleChanged = function onVisibleChanged() {
- setPrevStyle(null);
- setNextStyle(null);
- onMotionEnd();
- };
- // =========================== Render ===========================
- // No need motion when nothing exist in queue
- if (!prevStyle || !nextStyle) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: true,
- motionName: motionName,
- motionAppear: true,
- onAppearStart: onAppearStart,
- onAppearActive: onAppearActive,
- onVisibleChanged: onVisibleChanged
- }, function (_ref, ref) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, motionStyle), {}, {
- '--thumb-start-left': thumbStart,
- '--thumb-start-width': toPX(prevStyle === null || prevStyle === void 0 ? void 0 : prevStyle.width),
- '--thumb-active-left': thumbActive,
- '--thumb-active-width': toPX(nextStyle === null || nextStyle === void 0 ? void 0 : nextStyle.width),
- '--thumb-start-top': thumbStart,
- '--thumb-start-height': toPX(prevStyle === null || prevStyle === void 0 ? void 0 : prevStyle.height),
- '--thumb-active-top': thumbActive,
- '--thumb-active-height': toPX(nextStyle === null || nextStyle === void 0 ? void 0 : nextStyle.height)
- });
- // It's little ugly which should be refactor when @umi/test update to latest jsdom
- var motionProps = {
- ref: (0,es_ref.composeRef)(thumbRef, ref),
- style: mergedStyle,
- className: classnames_default()("".concat(prefixCls, "-thumb"), motionClassName)
- };
- if (false) // removed by dead control flow
- {}
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", motionProps);
- });
- }
- ;// ./node_modules/rc-segmented/es/index.js
- var rc_segmented_es_excluded = ["prefixCls", "direction", "vertical", "options", "disabled", "defaultValue", "value", "name", "onChange", "className", "motionName"];
- function getValidTitle(option) {
- if (typeof option.title !== 'undefined') {
- return option.title;
- }
- // read `label` when title is `undefined`
- if ((0,esm_typeof["default"])(option.label) !== 'object') {
- var _option$label;
- return (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toString();
- }
- }
- function normalizeOptions(options) {
- return options.map(function (option) {
- if ((0,esm_typeof["default"])(option) === 'object' && option !== null) {
- var validTitle = getValidTitle(option);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, option), {}, {
- title: validTitle
- });
- }
- return {
- label: option === null || option === void 0 ? void 0 : option.toString(),
- title: option === null || option === void 0 ? void 0 : option.toString(),
- value: option
- };
- });
- }
- var InternalSegmentedOption = function InternalSegmentedOption(_ref) {
- var prefixCls = _ref.prefixCls,
- className = _ref.className,
- disabled = _ref.disabled,
- checked = _ref.checked,
- label = _ref.label,
- title = _ref.title,
- value = _ref.value,
- name = _ref.name,
- onChange = _ref.onChange,
- onFocus = _ref.onFocus,
- onBlur = _ref.onBlur,
- onKeyDown = _ref.onKeyDown,
- onKeyUp = _ref.onKeyUp,
- onMouseDown = _ref.onMouseDown;
- var handleChange = function handleChange(event) {
- if (disabled) {
- return;
- }
- onChange(event, value);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("label", {
- className: classnames_default()(className, (0,defineProperty["default"])({}, "".concat(prefixCls, "-item-disabled"), disabled)),
- onMouseDown: onMouseDown
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", {
- name: name,
- className: "".concat(prefixCls, "-item-input"),
- type: "radio",
- disabled: disabled,
- checked: checked,
- onChange: handleChange,
- onFocus: onFocus,
- onBlur: onBlur,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-label"),
- title: title,
- "aria-selected": checked
- }, label));
- };
- var Segmented = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _segmentedOptions$, _classNames2;
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-segmented' : _props$prefixCls,
- direction = props.direction,
- vertical = props.vertical,
- _props$options = props.options,
- options = _props$options === void 0 ? [] : _props$options,
- disabled = props.disabled,
- defaultValue = props.defaultValue,
- value = props.value,
- name = props.name,
- onChange = props.onChange,
- _props$className = props.className,
- className = _props$className === void 0 ? '' : _props$className,
- _props$motionName = props.motionName,
- motionName = _props$motionName === void 0 ? 'thumb-motion' : _props$motionName,
- restProps = (0,objectWithoutProperties["default"])(props, rc_segmented_es_excluded);
- var containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var mergedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,es_ref.composeRef)(containerRef, ref);
- }, [containerRef, ref]);
- var segmentedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return normalizeOptions(options);
- }, [options]);
- // Note: We should not auto switch value when value not exist in options
- // which may break single source of truth.
- var _useMergedState = (0,useMergedState["default"])((_segmentedOptions$ = segmentedOptions[0]) === null || _segmentedOptions$ === void 0 ? void 0 : _segmentedOptions$.value, {
- value: value,
- defaultValue: defaultValue
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- rawValue = _useMergedState2[0],
- setRawValue = _useMergedState2[1];
- // ======================= Change ========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- thumbShow = _React$useState2[0],
- setThumbShow = _React$useState2[1];
- var handleChange = function handleChange(event, val) {
- setRawValue(val);
- onChange === null || onChange === void 0 || onChange(val);
- };
- var divProps = (0,omit["default"])(restProps, ['children']);
- // ======================= Focus ========================
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- isKeyboard = _React$useState4[0],
- setIsKeyboard = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- isFocused = _React$useState6[0],
- setIsFocused = _React$useState6[1];
- var handleFocus = function handleFocus() {
- setIsFocused(true);
- };
- var handleBlur = function handleBlur() {
- setIsFocused(false);
- };
- var handleMouseDown = function handleMouseDown() {
- setIsKeyboard(false);
- };
- // capture keyboard tab interaction for correct focus style
- var handleKeyUp = function handleKeyUp(event) {
- if (event.key === 'Tab') {
- setIsKeyboard(true);
- }
- };
- // ======================= Keyboard ========================
- var onOffset = function onOffset(offset) {
- var currentIndex = segmentedOptions.findIndex(function (option) {
- return option.value === rawValue;
- });
- var total = segmentedOptions.length;
- var nextIndex = (currentIndex + offset + total) % total;
- var nextOption = segmentedOptions[nextIndex];
- if (nextOption) {
- setRawValue(nextOption.value);
- onChange === null || onChange === void 0 || onChange(nextOption.value);
- }
- };
- var handleKeyDown = function handleKeyDown(event) {
- switch (event.key) {
- case 'ArrowLeft':
- case 'ArrowUp':
- onOffset(-1);
- break;
- case 'ArrowRight':
- case 'ArrowDown':
- onOffset(1);
- break;
- }
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- role: "radiogroup",
- "aria-label": "segmented control",
- tabIndex: disabled ? undefined : 0
- }, divProps, {
- className: classnames_default()(prefixCls, (_classNames2 = {}, (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-vertical"), vertical), _classNames2), className),
- ref: mergedRef
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-group")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MotionThumb, {
- vertical: vertical,
- prefixCls: prefixCls,
- value: rawValue,
- containerRef: containerRef,
- motionName: "".concat(prefixCls, "-").concat(motionName),
- direction: direction,
- getValueIndex: function getValueIndex(val) {
- return segmentedOptions.findIndex(function (n) {
- return n.value === val;
- });
- },
- onMotionStart: function onMotionStart() {
- setThumbShow(true);
- },
- onMotionEnd: function onMotionEnd() {
- setThumbShow(false);
- }
- }), segmentedOptions.map(function (segmentedOption) {
- var _classNames3;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalSegmentedOption, (0,esm_extends["default"])({}, segmentedOption, {
- name: name,
- key: segmentedOption.value,
- prefixCls: prefixCls,
- className: classnames_default()(segmentedOption.className, "".concat(prefixCls, "-item"), (_classNames3 = {}, (0,defineProperty["default"])(_classNames3, "".concat(prefixCls, "-item-selected"), segmentedOption.value === rawValue && !thumbShow), (0,defineProperty["default"])(_classNames3, "".concat(prefixCls, "-item-focused"), isFocused && isKeyboard && segmentedOption.value === rawValue), _classNames3)),
- checked: segmentedOption.value === rawValue,
- onChange: handleChange,
- onFocus: handleFocus,
- onBlur: handleBlur,
- onKeyDown: handleKeyDown,
- onKeyUp: handleKeyUp,
- onMouseDown: handleMouseDown,
- disabled: !!disabled || !!segmentedOption.disabled
- }));
- })));
- });
- if (true) {
- Segmented.displayName = 'Segmented';
- }
- var TypedSegmented = Segmented;
- /* harmony default export */ var rc_segmented_es = (TypedSegmented);
- // EXTERNAL MODULE: ./components/segmented/style/index.ts
- var segmented_style = __webpack_require__("./components/segmented/style/index.ts");
- ;// ./components/segmented/index.tsx
- var segmented_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function isSegmentedLabeledOptionWithIcon(option) {
- return typeof option === 'object' && !!(option === null || option === void 0 ? void 0 : option.icon);
- }
- const InternalSegmented = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const defaultName = hooks_useId();
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- block,
- options = [],
- size: customSize = 'middle',
- style,
- vertical,
- shape = 'default',
- name = defaultName
- } = props,
- restProps = segmented_rest(props, ["prefixCls", "className", "rootClassName", "block", "options", "size", "style", "vertical", "shape", "name"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('segmented');
- const prefixCls = getPrefixCls('segmented', customizePrefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,segmented_style["default"])(prefixCls);
- // ===================== Size =====================
- const mergedSize = (0,useSize["default"])(customSize);
- // syntactic sugar to support `icon` for Segmented Item
- const extendedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => options.map(option => {
- if (isSegmentedLabeledOptionWithIcon(option)) {
- const {
- icon,
- label
- } = option,
- restOption = segmented_rest(option, ["icon", "label"]);
- return Object.assign(Object.assign({}, restOption), {
- label: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-item-icon`
- }, icon), label && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, label)))
- });
- }
- return option;
- }), [options, prefixCls]);
- const cls = classnames_default()(className, rootClassName, contextClassName, {
- [`${prefixCls}-block`]: block,
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-vertical`]: vertical,
- [`${prefixCls}-shape-${shape}`]: shape === 'round'
- }, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_segmented_es, Object.assign({}, restProps, {
- name: name,
- className: cls,
- style: mergedStyle,
- options: extendedOptions,
- ref: ref,
- prefixCls: prefixCls,
- direction: direction,
- vertical: vertical
- })));
- });
- const segmented_Segmented = InternalSegmented;
- if (true) {
- segmented_Segmented.displayName = 'Segmented';
- }
- /* harmony default export */ var segmented = (segmented_Segmented);
- ;// ./components/color-picker/context.ts
- const PanelPickerContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- const PanelPresetsContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- ;// ./components/color-picker/components/ColorClear.tsx
- const ColorClear = ({
- prefixCls,
- value,
- onChange
- }) => {
- const handleClick = () => {
- if (onChange && value && !value.cleared) {
- const hsba = value.toHsb();
- hsba.a = 0;
- const genColor = (0,util.generateColor)(hsba);
- genColor.cleared = true;
- onChange(genColor);
- }
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-clear`,
- onClick: handleClick
- });
- };
- /* harmony default export */ var components_ColorClear = (ColorClear);
- ;// ./components/color-picker/interface.ts
- const FORMAT_HEX = 'hex';
- const FORMAT_RGB = 'rgb';
- const FORMAT_HSB = 'hsb';
- ;// ./node_modules/@ant-design/icons-svg/es/asn/UpOutlined.js
- // This icon file is generated automatically.
- var UpOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, "name": "up", "theme": "outlined" };
- /* harmony default export */ var asn_UpOutlined = (UpOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/UpOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var UpOutlined_UpOutlined = function UpOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_UpOutlined
- }));
- };
- /** */
- var UpOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(UpOutlined_UpOutlined);
- if (true) {
- UpOutlined_RefIcon.displayName = 'UpOutlined';
- }
- /* harmony default export */ var icons_UpOutlined = (UpOutlined_RefIcon);
- ;// ./node_modules/@rc-component/mini-decimal/es/supportUtil.js
- function supportBigInt() {
- return typeof BigInt === 'function';
- }
- ;// ./node_modules/@rc-component/mini-decimal/es/numberUtil.js
- function isEmpty(value) {
- return !value && value !== 0 && !Number.isNaN(value) || !String(value).trim();
- }
- /**
- * Format string number to readable number
- */
- function trimNumber(numStr) {
- var str = numStr.trim();
- var negative = str.startsWith('-');
- if (negative) {
- str = str.slice(1);
- }
- str = str
- // Remove decimal 0. `1.000` => `1.`, `1.100` => `1.1`
- .replace(/(\.\d*[^0])0*$/, '$1')
- // Remove useless decimal. `1.` => `1`
- .replace(/\.0*$/, '')
- // Remove integer 0. `0001` => `1`, 000.1' => `.1`
- .replace(/^0+/, '');
- if (str.startsWith('.')) {
- str = "0".concat(str);
- }
- var trimStr = str || '0';
- var splitNumber = trimStr.split('.');
- var integerStr = splitNumber[0] || '0';
- var decimalStr = splitNumber[1] || '0';
- if (integerStr === '0' && decimalStr === '0') {
- negative = false;
- }
- var negativeStr = negative ? '-' : '';
- return {
- negative: negative,
- negativeStr: negativeStr,
- trimStr: trimStr,
- integerStr: integerStr,
- decimalStr: decimalStr,
- fullStr: "".concat(negativeStr).concat(trimStr)
- };
- }
- function isE(number) {
- var str = String(number);
- return !Number.isNaN(Number(str)) && str.includes('e');
- }
- /**
- * [Legacy] Convert 1e-9 to 0.000000001.
- * This may lose some precision if user really want 1e-9.
- */
- function getNumberPrecision(number) {
- var numStr = String(number);
- if (isE(number)) {
- var precision = Number(numStr.slice(numStr.indexOf('e-') + 2));
- var decimalMatch = numStr.match(/\.(\d+)/);
- if (decimalMatch !== null && decimalMatch !== void 0 && decimalMatch[1]) {
- precision += decimalMatch[1].length;
- }
- return precision;
- }
- return numStr.includes('.') && validateNumber(numStr) ? numStr.length - numStr.indexOf('.') - 1 : 0;
- }
- /**
- * Convert number (includes scientific notation) to -xxx.yyy format
- */
- function num2str(number) {
- var numStr = String(number);
- if (isE(number)) {
- if (number > Number.MAX_SAFE_INTEGER) {
- return String(supportBigInt() ? BigInt(number).toString() : Number.MAX_SAFE_INTEGER);
- }
- if (number < Number.MIN_SAFE_INTEGER) {
- return String(supportBigInt() ? BigInt(number).toString() : Number.MIN_SAFE_INTEGER);
- }
- numStr = number.toFixed(getNumberPrecision(numStr));
- }
- return trimNumber(numStr).fullStr;
- }
- function validateNumber(num) {
- if (typeof num === 'number') {
- return !Number.isNaN(num);
- }
- // Empty
- if (!num) {
- return false;
- }
- return (
- // Normal type: 11.28
- /^\s*-?\d+(\.\d+)?\s*$/.test(num) ||
- // Pre-number: 1.
- /^\s*-?\d+\.\s*$/.test(num) ||
- // Post-number: .1
- /^\s*-?\.\d+\s*$/.test(num)
- );
- }
- ;// ./node_modules/@rc-component/mini-decimal/es/BigIntDecimal.js
- var BigIntDecimal = /*#__PURE__*/function () {
- /** BigInt will convert `0009` to `9`. We need record the len of decimal */
- function BigIntDecimal(value) {
- (0,classCallCheck["default"])(this, BigIntDecimal);
- (0,defineProperty["default"])(this, "origin", '');
- (0,defineProperty["default"])(this, "negative", void 0);
- (0,defineProperty["default"])(this, "integer", void 0);
- (0,defineProperty["default"])(this, "decimal", void 0);
- (0,defineProperty["default"])(this, "decimalLen", void 0);
- (0,defineProperty["default"])(this, "empty", void 0);
- (0,defineProperty["default"])(this, "nan", void 0);
- if (isEmpty(value)) {
- this.empty = true;
- return;
- }
- this.origin = String(value);
- // Act like Number convert
- if (value === '-' || Number.isNaN(value)) {
- this.nan = true;
- return;
- }
- var mergedValue = value;
- // We need convert back to Number since it require `toFixed` to handle this
- if (isE(mergedValue)) {
- mergedValue = Number(mergedValue);
- }
- mergedValue = typeof mergedValue === 'string' ? mergedValue : num2str(mergedValue);
- if (validateNumber(mergedValue)) {
- var trimRet = trimNumber(mergedValue);
- this.negative = trimRet.negative;
- var numbers = trimRet.trimStr.split('.');
- this.integer = BigInt(numbers[0]);
- var decimalStr = numbers[1] || '0';
- this.decimal = BigInt(decimalStr);
- this.decimalLen = decimalStr.length;
- } else {
- this.nan = true;
- }
- }
- (0,createClass["default"])(BigIntDecimal, [{
- key: "getMark",
- value: function getMark() {
- return this.negative ? '-' : '';
- }
- }, {
- key: "getIntegerStr",
- value: function getIntegerStr() {
- return this.integer.toString();
- }
- /**
- * @private get decimal string
- */
- }, {
- key: "getDecimalStr",
- value: function getDecimalStr() {
- return this.decimal.toString().padStart(this.decimalLen, '0');
- }
- /**
- * @private Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
- * This is used for add function only.
- */
- }, {
- key: "alignDecimal",
- value: function alignDecimal(decimalLength) {
- var str = "".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(decimalLength, '0'));
- return BigInt(str);
- }
- }, {
- key: "negate",
- value: function negate() {
- var clone = new BigIntDecimal(this.toString());
- clone.negative = !clone.negative;
- return clone;
- }
- }, {
- key: "cal",
- value: function cal(offset, calculator, calDecimalLen) {
- var maxDecimalLength = Math.max(this.getDecimalStr().length, offset.getDecimalStr().length);
- var myAlignedDecimal = this.alignDecimal(maxDecimalLength);
- var offsetAlignedDecimal = offset.alignDecimal(maxDecimalLength);
- var valueStr = calculator(myAlignedDecimal, offsetAlignedDecimal).toString();
- var nextDecimalLength = calDecimalLen(maxDecimalLength);
- // We need fill string length back to `maxDecimalLength` to avoid parser failed
- var _trimNumber = trimNumber(valueStr),
- negativeStr = _trimNumber.negativeStr,
- trimStr = _trimNumber.trimStr;
- var hydrateValueStr = "".concat(negativeStr).concat(trimStr.padStart(nextDecimalLength + 1, '0'));
- return new BigIntDecimal("".concat(hydrateValueStr.slice(0, -nextDecimalLength), ".").concat(hydrateValueStr.slice(-nextDecimalLength)));
- }
- }, {
- key: "add",
- value: function add(value) {
- if (this.isInvalidate()) {
- return new BigIntDecimal(value);
- }
- var offset = new BigIntDecimal(value);
- if (offset.isInvalidate()) {
- return this;
- }
- return this.cal(offset, function (num1, num2) {
- return num1 + num2;
- }, function (len) {
- return len;
- });
- }
- }, {
- key: "multi",
- value: function multi(value) {
- var target = new BigIntDecimal(value);
- if (this.isInvalidate() || target.isInvalidate()) {
- return new BigIntDecimal(NaN);
- }
- return this.cal(target, function (num1, num2) {
- return num1 * num2;
- }, function (len) {
- return len * 2;
- });
- }
- }, {
- key: "isEmpty",
- value: function isEmpty() {
- return this.empty;
- }
- }, {
- key: "isNaN",
- value: function isNaN() {
- return this.nan;
- }
- }, {
- key: "isInvalidate",
- value: function isInvalidate() {
- return this.isEmpty() || this.isNaN();
- }
- }, {
- key: "equals",
- value: function equals(target) {
- return this.toString() === (target === null || target === void 0 ? void 0 : target.toString());
- }
- }, {
- key: "lessEquals",
- value: function lessEquals(target) {
- return this.add(target.negate().toString()).toNumber() <= 0;
- }
- }, {
- key: "toNumber",
- value: function toNumber() {
- if (this.isNaN()) {
- return NaN;
- }
- return Number(this.toString());
- }
- }, {
- key: "toString",
- value: function toString() {
- var safe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- if (!safe) {
- return this.origin;
- }
- if (this.isInvalidate()) {
- return '';
- }
- return trimNumber("".concat(this.getMark()).concat(this.getIntegerStr(), ".").concat(this.getDecimalStr())).fullStr;
- }
- }]);
- return BigIntDecimal;
- }();
- ;// ./node_modules/@rc-component/mini-decimal/es/NumberDecimal.js
- /**
- * We can remove this when IE not support anymore
- */
- var NumberDecimal = /*#__PURE__*/function () {
- function NumberDecimal(value) {
- (0,classCallCheck["default"])(this, NumberDecimal);
- (0,defineProperty["default"])(this, "origin", '');
- (0,defineProperty["default"])(this, "number", void 0);
- (0,defineProperty["default"])(this, "empty", void 0);
- if (isEmpty(value)) {
- this.empty = true;
- return;
- }
- this.origin = String(value);
- this.number = Number(value);
- }
- (0,createClass["default"])(NumberDecimal, [{
- key: "negate",
- value: function negate() {
- return new NumberDecimal(-this.toNumber());
- }
- }, {
- key: "add",
- value: function add(value) {
- if (this.isInvalidate()) {
- return new NumberDecimal(value);
- }
- var target = Number(value);
- if (Number.isNaN(target)) {
- return this;
- }
- var number = this.number + target;
- // [Legacy] Back to safe integer
- if (number > Number.MAX_SAFE_INTEGER) {
- return new NumberDecimal(Number.MAX_SAFE_INTEGER);
- }
- if (number < Number.MIN_SAFE_INTEGER) {
- return new NumberDecimal(Number.MIN_SAFE_INTEGER);
- }
- var maxPrecision = Math.max(getNumberPrecision(this.number), getNumberPrecision(target));
- return new NumberDecimal(number.toFixed(maxPrecision));
- }
- }, {
- key: "multi",
- value: function multi(value) {
- var target = Number(value);
- if (this.isInvalidate() || Number.isNaN(target)) {
- return new NumberDecimal(NaN);
- }
- var number = this.number * target;
- // [Legacy] Back to safe integer
- if (number > Number.MAX_SAFE_INTEGER) {
- return new NumberDecimal(Number.MAX_SAFE_INTEGER);
- }
- if (number < Number.MIN_SAFE_INTEGER) {
- return new NumberDecimal(Number.MIN_SAFE_INTEGER);
- }
- var maxPrecision = Math.max(getNumberPrecision(this.number), getNumberPrecision(target));
- return new NumberDecimal(number.toFixed(maxPrecision));
- }
- }, {
- key: "isEmpty",
- value: function isEmpty() {
- return this.empty;
- }
- }, {
- key: "isNaN",
- value: function isNaN() {
- return Number.isNaN(this.number);
- }
- }, {
- key: "isInvalidate",
- value: function isInvalidate() {
- return this.isEmpty() || this.isNaN();
- }
- }, {
- key: "equals",
- value: function equals(target) {
- return this.toNumber() === (target === null || target === void 0 ? void 0 : target.toNumber());
- }
- }, {
- key: "lessEquals",
- value: function lessEquals(target) {
- return this.add(target.negate().toString()).toNumber() <= 0;
- }
- }, {
- key: "toNumber",
- value: function toNumber() {
- return this.number;
- }
- }, {
- key: "toString",
- value: function toString() {
- var safe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- if (!safe) {
- return this.origin;
- }
- if (this.isInvalidate()) {
- return '';
- }
- return num2str(this.number);
- }
- }]);
- return NumberDecimal;
- }();
- ;// ./node_modules/@rc-component/mini-decimal/es/MiniDecimal.js
- /* eslint-disable max-classes-per-file */
- // Still support origin export
- function getMiniDecimal(value) {
- // We use BigInt here.
- // Will fallback to Number if not support.
- if (supportBigInt()) {
- return new BigIntDecimal(value);
- }
- return new NumberDecimal(value);
- }
- /**
- * Align the logic of toFixed to around like 1.5 => 2.
- * If set `cutOnly`, will just remove the over decimal part.
- */
- function toFixed(numStr, separatorStr, precision) {
- var cutOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- if (numStr === '') {
- return '';
- }
- var _trimNumber = trimNumber(numStr),
- negativeStr = _trimNumber.negativeStr,
- integerStr = _trimNumber.integerStr,
- decimalStr = _trimNumber.decimalStr;
- var precisionDecimalStr = "".concat(separatorStr).concat(decimalStr);
- var numberWithoutDecimal = "".concat(negativeStr).concat(integerStr);
- if (precision >= 0) {
- // We will get last + 1 number to check if need advanced number
- var advancedNum = Number(decimalStr[precision]);
- if (advancedNum >= 5 && !cutOnly) {
- var advancedDecimal = getMiniDecimal(numStr).add("".concat(negativeStr, "0.").concat('0'.repeat(precision)).concat(10 - advancedNum));
- return toFixed(advancedDecimal.toString(), separatorStr, precision, cutOnly);
- }
- if (precision === 0) {
- return numberWithoutDecimal;
- }
- return "".concat(numberWithoutDecimal).concat(separatorStr).concat(decimalStr.padEnd(precision, '0').slice(0, precision));
- }
- if (precisionDecimalStr === '.0') {
- return numberWithoutDecimal;
- }
- return "".concat(numberWithoutDecimal).concat(precisionDecimalStr);
- }
- ;// ./node_modules/@rc-component/mini-decimal/es/index.js
- /* harmony default export */ var mini_decimal_es = (getMiniDecimal);
- ;// ./node_modules/rc-input/es/utils/commonUtils.js
- function hasAddon(props) {
- return !!(props.addonBefore || props.addonAfter);
- }
- function hasPrefixSuffix(props) {
- return !!(props.prefix || props.suffix || props.allowClear);
- }
- // TODO: It's better to use `Proxy` replace the `element.value`. But we still need support IE11.
- function cloneEvent(event, target, value) {
- // A bug report filed on WebKit's Bugzilla tracker, dating back to 2009, specifically addresses the issue of cloneNode() not copying files of <input type="file"> elements.
- // As of the last update, this bug was still marked as "NEW," indicating that it might not have been resolved yet.
- // https://bugs.webkit.org/show_bug.cgi?id=28123
- var currentTarget = target.cloneNode(true);
- // click clear icon
- var newEvent = Object.create(event, {
- target: {
- value: currentTarget
- },
- currentTarget: {
- value: currentTarget
- }
- });
- // Fill data
- currentTarget.value = value;
- // Fill selection. Some type like `email` not support selection
- // https://github.com/ant-design/ant-design/issues/47833
- if (typeof target.selectionStart === 'number' && typeof target.selectionEnd === 'number') {
- currentTarget.selectionStart = target.selectionStart;
- currentTarget.selectionEnd = target.selectionEnd;
- }
- currentTarget.setSelectionRange = function () {
- target.setSelectionRange.apply(target, arguments);
- };
- return newEvent;
- }
- function resolveOnChange(target, e, onChange, targetValue) {
- if (!onChange) {
- return;
- }
- var event = e;
- if (e.type === 'click') {
- // Clone a new target for event.
- // Avoid the following usage, the setQuery method gets the original value.
- //
- // const [query, setQuery] = React.useState('');
- // <Input
- // allowClear
- // value={query}
- // onChange={(e)=> {
- // setQuery((prevStatus) => e.target.value);
- // }}
- // />
- event = cloneEvent(e, target, '');
- onChange(event);
- return;
- }
- // Trigger by composition event, this means we need force change the input value
- // https://github.com/ant-design/ant-design/issues/45737
- // https://github.com/ant-design/ant-design/issues/46598
- if (target.type !== 'file' && targetValue !== undefined) {
- event = cloneEvent(e, target, targetValue);
- onChange(event);
- return;
- }
- onChange(event);
- }
- function triggerFocus(element, option) {
- if (!element) return;
- element.focus(option);
- // Selection content
- var _ref = option || {},
- cursor = _ref.cursor;
- if (cursor) {
- var len = element.value.length;
- switch (cursor) {
- case 'start':
- element.setSelectionRange(0, 0);
- break;
- case 'end':
- element.setSelectionRange(len, len);
- break;
- default:
- element.setSelectionRange(0, len);
- }
- }
- }
- ;// ./node_modules/rc-input/es/BaseInput.js
- var BaseInput = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (props, ref) {
- var _props, _props2, _props3;
- var inputEl = props.inputElement,
- children = props.children,
- prefixCls = props.prefixCls,
- prefix = props.prefix,
- suffix = props.suffix,
- addonBefore = props.addonBefore,
- addonAfter = props.addonAfter,
- className = props.className,
- style = props.style,
- disabled = props.disabled,
- readOnly = props.readOnly,
- focused = props.focused,
- triggerFocus = props.triggerFocus,
- allowClear = props.allowClear,
- value = props.value,
- handleReset = props.handleReset,
- hidden = props.hidden,
- classes = props.classes,
- classNames = props.classNames,
- dataAttrs = props.dataAttrs,
- styles = props.styles,
- components = props.components,
- onClear = props.onClear;
- var inputElement = children !== null && children !== void 0 ? children : inputEl;
- var AffixWrapperComponent = (components === null || components === void 0 ? void 0 : components.affixWrapper) || 'span';
- var GroupWrapperComponent = (components === null || components === void 0 ? void 0 : components.groupWrapper) || 'span';
- var WrapperComponent = (components === null || components === void 0 ? void 0 : components.wrapper) || 'span';
- var GroupAddonComponent = (components === null || components === void 0 ? void 0 : components.groupAddon) || 'span';
- var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var onInputClick = function onInputClick(e) {
- var _containerRef$current;
- if ((_containerRef$current = containerRef.current) !== null && _containerRef$current !== void 0 && _containerRef$current.contains(e.target)) {
- triggerFocus === null || triggerFocus === void 0 || triggerFocus();
- }
- };
- var hasAffix = hasPrefixSuffix(props);
- var element = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(inputElement, {
- value: value,
- className: classnames_default()((_props = inputElement.props) === null || _props === void 0 ? void 0 : _props.className, !hasAffix && (classNames === null || classNames === void 0 ? void 0 : classNames.variant)) || null
- });
- // ======================== Ref ======================== //
- var groupRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, function () {
- return {
- nativeElement: groupRef.current || containerRef.current
- };
- });
- // ================== Prefix & Suffix ================== //
- if (hasAffix) {
- // ================== Clear Icon ================== //
- var clearIcon = null;
- if (allowClear) {
- var needClear = !disabled && !readOnly && value;
- var clearIconCls = "".concat(prefixCls, "-clear-icon");
- var iconNode = (0,esm_typeof["default"])(allowClear) === 'object' && allowClear !== null && allowClear !== void 0 && allowClear.clearIcon ? allowClear.clearIcon : '✖';
- clearIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
- type: "button",
- tabIndex: -1,
- onClick: function onClick(event) {
- handleReset === null || handleReset === void 0 || handleReset(event);
- onClear === null || onClear === void 0 || onClear();
- }
- // Do not trigger onBlur when clear input
- // https://github.com/ant-design/ant-design/issues/31200
- ,
- onMouseDown: function onMouseDown(e) {
- return e.preventDefault();
- },
- className: classnames_default()(clearIconCls, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(clearIconCls, "-hidden"), !needClear), "".concat(clearIconCls, "-has-suffix"), !!suffix))
- }, iconNode);
- }
- var affixWrapperPrefixCls = "".concat(prefixCls, "-affix-wrapper");
- var affixWrapperCls = classnames_default()(affixWrapperPrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(affixWrapperPrefixCls, "-disabled"), disabled), "".concat(affixWrapperPrefixCls, "-focused"), focused), "".concat(affixWrapperPrefixCls, "-readonly"), readOnly), "".concat(affixWrapperPrefixCls, "-input-with-clear-btn"), suffix && allowClear && value), classes === null || classes === void 0 ? void 0 : classes.affixWrapper, classNames === null || classNames === void 0 ? void 0 : classNames.affixWrapper, classNames === null || classNames === void 0 ? void 0 : classNames.variant);
- var suffixNode = (suffix || allowClear) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(prefixCls, "-suffix"), classNames === null || classNames === void 0 ? void 0 : classNames.suffix),
- style: styles === null || styles === void 0 ? void 0 : styles.suffix
- }, clearIcon, suffix);
- element = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(AffixWrapperComponent, (0,esm_extends["default"])({
- className: affixWrapperCls,
- style: styles === null || styles === void 0 ? void 0 : styles.affixWrapper,
- onClick: onInputClick
- }, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.affixWrapper, {
- ref: containerRef
- }), prefix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(prefixCls, "-prefix"), classNames === null || classNames === void 0 ? void 0 : classNames.prefix),
- style: styles === null || styles === void 0 ? void 0 : styles.prefix
- }, prefix), element, suffixNode);
- }
- // ================== Addon ================== //
- if (hasAddon(props)) {
- var wrapperCls = "".concat(prefixCls, "-group");
- var addonCls = "".concat(wrapperCls, "-addon");
- var groupWrapperCls = "".concat(wrapperCls, "-wrapper");
- var mergedWrapperClassName = classnames_default()("".concat(prefixCls, "-wrapper"), wrapperCls, classes === null || classes === void 0 ? void 0 : classes.wrapper, classNames === null || classNames === void 0 ? void 0 : classNames.wrapper);
- var mergedGroupClassName = classnames_default()(groupWrapperCls, (0,defineProperty["default"])({}, "".concat(groupWrapperCls, "-disabled"), disabled), classes === null || classes === void 0 ? void 0 : classes.group, classNames === null || classNames === void 0 ? void 0 : classNames.groupWrapper);
- // Need another wrapper for changing display:table to display:inline-block
- // and put style prop in wrapper
- element = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(GroupWrapperComponent, {
- className: mergedGroupClassName,
- ref: groupRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(WrapperComponent, {
- className: mergedWrapperClassName
- }, addonBefore && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(GroupAddonComponent, {
- className: addonCls
- }, addonBefore), element, addonAfter && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(GroupAddonComponent, {
- className: addonCls
- }, addonAfter)));
- }
- // `className` and `style` are always on the root element
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(element, {
- className: classnames_default()((_props2 = element.props) === null || _props2 === void 0 ? void 0 : _props2.className, className) || null,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, (_props3 = element.props) === null || _props3 === void 0 ? void 0 : _props3.style), style),
- hidden: hidden
- });
- });
- /* harmony default export */ var es_BaseInput = (BaseInput);
- ;// ./node_modules/rc-input/es/hooks/useCount.js
- var useCount_excluded = ["show"];
- /**
- * Cut `value` by the `count.max` prop.
- */
- function inCountRange(value, countConfig) {
- if (!countConfig.max) {
- return true;
- }
- var count = countConfig.strategy(value);
- return count <= countConfig.max;
- }
- function useCount(count, showCount) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var mergedConfig = {};
- if (showCount) {
- mergedConfig.show = (0,esm_typeof["default"])(showCount) === 'object' && showCount.formatter ? showCount.formatter : !!showCount;
- }
- mergedConfig = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedConfig), count);
- var _ref = mergedConfig,
- show = _ref.show,
- rest = (0,objectWithoutProperties["default"])(_ref, useCount_excluded);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, rest), {}, {
- show: !!show,
- showFormatter: typeof show === 'function' ? show : undefined,
- strategy: rest.strategy || function (value) {
- return value.length;
- }
- });
- }, [count, showCount]);
- }
- ;// ./node_modules/rc-input/es/Input.js
- var es_Input_excluded = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "onKeyUp", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"];
- var es_Input_Input = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var autoComplete = props.autoComplete,
- onChange = props.onChange,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onPressEnter = props.onPressEnter,
- onKeyDown = props.onKeyDown,
- onKeyUp = props.onKeyUp,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-input' : _props$prefixCls,
- disabled = props.disabled,
- htmlSize = props.htmlSize,
- className = props.className,
- maxLength = props.maxLength,
- suffix = props.suffix,
- showCount = props.showCount,
- count = props.count,
- _props$type = props.type,
- type = _props$type === void 0 ? 'text' : _props$type,
- classes = props.classes,
- classNames = props.classNames,
- styles = props.styles,
- _onCompositionStart = props.onCompositionStart,
- onCompositionEnd = props.onCompositionEnd,
- rest = (0,objectWithoutProperties["default"])(props, es_Input_excluded);
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- focused = _useState2[0],
- setFocused = _useState2[1];
- var compositionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var keyLockRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var holderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var focus = function focus(option) {
- if (inputRef.current) {
- triggerFocus(inputRef.current, option);
- }
- };
- // ====================== Value =======================
- var _useMergedState = (0,useMergedState["default"])(props.defaultValue, {
- value: props.value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- value = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var formatValue = value === undefined || value === null ? '' : String(value);
- // =================== Select Range ===================
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- selection = _useState4[0],
- setSelection = _useState4[1];
- // ====================== Count =======================
- var countConfig = useCount(count, showCount);
- var mergedMax = countConfig.max || maxLength;
- var valueLength = countConfig.strategy(formatValue);
- var isOutOfRange = !!mergedMax && valueLength > mergedMax;
- // ======================= Ref ========================
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- var _holderRef$current;
- return {
- focus: focus,
- blur: function blur() {
- var _inputRef$current;
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
- },
- setSelectionRange: function setSelectionRange(start, end, direction) {
- var _inputRef$current2;
- (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.setSelectionRange(start, end, direction);
- },
- select: function select() {
- var _inputRef$current3;
- (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 || _inputRef$current3.select();
- },
- input: inputRef.current,
- nativeElement: ((_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.nativeElement) || inputRef.current
- };
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (keyLockRef.current) {
- keyLockRef.current = false;
- }
- setFocused(function (prev) {
- return prev && disabled ? false : prev;
- });
- }, [disabled]);
- var triggerChange = function triggerChange(e, currentValue, info) {
- var cutValue = currentValue;
- if (!compositionRef.current && countConfig.exceedFormatter && countConfig.max && countConfig.strategy(currentValue) > countConfig.max) {
- cutValue = countConfig.exceedFormatter(currentValue, {
- max: countConfig.max
- });
- if (currentValue !== cutValue) {
- var _inputRef$current4, _inputRef$current5;
- setSelection([((_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.selectionStart) || 0, ((_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.selectionEnd) || 0]);
- }
- } else if (info.source === 'compositionEnd') {
- // Avoid triggering twice
- // https://github.com/ant-design/ant-design/issues/46587
- return;
- }
- setValue(cutValue);
- if (inputRef.current) {
- resolveOnChange(inputRef.current, e, onChange, cutValue);
- }
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (selection) {
- var _inputRef$current6;
- (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 || _inputRef$current6.setSelectionRange.apply(_inputRef$current6, (0,toConsumableArray["default"])(selection));
- }
- }, [selection]);
- var onInternalChange = function onInternalChange(e) {
- triggerChange(e, e.target.value, {
- source: 'change'
- });
- };
- var onInternalCompositionEnd = function onInternalCompositionEnd(e) {
- compositionRef.current = false;
- triggerChange(e, e.currentTarget.value, {
- source: 'compositionEnd'
- });
- onCompositionEnd === null || onCompositionEnd === void 0 || onCompositionEnd(e);
- };
- var handleKeyDown = function handleKeyDown(e) {
- if (onPressEnter && e.key === 'Enter' && !keyLockRef.current) {
- keyLockRef.current = true;
- onPressEnter(e);
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
- };
- var handleKeyUp = function handleKeyUp(e) {
- if (e.key === 'Enter') {
- keyLockRef.current = false;
- }
- onKeyUp === null || onKeyUp === void 0 || onKeyUp(e);
- };
- var handleFocus = function handleFocus(e) {
- setFocused(true);
- onFocus === null || onFocus === void 0 || onFocus(e);
- };
- var handleBlur = function handleBlur(e) {
- if (keyLockRef.current) {
- keyLockRef.current = false;
- }
- setFocused(false);
- onBlur === null || onBlur === void 0 || onBlur(e);
- };
- var handleReset = function handleReset(e) {
- setValue('');
- focus();
- if (inputRef.current) {
- resolveOnChange(inputRef.current, e, onChange);
- }
- };
- // ====================== Input =======================
- var outOfRangeCls = isOutOfRange && "".concat(prefixCls, "-out-of-range");
- var getInputElement = function getInputElement() {
- // Fix https://fb.me/react-unknown-prop
- var otherProps = (0,omit["default"])(props, ['prefixCls', 'onPressEnter', 'addonBefore', 'addonAfter', 'prefix', 'suffix', 'allowClear',
- // Input elements must be either controlled or uncontrolled,
- // specify either the value prop, or the defaultValue prop, but not both.
- 'defaultValue', 'showCount', 'count', 'classes', 'htmlSize', 'styles', 'classNames', 'onClear']);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", (0,esm_extends["default"])({
- autoComplete: autoComplete
- }, otherProps, {
- onChange: onInternalChange,
- onFocus: handleFocus,
- onBlur: handleBlur,
- onKeyDown: handleKeyDown,
- onKeyUp: handleKeyUp,
- className: classnames_default()(prefixCls, (0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), disabled), classNames === null || classNames === void 0 ? void 0 : classNames.input),
- style: styles === null || styles === void 0 ? void 0 : styles.input,
- ref: inputRef,
- size: htmlSize,
- type: type,
- onCompositionStart: function onCompositionStart(e) {
- compositionRef.current = true;
- _onCompositionStart === null || _onCompositionStart === void 0 || _onCompositionStart(e);
- },
- onCompositionEnd: onInternalCompositionEnd
- }));
- };
- var getSuffix = function getSuffix() {
- // Max length value
- var hasMaxLength = Number(mergedMax) > 0;
- if (suffix || countConfig.show) {
- var dataCount = countConfig.showFormatter ? countConfig.showFormatter({
- value: formatValue,
- count: valueLength,
- maxLength: mergedMax
- }) : "".concat(valueLength).concat(hasMaxLength ? " / ".concat(mergedMax) : '');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, countConfig.show && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(prefixCls, "-show-count-suffix"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-show-count-has-suffix"), !!suffix), classNames === null || classNames === void 0 ? void 0 : classNames.count),
- style: (0,objectSpread2["default"])({}, styles === null || styles === void 0 ? void 0 : styles.count)
- }, dataCount), suffix);
- }
- return null;
- };
- // ====================== Render ======================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_BaseInput, (0,esm_extends["default"])({}, rest, {
- prefixCls: prefixCls,
- className: classnames_default()(className, outOfRangeCls),
- handleReset: handleReset,
- value: formatValue,
- focused: focused,
- triggerFocus: focus,
- suffix: getSuffix(),
- disabled: disabled,
- classes: classes,
- classNames: classNames,
- styles: styles,
- ref: holderRef
- }), getInputElement());
- });
- /* harmony default export */ var es_Input = (es_Input_Input);
- ;// ./node_modules/rc-input/es/index.js
- /* harmony default export */ var rc_input_es = (es_Input);
- ;// ./node_modules/rc-util/es/proxyObject.js
- /**
- * Proxy object if environment supported
- */
- function proxyObject(obj, extendProps) {
- if (typeof Proxy !== 'undefined' && obj) {
- return new Proxy(obj, {
- get: function get(target, prop) {
- if (extendProps[prop]) {
- return extendProps[prop];
- }
- // Proxy origin property
- var originProp = target[prop];
- return typeof originProp === 'function' ? originProp.bind(target) : originProp;
- }
- });
- }
- return obj;
- }
- ;// ./node_modules/rc-input-number/es/hooks/useCursor.js
- /**
- * Keep input cursor in the correct position if possible.
- * Is this necessary since we have `formatter` which may mass the content?
- */
- function useCursor(input, focused) {
- var selectionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- function recordCursor() {
- // Record position
- try {
- var start = input.selectionStart,
- end = input.selectionEnd,
- value = input.value;
- var beforeTxt = value.substring(0, start);
- var afterTxt = value.substring(end);
- selectionRef.current = {
- start: start,
- end: end,
- value: value,
- beforeTxt: beforeTxt,
- afterTxt: afterTxt
- };
- } catch (e) {
- // Fix error in Chrome:
- // Failed to read the 'selectionStart' property from 'HTMLInputElement'
- // http://stackoverflow.com/q/21177489/3040605
- }
- }
- /**
- * Restore logic:
- * 1. back string same
- * 2. start string same
- */
- function restoreCursor() {
- if (input && selectionRef.current && focused) {
- try {
- var value = input.value;
- var _selectionRef$current = selectionRef.current,
- beforeTxt = _selectionRef$current.beforeTxt,
- afterTxt = _selectionRef$current.afterTxt,
- start = _selectionRef$current.start;
- var startPos = value.length;
- if (value.startsWith(beforeTxt)) {
- startPos = beforeTxt.length;
- } else if (value.endsWith(afterTxt)) {
- startPos = value.length - selectionRef.current.afterTxt.length;
- } else {
- var beforeLastChar = beforeTxt[start - 1];
- var newIndex = value.indexOf(beforeLastChar, start - 1);
- if (newIndex !== -1) {
- startPos = newIndex + 1;
- }
- }
- input.setSelectionRange(startPos, startPos);
- } catch (e) {
- (0,warning["default"])(false, "Something warning of cursor restore. Please fire issue about this: ".concat(e.message));
- }
- }
- }
- return [recordCursor, restoreCursor];
- }
- ;// ./node_modules/rc-util/es/hooks/useMobile.js
- /**
- * Hook to detect if the user is on a mobile device
- * Notice that this hook will only detect the device type in effect, so it will always be false in server side
- */
- var useMobile = function useMobile() {
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- mobile = _useState2[0],
- setMobile = _useState2[1];
- (0,useLayoutEffect["default"])(function () {
- setMobile(isMobile());
- }, []);
- return mobile;
- };
- /* harmony default export */ var hooks_useMobile = (useMobile);
- ;// ./node_modules/rc-input-number/es/StepHandler.js
- /* eslint-disable react/no-unknown-property */
- /**
- * When click and hold on a button - the speed of auto changing the value.
- */
- var STEP_INTERVAL = 200;
- /**
- * When click and hold on a button - the delay before auto changing the value.
- */
- var STEP_DELAY = 600;
- function StepHandler(_ref) {
- var prefixCls = _ref.prefixCls,
- upNode = _ref.upNode,
- downNode = _ref.downNode,
- upDisabled = _ref.upDisabled,
- downDisabled = _ref.downDisabled,
- onStep = _ref.onStep;
- // ======================== Step ========================
- var stepTimeoutRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var frameIds = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- var onStepRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- onStepRef.current = onStep;
- var onStopStep = function onStopStep() {
- clearTimeout(stepTimeoutRef.current);
- };
- // We will interval update step when hold mouse down
- var onStepMouseDown = function onStepMouseDown(e, up) {
- e.preventDefault();
- onStopStep();
- onStepRef.current(up);
- // Loop step for interval
- function loopStep() {
- onStepRef.current(up);
- stepTimeoutRef.current = setTimeout(loopStep, STEP_INTERVAL);
- }
- // First time press will wait some time to trigger loop step update
- stepTimeoutRef.current = setTimeout(loopStep, STEP_DELAY);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- onStopStep();
- frameIds.current.forEach(function (id) {
- return raf["default"].cancel(id);
- });
- };
- }, []);
- // ======================= Render =======================
- var isMobile = hooks_useMobile();
- if (isMobile) {
- return null;
- }
- var handlerClassName = "".concat(prefixCls, "-handler");
- var upClassName = classnames_default()(handlerClassName, "".concat(handlerClassName, "-up"), (0,defineProperty["default"])({}, "".concat(handlerClassName, "-up-disabled"), upDisabled));
- var downClassName = classnames_default()(handlerClassName, "".concat(handlerClassName, "-down"), (0,defineProperty["default"])({}, "".concat(handlerClassName, "-down-disabled"), downDisabled));
- // fix: https://github.com/ant-design/ant-design/issues/43088
- // In Safari, When we fire onmousedown and onmouseup events in quick succession,
- // there may be a problem that the onmouseup events are executed first,
- // resulting in a disordered program execution.
- // So, we need to use requestAnimationFrame to ensure that the onmouseup event is executed after the onmousedown event.
- var safeOnStopStep = function safeOnStopStep() {
- return frameIds.current.push((0,raf["default"])(onStopStep));
- };
- var sharedHandlerProps = {
- unselectable: 'on',
- role: 'button',
- onMouseUp: safeOnStopStep,
- onMouseLeave: safeOnStopStep
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(handlerClassName, "-wrap")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", (0,esm_extends["default"])({}, sharedHandlerProps, {
- onMouseDown: function onMouseDown(e) {
- onStepMouseDown(e, true);
- },
- "aria-label": "Increase Value",
- "aria-disabled": upDisabled,
- className: upClassName
- }), upNode || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- unselectable: "on",
- className: "".concat(prefixCls, "-handler-up-inner")
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", (0,esm_extends["default"])({}, sharedHandlerProps, {
- onMouseDown: function onMouseDown(e) {
- onStepMouseDown(e, false);
- },
- "aria-label": "Decrease Value",
- "aria-disabled": downDisabled,
- className: downClassName
- }), downNode || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- unselectable: "on",
- className: "".concat(prefixCls, "-handler-down-inner")
- })));
- }
- ;// ./node_modules/rc-input-number/es/utils/numberUtil.js
- function getDecupleSteps(step) {
- var stepStr = typeof step === 'number' ? num2str(step) : trimNumber(step).fullStr;
- var hasPoint = stepStr.includes('.');
- if (!hasPoint) {
- return step + '0';
- }
- return trimNumber(stepStr.replace(/(\d)\.(\d)/g, '$1$2.')).fullStr;
- }
- ;// ./node_modules/rc-input-number/es/hooks/useFrame.js
- /**
- * Always trigger latest once when call multiple time
- */
- /* harmony default export */ var useFrame = (function () {
- var idRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
- var cleanUp = function cleanUp() {
- raf["default"].cancel(idRef.current);
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return cleanUp;
- }, []);
- return function (callback) {
- cleanUp();
- idRef.current = (0,raf["default"])(function () {
- callback();
- });
- };
- });
- ;// ./node_modules/rc-input-number/es/InputNumber.js
- var InputNumber_excluded = ["prefixCls", "className", "style", "min", "max", "step", "defaultValue", "value", "disabled", "readOnly", "upHandler", "downHandler", "keyboard", "changeOnWheel", "controls", "classNames", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep", "changeOnBlur", "domRef"],
- InputNumber_excluded2 = ["disabled", "style", "prefixCls", "value", "prefix", "suffix", "addonBefore", "addonAfter", "className", "classNames"];
- /**
- * We support `stringMode` which need handle correct type when user call in onChange
- * format max or min value
- * 1. if isInvalid return null
- * 2. if precision is undefined, return decimal
- * 3. format with precision
- * I. if max > 0, round down with precision. Example: max= 3.5, precision=0 afterFormat: 3
- * II. if max < 0, round up with precision. Example: max= -3.5, precision=0 afterFormat: -4
- * III. if min > 0, round up with precision. Example: min= 3.5, precision=0 afterFormat: 4
- * IV. if min < 0, round down with precision. Example: max= -3.5, precision=0 afterFormat: -3
- */
- var getDecimalValue = function getDecimalValue(stringMode, decimalValue) {
- if (stringMode || decimalValue.isEmpty()) {
- return decimalValue.toString();
- }
- return decimalValue.toNumber();
- };
- var getDecimalIfValidate = function getDecimalIfValidate(value) {
- var decimal = mini_decimal_es(value);
- return decimal.isInvalidate() ? null : decimal;
- };
- var InternalInputNumber = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- className = props.className,
- style = props.style,
- min = props.min,
- max = props.max,
- _props$step = props.step,
- step = _props$step === void 0 ? 1 : _props$step,
- defaultValue = props.defaultValue,
- value = props.value,
- disabled = props.disabled,
- readOnly = props.readOnly,
- upHandler = props.upHandler,
- downHandler = props.downHandler,
- keyboard = props.keyboard,
- _props$changeOnWheel = props.changeOnWheel,
- changeOnWheel = _props$changeOnWheel === void 0 ? false : _props$changeOnWheel,
- _props$controls = props.controls,
- controls = _props$controls === void 0 ? true : _props$controls,
- classNames = props.classNames,
- stringMode = props.stringMode,
- parser = props.parser,
- formatter = props.formatter,
- precision = props.precision,
- decimalSeparator = props.decimalSeparator,
- onChange = props.onChange,
- onInput = props.onInput,
- onPressEnter = props.onPressEnter,
- onStep = props.onStep,
- _props$changeOnBlur = props.changeOnBlur,
- changeOnBlur = _props$changeOnBlur === void 0 ? true : _props$changeOnBlur,
- domRef = props.domRef,
- inputProps = (0,objectWithoutProperties["default"])(props, InputNumber_excluded);
- var inputClassName = "".concat(prefixCls, "-input");
- var inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- focus = _React$useState2[0],
- setFocus = _React$useState2[1];
- var userTypingRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var compositionRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var shiftKeyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- // ============================ Value =============================
- // Real value control
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- return mini_decimal_es(value !== null && value !== void 0 ? value : defaultValue);
- }),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- decimalValue = _React$useState4[0],
- setDecimalValue = _React$useState4[1];
- function setUncontrolledDecimalValue(newDecimal) {
- if (value === undefined) {
- setDecimalValue(newDecimal);
- }
- }
- // ====================== Parser & Formatter ======================
- /**
- * `precision` is used for formatter & onChange.
- * It will auto generate by `value` & `step`.
- * But it will not block user typing.
- *
- * Note: Auto generate `precision` is used for legacy logic.
- * We should remove this since we already support high precision with BigInt.
- *
- * @param number Provide which number should calculate precision
- * @param userTyping Change by user typing
- */
- var getPrecision = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (numStr, userTyping) {
- if (userTyping) {
- return undefined;
- }
- if (precision >= 0) {
- return precision;
- }
- return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));
- }, [precision, step]);
- // >>> Parser
- var mergedParser = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (num) {
- var numStr = String(num);
- if (parser) {
- return parser(numStr);
- }
- var parsedStr = numStr;
- if (decimalSeparator) {
- parsedStr = parsedStr.replace(decimalSeparator, '.');
- }
- // [Legacy] We still support auto convert `$ 123,456` to `123456`
- return parsedStr.replace(/[^\w.-]+/g, '');
- }, [parser, decimalSeparator]);
- // >>> Formatter
- var inputValueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef('');
- var mergedFormatter = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (number, userTyping) {
- if (formatter) {
- return formatter(number, {
- userTyping: userTyping,
- input: String(inputValueRef.current)
- });
- }
- var str = typeof number === 'number' ? num2str(number) : number;
- // User typing will not auto format with precision directly
- if (!userTyping) {
- var mergedPrecision = getPrecision(str, userTyping);
- if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {
- // Separator
- var separatorStr = decimalSeparator || '.';
- str = toFixed(str, separatorStr, mergedPrecision);
- }
- }
- return str;
- }, [formatter, getPrecision, decimalSeparator]);
- // ========================== InputValue ==========================
- /**
- * Input text value control
- *
- * User can not update input content directly. It updates with follow rules by priority:
- * 1. controlled `value` changed
- * * [SPECIAL] Typing like `1.` should not immediately convert to `1`
- * 2. User typing with format (not precision)
- * 3. Blur or Enter trigger revalidate
- */
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
- if (decimalValue.isInvalidate() && ['string', 'number'].includes((0,esm_typeof["default"])(initValue))) {
- return Number.isNaN(initValue) ? '' : initValue;
- }
- return mergedFormatter(decimalValue.toString(), false);
- }),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- inputValue = _React$useState6[0],
- setInternalInputValue = _React$useState6[1];
- inputValueRef.current = inputValue;
- // Should always be string
- function setInputValue(newValue, userTyping) {
- setInternalInputValue(mergedFormatter(
- // Invalidate number is sometime passed by external control, we should let it go
- // Otherwise is controlled by internal interactive logic which check by userTyping
- // You can ref 'show limited value when input is not focused' test for more info.
- newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));
- }
- // >>> Max & Min limit
- var maxDecimal = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getDecimalIfValidate(max);
- }, [max, precision]);
- var minDecimal = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getDecimalIfValidate(min);
- }, [min, precision]);
- var upDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {
- return false;
- }
- return maxDecimal.lessEquals(decimalValue);
- }, [maxDecimal, decimalValue]);
- var downDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {
- return false;
- }
- return decimalValue.lessEquals(minDecimal);
- }, [minDecimal, decimalValue]);
- // Cursor controller
- var _useCursor = useCursor(inputRef.current, focus),
- _useCursor2 = (0,slicedToArray["default"])(_useCursor, 2),
- recordCursor = _useCursor2[0],
- restoreCursor = _useCursor2[1];
- // ============================= Data =============================
- /**
- * Find target value closet within range.
- * e.g. [11, 28]:
- * 3 => 11
- * 23 => 23
- * 99 => 28
- */
- var getRangeValue = function getRangeValue(target) {
- // target > max
- if (maxDecimal && !target.lessEquals(maxDecimal)) {
- return maxDecimal;
- }
- // target < min
- if (minDecimal && !minDecimal.lessEquals(target)) {
- return minDecimal;
- }
- return null;
- };
- /**
- * Check value is in [min, max] range
- */
- var isInRange = function isInRange(target) {
- return !getRangeValue(target);
- };
- /**
- * Trigger `onChange` if value validated and not equals of origin.
- * Return the value that re-align in range.
- */
- var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {
- var updateValue = newValue;
- var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();
- // Skip align value when trigger value is empty.
- // We just trigger onChange(null)
- // This should not block user typing
- if (!updateValue.isEmpty() && !userTyping) {
- // Revert value in range if needed
- updateValue = getRangeValue(updateValue) || updateValue;
- isRangeValidate = true;
- }
- if (!readOnly && !disabled && isRangeValidate) {
- var numStr = updateValue.toString();
- var mergedPrecision = getPrecision(numStr, userTyping);
- if (mergedPrecision >= 0) {
- updateValue = mini_decimal_es(toFixed(numStr, '.', mergedPrecision));
- // When to fixed. The value may out of min & max range.
- // 4 in [0, 3.8] => 3.8 => 4 (toFixed)
- if (!isInRange(updateValue)) {
- updateValue = mini_decimal_es(toFixed(numStr, '.', mergedPrecision, true));
- }
- }
- // Trigger event
- if (!updateValue.equals(decimalValue)) {
- setUncontrolledDecimalValue(updateValue);
- onChange === null || onChange === void 0 || onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));
- // Reformat input if value is not controlled
- if (value === undefined) {
- setInputValue(updateValue, userTyping);
- }
- }
- return updateValue;
- }
- return decimalValue;
- };
- // ========================== User Input ==========================
- var onNextPromise = useFrame();
- // >>> Collect input value
- var collectInputValue = function collectInputValue(inputStr) {
- recordCursor();
- // Update inputValue in case input can not parse as number
- // Refresh ref value immediately since it may used by formatter
- inputValueRef.current = inputStr;
- setInternalInputValue(inputStr);
- // Parse number
- if (!compositionRef.current) {
- var finalValue = mergedParser(inputStr);
- var finalDecimal = mini_decimal_es(finalValue);
- if (!finalDecimal.isNaN()) {
- triggerValueUpdate(finalDecimal, true);
- }
- }
- // Trigger onInput later to let user customize value if they want to handle something after onChange
- onInput === null || onInput === void 0 || onInput(inputStr);
- // optimize for chinese input experience
- // https://github.com/ant-design/ant-design/issues/8196
- onNextPromise(function () {
- var nextInputStr = inputStr;
- if (!parser) {
- nextInputStr = inputStr.replace(/。/g, '.');
- }
- if (nextInputStr !== inputStr) {
- collectInputValue(nextInputStr);
- }
- });
- };
- // >>> Composition
- var onCompositionStart = function onCompositionStart() {
- compositionRef.current = true;
- };
- var onCompositionEnd = function onCompositionEnd() {
- compositionRef.current = false;
- collectInputValue(inputRef.current.value);
- };
- // >>> Input
- var onInternalInput = function onInternalInput(e) {
- collectInputValue(e.target.value);
- };
- // ============================= Step =============================
- var onInternalStep = function onInternalStep(up) {
- var _inputRef$current;
- // Ignore step since out of range
- if (up && upDisabled || !up && downDisabled) {
- return;
- }
- // Clear typing status since it may be caused by up & down key.
- // We should sync with input value.
- userTypingRef.current = false;
- var stepDecimal = mini_decimal_es(shiftKeyRef.current ? getDecupleSteps(step) : step);
- if (!up) {
- stepDecimal = stepDecimal.negate();
- }
- var target = (decimalValue || mini_decimal_es(0)).add(stepDecimal.toString());
- var updatedValue = triggerValueUpdate(target, false);
- onStep === null || onStep === void 0 || onStep(getDecimalValue(stringMode, updatedValue), {
- offset: shiftKeyRef.current ? getDecupleSteps(step) : step,
- type: up ? 'up' : 'down'
- });
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
- };
- // ============================ Flush =============================
- /**
- * Flush current input content to trigger value change & re-formatter input if needed.
- * This will always flush input value for update.
- * If it's invalidate, will fallback to last validate value.
- */
- var flushInputValue = function flushInputValue(userTyping) {
- var parsedValue = mini_decimal_es(mergedParser(inputValue));
- var formatValue;
- if (!parsedValue.isNaN()) {
- // Only validate value or empty value can be re-fill to inputValue
- // Reassign the formatValue within ranged of trigger control
- formatValue = triggerValueUpdate(parsedValue, userTyping);
- } else {
- formatValue = triggerValueUpdate(decimalValue, userTyping);
- }
- if (value !== undefined) {
- // Reset back with controlled value first
- setInputValue(decimalValue, false);
- } else if (!formatValue.isNaN()) {
- // Reset input back since no validate value
- setInputValue(formatValue, false);
- }
- };
- // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)
- var onBeforeInput = function onBeforeInput() {
- userTypingRef.current = true;
- };
- var onKeyDown = function onKeyDown(event) {
- var key = event.key,
- shiftKey = event.shiftKey;
- userTypingRef.current = true;
- shiftKeyRef.current = shiftKey;
- if (key === 'Enter') {
- if (!compositionRef.current) {
- userTypingRef.current = false;
- }
- flushInputValue(false);
- onPressEnter === null || onPressEnter === void 0 || onPressEnter(event);
- }
- if (keyboard === false) {
- return;
- }
- // Do step
- if (!compositionRef.current && ['Up', 'ArrowUp', 'Down', 'ArrowDown'].includes(key)) {
- onInternalStep(key === 'Up' || key === 'ArrowUp');
- event.preventDefault();
- }
- };
- var onKeyUp = function onKeyUp() {
- userTypingRef.current = false;
- shiftKeyRef.current = false;
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (changeOnWheel && focus) {
- var onWheel = function onWheel(event) {
- // moving mouse wheel rises wheel event with deltaY < 0
- // scroll value grows from top to bottom, as screen Y coordinate
- onInternalStep(event.deltaY < 0);
- event.preventDefault();
- };
- var input = inputRef.current;
- if (input) {
- // React onWheel is passive and we can't preventDefault() in it.
- // That's why we should subscribe with DOM listener
- // https://stackoverflow.com/questions/63663025/react-onwheel-handler-cant-preventdefault-because-its-a-passive-event-listenev
- input.addEventListener('wheel', onWheel, {
- passive: false
- });
- return function () {
- return input.removeEventListener('wheel', onWheel);
- };
- }
- }
- });
- // >>> Focus & Blur
- var onBlur = function onBlur() {
- if (changeOnBlur) {
- flushInputValue(false);
- }
- setFocus(false);
- userTypingRef.current = false;
- };
- // ========================== Controlled ==========================
- // Input by precision & formatter
- (0,useLayoutEffect.useLayoutUpdateEffect)(function () {
- if (!decimalValue.isInvalidate()) {
- setInputValue(decimalValue, false);
- }
- }, [precision, formatter]);
- // Input by value
- (0,useLayoutEffect.useLayoutUpdateEffect)(function () {
- var newValue = mini_decimal_es(value);
- setDecimalValue(newValue);
- var currentParsedValue = mini_decimal_es(mergedParser(inputValue));
- // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.
- // But let it go if user set `formatter`
- if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {
- // Update value as effect
- setInputValue(newValue, userTypingRef.current);
- }
- }, [value]);
- // ============================ Cursor ============================
- (0,useLayoutEffect.useLayoutUpdateEffect)(function () {
- if (formatter) {
- restoreCursor();
- }
- }, [inputValue]);
- // ============================ Render ============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: domRef,
- className: classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-focused"), focus), "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-readonly"), readOnly), "".concat(prefixCls, "-not-a-number"), decimalValue.isNaN()), "".concat(prefixCls, "-out-of-range"), !decimalValue.isInvalidate() && !isInRange(decimalValue))),
- style: style,
- onFocus: function onFocus() {
- setFocus(true);
- },
- onBlur: onBlur,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp,
- onCompositionStart: onCompositionStart,
- onCompositionEnd: onCompositionEnd,
- onBeforeInput: onBeforeInput
- }, controls && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StepHandler, {
- prefixCls: prefixCls,
- upNode: upHandler,
- downNode: downHandler,
- upDisabled: upDisabled,
- downDisabled: downDisabled,
- onStep: onInternalStep
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(inputClassName, "-wrap")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", (0,esm_extends["default"])({
- autoComplete: "off",
- role: "spinbutton",
- "aria-valuemin": min,
- "aria-valuemax": max,
- "aria-valuenow": decimalValue.isInvalidate() ? null : decimalValue.toString(),
- step: step
- }, inputProps, {
- ref: (0,es_ref.composeRef)(inputRef, ref),
- className: inputClassName,
- value: inputValue,
- onChange: onInternalInput,
- disabled: disabled,
- readOnly: readOnly
- }))));
- });
- var InputNumber = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var disabled = props.disabled,
- style = props.style,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,
- value = props.value,
- prefix = props.prefix,
- suffix = props.suffix,
- addonBefore = props.addonBefore,
- addonAfter = props.addonAfter,
- className = props.className,
- classNames = props.classNames,
- rest = (0,objectWithoutProperties["default"])(props, InputNumber_excluded2);
- var holderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var inputNumberDomRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var inputFocusRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var focus = function focus(option) {
- if (inputFocusRef.current) {
- triggerFocus(inputFocusRef.current, option);
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return proxyObject(inputFocusRef.current, {
- focus: focus,
- nativeElement: holderRef.current.nativeElement || inputNumberDomRef.current
- });
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_BaseInput, {
- className: className,
- triggerFocus: focus,
- prefixCls: prefixCls,
- value: value,
- disabled: disabled,
- style: style,
- prefix: prefix,
- suffix: suffix,
- addonAfter: addonAfter,
- addonBefore: addonBefore,
- classNames: classNames,
- components: {
- affixWrapper: 'div',
- groupWrapper: 'div',
- wrapper: 'div',
- groupAddon: 'div'
- },
- ref: holderRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalInputNumber, (0,esm_extends["default"])({
- prefixCls: prefixCls,
- disabled: disabled,
- ref: inputFocusRef,
- domRef: inputNumberDomRef,
- className: classNames === null || classNames === void 0 ? void 0 : classNames.input
- }, rest)));
- });
- if (true) {
- InputNumber.displayName = 'InputNumber';
- }
- /* harmony default export */ var es_InputNumber = (InputNumber);
- ;// ./node_modules/rc-input-number/es/index.js
- /* harmony default export */ var rc_input_number_es = (es_InputNumber);
- // EXTERNAL MODULE: ./components/input-number/style/index.ts + 1 modules
- var input_number_style = __webpack_require__("./components/input-number/style/index.ts");
- ;// ./components/input-number/index.tsx
- var input_number_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const input_number_InputNumber = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- if (true) {
- const typeWarning = (0,_util_warning.devUseWarning)('InputNumber');
- typeWarning.deprecated(!('bordered' in props), 'bordered', 'variant');
- typeWarning(!(props.type === 'number' && props.changeOnWheel), 'usage', 'When `type=number` is used together with `changeOnWheel`, changeOnWheel may not work properly. Please delete `type=number` if it is not necessary.');
- }
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => inputRef.current);
- const {
- className,
- rootClassName,
- size: customizeSize,
- disabled: customDisabled,
- prefixCls: customizePrefixCls,
- addonBefore,
- addonAfter,
- prefix,
- suffix,
- bordered,
- readOnly,
- status: customStatus,
- controls,
- variant: customVariant
- } = props,
- others = input_number_rest(props, ["className", "rootClassName", "size", "disabled", "prefixCls", "addonBefore", "addonAfter", "prefix", "suffix", "bordered", "readOnly", "status", "controls", "variant"]);
- const prefixCls = getPrefixCls('input-number', customizePrefixCls);
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,input_number_style["default"])(prefixCls, rootCls);
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- let upIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_UpOutlined, {
- className: `${prefixCls}-handler-up-inner`
- });
- let downIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DownOutlined, {
- className: `${prefixCls}-handler-down-inner`
- });
- const controlsTemp = typeof controls === 'boolean' ? controls : undefined;
- if (typeof controls === 'object') {
- upIcon = typeof controls.upIcon === 'undefined' ? upIcon : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-handler-up-inner`
- }, controls.upIcon));
- downIcon = typeof controls.downIcon === 'undefined' ? downIcon : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-handler-down-inner`
- }, controls.downIcon));
- }
- const {
- hasFeedback,
- status: contextStatus,
- isFormItemInput,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const [variant, enableVariantCls] = useVariants('inputNumber', customVariant, bordered);
- const suffixNode = hasFeedback && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, feedbackIcon);
- const inputNumberClass = classnames_default()({
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-in-form-item`]: isFormItemInput
- }, hashId);
- const wrapperClassName = `${prefixCls}-group`;
- const element = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_input_number_es, Object.assign({
- ref: inputRef,
- disabled: mergedDisabled,
- className: classnames_default()(cssVarCls, rootCls, className, rootClassName, compactItemClassnames),
- upHandler: upIcon,
- downHandler: downIcon,
- prefixCls: prefixCls,
- readOnly: readOnly,
- controls: controlsTemp,
- prefix: prefix,
- suffix: suffixNode || suffix,
- addonBefore: addonBefore && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, addonBefore)),
- addonAfter: addonAfter && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, addonAfter)),
- classNames: {
- input: inputNumberClass,
- variant: classnames_default()({
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback)),
- affixWrapper: classnames_default()({
- [`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
- [`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
- [`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
- [`${prefixCls}-affix-wrapper-without-controls`]: controls === false || mergedDisabled || readOnly
- }, hashId),
- wrapper: classnames_default()({
- [`${wrapperClassName}-rtl`]: direction === 'rtl'
- }, hashId),
- groupWrapper: classnames_default()({
- [`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
- [`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
- [`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
- [`${prefixCls}-group-wrapper-${variant}`]: enableVariantCls
- }, getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
- }
- }, others));
- return wrapCSSVar(element);
- });
- const TypedInputNumber = input_number_InputNumber;
- /** @private Internal Component. Do not use in your production. */
- const PureInputNumber = props => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider, {
- theme: {
- components: {
- InputNumber: {
- handleVisible: true
- }
- }
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_number_InputNumber, Object.assign({}, props))));
- if (true) {
- TypedInputNumber.displayName = 'InputNumber';
- }
- TypedInputNumber._InternalPanelDoNotUseOrYouWillBeFired = PureInputNumber;
- /* harmony default export */ var input_number = (TypedInputNumber);
- ;// ./components/color-picker/components/ColorSteppers.tsx
- const ColorSteppers = ({
- prefixCls,
- min = 0,
- max = 100,
- value,
- onChange,
- className,
- formatter
- }) => {
- const colorSteppersPrefixCls = `${prefixCls}-steppers`;
- const [internalValue, setInternalValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0);
- const stepValue = !Number.isNaN(value) ? value : internalValue;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(input_number, {
- className: classnames_default()(colorSteppersPrefixCls, className),
- min: min,
- max: max,
- value: stepValue,
- formatter: formatter,
- size: "small",
- onChange: step => {
- setInternalValue(step || 0);
- onChange === null || onChange === void 0 ? void 0 : onChange(step);
- }
- });
- };
- /* harmony default export */ var components_ColorSteppers = (ColorSteppers);
- ;// ./components/color-picker/components/ColorAlphaInput.tsx
- const ColorAlphaInput = ({
- prefixCls,
- value,
- onChange
- }) => {
- const colorAlphaInputPrefixCls = `${prefixCls}-alpha-input`;
- const [internalValue, setInternalValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => (0,util.generateColor)(value || '#000'));
- const alphaValue = value || internalValue;
- const handleAlphaChange = step => {
- const hsba = alphaValue.toHsb();
- hsba.a = (step || 0) / 100;
- const genColor = (0,util.generateColor)(hsba);
- setInternalValue(genColor);
- onChange === null || onChange === void 0 ? void 0 : onChange(genColor);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- value: (0,util.getColorAlpha)(alphaValue),
- prefixCls: prefixCls,
- formatter: step => `${step}%`,
- className: colorAlphaInputPrefixCls,
- onChange: handleAlphaChange
- });
- };
- /* harmony default export */ var components_ColorAlphaInput = (ColorAlphaInput);
- ;// ./components/_util/getAllowClear.tsx
- const getAllowClear = allowClear => {
- let mergedAllowClear;
- if (typeof allowClear === 'object' && (allowClear === null || allowClear === void 0 ? void 0 : allowClear.clearIcon)) {
- mergedAllowClear = allowClear;
- } else if (allowClear) {
- mergedAllowClear = {
- clearIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_CloseCircleFilled, null)
- };
- }
- return mergedAllowClear;
- };
- /* harmony default export */ var _util_getAllowClear = (getAllowClear);
- ;// ./components/input/hooks/useRemovePasswordTimeout.ts
- function useRemovePasswordTimeout(inputRef, triggerOnMount) {
- const removePasswordTimeoutRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
- const removePasswordTimeout = () => {
- removePasswordTimeoutRef.current.push(setTimeout(() => {
- var _a, _b, _c, _d;
- if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.input.getAttribute('type')) === 'password' && ((_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.input.hasAttribute('value'))) {
- (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.input.removeAttribute('value');
- }
- }));
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- if (triggerOnMount) {
- removePasswordTimeout();
- }
- return () => removePasswordTimeoutRef.current.forEach(timer => {
- if (timer) {
- clearTimeout(timer);
- }
- });
- }, []);
- return removePasswordTimeout;
- }
- // EXTERNAL MODULE: ./components/input/style/index.ts
- var input_style = __webpack_require__("./components/input/style/index.ts");
- ;// ./components/input/utils.ts
- function utils_hasPrefixSuffix(props) {
- return !!(props.prefix || props.suffix || props.allowClear || props.showCount);
- }
- ;// ./components/input/Input.tsx
- var Input_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const input_Input_Input = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- bordered = true,
- status: customStatus,
- size: customSize,
- disabled: customDisabled,
- onBlur,
- onFocus,
- suffix,
- allowClear,
- addonAfter,
- addonBefore,
- className,
- style,
- styles,
- rootClassName,
- onChange,
- classNames,
- variant: customVariant
- } = props,
- rest = Input_rest(props, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant"]);
- if (true) {
- const {
- deprecated
- } = (0,_util_warning.devUseWarning)('Input');
- deprecated(!('bordered' in props), 'bordered', 'variant');
- }
- const {
- getPrefixCls,
- direction,
- allowClear: contextAllowClear,
- autoComplete: contextAutoComplete,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('input');
- const prefixCls = getPrefixCls('input', customizePrefixCls);
- const inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapSharedCSSVar, hashId, cssVarCls] = (0,input_style.useSharedStyle)(prefixCls, rootClassName);
- const [wrapCSSVar] = (0,input_style["default"])(prefixCls, rootCls);
- // ===================== Compact Item =====================
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- // ===================== Size =====================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customSize !== null && customSize !== void 0 ? customSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- // ===================== Status =====================
- const {
- status: contextStatus,
- hasFeedback,
- feedbackIcon
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- // ===================== Focus warning =====================
- const inputHasPrefixSuffix = utils_hasPrefixSuffix(props) || !!hasFeedback;
- const prevHasPrefixSuffix = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(inputHasPrefixSuffix);
- /* eslint-disable react-hooks/rules-of-hooks */
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Input');
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- var _a;
- if (inputHasPrefixSuffix && !prevHasPrefixSuffix.current) {
- true ? warning(document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input), 'usage', `When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`) : 0;
- }
- prevHasPrefixSuffix.current = inputHasPrefixSuffix;
- }, [inputHasPrefixSuffix]);
- }
- /* eslint-enable */
- // ===================== Remove Password value =====================
- const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
- const handleBlur = e => {
- removePasswordTimeout();
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
- };
- const handleFocus = e => {
- removePasswordTimeout();
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
- };
- const handleChange = e => {
- removePasswordTimeout();
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
- };
- const suffixNode = (hasFeedback || suffix) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, suffix, hasFeedback && feedbackIcon));
- const mergedAllowClear = _util_getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
- const [variant, enableVariantCls] = useVariants('input', customVariant, bordered);
- return wrapSharedCSSVar(wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_input_es, Object.assign({
- ref: (0,es_ref.composeRef)(ref, inputRef),
- prefixCls: prefixCls,
- autoComplete: contextAutoComplete
- }, rest, {
- disabled: mergedDisabled,
- onBlur: handleBlur,
- onFocus: handleFocus,
- style: Object.assign(Object.assign({}, contextStyle), style),
- styles: Object.assign(Object.assign({}, contextStyles), styles),
- suffix: suffixNode,
- allowClear: mergedAllowClear,
- className: classnames_default()(className, rootClassName, cssVarCls, rootCls, compactItemClassnames, contextClassName),
- onChange: handleChange,
- addonBefore: addonBefore && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, addonBefore)),
- addonAfter: addonAfter && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, addonAfter)),
- classNames: Object.assign(Object.assign(Object.assign({}, classNames), contextClassNames), {
- input: classnames_default()({
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, classNames === null || classNames === void 0 ? void 0 : classNames.input, contextClassNames.input, hashId),
- variant: classnames_default()({
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, mergedStatus)),
- affixWrapper: classnames_default()({
- [`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
- [`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
- [`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl'
- }, hashId),
- wrapper: classnames_default()({
- [`${prefixCls}-group-rtl`]: direction === 'rtl'
- }, hashId),
- groupWrapper: classnames_default()({
- [`${prefixCls}-group-wrapper-sm`]: mergedSize === 'small',
- [`${prefixCls}-group-wrapper-lg`]: mergedSize === 'large',
- [`${prefixCls}-group-wrapper-rtl`]: direction === 'rtl',
- [`${prefixCls}-group-wrapper-${variant}`]: enableVariantCls
- }, getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
- })
- }))));
- });
- if (true) {
- input_Input_Input.displayName = 'Input';
- }
- /* harmony default export */ var input_Input = (input_Input_Input);
- ;// ./components/color-picker/components/ColorHexInput.tsx
- const hexReg = /(^#[\da-f]{6}$)|(^#[\da-f]{8}$)/i;
- const isHexString = hex => hexReg.test(`#${hex}`);
- const ColorHexInput = ({
- prefixCls,
- value,
- onChange
- }) => {
- const colorHexInputPrefixCls = `${prefixCls}-hex-input`;
- const [hexValue, setHexValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => value ? (0,color.toHexFormat)(value.toHexString()) : undefined);
- // Update step value
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- if (value) {
- setHexValue((0,color.toHexFormat)(value.toHexString()));
- }
- }, [value]);
- const handleHexChange = e => {
- const originValue = e.target.value;
- setHexValue((0,color.toHexFormat)(originValue));
- if (isHexString((0,color.toHexFormat)(originValue, true))) {
- onChange === null || onChange === void 0 ? void 0 : onChange((0,util.generateColor)(originValue));
- }
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(input_Input, {
- className: colorHexInputPrefixCls,
- value: hexValue,
- prefix: "#",
- onChange: handleHexChange,
- size: "small"
- });
- };
- /* harmony default export */ var components_ColorHexInput = (ColorHexInput);
- ;// ./components/color-picker/components/ColorHsbInput.tsx
- const ColorHsbInput = ({
- prefixCls,
- value,
- onChange
- }) => {
- const colorHsbInputPrefixCls = `${prefixCls}-hsb-input`;
- const [internalValue, setInternalValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => (0,util.generateColor)(value || '#000'));
- const hsbValue = value || internalValue;
- const handleHsbChange = (step, type) => {
- const hsb = hsbValue.toHsb();
- hsb[type] = type === 'h' ? step : (step || 0) / 100;
- const genColor = (0,util.generateColor)(hsb);
- setInternalValue(genColor);
- onChange === null || onChange === void 0 ? void 0 : onChange(genColor);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: colorHsbInputPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 360,
- min: 0,
- value: Number(hsbValue.toHsb().h),
- prefixCls: prefixCls,
- className: colorHsbInputPrefixCls,
- formatter: step => (0,util.getRoundNumber)(step || 0).toString(),
- onChange: step => handleHsbChange(Number(step), 'h')
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 100,
- min: 0,
- value: Number(hsbValue.toHsb().s) * 100,
- prefixCls: prefixCls,
- className: colorHsbInputPrefixCls,
- formatter: step => `${(0,util.getRoundNumber)(step || 0)}%`,
- onChange: step => handleHsbChange(Number(step), 's')
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 100,
- min: 0,
- value: Number(hsbValue.toHsb().b) * 100,
- prefixCls: prefixCls,
- className: colorHsbInputPrefixCls,
- formatter: step => `${(0,util.getRoundNumber)(step || 0)}%`,
- onChange: step => handleHsbChange(Number(step), 'b')
- }));
- };
- /* harmony default export */ var components_ColorHsbInput = (ColorHsbInput);
- ;// ./components/color-picker/components/ColorRgbInput.tsx
- const ColorRgbInput = ({
- prefixCls,
- value,
- onChange
- }) => {
- const colorRgbInputPrefixCls = `${prefixCls}-rgb-input`;
- const [internalValue, setInternalValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => (0,util.generateColor)(value || '#000'));
- const rgbValue = value || internalValue;
- const handleRgbChange = (step, type) => {
- const rgb = rgbValue.toRgb();
- rgb[type] = step || 0;
- const genColor = (0,util.generateColor)(rgb);
- setInternalValue(genColor);
- onChange === null || onChange === void 0 ? void 0 : onChange(genColor);
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: colorRgbInputPrefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 255,
- min: 0,
- value: Number(rgbValue.toRgb().r),
- prefixCls: prefixCls,
- className: colorRgbInputPrefixCls,
- onChange: step => handleRgbChange(Number(step), 'r')
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 255,
- min: 0,
- value: Number(rgbValue.toRgb().g),
- prefixCls: prefixCls,
- className: colorRgbInputPrefixCls,
- onChange: step => handleRgbChange(Number(step), 'g')
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorSteppers, {
- max: 255,
- min: 0,
- value: Number(rgbValue.toRgb().b),
- prefixCls: prefixCls,
- className: colorRgbInputPrefixCls,
- onChange: step => handleRgbChange(Number(step), 'b')
- }));
- };
- /* harmony default export */ var components_ColorRgbInput = (ColorRgbInput);
- ;// ./components/color-picker/components/ColorInput.tsx
- const selectOptions = [FORMAT_HEX, FORMAT_HSB, FORMAT_RGB].map(format => ({
- value: format,
- label: format.toUpperCase()
- }));
- const ColorInput = props => {
- const {
- prefixCls,
- format,
- value,
- disabledAlpha,
- onFormatChange,
- onChange,
- disabledFormat
- } = props;
- const [colorFormat, setColorFormat] = (0,useMergedState["default"])(FORMAT_HEX, {
- value: format,
- onChange: onFormatChange
- });
- const colorInputPrefixCls = `${prefixCls}-input`;
- const handleFormatChange = newFormat => {
- setColorFormat(newFormat);
- };
- const steppersNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const inputProps = {
- value,
- prefixCls,
- onChange
- };
- switch (colorFormat) {
- case FORMAT_HSB:
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorHsbInput, Object.assign({}, inputProps));
- case FORMAT_RGB:
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorRgbInput, Object.assign({}, inputProps));
- // case FORMAT_HEX:
- default:
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorHexInput, Object.assign({}, inputProps));
- }
- }, [colorFormat, prefixCls, value, onChange]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${colorInputPrefixCls}-container`
- }, !disabledFormat && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_select, {
- value: colorFormat,
- variant: "borderless",
- getPopupContainer: current => current,
- popupMatchSelectWidth: 68,
- placement: "bottomRight",
- onChange: handleFormatChange,
- className: `${prefixCls}-format-select`,
- size: "small",
- options: selectOptions
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: colorInputPrefixCls
- }, steppersNode), !disabledAlpha && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorAlphaInput, {
- prefixCls: prefixCls,
- value: value,
- onChange: onChange
- })));
- };
- /* harmony default export */ var components_ColorInput = (ColorInput);
- ;// ./node_modules/rc-slider/es/util.js
- function util_getOffset(value, min, max) {
- return (value - min) / (max - min);
- }
- function getDirectionStyle(direction, value, min, max) {
- var offset = util_getOffset(value, min, max);
- var positionStyle = {};
- switch (direction) {
- case 'rtl':
- positionStyle.right = "".concat(offset * 100, "%");
- positionStyle.transform = 'translateX(50%)';
- break;
- case 'btt':
- positionStyle.bottom = "".concat(offset * 100, "%");
- positionStyle.transform = 'translateY(50%)';
- break;
- case 'ttb':
- positionStyle.top = "".concat(offset * 100, "%");
- positionStyle.transform = 'translateY(-50%)';
- break;
- default:
- positionStyle.left = "".concat(offset * 100, "%");
- positionStyle.transform = 'translateX(-50%)';
- break;
- }
- return positionStyle;
- }
- /** Return index value if is list or return value directly */
- function getIndex(value, index) {
- return Array.isArray(value) ? value[index] : value;
- }
- ;// ./node_modules/rc-slider/es/context.js
- var SliderContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- min: 0,
- max: 0,
- direction: 'ltr',
- step: 1,
- includedStart: 0,
- includedEnd: 0,
- tabIndex: 0,
- keyboard: true,
- styles: {},
- classNames: {}
- });
- /* harmony default export */ var rc_slider_es_context = (SliderContext);
- /** @private NOT PROMISE AVAILABLE. DO NOT USE IN PRODUCTION. */
- var UnstableContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- ;// ./node_modules/rc-slider/es/Handles/Handle.js
- var Handle_excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "onDelete", "style", "render", "dragging", "draggingDelete", "onOffsetChange", "onChangeComplete", "onFocus", "onMouseEnter"];
- var Handle = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- value = props.value,
- valueIndex = props.valueIndex,
- onStartMove = props.onStartMove,
- onDelete = props.onDelete,
- style = props.style,
- render = props.render,
- dragging = props.dragging,
- draggingDelete = props.draggingDelete,
- onOffsetChange = props.onOffsetChange,
- onChangeComplete = props.onChangeComplete,
- onFocus = props.onFocus,
- onMouseEnter = props.onMouseEnter,
- restProps = (0,objectWithoutProperties["default"])(props, Handle_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- min = _React$useContext.min,
- max = _React$useContext.max,
- direction = _React$useContext.direction,
- disabled = _React$useContext.disabled,
- keyboard = _React$useContext.keyboard,
- range = _React$useContext.range,
- tabIndex = _React$useContext.tabIndex,
- ariaLabelForHandle = _React$useContext.ariaLabelForHandle,
- ariaLabelledByForHandle = _React$useContext.ariaLabelledByForHandle,
- ariaRequired = _React$useContext.ariaRequired,
- ariaValueTextFormatterForHandle = _React$useContext.ariaValueTextFormatterForHandle,
- styles = _React$useContext.styles,
- classNames = _React$useContext.classNames;
- var handlePrefixCls = "".concat(prefixCls, "-handle");
- // ============================ Events ============================
- var onInternalStartMove = function onInternalStartMove(e) {
- if (!disabled) {
- onStartMove(e, valueIndex);
- }
- };
- var onInternalFocus = function onInternalFocus(e) {
- onFocus === null || onFocus === void 0 || onFocus(e, valueIndex);
- };
- var onInternalMouseEnter = function onInternalMouseEnter(e) {
- onMouseEnter(e, valueIndex);
- };
- // =========================== Keyboard ===========================
- var onKeyDown = function onKeyDown(e) {
- if (!disabled && keyboard) {
- var offset = null;
- // Change the value
- switch (e.which || e.keyCode) {
- case KeyCode["default"].LEFT:
- offset = direction === 'ltr' || direction === 'btt' ? -1 : 1;
- break;
- case KeyCode["default"].RIGHT:
- offset = direction === 'ltr' || direction === 'btt' ? 1 : -1;
- break;
- // Up is plus
- case KeyCode["default"].UP:
- offset = direction !== 'ttb' ? 1 : -1;
- break;
- // Down is minus
- case KeyCode["default"].DOWN:
- offset = direction !== 'ttb' ? -1 : 1;
- break;
- case KeyCode["default"].HOME:
- offset = 'min';
- break;
- case KeyCode["default"].END:
- offset = 'max';
- break;
- case KeyCode["default"].PAGE_UP:
- offset = 2;
- break;
- case KeyCode["default"].PAGE_DOWN:
- offset = -2;
- break;
- case KeyCode["default"].BACKSPACE:
- case KeyCode["default"].DELETE:
- onDelete === null || onDelete === void 0 || onDelete(valueIndex);
- break;
- }
- if (offset !== null) {
- e.preventDefault();
- onOffsetChange(offset, valueIndex);
- }
- }
- };
- var handleKeyUp = function handleKeyUp(e) {
- switch (e.which || e.keyCode) {
- case KeyCode["default"].LEFT:
- case KeyCode["default"].RIGHT:
- case KeyCode["default"].UP:
- case KeyCode["default"].DOWN:
- case KeyCode["default"].HOME:
- case KeyCode["default"].END:
- case KeyCode["default"].PAGE_UP:
- case KeyCode["default"].PAGE_DOWN:
- onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete();
- break;
- }
- };
- // ============================ Offset ============================
- var positionStyle = getDirectionStyle(direction, value, min, max);
- // ============================ Render ============================
- var divProps = {};
- if (valueIndex !== null) {
- var _getIndex;
- divProps = {
- tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),
- role: 'slider',
- 'aria-valuemin': min,
- 'aria-valuemax': max,
- 'aria-valuenow': value,
- 'aria-disabled': disabled,
- 'aria-label': getIndex(ariaLabelForHandle, valueIndex),
- 'aria-labelledby': getIndex(ariaLabelledByForHandle, valueIndex),
- 'aria-required': getIndex(ariaRequired, valueIndex),
- 'aria-valuetext': (_getIndex = getIndex(ariaValueTextFormatterForHandle, valueIndex)) === null || _getIndex === void 0 ? void 0 : _getIndex(value),
- 'aria-orientation': direction === 'ltr' || direction === 'rtl' ? 'horizontal' : 'vertical',
- onMouseDown: onInternalStartMove,
- onTouchStart: onInternalStartMove,
- onFocus: onInternalFocus,
- onMouseEnter: onInternalMouseEnter,
- onKeyDown: onKeyDown,
- onKeyUp: handleKeyUp
- };
- }
- var handleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- ref: ref,
- className: classnames_default()(handlePrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(handlePrefixCls, "-").concat(valueIndex + 1), valueIndex !== null && range), "".concat(handlePrefixCls, "-dragging"), dragging), "".concat(handlePrefixCls, "-dragging-delete"), draggingDelete), classNames.handle),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, positionStyle), style), styles.handle)
- }, divProps, restProps));
- // Customize
- if (render) {
- handleNode = render(handleNode, {
- index: valueIndex,
- prefixCls: prefixCls,
- value: value,
- dragging: dragging,
- draggingDelete: draggingDelete
- });
- }
- return handleNode;
- });
- if (true) {
- Handle.displayName = 'Handle';
- }
- /* harmony default export */ var Handles_Handle = (Handle);
- ;// ./node_modules/rc-slider/es/Handles/index.js
- var Handles_excluded = ["prefixCls", "style", "onStartMove", "onOffsetChange", "values", "handleRender", "activeHandleRender", "draggingIndex", "draggingDelete", "onFocus"];
- var Handles = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- style = props.style,
- onStartMove = props.onStartMove,
- onOffsetChange = props.onOffsetChange,
- values = props.values,
- handleRender = props.handleRender,
- activeHandleRender = props.activeHandleRender,
- draggingIndex = props.draggingIndex,
- draggingDelete = props.draggingDelete,
- onFocus = props.onFocus,
- restProps = (0,objectWithoutProperties["default"])(props, Handles_excluded);
- var handlesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- // =========================== Active ===========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- activeVisible = _React$useState2[0],
- setActiveVisible = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(-1),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- activeIndex = _React$useState4[0],
- setActiveIndex = _React$useState4[1];
- var onActive = function onActive(index) {
- setActiveIndex(index);
- setActiveVisible(true);
- };
- var onHandleFocus = function onHandleFocus(e, index) {
- onActive(index);
- onFocus === null || onFocus === void 0 || onFocus(e);
- };
- var onHandleMouseEnter = function onHandleMouseEnter(e, index) {
- onActive(index);
- };
- // =========================== Render ===========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- focus: function focus(index) {
- var _handlesRef$current$i;
- (_handlesRef$current$i = handlesRef.current[index]) === null || _handlesRef$current$i === void 0 || _handlesRef$current$i.focus();
- },
- hideHelp: function hideHelp() {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(function () {
- setActiveVisible(false);
- });
- }
- };
- });
- // =========================== Render ===========================
- // Handle Props
- var handleProps = (0,objectSpread2["default"])({
- prefixCls: prefixCls,
- onStartMove: onStartMove,
- onOffsetChange: onOffsetChange,
- render: handleRender,
- onFocus: onHandleFocus,
- onMouseEnter: onHandleMouseEnter
- }, restProps);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, values.map(function (value, index) {
- var dragging = draggingIndex === index;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Handles_Handle, (0,esm_extends["default"])({
- ref: function ref(node) {
- if (!node) {
- delete handlesRef.current[index];
- } else {
- handlesRef.current[index] = node;
- }
- },
- dragging: dragging,
- draggingDelete: dragging && draggingDelete,
- style: getIndex(style, index),
- key: index,
- value: value,
- valueIndex: index
- }, handleProps));
- }), activeHandleRender && activeVisible && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Handles_Handle, (0,esm_extends["default"])({
- key: "a11y"
- }, handleProps, {
- value: values[activeIndex],
- valueIndex: null,
- dragging: draggingIndex !== -1,
- draggingDelete: draggingDelete,
- render: activeHandleRender,
- style: {
- pointerEvents: 'none'
- },
- tabIndex: null,
- "aria-hidden": true
- })));
- });
- if (true) {
- Handles.displayName = 'Handles';
- }
- /* harmony default export */ var es_Handles = (Handles);
- ;// ./node_modules/rc-slider/es/Marks/Mark.js
- var Mark = function Mark(props) {
- var prefixCls = props.prefixCls,
- style = props.style,
- children = props.children,
- value = props.value,
- _onClick = props.onClick;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- min = _React$useContext.min,
- max = _React$useContext.max,
- direction = _React$useContext.direction,
- includedStart = _React$useContext.includedStart,
- includedEnd = _React$useContext.includedEnd,
- included = _React$useContext.included;
- var textCls = "".concat(prefixCls, "-text");
- // ============================ Offset ============================
- var positionStyle = getDirectionStyle(direction, value, min, max);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(textCls, (0,defineProperty["default"])({}, "".concat(textCls, "-active"), included && includedStart <= value && value <= includedEnd)),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, positionStyle), style),
- onMouseDown: function onMouseDown(e) {
- e.stopPropagation();
- },
- onClick: function onClick() {
- _onClick(value);
- }
- }, children);
- };
- /* harmony default export */ var Marks_Mark = (Mark);
- ;// ./node_modules/rc-slider/es/Marks/index.js
- var Marks = function Marks(props) {
- var prefixCls = props.prefixCls,
- marks = props.marks,
- onClick = props.onClick;
- var markPrefixCls = "".concat(prefixCls, "-mark");
- // Not render mark if empty
- if (!marks.length) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: markPrefixCls
- }, marks.map(function (_ref) {
- var value = _ref.value,
- style = _ref.style,
- label = _ref.label;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Marks_Mark, {
- key: value,
- prefixCls: markPrefixCls,
- style: style,
- value: value,
- onClick: onClick
- }, label);
- }));
- };
- /* harmony default export */ var es_Marks = (Marks);
- ;// ./node_modules/rc-slider/es/Steps/Dot.js
- var Dot = function Dot(props) {
- var prefixCls = props.prefixCls,
- value = props.value,
- style = props.style,
- activeStyle = props.activeStyle;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- min = _React$useContext.min,
- max = _React$useContext.max,
- direction = _React$useContext.direction,
- included = _React$useContext.included,
- includedStart = _React$useContext.includedStart,
- includedEnd = _React$useContext.includedEnd;
- var dotClassName = "".concat(prefixCls, "-dot");
- var active = included && includedStart <= value && value <= includedEnd;
- // ============================ Offset ============================
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, getDirectionStyle(direction, value, min, max)), typeof style === 'function' ? style(value) : style);
- if (active) {
- mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedStyle), typeof activeStyle === 'function' ? activeStyle(value) : activeStyle);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(dotClassName, (0,defineProperty["default"])({}, "".concat(dotClassName, "-active"), active)),
- style: mergedStyle
- });
- };
- /* harmony default export */ var Steps_Dot = (Dot);
- ;// ./node_modules/rc-slider/es/Steps/index.js
- var Steps = function Steps(props) {
- var prefixCls = props.prefixCls,
- marks = props.marks,
- dots = props.dots,
- style = props.style,
- activeStyle = props.activeStyle;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- min = _React$useContext.min,
- max = _React$useContext.max,
- step = _React$useContext.step;
- var stepDots = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var dotSet = new Set();
- // Add marks
- marks.forEach(function (mark) {
- dotSet.add(mark.value);
- });
- // Fill dots
- if (dots && step !== null) {
- var current = min;
- while (current <= max) {
- dotSet.add(current);
- current += step;
- }
- }
- return Array.from(dotSet);
- }, [min, max, step, dots, marks]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-step")
- }, stepDots.map(function (dotValue) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Steps_Dot, {
- prefixCls: prefixCls,
- key: dotValue,
- value: dotValue,
- style: style,
- activeStyle: activeStyle
- });
- }));
- };
- /* harmony default export */ var es_Steps = (Steps);
- ;// ./node_modules/rc-slider/es/Tracks/Track.js
- var Track_Track = function Track(props) {
- var prefixCls = props.prefixCls,
- style = props.style,
- start = props.start,
- end = props.end,
- index = props.index,
- onStartMove = props.onStartMove,
- replaceCls = props.replaceCls;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- direction = _React$useContext.direction,
- min = _React$useContext.min,
- max = _React$useContext.max,
- disabled = _React$useContext.disabled,
- range = _React$useContext.range,
- classNames = _React$useContext.classNames;
- var trackPrefixCls = "".concat(prefixCls, "-track");
- var offsetStart = util_getOffset(start, min, max);
- var offsetEnd = util_getOffset(end, min, max);
- // ============================ Events ============================
- var onInternalStartMove = function onInternalStartMove(e) {
- if (!disabled && onStartMove) {
- onStartMove(e, -1);
- }
- };
- // ============================ Render ============================
- var positionStyle = {};
- switch (direction) {
- case 'rtl':
- positionStyle.right = "".concat(offsetStart * 100, "%");
- positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
- break;
- case 'btt':
- positionStyle.bottom = "".concat(offsetStart * 100, "%");
- positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
- break;
- case 'ttb':
- positionStyle.top = "".concat(offsetStart * 100, "%");
- positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
- break;
- default:
- positionStyle.left = "".concat(offsetStart * 100, "%");
- positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
- }
- var className = replaceCls || classnames_default()(trackPrefixCls, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(trackPrefixCls, "-").concat(index + 1), index !== null && range), "".concat(prefixCls, "-track-draggable"), onStartMove), classNames.track);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, positionStyle), style),
- onMouseDown: onInternalStartMove,
- onTouchStart: onInternalStartMove
- });
- };
- /* harmony default export */ var Tracks_Track = (Track_Track);
- ;// ./node_modules/rc-slider/es/Tracks/index.js
- var Tracks = function Tracks(props) {
- var prefixCls = props.prefixCls,
- style = props.style,
- values = props.values,
- startPoint = props.startPoint,
- onStartMove = props.onStartMove;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_slider_es_context),
- included = _React$useContext.included,
- range = _React$useContext.range,
- min = _React$useContext.min,
- styles = _React$useContext.styles,
- classNames = _React$useContext.classNames;
- // =========================== List ===========================
- var trackList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!range) {
- // null value do not have track
- if (values.length === 0) {
- return [];
- }
- var startValue = startPoint !== null && startPoint !== void 0 ? startPoint : min;
- var endValue = values[0];
- return [{
- start: Math.min(startValue, endValue),
- end: Math.max(startValue, endValue)
- }];
- }
- // Multiple
- var list = [];
- for (var i = 0; i < values.length - 1; i += 1) {
- list.push({
- start: values[i],
- end: values[i + 1]
- });
- }
- return list;
- }, [values, range, startPoint, min]);
- if (!included) {
- return null;
- }
- // ========================== Render ==========================
- var tracksNode = trackList !== null && trackList !== void 0 && trackList.length && (classNames.tracks || styles.tracks) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Tracks_Track, {
- index: null,
- prefixCls: prefixCls,
- start: trackList[0].start,
- end: trackList[trackList.length - 1].end,
- replaceCls: classnames_default()(classNames.tracks, "".concat(prefixCls, "-tracks")),
- style: styles.tracks
- }) : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, tracksNode, trackList.map(function (_ref, index) {
- var start = _ref.start,
- end = _ref.end;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Tracks_Track, {
- index: index,
- prefixCls: prefixCls,
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, getIndex(style, index)), styles.track),
- start: start,
- end: end,
- key: index,
- onStartMove: onStartMove
- });
- }));
- };
- /* harmony default export */ var es_Tracks = (Tracks);
- ;// ./node_modules/rc-slider/es/hooks/useDrag.js
- /** Drag to delete offset. It's a user experience number for dragging out */
- var REMOVE_DIST = 130;
- function useDrag_getPosition(e) {
- var obj = 'targetTouches' in e ? e.targetTouches[0] : e;
- return {
- pageX: obj.pageX,
- pageY: obj.pageY
- };
- }
- function useDrag(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues, editable, minCount) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- draggingValue = _React$useState2[0],
- setDraggingValue = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(-1),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- draggingIndex = _React$useState4[0],
- setDraggingIndex = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- draggingDelete = _React$useState6[0],
- setDraggingDelete = _React$useState6[1];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(rawValues),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- cacheValues = _React$useState8[0],
- setCacheValues = _React$useState8[1];
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(rawValues),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- originValues = _React$useState10[0],
- setOriginValues = _React$useState10[1];
- var mouseMoveEventRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var mouseUpEventRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var touchEventTargetRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(UnstableContext),
- onDragStart = _React$useContext.onDragStart,
- onDragChange = _React$useContext.onDragChange;
- (0,useLayoutEffect["default"])(function () {
- if (draggingIndex === -1) {
- setCacheValues(rawValues);
- }
- }, [rawValues, draggingIndex]);
- // Clean up event
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- document.removeEventListener('mousemove', mouseMoveEventRef.current);
- document.removeEventListener('mouseup', mouseUpEventRef.current);
- if (touchEventTargetRef.current) {
- touchEventTargetRef.current.removeEventListener('touchmove', mouseMoveEventRef.current);
- touchEventTargetRef.current.removeEventListener('touchend', mouseUpEventRef.current);
- }
- };
- }, []);
- var flushValues = function flushValues(nextValues, nextValue, deleteMark) {
- // Perf: Only update state when value changed
- if (nextValue !== undefined) {
- setDraggingValue(nextValue);
- }
- setCacheValues(nextValues);
- var changeValues = nextValues;
- if (deleteMark) {
- changeValues = nextValues.filter(function (_, i) {
- return i !== draggingIndex;
- });
- }
- triggerChange(changeValues);
- if (onDragChange) {
- onDragChange({
- rawValues: nextValues,
- deleteIndex: deleteMark ? draggingIndex : -1,
- draggingIndex: draggingIndex,
- draggingValue: nextValue
- });
- }
- };
- var updateCacheValue = (0,useEvent["default"])(function (valueIndex, offsetPercent, deleteMark) {
- if (valueIndex === -1) {
- // >>>> Dragging on the track
- var startValue = originValues[0];
- var endValue = originValues[originValues.length - 1];
- var maxStartOffset = min - startValue;
- var maxEndOffset = max - endValue;
- // Get valid offset
- var offset = offsetPercent * (max - min);
- offset = Math.max(offset, maxStartOffset);
- offset = Math.min(offset, maxEndOffset);
- // Use first value to revert back of valid offset (like steps marks)
- var formatStartValue = formatValue(startValue + offset);
- offset = formatStartValue - startValue;
- var cloneCacheValues = originValues.map(function (val) {
- return val + offset;
- });
- flushValues(cloneCacheValues);
- } else {
- // >>>> Dragging on the handle
- var offsetDist = (max - min) * offsetPercent;
- // Always start with the valueIndex origin value
- var cloneValues = (0,toConsumableArray["default"])(cacheValues);
- cloneValues[valueIndex] = originValues[valueIndex];
- var next = offsetValues(cloneValues, offsetDist, valueIndex, 'dist');
- flushValues(next.values, next.value, deleteMark);
- }
- });
- var onStartMove = function onStartMove(e, valueIndex, startValues) {
- e.stopPropagation();
- // 如果是点击 track 触发的,需要传入变化后的初始值,而不能直接用 rawValues
- var initialValues = startValues || rawValues;
- var originValue = initialValues[valueIndex];
- setDraggingIndex(valueIndex);
- setDraggingValue(originValue);
- setOriginValues(initialValues);
- setCacheValues(initialValues);
- setDraggingDelete(false);
- var _getPosition = useDrag_getPosition(e),
- startX = _getPosition.pageX,
- startY = _getPosition.pageY;
- // We declare it here since closure can't get outer latest value
- var deleteMark = false;
- // Internal trigger event
- if (onDragStart) {
- onDragStart({
- rawValues: initialValues,
- draggingIndex: valueIndex,
- draggingValue: originValue
- });
- }
- // Moving
- var onMouseMove = function onMouseMove(event) {
- event.preventDefault();
- var _getPosition2 = useDrag_getPosition(event),
- moveX = _getPosition2.pageX,
- moveY = _getPosition2.pageY;
- var offsetX = moveX - startX;
- var offsetY = moveY - startY;
- var _containerRef$current = containerRef.current.getBoundingClientRect(),
- width = _containerRef$current.width,
- height = _containerRef$current.height;
- var offSetPercent;
- var removeDist;
- switch (direction) {
- case 'btt':
- offSetPercent = -offsetY / height;
- removeDist = offsetX;
- break;
- case 'ttb':
- offSetPercent = offsetY / height;
- removeDist = offsetX;
- break;
- case 'rtl':
- offSetPercent = -offsetX / width;
- removeDist = offsetY;
- break;
- default:
- offSetPercent = offsetX / width;
- removeDist = offsetY;
- }
- // Check if need mark remove
- deleteMark = editable ? Math.abs(removeDist) > REMOVE_DIST && minCount < cacheValues.length : false;
- setDraggingDelete(deleteMark);
- updateCacheValue(valueIndex, offSetPercent, deleteMark);
- };
- // End
- var onMouseUp = function onMouseUp(event) {
- event.preventDefault();
- document.removeEventListener('mouseup', onMouseUp);
- document.removeEventListener('mousemove', onMouseMove);
- if (touchEventTargetRef.current) {
- touchEventTargetRef.current.removeEventListener('touchmove', mouseMoveEventRef.current);
- touchEventTargetRef.current.removeEventListener('touchend', mouseUpEventRef.current);
- }
- mouseMoveEventRef.current = null;
- mouseUpEventRef.current = null;
- touchEventTargetRef.current = null;
- finishChange(deleteMark);
- setDraggingIndex(-1);
- setDraggingDelete(false);
- };
- document.addEventListener('mouseup', onMouseUp);
- document.addEventListener('mousemove', onMouseMove);
- e.currentTarget.addEventListener('touchend', onMouseUp);
- e.currentTarget.addEventListener('touchmove', onMouseMove);
- mouseMoveEventRef.current = onMouseMove;
- mouseUpEventRef.current = onMouseUp;
- touchEventTargetRef.current = e.currentTarget;
- };
- // Only return cache value when it mapping with rawValues
- var returnValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var sourceValues = (0,toConsumableArray["default"])(rawValues).sort(function (a, b) {
- return a - b;
- });
- var targetValues = (0,toConsumableArray["default"])(cacheValues).sort(function (a, b) {
- return a - b;
- });
- var counts = {};
- targetValues.forEach(function (val) {
- counts[val] = (counts[val] || 0) + 1;
- });
- sourceValues.forEach(function (val) {
- counts[val] = (counts[val] || 0) - 1;
- });
- var maxDiffCount = editable ? 1 : 0;
- var diffCount = Object.values(counts).reduce(function (prev, next) {
- return prev + Math.abs(next);
- }, 0);
- return diffCount <= maxDiffCount ? cacheValues : rawValues;
- }, [rawValues, cacheValues, editable]);
- return [draggingIndex, draggingValue, draggingDelete, returnValues, onStartMove];
- }
- /* harmony default export */ var hooks_useDrag = (useDrag);
- ;// ./node_modules/rc-slider/es/hooks/useOffset.js
- /** Format the value in the range of [min, max] */
- /** Format value align with step */
- /** Format value align with step & marks */
- function useOffset(min, max, step, markList, allowCross, pushable) {
- var formatRangeValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (val) {
- return Math.max(min, Math.min(max, val));
- }, [min, max]);
- var formatStepValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (val) {
- if (step !== null) {
- var stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;
- // Cut number in case to be like 0.30000000000000004
- var getDecimal = function getDecimal(num) {
- return (String(num).split('.')[1] || '').length;
- };
- var maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));
- var fixedValue = Number(stepValue.toFixed(maxDecimal));
- return min <= fixedValue && fixedValue <= max ? fixedValue : null;
- }
- return null;
- }, [step, min, max, formatRangeValue]);
- var formatValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (val) {
- var formatNextValue = formatRangeValue(val);
- // List align values
- var alignValues = markList.map(function (mark) {
- return mark.value;
- });
- if (step !== null) {
- alignValues.push(formatStepValue(val));
- }
- // min & max
- alignValues.push(min, max);
- // Align with marks
- var closeValue = alignValues[0];
- var closeDist = max - min;
- alignValues.forEach(function (alignValue) {
- var dist = Math.abs(formatNextValue - alignValue);
- if (dist <= closeDist) {
- closeValue = alignValue;
- closeDist = dist;
- }
- });
- return closeValue;
- }, [min, max, markList, step, formatRangeValue, formatStepValue]);
- // ========================== Offset ==========================
- // Single Value
- var offsetValue = function offsetValue(values, offset, valueIndex) {
- var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
- if (typeof offset === 'number') {
- var nextValue;
- var originValue = values[valueIndex];
- // Only used for `dist` mode
- var targetDistValue = originValue + offset;
- // Compare next step value & mark value which is best match
- var potentialValues = [];
- markList.forEach(function (mark) {
- potentialValues.push(mark.value);
- });
- // Min & Max
- potentialValues.push(min, max);
- // In case origin value is align with mark but not with step
- potentialValues.push(formatStepValue(originValue));
- // Put offset step value also
- var sign = offset > 0 ? 1 : -1;
- if (mode === 'unit') {
- potentialValues.push(formatStepValue(originValue + sign * step));
- } else {
- potentialValues.push(formatStepValue(targetDistValue));
- }
- // Find close one
- potentialValues = potentialValues.filter(function (val) {
- return val !== null;
- })
- // Remove reverse value
- .filter(function (val) {
- return offset < 0 ? val <= originValue : val >= originValue;
- });
- if (mode === 'unit') {
- // `unit` mode can not contain itself
- potentialValues = potentialValues.filter(function (val) {
- return val !== originValue;
- });
- }
- var compareValue = mode === 'unit' ? originValue : targetDistValue;
- nextValue = potentialValues[0];
- var valueDist = Math.abs(nextValue - compareValue);
- potentialValues.forEach(function (potentialValue) {
- var dist = Math.abs(potentialValue - compareValue);
- if (dist < valueDist) {
- nextValue = potentialValue;
- valueDist = dist;
- }
- });
- // Out of range will back to range
- if (nextValue === undefined) {
- return offset < 0 ? min : max;
- }
- // `dist` mode
- if (mode === 'dist') {
- return nextValue;
- }
- // `unit` mode may need another round
- if (Math.abs(offset) > 1) {
- var cloneValues = (0,toConsumableArray["default"])(values);
- cloneValues[valueIndex] = nextValue;
- return offsetValue(cloneValues, offset - sign, valueIndex, mode);
- }
- return nextValue;
- } else if (offset === 'min') {
- return min;
- } else if (offset === 'max') {
- return max;
- }
- };
- /** Same as `offsetValue` but return `changed` mark to tell value changed */
- var offsetChangedValue = function offsetChangedValue(values, offset, valueIndex) {
- var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
- var originValue = values[valueIndex];
- var nextValue = offsetValue(values, offset, valueIndex, mode);
- return {
- value: nextValue,
- changed: nextValue !== originValue
- };
- };
- var needPush = function needPush(dist) {
- return pushable === null && dist === 0 || typeof pushable === 'number' && dist < pushable;
- };
- // Values
- var offsetValues = function offsetValues(values, offset, valueIndex) {
- var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
- var nextValues = values.map(formatValue);
- var originValue = nextValues[valueIndex];
- var nextValue = offsetValue(nextValues, offset, valueIndex, mode);
- nextValues[valueIndex] = nextValue;
- if (allowCross === false) {
- // >>>>> Allow Cross
- var pushNum = pushable || 0;
- // ============ AllowCross ===============
- if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) {
- nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);
- }
- if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) {
- nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);
- }
- } else if (typeof pushable === 'number' || pushable === null) {
- // >>>>> Pushable
- // =============== Push ==================
- // >>>>>> Basic push
- // End values
- for (var i = valueIndex + 1; i < nextValues.length; i += 1) {
- var changed = true;
- while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
- var _offsetChangedValue = offsetChangedValue(nextValues, 1, i);
- nextValues[i] = _offsetChangedValue.value;
- changed = _offsetChangedValue.changed;
- }
- }
- // Start values
- for (var _i = valueIndex; _i > 0; _i -= 1) {
- var _changed = true;
- while (needPush(nextValues[_i] - nextValues[_i - 1]) && _changed) {
- var _offsetChangedValue2 = offsetChangedValue(nextValues, -1, _i - 1);
- nextValues[_i - 1] = _offsetChangedValue2.value;
- _changed = _offsetChangedValue2.changed;
- }
- }
- // >>>>> Revert back to safe push range
- // End to Start
- for (var _i2 = nextValues.length - 1; _i2 > 0; _i2 -= 1) {
- var _changed2 = true;
- while (needPush(nextValues[_i2] - nextValues[_i2 - 1]) && _changed2) {
- var _offsetChangedValue3 = offsetChangedValue(nextValues, -1, _i2 - 1);
- nextValues[_i2 - 1] = _offsetChangedValue3.value;
- _changed2 = _offsetChangedValue3.changed;
- }
- }
- // Start to End
- for (var _i3 = 0; _i3 < nextValues.length - 1; _i3 += 1) {
- var _changed3 = true;
- while (needPush(nextValues[_i3 + 1] - nextValues[_i3]) && _changed3) {
- var _offsetChangedValue4 = offsetChangedValue(nextValues, 1, _i3 + 1);
- nextValues[_i3 + 1] = _offsetChangedValue4.value;
- _changed3 = _offsetChangedValue4.changed;
- }
- }
- }
- return {
- value: nextValues[valueIndex],
- values: nextValues
- };
- };
- return [formatValue, offsetValues];
- }
- ;// ./node_modules/rc-slider/es/hooks/useRange.js
- function useRange(range) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if (range === true || !range) {
- return [!!range, false, false, 0];
- }
- var editable = range.editable,
- draggableTrack = range.draggableTrack,
- minCount = range.minCount,
- maxCount = range.maxCount;
- if (true) {
- (0,warning.warning)(!editable || !draggableTrack, '`editable` can not work with `draggableTrack`.');
- }
- return [true, editable, !editable && draggableTrack, minCount || 0, maxCount];
- }, [range]);
- }
- ;// ./node_modules/rc-slider/es/Slider.js
- /**
- * New:
- * - click mark to update range value
- * - handleRender
- * - Fix handle with count not correct
- * - Fix pushable not work in some case
- * - No more FindDOMNode
- * - Move all position related style into inline style
- * - Key: up is plus, down is minus
- * - fix Key with step = null not align with marks
- * - Change range should not trigger onChange
- * - keyboard support pushable
- */
- var Slider_Slider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-slider' : _props$prefixCls,
- className = props.className,
- style = props.style,
- classNames = props.classNames,
- styles = props.styles,
- id = props.id,
- _props$disabled = props.disabled,
- disabled = _props$disabled === void 0 ? false : _props$disabled,
- _props$keyboard = props.keyboard,
- keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
- autoFocus = props.autoFocus,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- _props$min = props.min,
- min = _props$min === void 0 ? 0 : _props$min,
- _props$max = props.max,
- max = _props$max === void 0 ? 100 : _props$max,
- _props$step = props.step,
- step = _props$step === void 0 ? 1 : _props$step,
- value = props.value,
- defaultValue = props.defaultValue,
- range = props.range,
- count = props.count,
- onChange = props.onChange,
- onBeforeChange = props.onBeforeChange,
- onAfterChange = props.onAfterChange,
- onChangeComplete = props.onChangeComplete,
- _props$allowCross = props.allowCross,
- allowCross = _props$allowCross === void 0 ? true : _props$allowCross,
- _props$pushable = props.pushable,
- pushable = _props$pushable === void 0 ? false : _props$pushable,
- reverse = props.reverse,
- vertical = props.vertical,
- _props$included = props.included,
- included = _props$included === void 0 ? true : _props$included,
- startPoint = props.startPoint,
- trackStyle = props.trackStyle,
- handleStyle = props.handleStyle,
- railStyle = props.railStyle,
- dotStyle = props.dotStyle,
- activeDotStyle = props.activeDotStyle,
- marks = props.marks,
- dots = props.dots,
- handleRender = props.handleRender,
- activeHandleRender = props.activeHandleRender,
- track = props.track,
- _props$tabIndex = props.tabIndex,
- tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
- ariaLabelForHandle = props.ariaLabelForHandle,
- ariaLabelledByForHandle = props.ariaLabelledByForHandle,
- ariaRequired = props.ariaRequired,
- ariaValueTextFormatterForHandle = props.ariaValueTextFormatterForHandle;
- var handlesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var direction = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (vertical) {
- return reverse ? 'ttb' : 'btt';
- }
- return reverse ? 'rtl' : 'ltr';
- }, [reverse, vertical]);
- // ============================ Range =============================
- var _useRange = useRange(range),
- _useRange2 = (0,slicedToArray["default"])(_useRange, 5),
- rangeEnabled = _useRange2[0],
- rangeEditable = _useRange2[1],
- rangeDraggableTrack = _useRange2[2],
- minCount = _useRange2[3],
- maxCount = _useRange2[4];
- var mergedMin = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return isFinite(min) ? min : 0;
- }, [min]);
- var mergedMax = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return isFinite(max) ? max : 100;
- }, [max]);
- // ============================= Step =============================
- var mergedStep = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return step !== null && step <= 0 ? 1 : step;
- }, [step]);
- // ============================= Push =============================
- var mergedPush = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (typeof pushable === 'boolean') {
- return pushable ? mergedStep : false;
- }
- return pushable >= 0 ? pushable : false;
- }, [pushable, mergedStep]);
- // ============================ Marks =============================
- var markList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return Object.keys(marks || {}).map(function (key) {
- var mark = marks[key];
- var markObj = {
- value: Number(key)
- };
- if (mark && (0,esm_typeof["default"])(mark) === 'object' && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mark) && ('label' in mark || 'style' in mark)) {
- markObj.style = mark.style;
- markObj.label = mark.label;
- } else {
- markObj.label = mark;
- }
- return markObj;
- }).filter(function (_ref) {
- var label = _ref.label;
- return label || typeof label === 'number';
- }).sort(function (a, b) {
- return a.value - b.value;
- });
- }, [marks]);
- // ============================ Format ============================
- var _useOffset = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush),
- _useOffset2 = (0,slicedToArray["default"])(_useOffset, 2),
- formatValue = _useOffset2[0],
- offsetValues = _useOffset2[1];
- // ============================ Values ============================
- var _useMergedState = (0,useMergedState["default"])(defaultValue, {
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedValue = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var rawValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var valueList = mergedValue === null || mergedValue === undefined ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];
- var _valueList = (0,slicedToArray["default"])(valueList, 1),
- _valueList$ = _valueList[0],
- val0 = _valueList$ === void 0 ? mergedMin : _valueList$;
- var returnValues = mergedValue === null ? [] : [val0];
- // Format as range
- if (rangeEnabled) {
- returnValues = (0,toConsumableArray["default"])(valueList);
- // When count provided or value is `undefined`, we fill values
- if (count || mergedValue === undefined) {
- var pointCount = count >= 0 ? count + 1 : 2;
- returnValues = returnValues.slice(0, pointCount);
- // Fill with count
- while (returnValues.length < pointCount) {
- var _returnValues;
- returnValues.push((_returnValues = returnValues[returnValues.length - 1]) !== null && _returnValues !== void 0 ? _returnValues : mergedMin);
- }
- }
- returnValues.sort(function (a, b) {
- return a - b;
- });
- }
- // Align in range
- returnValues.forEach(function (val, index) {
- returnValues[index] = formatValue(val);
- });
- return returnValues;
- }, [mergedValue, rangeEnabled, mergedMin, count, formatValue]);
- // =========================== onChange ===========================
- var getTriggerValue = function getTriggerValue(triggerValues) {
- return rangeEnabled ? triggerValues : triggerValues[0];
- };
- var triggerChange = (0,useEvent["default"])(function (nextValues) {
- // Order first
- var cloneNextValues = (0,toConsumableArray["default"])(nextValues).sort(function (a, b) {
- return a - b;
- });
- // Trigger event if needed
- if (onChange && !(0,isEqual["default"])(cloneNextValues, rawValues, true)) {
- onChange(getTriggerValue(cloneNextValues));
- }
- // We set this later since it will re-render component immediately
- setValue(cloneNextValues);
- });
- var finishChange = (0,useEvent["default"])(function (draggingDelete) {
- // Trigger from `useDrag` will tell if it's a delete action
- if (draggingDelete) {
- handlesRef.current.hideHelp();
- }
- var finishValue = getTriggerValue(rawValues);
- onAfterChange === null || onAfterChange === void 0 || onAfterChange(finishValue);
- (0,warning["default"])(!onAfterChange, '[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.');
- onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(finishValue);
- });
- var onDelete = function onDelete(index) {
- if (disabled || !rangeEditable || rawValues.length <= minCount) {
- return;
- }
- var cloneNextValues = (0,toConsumableArray["default"])(rawValues);
- cloneNextValues.splice(index, 1);
- onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(cloneNextValues));
- triggerChange(cloneNextValues);
- var nextFocusIndex = Math.max(0, index - 1);
- handlesRef.current.hideHelp();
- handlesRef.current.focus(nextFocusIndex);
- };
- var _useDrag = hooks_useDrag(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues, rangeEditable, minCount),
- _useDrag2 = (0,slicedToArray["default"])(_useDrag, 5),
- draggingIndex = _useDrag2[0],
- draggingValue = _useDrag2[1],
- draggingDelete = _useDrag2[2],
- cacheValues = _useDrag2[3],
- onStartDrag = _useDrag2[4];
- /**
- * When `rangeEditable` will insert a new value in the values array.
- * Else it will replace the value in the values array.
- */
- var changeToCloseValue = function changeToCloseValue(newValue, e) {
- if (!disabled) {
- // Create new values
- var cloneNextValues = (0,toConsumableArray["default"])(rawValues);
- var valueIndex = 0;
- var valueBeforeIndex = 0; // Record the index which value < newValue
- var valueDist = mergedMax - mergedMin;
- rawValues.forEach(function (val, index) {
- var dist = Math.abs(newValue - val);
- if (dist <= valueDist) {
- valueDist = dist;
- valueIndex = index;
- }
- if (val < newValue) {
- valueBeforeIndex = index;
- }
- });
- var focusIndex = valueIndex;
- if (rangeEditable && valueDist !== 0 && (!maxCount || rawValues.length < maxCount)) {
- cloneNextValues.splice(valueBeforeIndex + 1, 0, newValue);
- focusIndex = valueBeforeIndex + 1;
- } else {
- cloneNextValues[valueIndex] = newValue;
- }
- // Fill value to match default 2 (only when `rawValues` is empty)
- if (rangeEnabled && !rawValues.length && count === undefined) {
- cloneNextValues.push(newValue);
- }
- var nextValue = getTriggerValue(cloneNextValues);
- onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(nextValue);
- triggerChange(cloneNextValues);
- if (e) {
- var _document$activeEleme, _document$activeEleme2;
- (_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 || (_document$activeEleme2 = _document$activeEleme.blur) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.call(_document$activeEleme);
- handlesRef.current.focus(focusIndex);
- onStartDrag(e, focusIndex, cloneNextValues);
- } else {
- // https://github.com/ant-design/ant-design/issues/49997
- onAfterChange === null || onAfterChange === void 0 || onAfterChange(nextValue);
- (0,warning["default"])(!onAfterChange, '[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.');
- onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(nextValue);
- }
- }
- };
- // ============================ Click =============================
- var onSliderMouseDown = function onSliderMouseDown(e) {
- e.preventDefault();
- var _containerRef$current = containerRef.current.getBoundingClientRect(),
- width = _containerRef$current.width,
- height = _containerRef$current.height,
- left = _containerRef$current.left,
- top = _containerRef$current.top,
- bottom = _containerRef$current.bottom,
- right = _containerRef$current.right;
- var clientX = e.clientX,
- clientY = e.clientY;
- var percent;
- switch (direction) {
- case 'btt':
- percent = (bottom - clientY) / height;
- break;
- case 'ttb':
- percent = (clientY - top) / height;
- break;
- case 'rtl':
- percent = (right - clientX) / width;
- break;
- default:
- percent = (clientX - left) / width;
- }
- var nextValue = mergedMin + percent * (mergedMax - mergedMin);
- changeToCloseValue(formatValue(nextValue), e);
- };
- // =========================== Keyboard ===========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- keyboardValue = _React$useState2[0],
- setKeyboardValue = _React$useState2[1];
- var onHandleOffsetChange = function onHandleOffsetChange(offset, valueIndex) {
- if (!disabled) {
- var next = offsetValues(rawValues, offset, valueIndex);
- onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(rawValues));
- triggerChange(next.values);
- setKeyboardValue(next.value);
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (keyboardValue !== null) {
- var valueIndex = rawValues.indexOf(keyboardValue);
- if (valueIndex >= 0) {
- handlesRef.current.focus(valueIndex);
- }
- }
- setKeyboardValue(null);
- }, [keyboardValue]);
- // ============================= Drag =============================
- var mergedDraggableTrack = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (rangeDraggableTrack && mergedStep === null) {
- if (true) {
- (0,warning["default"])(false, '`draggableTrack` is not supported when `step` is `null`.');
- }
- return false;
- }
- return rangeDraggableTrack;
- }, [rangeDraggableTrack, mergedStep]);
- var onStartMove = (0,useEvent["default"])(function (e, valueIndex) {
- onStartDrag(e, valueIndex);
- onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(getTriggerValue(rawValues));
- });
- // Auto focus for updated handle
- var dragging = draggingIndex !== -1;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!dragging) {
- var valueIndex = rawValues.lastIndexOf(draggingValue);
- handlesRef.current.focus(valueIndex);
- }
- }, [dragging]);
- // =========================== Included ===========================
- var sortedCacheValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return (0,toConsumableArray["default"])(cacheValues).sort(function (a, b) {
- return a - b;
- });
- }, [cacheValues]);
- // Provide a range values with included [min, max]
- // Used for Track, Mark & Dot
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!rangeEnabled) {
- return [mergedMin, sortedCacheValues[0]];
- }
- return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];
- }, [sortedCacheValues, rangeEnabled, mergedMin]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- includedStart = _React$useMemo2[0],
- includedEnd = _React$useMemo2[1];
- // ============================= Refs =============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- focus: function focus() {
- handlesRef.current.focus(0);
- },
- blur: function blur() {
- var _containerRef$current2;
- var _document = document,
- activeElement = _document.activeElement;
- if ((_containerRef$current2 = containerRef.current) !== null && _containerRef$current2 !== void 0 && _containerRef$current2.contains(activeElement)) {
- activeElement === null || activeElement === void 0 || activeElement.blur();
- }
- }
- };
- });
- // ========================== Auto Focus ==========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (autoFocus) {
- handlesRef.current.focus(0);
- }
- }, []);
- // =========================== Context ============================
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- min: mergedMin,
- max: mergedMax,
- direction: direction,
- disabled: disabled,
- keyboard: keyboard,
- step: mergedStep,
- included: included,
- includedStart: includedStart,
- includedEnd: includedEnd,
- range: rangeEnabled,
- tabIndex: tabIndex,
- ariaLabelForHandle: ariaLabelForHandle,
- ariaLabelledByForHandle: ariaLabelledByForHandle,
- ariaRequired: ariaRequired,
- ariaValueTextFormatterForHandle: ariaValueTextFormatterForHandle,
- styles: styles || {},
- classNames: classNames || {}
- };
- }, [mergedMin, mergedMax, direction, disabled, keyboard, mergedStep, included, includedStart, includedEnd, rangeEnabled, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle, styles, classNames]);
- // ============================ Render ============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_slider_es_context.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: containerRef,
- className: classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-vertical"), vertical), "".concat(prefixCls, "-horizontal"), !vertical), "".concat(prefixCls, "-with-marks"), markList.length)),
- style: style,
- onMouseDown: onSliderMouseDown,
- id: id
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-rail"), classNames === null || classNames === void 0 ? void 0 : classNames.rail),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, railStyle), styles === null || styles === void 0 ? void 0 : styles.rail)
- }), track !== false && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Tracks, {
- prefixCls: prefixCls,
- style: trackStyle,
- values: rawValues,
- startPoint: startPoint,
- onStartMove: mergedDraggableTrack ? onStartMove : undefined
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Steps, {
- prefixCls: prefixCls,
- marks: markList,
- dots: dots,
- style: dotStyle,
- activeStyle: activeDotStyle
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Handles, {
- ref: handlesRef,
- prefixCls: prefixCls,
- style: handleStyle,
- values: cacheValues,
- draggingIndex: draggingIndex,
- draggingDelete: draggingDelete,
- onStartMove: onStartMove,
- onOffsetChange: onHandleOffsetChange,
- onFocus: onFocus,
- onBlur: onBlur,
- handleRender: handleRender,
- activeHandleRender: activeHandleRender,
- onChangeComplete: finishChange,
- onDelete: rangeEditable ? onDelete : undefined
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Marks, {
- prefixCls: prefixCls,
- marks: markList,
- onClick: changeToCloseValue
- })));
- });
- if (true) {
- Slider_Slider.displayName = 'Slider';
- }
- /* harmony default export */ var es_Slider = (Slider_Slider);
- ;// ./node_modules/rc-slider/es/index.js
- /* harmony default export */ var rc_slider_es = (es_Slider);
- ;// ./components/slider/Context.ts
- /** @private Internal context. Do not use in your production. */
- const SliderInternalContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)({});
- /* harmony default export */ var slider_Context = (SliderInternalContext);
- ;// ./components/slider/SliderTooltip.tsx
- const SliderTooltip = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- open,
- draggingDelete,
- value
- } = props;
- const innerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- const mergedOpen = open && !draggingDelete;
- const rafRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- function cancelKeepAlign() {
- raf["default"].cancel(rafRef.current);
- rafRef.current = null;
- }
- function keepAlign() {
- rafRef.current = (0,raf["default"])(() => {
- var _a;
- (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.forceAlign();
- rafRef.current = null;
- });
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (mergedOpen) {
- keepAlign();
- } else {
- cancelKeepAlign();
- }
- return cancelKeepAlign;
- }, [mergedOpen, props.title, value]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({
- ref: (0,es_ref.composeRef)(innerRef, ref)
- }, props, {
- open: mergedOpen
- }));
- });
- if (true) {
- SliderTooltip.displayName = 'SliderTooltip';
- }
- /* harmony default export */ var slider_SliderTooltip = (SliderTooltip);
- // EXTERNAL MODULE: ./components/slider/style/index.ts
- var slider_style = __webpack_require__("./components/slider/style/index.ts");
- ;// ./components/slider/useRafLock.ts
- function useRafLock() {
- const [state, setState] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const cleanup = () => {
- raf["default"].cancel(rafRef.current);
- };
- const setDelayState = nextState => {
- cleanup();
- if (nextState) {
- setState(nextState);
- } else {
- rafRef.current = (0,raf["default"])(() => {
- setState(nextState);
- });
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => cleanup, []);
- return [state, setDelayState];
- }
- ;// ./components/slider/index.tsx
- var slider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getTipFormatter(tipFormatter, legacyTipFormatter) {
- if (tipFormatter || tipFormatter === null) {
- return tipFormatter;
- }
- if (legacyTipFormatter || legacyTipFormatter === null) {
- return legacyTipFormatter;
- }
- return val => typeof val === 'number' ? val.toString() : '';
- }
- const slider_Slider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- range,
- className,
- rootClassName,
- style,
- disabled,
- // Deprecated Props
- tooltipPrefixCls: legacyTooltipPrefixCls,
- tipFormatter: legacyTipFormatter,
- tooltipVisible: legacyTooltipVisible,
- getTooltipPopupContainer: legacyGetTooltipPopupContainer,
- tooltipPlacement: legacyTooltipPlacement,
- tooltip = {},
- onChangeComplete,
- classNames: sliderClassNames,
- styles
- } = props,
- restProps = slider_rest(props, ["prefixCls", "range", "className", "rootClassName", "style", "disabled", "tooltipPrefixCls", "tipFormatter", "tooltipVisible", "getTooltipPopupContainer", "tooltipPlacement", "tooltip", "onChangeComplete", "classNames", "styles"]);
- const {
- vertical
- } = props;
- const {
- getPrefixCls,
- direction: contextDirection,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles,
- getPopupContainer
- } = (0,config_provider_context.useComponentConfig)('slider');
- const contextDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_DisabledContext);
- const mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
- // ============================= Context ==============================
- const {
- handleRender: contextHandleRender,
- direction: internalContextDirection
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(slider_Context);
- const mergedDirection = internalContextDirection || contextDirection;
- const isRTL = mergedDirection === 'rtl';
- // =============================== Open ===============================
- const [hoverOpen, setHoverOpen] = useRafLock();
- const [focusOpen, setFocusOpen] = useRafLock();
- const tooltipProps = Object.assign({}, tooltip);
- const {
- open: tooltipOpen,
- placement: tooltipPlacement,
- getPopupContainer: getTooltipPopupContainer,
- prefixCls: customizeTooltipPrefixCls,
- formatter: tipFormatter
- } = tooltipProps;
- const lockOpen = tooltipOpen !== null && tooltipOpen !== void 0 ? tooltipOpen : legacyTooltipVisible;
- const activeOpen = (hoverOpen || focusOpen) && lockOpen !== false;
- const mergedTipFormatter = getTipFormatter(tipFormatter, legacyTipFormatter);
- // ============================= Change ==============================
- const [dragging, setDragging] = useRafLock();
- const onInternalChangeComplete = nextValues => {
- onChangeComplete === null || onChangeComplete === void 0 ? void 0 : onChangeComplete(nextValues);
- setDragging(false);
- };
- // ============================ Placement ============================
- const getTooltipPlacement = (placement, vert) => {
- if (placement) {
- return placement;
- }
- if (!vert) {
- return 'top';
- }
- return isRTL ? 'left' : 'right';
- };
- // ============================== Style ===============================
- const prefixCls = getPrefixCls('slider', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,slider_style["default"])(prefixCls);
- const rootClassNames = classnames_default()(className, contextClassName, contextClassNames.root, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.root, rootClassName, {
- [`${prefixCls}-rtl`]: isRTL,
- [`${prefixCls}-lock`]: dragging
- }, hashId, cssVarCls);
- // make reverse default on rtl direction
- if (isRTL && !restProps.vertical) {
- restProps.reverse = !restProps.reverse;
- }
- // ============================= Warning ==============================
- // Warning for deprecated usage
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Slider');
- [['tooltipPrefixCls', 'prefixCls'], ['getTooltipPopupContainer', 'getPopupContainer'], ['tipFormatter', 'formatter'], ['tooltipPlacement', 'placement'], ['tooltipVisible', 'open']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, `tooltip.${newName}`);
- });
- }
- // ============================== Handle ==============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- const onMouseUp = () => {
- // Delay for 1 frame to make the click to enable hide tooltip
- // even when the handle is focused
- (0,raf["default"])(() => {
- setFocusOpen(false);
- }, 1);
- };
- document.addEventListener('mouseup', onMouseUp);
- return () => {
- document.removeEventListener('mouseup', onMouseUp);
- };
- }, []);
- const useActiveTooltipHandle = range && !lockOpen;
- const handleRender = contextHandleRender || ((node, info) => {
- const {
- index
- } = info;
- const nodeProps = node.props;
- function proxyEvent(eventName, event, triggerRestPropsEvent) {
- var _a, _b, _c, _d;
- if (triggerRestPropsEvent) {
- (_b = (_a = restProps)[eventName]) === null || _b === void 0 ? void 0 : _b.call(_a, event);
- }
- (_d = (_c = nodeProps)[eventName]) === null || _d === void 0 ? void 0 : _d.call(_c, event);
- }
- const passedProps = Object.assign(Object.assign({}, nodeProps), {
- onMouseEnter: e => {
- setHoverOpen(true);
- proxyEvent('onMouseEnter', e);
- },
- onMouseLeave: e => {
- setHoverOpen(false);
- proxyEvent('onMouseLeave', e);
- },
- onMouseDown: e => {
- setFocusOpen(true);
- setDragging(true);
- proxyEvent('onMouseDown', e);
- },
- onFocus: e => {
- var _a;
- setFocusOpen(true);
- (_a = restProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
- proxyEvent('onFocus', e, true);
- },
- onBlur: e => {
- var _a;
- setFocusOpen(false);
- (_a = restProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
- proxyEvent('onBlur', e, true);
- }
- });
- const cloneNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(node, passedProps);
- const open = (!!lockOpen || activeOpen) && mergedTipFormatter !== null;
- // Wrap on handle with Tooltip when is single mode or multiple with all show tooltip
- if (!useActiveTooltipHandle) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(slider_SliderTooltip, Object.assign({}, tooltipProps, {
- prefixCls: getPrefixCls('tooltip', customizeTooltipPrefixCls !== null && customizeTooltipPrefixCls !== void 0 ? customizeTooltipPrefixCls : legacyTooltipPrefixCls),
- title: mergedTipFormatter ? mergedTipFormatter(info.value) : '',
- value: info.value,
- open: open,
- placement: getTooltipPlacement(tooltipPlacement !== null && tooltipPlacement !== void 0 ? tooltipPlacement : legacyTooltipPlacement, vertical),
- key: index,
- classNames: {
- root: `${prefixCls}-tooltip`
- },
- getPopupContainer: getTooltipPopupContainer || legacyGetTooltipPopupContainer || getPopupContainer
- }), cloneNode);
- }
- return cloneNode;
- });
- // ========================== Active Handle ===========================
- const activeHandleRender = useActiveTooltipHandle ? (handle, info) => {
- const cloneNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(handle, {
- style: Object.assign(Object.assign({}, handle.props.style), {
- visibility: 'hidden'
- })
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(slider_SliderTooltip, Object.assign({}, tooltipProps, {
- prefixCls: getPrefixCls('tooltip', customizeTooltipPrefixCls !== null && customizeTooltipPrefixCls !== void 0 ? customizeTooltipPrefixCls : legacyTooltipPrefixCls),
- title: mergedTipFormatter ? mergedTipFormatter(info.value) : '',
- open: mergedTipFormatter !== null && activeOpen,
- placement: getTooltipPlacement(tooltipPlacement !== null && tooltipPlacement !== void 0 ? tooltipPlacement : legacyTooltipPlacement, vertical),
- key: "tooltip",
- classNames: {
- root: `${prefixCls}-tooltip`
- },
- getPopupContainer: getTooltipPopupContainer || legacyGetTooltipPopupContainer || getPopupContainer,
- draggingDelete: info.draggingDelete
- }), cloneNode);
- } : undefined;
- // ============================== Render ==============================
- const rootStyle = Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), contextStyle), styles === null || styles === void 0 ? void 0 : styles.root), style);
- const mergedTracks = Object.assign(Object.assign({}, contextStyles.tracks), styles === null || styles === void 0 ? void 0 : styles.tracks);
- const mergedTracksClassNames = classnames_default()(contextClassNames.tracks, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.tracks);
- return wrapCSSVar(
- /*#__PURE__*/
- // @ts-ignore
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_slider_es, Object.assign({}, restProps, {
- classNames: Object.assign({
- handle: classnames_default()(contextClassNames.handle, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.handle),
- rail: classnames_default()(contextClassNames.rail, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.rail),
- track: classnames_default()(contextClassNames.track, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.track)
- }, mergedTracksClassNames ? {
- tracks: mergedTracksClassNames
- } : {}),
- styles: Object.assign({
- handle: Object.assign(Object.assign({}, contextStyles.handle), styles === null || styles === void 0 ? void 0 : styles.handle),
- rail: Object.assign(Object.assign({}, contextStyles.rail), styles === null || styles === void 0 ? void 0 : styles.rail),
- track: Object.assign(Object.assign({}, contextStyles.track), styles === null || styles === void 0 ? void 0 : styles.track)
- }, Object.keys(mergedTracks).length ? {
- tracks: mergedTracks
- } : {}),
- step: restProps.step,
- range: range,
- className: rootClassNames,
- style: rootStyle,
- disabled: mergedDisabled,
- ref: ref,
- prefixCls: prefixCls,
- handleRender: handleRender,
- activeHandleRender: activeHandleRender,
- onChangeComplete: onInternalChangeComplete
- })));
- });
- if (true) {
- slider_Slider.displayName = 'Slider';
- }
- /* harmony default export */ var slider = (slider_Slider);
- ;// ./components/color-picker/components/ColorSlider.tsx
- var ColorSlider_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const GradientColorSlider = props => {
- const {
- prefixCls,
- colors,
- type,
- color,
- range = false,
- className,
- activeIndex,
- onActive,
- onDragStart,
- onDragChange,
- onKeyDelete
- } = props,
- restProps = ColorSlider_rest(props, ["prefixCls", "colors", "type", "color", "range", "className", "activeIndex", "onActive", "onDragStart", "onDragChange", "onKeyDelete"]);
- const sliderProps = Object.assign(Object.assign({}, restProps), {
- track: false
- });
- // ========================== Background ==========================
- const linearCss = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const colorsStr = colors.map(c => `${c.color} ${c.percent}%`).join(', ');
- return `linear-gradient(90deg, ${colorsStr})`;
- }, [colors]);
- const pointColor = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!color || !type) {
- return null;
- }
- if (type === 'alpha') {
- return color.toRgbString();
- }
- return `hsl(${color.toHsb().h}, 100%, 50%)`;
- }, [color, type]);
- // ======================= Context: Slider ========================
- const onInternalDragStart = (0,useEvent["default"])(onDragStart);
- const onInternalDragChange = (0,useEvent["default"])(onDragChange);
- const unstableContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- onDragStart: onInternalDragStart,
- onDragChange: onInternalDragChange
- }), []);
- // ======================= Context: Render ========================
- const handleRender = (0,useEvent["default"])((ori, info) => {
- const {
- onFocus,
- style,
- className: handleCls,
- onKeyDown
- } = ori.props;
- // Point Color
- const mergedStyle = Object.assign({}, style);
- if (type === 'gradient') {
- mergedStyle.background = (0,util.getGradientPercentColor)(colors, info.value);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(ori, {
- onFocus: e => {
- onActive === null || onActive === void 0 ? void 0 : onActive(info.index);
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
- },
- style: mergedStyle,
- className: classnames_default()(handleCls, {
- [`${prefixCls}-slider-handle-active`]: activeIndex === info.index
- }),
- onKeyDown: e => {
- if ((e.key === 'Delete' || e.key === 'Backspace') && onKeyDelete) {
- onKeyDelete(info.index);
- }
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
- }
- });
- });
- const sliderContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- direction: 'ltr',
- handleRender
- }), []);
- // ============================ Render ============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(slider_Context.Provider, {
- value: sliderContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(UnstableContext.Provider, {
- value: unstableContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(slider, Object.assign({}, sliderProps, {
- className: classnames_default()(className, `${prefixCls}-slider`),
- tooltip: {
- open: false
- },
- range: {
- editable: range,
- minCount: 2
- },
- styles: {
- rail: {
- background: linearCss
- },
- handle: pointColor ? {
- background: pointColor
- } : {}
- },
- classNames: {
- rail: `${prefixCls}-slider-rail`,
- handle: `${prefixCls}-slider-handle`
- }
- }))));
- };
- const SingleColorSlider = props => {
- const {
- value,
- onChange,
- onChangeComplete
- } = props;
- const singleOnChange = v => onChange(v[0]);
- const singleOnChangeComplete = v => onChangeComplete(v[0]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(GradientColorSlider, Object.assign({}, props, {
- value: [value],
- onChange: singleOnChange,
- onChangeComplete: singleOnChangeComplete
- }));
- };
- /* harmony default export */ var ColorSlider = (SingleColorSlider);
- ;// ./components/color-picker/components/PanelPicker/GradientColorBar.tsx
- function sortColors(colors) {
- return (0,toConsumableArray["default"])(colors).sort((a, b) => a.percent - b.percent);
- }
- /**
- * GradientColorBar will auto show when the mode is `gradient`.
- */
- const GradientColorBar = props => {
- const {
- prefixCls,
- mode,
- onChange,
- onChangeComplete,
- onActive,
- activeIndex,
- onGradientDragging,
- colors
- } = props;
- const isGradient = mode === 'gradient';
- // ============================= Colors =============================
- const colorList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => colors.map(info => ({
- percent: info.percent,
- color: info.color.toRgbString()
- })), [colors]);
- const values = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => colorList.map(info => info.percent), [colorList]);
- // ============================== Drag ==============================
- const colorsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(colorList);
- // Record current colors
- const onDragStart = ({
- rawValues,
- draggingIndex,
- draggingValue
- }) => {
- if (rawValues.length > colorList.length) {
- // Add new node
- const newPointColor = (0,util.getGradientPercentColor)(colorList, draggingValue);
- const nextColors = (0,toConsumableArray["default"])(colorList);
- nextColors.splice(draggingIndex, 0, {
- percent: draggingValue,
- color: newPointColor
- });
- colorsRef.current = nextColors;
- } else {
- colorsRef.current = colorList;
- }
- onGradientDragging(true);
- onChange(new color.AggregationColor(sortColors(colorsRef.current)), true);
- };
- // Adjust color when dragging
- const onDragChange = ({
- deleteIndex,
- draggingIndex,
- draggingValue
- }) => {
- let nextColors = (0,toConsumableArray["default"])(colorsRef.current);
- if (deleteIndex !== -1) {
- nextColors.splice(deleteIndex, 1);
- } else {
- nextColors[draggingIndex] = Object.assign(Object.assign({}, nextColors[draggingIndex]), {
- percent: draggingValue
- });
- nextColors = sortColors(nextColors);
- }
- onChange(new color.AggregationColor(nextColors), true);
- };
- // ============================== Key ===============================
- const onKeyDelete = index => {
- const nextColors = (0,toConsumableArray["default"])(colorList);
- nextColors.splice(index, 1);
- const nextColor = new color.AggregationColor(nextColors);
- onChange(nextColor);
- onChangeComplete(nextColor);
- };
- // ============================= Change =============================
- const onInternalChangeComplete = nextValues => {
- onChangeComplete(new color.AggregationColor(colorList));
- // Reset `activeIndex` if out of range
- if (activeIndex >= nextValues.length) {
- onActive(nextValues.length - 1);
- }
- onGradientDragging(false);
- };
- // ============================= Render =============================
- if (!isGradient) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(GradientColorSlider, {
- min: 0,
- max: 100,
- prefixCls: prefixCls,
- className: `${prefixCls}-gradient-slider`,
- colors: colorList,
- color: null,
- value: values,
- range: true,
- onChangeComplete: onInternalChangeComplete,
- disabled: false,
- type: "gradient",
- // Active
- activeIndex: activeIndex,
- onActive: onActive,
- // Drag
- onDragStart: onDragStart,
- onDragChange: onDragChange,
- onKeyDelete: onKeyDelete
- });
- };
- /* harmony default export */ var PanelPicker_GradientColorBar = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(GradientColorBar));
- ;// ./components/color-picker/components/PanelPicker/index.tsx
- var PanelPicker_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const components = {
- slider: ColorSlider
- };
- const PanelPicker = () => {
- const panelPickerContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PanelPickerContext);
- const {
- mode,
- onModeChange,
- modeOptions,
- prefixCls,
- allowClear,
- value,
- disabledAlpha,
- onChange,
- onClear,
- onChangeComplete,
- activeIndex,
- gradientDragging
- } = panelPickerContext,
- injectProps = PanelPicker_rest(panelPickerContext, ["mode", "onModeChange", "modeOptions", "prefixCls", "allowClear", "value", "disabledAlpha", "onChange", "onClear", "onChangeComplete", "activeIndex", "gradientDragging"]);
- // ============================ Colors ============================
- const colors = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- if (!value.cleared) {
- return value.getColors();
- }
- return [{
- percent: 0,
- color: new color.AggregationColor('')
- }, {
- percent: 100,
- color: new color.AggregationColor('')
- }];
- }, [value]);
- // ========================= Single Color =========================
- const isSingle = !value.isGradient();
- // We cache the point color in case user drag the gradient point across another one
- const [lockedColor, setLockedColor] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(value);
- // Use layout effect here since `useEffect` will cause a blink when mouseDown
- (0,useLayoutEffect["default"])(() => {
- var _a;
- if (!isSingle) {
- setLockedColor((_a = colors[activeIndex]) === null || _a === void 0 ? void 0 : _a.color);
- }
- }, [gradientDragging, activeIndex]);
- const activeColor = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- var _a;
- if (isSingle) {
- return value;
- }
- // Use cache when dragging. User can not operation panel when dragging.
- if (gradientDragging) {
- return lockedColor;
- }
- return (_a = colors[activeIndex]) === null || _a === void 0 ? void 0 : _a.color;
- }, [value, activeIndex, isSingle, lockedColor, gradientDragging]);
- // ========================= Picker Color =========================
- const [pickerColor, setPickerColor] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(activeColor);
- const [forceSync, setForceSync] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0);
- const mergedPickerColor = (pickerColor === null || pickerColor === void 0 ? void 0 : pickerColor.equals(activeColor)) ? activeColor : pickerColor;
- (0,useLayoutEffect["default"])(() => {
- setPickerColor(activeColor);
- }, [forceSync, activeColor === null || activeColor === void 0 ? void 0 : activeColor.toHexString()]);
- // ============================ Change ============================
- const fillColor = (nextColor, info) => {
- let submitColor = (0,util.generateColor)(nextColor);
- // Fill alpha color to 100% if origin is cleared color
- if (value.cleared) {
- const rgb = submitColor.toRgb();
- // Auto fill color if origin is `0/0/0` to enhance user experience
- if (!rgb.r && !rgb.g && !rgb.b && info) {
- const {
- type: infoType,
- value: infoValue = 0
- } = info;
- submitColor = new color.AggregationColor({
- h: infoType === 'hue' ? infoValue : 0,
- s: 1,
- b: 1,
- a: infoType === 'alpha' ? infoValue / 100 : 1
- });
- } else {
- submitColor = (0,util.genAlphaColor)(submitColor);
- }
- }
- if (mode === 'single') {
- return submitColor;
- }
- const nextColors = (0,toConsumableArray["default"])(colors);
- nextColors[activeIndex] = Object.assign(Object.assign({}, nextColors[activeIndex]), {
- color: submitColor
- });
- return new color.AggregationColor(nextColors);
- };
- const onPickerChange = (colorValue, fromPicker, info) => {
- const nextColor = fillColor(colorValue, info);
- setPickerColor(nextColor.isGradient() ? nextColor.getColors()[activeIndex].color : nextColor);
- onChange(nextColor, fromPicker);
- };
- const onInternalChangeComplete = (nextColor, info) => {
- // Trigger complete event
- onChangeComplete(fillColor(nextColor, info));
- // Back of origin color in case in controlled
- // This will set after `onChangeComplete` to avoid `setState` trigger rerender
- // which will make `fillColor` get wrong `color.cleared` state
- setForceSync(ori => ori + 1);
- };
- const onInputChange = colorValue => {
- onChange(fillColor(colorValue));
- };
- // ============================ Render ============================
- // Operation bar
- let operationNode = null;
- const showMode = modeOptions.length > 1;
- if (allowClear || showMode) {
- operationNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-operation`
- }, showMode && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(segmented, {
- size: "small",
- options: modeOptions,
- value: mode,
- onChange: onModeChange
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorClear, Object.assign({
- prefixCls: prefixCls,
- value: value,
- onChange: clearColor => {
- onChange(clearColor);
- onClear === null || onClear === void 0 ? void 0 : onClear();
- }
- }, injectProps)));
- }
- // Return
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, operationNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PanelPicker_GradientColorBar, Object.assign({}, panelPickerContext, {
- colors: colors
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(color_picker_es["default"], {
- prefixCls: prefixCls,
- value: mergedPickerColor === null || mergedPickerColor === void 0 ? void 0 : mergedPickerColor.toHsb(),
- disabledAlpha: disabledAlpha,
- onChange: (colorValue, info) => {
- onPickerChange(colorValue, true, info);
- },
- onChangeComplete: (colorValue, info) => {
- onInternalChangeComplete(colorValue, info);
- },
- components: components
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorInput, Object.assign({
- value: activeColor,
- onChange: onInputChange,
- prefixCls: prefixCls,
- disabledAlpha: disabledAlpha
- }, injectProps)));
- };
- /* harmony default export */ var components_PanelPicker = (PanelPicker);
- // EXTERNAL MODULE: ./components/color-picker/components/ColorPresets.tsx
- var ColorPresets = __webpack_require__("./components/color-picker/components/ColorPresets.tsx");
- ;// ./components/color-picker/components/PanelPresets.tsx
- const PanelPresets = () => {
- const {
- prefixCls,
- value,
- presets,
- onChange
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PanelPresetsContext);
- return Array.isArray(presets) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ColorPresets["default"], {
- value: value,
- presets: presets,
- prefixCls: prefixCls,
- onChange: onChange
- })) : null;
- };
- /* harmony default export */ var components_PanelPresets = (PanelPresets);
- ;// ./components/color-picker/ColorPickerPanel.tsx
- const ColorPickerPanel = props => {
- const {
- prefixCls,
- presets,
- panelRender,
- value,
- onChange,
- onClear,
- allowClear,
- disabledAlpha,
- mode,
- onModeChange,
- modeOptions,
- onChangeComplete,
- activeIndex,
- onActive,
- format,
- onFormatChange,
- gradientDragging,
- onGradientDragging,
- disabledFormat
- } = props;
- const colorPickerPanelPrefixCls = `${prefixCls}-inner`;
- // ===================== Context ======================
- const panelContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => ({
- prefixCls,
- value,
- onChange,
- onClear,
- allowClear,
- disabledAlpha,
- mode,
- onModeChange,
- modeOptions,
- onChangeComplete,
- activeIndex,
- onActive,
- format,
- onFormatChange,
- gradientDragging,
- onGradientDragging,
- disabledFormat
- }), [prefixCls, value, onChange, onClear, allowClear, disabledAlpha, mode, onModeChange, modeOptions, onChangeComplete, activeIndex, onActive, format, onFormatChange, gradientDragging, onGradientDragging, disabledFormat]);
- const presetContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => ({
- prefixCls,
- value,
- presets,
- onChange
- }), [prefixCls, value, presets, onChange]);
- // ====================== Render ======================
- const innerPanel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${colorPickerPanelPrefixCls}-content`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_PanelPicker, null), Array.isArray(presets) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(divider, null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_PanelPresets, null));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PanelPickerContext.Provider, {
- value: panelContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PanelPresetsContext.Provider, {
- value: presetContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: colorPickerPanelPrefixCls
- }, typeof panelRender === 'function' ? panelRender(innerPanel, {
- components: {
- Picker: components_PanelPicker,
- Presets: components_PanelPresets
- }
- }) : innerPanel)));
- };
- if (true) {
- ColorPickerPanel.displayName = 'ColorPickerPanel';
- }
- /* harmony default export */ var color_picker_ColorPickerPanel = (ColorPickerPanel);
- ;// ./components/color-picker/components/ColorTrigger.tsx
- var ColorTrigger_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const ColorTrigger = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const {
- color,
- prefixCls,
- open,
- disabled,
- format,
- className,
- showText,
- activeIndex
- } = props,
- rest = ColorTrigger_rest(props, ["color", "prefixCls", "open", "disabled", "format", "className", "showText", "activeIndex"]);
- const colorTriggerPrefixCls = `${prefixCls}-trigger`;
- const colorTextPrefixCls = `${colorTriggerPrefixCls}-text`;
- const colorTextCellPrefixCls = `${colorTextPrefixCls}-cell`;
- const [locale] = (0,useLocale["default"])('ColorPicker');
- // ============================== Text ==============================
- const desc = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- if (!showText) {
- return '';
- }
- if (typeof showText === 'function') {
- return showText(color);
- }
- if (color.cleared) {
- return locale.transparent;
- }
- if (color.isGradient()) {
- return color.getColors().map((c, index) => {
- const inactive = activeIndex !== -1 && activeIndex !== index;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- key: index,
- className: classnames_default()(colorTextCellPrefixCls, inactive && `${colorTextCellPrefixCls}-inactive`)
- }, c.color.toRgbString(), " ", c.percent, "%");
- });
- }
- const hexString = color.toHexString().toUpperCase();
- const alpha = (0,util.getColorAlpha)(color);
- switch (format) {
- case 'rgb':
- return color.toRgbString();
- case 'hsb':
- return color.toHsbString();
- // case 'hex':
- default:
- return alpha < 100 ? `${hexString.slice(0, 7)},${alpha}%` : hexString;
- }
- }, [color, format, showText, activeIndex]);
- // ============================= Render =============================
- const containerNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => color.cleared ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorClear, {
- prefixCls: prefixCls
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(color_picker_es.ColorBlock, {
- prefixCls: prefixCls,
- color: color.toCssString()
- })), [color, prefixCls]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({
- ref: ref,
- className: classnames_default()(colorTriggerPrefixCls, className, {
- [`${colorTriggerPrefixCls}-active`]: open,
- [`${colorTriggerPrefixCls}-disabled`]: disabled
- })
- }, (0,pickAttrs["default"])(rest)), containerNode, showText && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: colorTextPrefixCls
- }, desc));
- });
- /* harmony default export */ var components_ColorTrigger = (ColorTrigger);
- ;// ./components/color-picker/hooks/useModeColor.ts
- /**
- * Combine the `color` and `mode` to make sure sync of state.
- */
- function useModeColor(defaultValue, value, mode) {
- const [locale] = (0,useLocale["default"])('ColorPicker');
- // ======================== Base ========================
- // Color
- const [mergedColor, setMergedColor] = (0,useMergedState["default"])(defaultValue, {
- value
- });
- // Mode
- const [modeState, setModeState] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState('single');
- const [modeOptionList, modeSet] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const list = (Array.isArray(mode) ? mode : [mode]).filter(m => m);
- if (!list.length) {
- list.push('single');
- }
- const modes = new Set(list);
- const optionList = [];
- const pushOption = (modeType, localeTxt) => {
- if (modes.has(modeType)) {
- optionList.push({
- label: localeTxt,
- value: modeType
- });
- }
- };
- pushOption('single', locale.singleColor);
- pushOption('gradient', locale.gradientColor);
- return [optionList, modes];
- }, [mode]);
- // ======================== Post ========================
- // We need align `mode` with `color` state
- // >>>>> Color
- const [cacheColor, setCacheColor] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- const setColor = (0,useEvent["default"])(nextColor => {
- setCacheColor(nextColor);
- setMergedColor(nextColor);
- });
- const postColor = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const colorObj = (0,util.generateColor)(mergedColor || '');
- // Use `cacheColor` in case the color is `cleared`
- return colorObj.equals(cacheColor) ? cacheColor : colorObj;
- }, [mergedColor, cacheColor]);
- // >>>>> Mode
- const postMode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a;
- if (modeSet.has(modeState)) {
- return modeState;
- }
- return (_a = modeOptionList[0]) === null || _a === void 0 ? void 0 : _a.value;
- }, [modeSet, modeState, modeOptionList]);
- // ======================= Effect =======================
- // Dynamic update mode when color change
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setModeState(postColor.isGradient() ? 'gradient' : 'single');
- }, [postColor]);
- // ======================= Return =======================
- return [postColor, setColor, postMode, setModeState, modeOptionList];
- }
- // EXTERNAL MODULE: ./components/color-picker/style/index.ts + 5 modules
- var color_picker_style = __webpack_require__("./components/color-picker/style/index.ts");
- ;// ./components/color-picker/ColorPicker.tsx
- var ColorPicker_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const ColorPicker = props => {
- const {
- mode,
- value,
- defaultValue,
- format,
- defaultFormat,
- allowClear = false,
- presets,
- children,
- trigger = 'click',
- open,
- disabled,
- placement = 'bottomLeft',
- arrow = true,
- panelRender,
- showText,
- style,
- className,
- size: customizeSize,
- rootClassName,
- prefixCls: customizePrefixCls,
- styles,
- disabledAlpha = false,
- onFormatChange,
- onChange,
- onClear,
- onOpenChange,
- onChangeComplete,
- getPopupContainer,
- autoAdjustOverflow = true,
- destroyTooltipOnHide,
- destroyOnHidden,
- disabledFormat
- } = props,
- rest = ColorPicker_rest(props, ["mode", "value", "defaultValue", "format", "defaultFormat", "allowClear", "presets", "children", "trigger", "open", "disabled", "placement", "arrow", "panelRender", "showText", "style", "className", "size", "rootClassName", "prefixCls", "styles", "disabledAlpha", "onFormatChange", "onChange", "onClear", "onOpenChange", "onChangeComplete", "getPopupContainer", "autoAdjustOverflow", "destroyTooltipOnHide", "destroyOnHidden", "disabledFormat"]);
- const {
- getPrefixCls,
- direction,
- colorPicker
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const contextDisabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_DisabledContext);
- const mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
- const [popupOpen, setPopupOpen] = (0,useMergedState["default"])(false, {
- value: open,
- postState: openData => !mergedDisabled && openData,
- onChange: onOpenChange
- });
- const [formatValue, setFormatValue] = (0,useMergedState["default"])(format, {
- value: format,
- defaultValue: defaultFormat,
- onChange: onFormatChange
- });
- const prefixCls = getPrefixCls('color-picker', customizePrefixCls);
- // ================== Value & Mode =================
- const [mergedColor, setColor, modeState, setModeState, modeOptions] = useModeColor(defaultValue, value, mode);
- const isAlphaColor = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => (0,util.getColorAlpha)(mergedColor) < 100, [mergedColor]);
- // ==================== Change =====================
- // To enhance user experience, we cache the gradient color when switch from gradient to single
- // If user not modify single color, we will use the cached gradient color.
- const [cachedGradientColor, setCachedGradientColor] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null);
- const onInternalChangeComplete = color => {
- if (onChangeComplete) {
- let changeColor = (0,util.generateColor)(color);
- // ignore alpha color
- if (disabledAlpha && isAlphaColor) {
- changeColor = (0,util.genAlphaColor)(color);
- }
- onChangeComplete(changeColor);
- }
- };
- const onInternalChange = (data, changeFromPickerDrag) => {
- let color = (0,util.generateColor)(data);
- // ignore alpha color
- if (disabledAlpha && isAlphaColor) {
- color = (0,util.genAlphaColor)(color);
- }
- setColor(color);
- setCachedGradientColor(null);
- // Trigger change event
- if (onChange) {
- onChange(color, color.toCssString());
- }
- // Only for drag-and-drop color picking
- if (!changeFromPickerDrag) {
- onInternalChangeComplete(color);
- }
- };
- // =================== Gradient ====================
- const [activeIndex, setActiveIndex] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0);
- const [gradientDragging, setGradientDragging] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(false);
- // Mode change should also trigger color change
- const onInternalModeChange = newMode => {
- setModeState(newMode);
- if (newMode === 'single' && mergedColor.isGradient()) {
- setActiveIndex(0);
- onInternalChange(new color.AggregationColor(mergedColor.getColors()[0].color));
- // Should after `onInternalChange` since it will clear the cached color
- setCachedGradientColor(mergedColor);
- } else if (newMode === 'gradient' && !mergedColor.isGradient()) {
- const baseColor = isAlphaColor ? (0,util.genAlphaColor)(mergedColor) : mergedColor;
- onInternalChange(new color.AggregationColor(cachedGradientColor || [{
- percent: 0,
- color: baseColor
- }, {
- percent: 100,
- color: baseColor
- }]));
- }
- };
- // ================== Form Status ==================
- const {
- status: contextStatus
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(FormItemInputContext);
- // ==================== Compact ====================
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- // ===================== Style =====================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,color_picker_style["default"])(prefixCls, rootCls);
- const rtlCls = {
- [`${prefixCls}-rtl`]: direction
- };
- const mergedRootCls = classnames_default()(rootClassName, cssVarCls, rootCls, rtlCls);
- const mergedCls = classnames_default()(getStatusClassNames(prefixCls, contextStatus), {
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-lg`]: mergedSize === 'large'
- }, compactItemClassnames, colorPicker === null || colorPicker === void 0 ? void 0 : colorPicker.className, mergedRootCls, className, hashId);
- const mergedPopupCls = classnames_default()(prefixCls, mergedRootCls);
- // ===================== Warning ======================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('ColorPicker');
- true ? warning(!(disabledAlpha && isAlphaColor), 'usage', '`disabledAlpha` will make the alpha to be 100% when use alpha color.') : 0;
- }
- const popoverProps = {
- open: popupOpen,
- trigger,
- placement,
- arrow,
- rootClassName,
- getPopupContainer,
- autoAdjustOverflow,
- destroyOnHidden: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide
- };
- const mergedStyle = Object.assign(Object.assign({}, colorPicker === null || colorPicker === void 0 ? void 0 : colorPicker.style), style);
- // ============================ zIndex ============================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(popover, Object.assign({
- style: styles === null || styles === void 0 ? void 0 : styles.popup,
- styles: {
- body: styles === null || styles === void 0 ? void 0 : styles.popupOverlayInner
- },
- onOpenChange: visible => {
- if (!visible || !mergedDisabled) {
- setPopupOpen(visible);
- }
- },
- content: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_util_ContextIsolator, {
- form: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(color_picker_ColorPickerPanel, {
- mode: modeState,
- onModeChange: onInternalModeChange,
- modeOptions: modeOptions,
- prefixCls: prefixCls,
- value: mergedColor,
- allowClear: allowClear,
- disabled: mergedDisabled,
- disabledAlpha: disabledAlpha,
- presets: presets,
- panelRender: panelRender,
- format: formatValue,
- onFormatChange: setFormatValue,
- onChange: onInternalChange,
- onChangeComplete: onInternalChangeComplete,
- onClear: onClear,
- activeIndex: activeIndex,
- onActive: setActiveIndex,
- gradientDragging: gradientDragging,
- onGradientDragging: setGradientDragging,
- disabledFormat: disabledFormat
- })),
- classNames: {
- root: mergedPopupCls
- }
- }, popoverProps), children || (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorTrigger, Object.assign({
- activeIndex: popupOpen ? activeIndex : -1,
- open: popupOpen,
- className: mergedCls,
- style: mergedStyle,
- prefixCls: prefixCls,
- disabled: mergedDisabled,
- showText: showText,
- format: formatValue
- }, rest, {
- color: mergedColor
- })))));
- };
- if (true) {
- ColorPicker.displayName = 'ColorPicker';
- }
- const ColorPicker_PurePanel = _util_PurePanel(ColorPicker, undefined, props => Object.assign(Object.assign({}, props), {
- placement: 'bottom',
- autoAdjustOverflow: false
- }), 'color-picker', /* istanbul ignore next */
- prefixCls => prefixCls);
- ColorPicker._InternalPanelDoNotUseOrYouWillBeFired = ColorPicker_PurePanel;
- /* harmony default export */ var color_picker_ColorPicker = (ColorPicker);
- ;// ./components/color-picker/index.tsx
- /* harmony default export */ var color_picker = (color_picker_ColorPicker);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CalendarOutlined.js
- // This icon file is generated automatically.
- var CalendarOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, "name": "calendar", "theme": "outlined" };
- /* harmony default export */ var asn_CalendarOutlined = (CalendarOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CalendarOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CalendarOutlined_CalendarOutlined = function CalendarOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CalendarOutlined
- }));
- };
- /** */
- var CalendarOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CalendarOutlined_CalendarOutlined);
- if (true) {
- CalendarOutlined_RefIcon.displayName = 'CalendarOutlined';
- }
- /* harmony default export */ var icons_CalendarOutlined = (CalendarOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/ClockCircleOutlined.js
- // This icon file is generated automatically.
- var ClockCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, "name": "clock-circle", "theme": "outlined" };
- /* harmony default export */ var asn_ClockCircleOutlined = (ClockCircleOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var ClockCircleOutlined_ClockCircleOutlined = function ClockCircleOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_ClockCircleOutlined
- }));
- };
- /** */
- var ClockCircleOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ClockCircleOutlined_ClockCircleOutlined);
- if (true) {
- ClockCircleOutlined_RefIcon.displayName = 'ClockCircleOutlined';
- }
- /* harmony default export */ var icons_ClockCircleOutlined = (ClockCircleOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/SwapRightOutlined.js
- // This icon file is generated automatically.
- var SwapRightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z" } }] }, "name": "swap-right", "theme": "outlined" };
- /* harmony default export */ var asn_SwapRightOutlined = (SwapRightOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/SwapRightOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var SwapRightOutlined_SwapRightOutlined = function SwapRightOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_SwapRightOutlined
- }));
- };
- /** */
- var SwapRightOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SwapRightOutlined_SwapRightOutlined);
- if (true) {
- SwapRightOutlined_RefIcon.displayName = 'SwapRightOutlined';
- }
- /* harmony default export */ var icons_SwapRightOutlined = (SwapRightOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/date-picker/locale/en_US.ts + 1 modules
- var date_picker_locale_en_US = __webpack_require__("./components/date-picker/locale/en_US.ts");
- // EXTERNAL MODULE: ./components/date-picker/style/index.ts + 2 modules
- var date_picker_style = __webpack_require__("./components/date-picker/style/index.ts");
- ;// ./components/date-picker/util.ts
- function getPlaceholder(locale, picker, customizePlaceholder) {
- if (customizePlaceholder !== undefined) {
- return customizePlaceholder;
- }
- if (picker === 'year' && locale.lang.yearPlaceholder) {
- return locale.lang.yearPlaceholder;
- }
- if (picker === 'quarter' && locale.lang.quarterPlaceholder) {
- return locale.lang.quarterPlaceholder;
- }
- if (picker === 'month' && locale.lang.monthPlaceholder) {
- return locale.lang.monthPlaceholder;
- }
- if (picker === 'week' && locale.lang.weekPlaceholder) {
- return locale.lang.weekPlaceholder;
- }
- if (picker === 'time' && locale.timePickerLocale.placeholder) {
- return locale.timePickerLocale.placeholder;
- }
- return locale.lang.placeholder;
- }
- function getRangePlaceholder(locale, picker, customizePlaceholder) {
- if (customizePlaceholder !== undefined) {
- return customizePlaceholder;
- }
- if (picker === 'year' && locale.lang.yearPlaceholder) {
- return locale.lang.rangeYearPlaceholder;
- }
- if (picker === 'quarter' && locale.lang.quarterPlaceholder) {
- return locale.lang.rangeQuarterPlaceholder;
- }
- if (picker === 'month' && locale.lang.monthPlaceholder) {
- return locale.lang.rangeMonthPlaceholder;
- }
- if (picker === 'week' && locale.lang.weekPlaceholder) {
- return locale.lang.rangeWeekPlaceholder;
- }
- if (picker === 'time' && locale.timePickerLocale.placeholder) {
- return locale.timePickerLocale.rangePlaceholder;
- }
- return locale.lang.rangePlaceholder;
- }
- function util_useIcons(props, prefixCls) {
- const {
- allowClear = true
- } = props;
- const {
- clearIcon,
- removeIcon
- } = useIcons(Object.assign(Object.assign({}, props), {
- prefixCls,
- componentName: 'DatePicker'
- }));
- const mergedAllowClear = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (allowClear === false) {
- return false;
- }
- const allowClearConfig = allowClear === true ? {} : allowClear;
- return Object.assign({
- clearIcon: clearIcon
- }, allowClearConfig);
- }, [allowClear, clearIcon]);
- return [mergedAllowClear, removeIcon];
- }
- ;// ./components/date-picker/generatePicker/constant.ts
- const [WEEK, WEEKPICKER] = ['week', 'WeekPicker'];
- const [MONTH, MONTHPICKER] = ['month', 'MonthPicker'];
- const [YEAR, YEARPICKER] = ['year', 'YearPicker'];
- const [QUARTER, QUARTERPICKER] = ['quarter', 'QuarterPicker'];
- const [TIME, TIMEPICKER] = ['time', 'TimePicker'];
- ;// ./components/date-picker/PickerButton.tsx
- const PickerButton = props => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, Object.assign({
- size: "small",
- type: "primary"
- }, props)));
- /* harmony default export */ var date_picker_PickerButton = (PickerButton);
- ;// ./components/date-picker/generatePicker/useComponents.ts
- function useComponents(components) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => Object.assign({
- button: date_picker_PickerButton
- }, components), [components]);
- }
- ;// ./components/_util/hooks/useMergeSemantic/index.ts
- // ========================= ClassNames =========================
- function mergeClassNames(schema, ...classNames) {
- const mergedSchema = schema || {};
- return classNames.reduce((acc, cur) => {
- // Loop keys of the current classNames
- Object.keys(cur || {}).forEach(key => {
- const keySchema = mergedSchema[key];
- const curVal = cur[key];
- if (keySchema && typeof keySchema === 'object') {
- if (curVal && typeof curVal === 'object') {
- // Loop fill
- acc[key] = mergeClassNames(keySchema, acc[key], curVal);
- } else {
- // Covert string to object structure
- const {
- _default: defaultField
- } = keySchema;
- acc[key] = acc[key] || {};
- acc[key][defaultField] = classnames_default()(acc[key][defaultField], curVal);
- }
- } else {
- // Flatten fill
- acc[key] = classnames_default()(acc[key], curVal);
- }
- });
- return acc;
- }, {});
- }
- function useSemanticClassNames(schema, ...classNames) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => mergeClassNames.apply(void 0, [schema].concat(classNames)), [classNames]);
- }
- // =========================== Styles ===========================
- function useSemanticStyles(...styles) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- return styles.reduce((acc, cur = {}) => {
- Object.keys(cur).forEach(key => {
- acc[key] = Object.assign(Object.assign({}, acc[key]), cur[key]);
- });
- return acc;
- }, {});
- }, [styles]);
- }
- // =========================== Export ===========================
- function fillObjectBySchema(obj, schema) {
- const newObj = Object.assign({}, obj);
- Object.keys(schema).forEach(key => {
- if (key !== '_default') {
- const nestSchema = schema[key];
- const nextValue = newObj[key] || {};
- newObj[key] = nestSchema ? fillObjectBySchema(nextValue, nestSchema) : nextValue;
- }
- });
- return newObj;
- }
- /**
- * Merge classNames and styles from multiple sources.
- * When `schema` is provided, it will **must** provide the nest object structure.
- */
- function useMergeSemantic(classNamesList, stylesList, schema) {
- const mergedClassNames = useSemanticClassNames.apply(void 0, [schema].concat((0,toConsumableArray["default"])(classNamesList)));
- const mergedStyles = useSemanticStyles.apply(void 0, (0,toConsumableArray["default"])(stylesList));
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- return [fillObjectBySchema(mergedClassNames, schema), fillObjectBySchema(mergedStyles, schema)];
- }, [mergedClassNames, mergedStyles]);
- }
- ;// ./components/date-picker/hooks/useMergedPickerSemantic.ts
- const useMergedPickerSemantic = (pickerType, classNames, styles, popupClassName, popupStyle) => {
- const {
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)(pickerType);
- const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
- popup: {
- _default: 'root'
- }
- });
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- // ClassNames
- const filledClassNames = Object.assign(Object.assign({}, mergedClassNames), {
- popup: Object.assign(Object.assign({}, mergedClassNames.popup), {
- root: classnames_default()((_a = mergedClassNames.popup) === null || _a === void 0 ? void 0 : _a.root, popupClassName)
- })
- });
- // Styles
- const filledStyles = Object.assign(Object.assign({}, mergedStyles), {
- popup: Object.assign(Object.assign({}, mergedStyles.popup), {
- root: Object.assign(Object.assign({}, (_b = mergedStyles.popup) === null || _b === void 0 ? void 0 : _b.root), popupStyle)
- })
- });
- // Return
- return [filledClassNames, filledStyles];
- }, [mergedClassNames, mergedStyles, popupClassName, popupStyle]);
- };
- /* harmony default export */ var hooks_useMergedPickerSemantic = (useMergedPickerSemantic);
- ;// ./components/date-picker/generatePicker/generateRangePicker.tsx
- var generateRangePicker_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const generateRangePicker = generateConfig => {
- const RangePicker = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- getPopupContainer: customGetPopupContainer,
- components,
- className,
- style,
- placement,
- size: customizeSize,
- disabled: customDisabled,
- bordered = true,
- placeholder,
- popupStyle,
- popupClassName,
- dropdownClassName,
- status: customStatus,
- rootClassName,
- variant: customVariant,
- picker,
- styles,
- classNames
- } = props,
- restProps = generateRangePicker_rest(props, ["prefixCls", "getPopupContainer", "components", "className", "style", "placement", "size", "disabled", "bordered", "placeholder", "popupStyle", "popupClassName", "dropdownClassName", "status", "rootClassName", "variant", "picker", "styles", "classNames"]);
- const pickerType = picker === TIME ? 'timePicker' : 'datePicker';
- const innerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const {
- getPrefixCls,
- direction,
- getPopupContainer,
- rangePicker
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('picker', customizePrefixCls);
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const rootPrefixCls = getPrefixCls();
- const [variant, enableVariantCls] = useVariants('rangePicker', customVariant, bordered);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,date_picker_style["default"])(prefixCls, rootCls);
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('DatePicker.RangePicker');
- // ==================== Deprecated =====================
- const deprecatedProps = {
- dropdownClassName: 'classNames.popup.root',
- popupClassName: 'classNames.popup.root',
- popupStyle: 'styles.popup.root',
- bordered: 'variant',
- onSelect: 'onCalendarChange'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- }
- const [mergedClassNames, mergedStyles] = hooks_useMergedPickerSemantic(pickerType, classNames, styles, popupClassName || dropdownClassName, popupStyle);
- // ===================== Icon =====================
- const [mergedAllowClear] = util_useIcons(props, prefixCls);
- // ================== components ==================
- const mergedComponents = useComponents(components);
- // ===================== Size =====================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- // ===================== FormItemInput =====================
- const formItemContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const {
- hasFeedback,
- status: contextStatus,
- feedbackIcon
- } = formItemContext;
- const suffixNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, picker === TIME ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ClockCircleOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CalendarOutlined, null), hasFeedback && feedbackIcon);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => innerRef.current);
- const [contextLocale] = (0,useLocale["default"])('Calendar', date_picker_locale_en_US["default"]);
- const locale = Object.assign(Object.assign({}, contextLocale), props.locale);
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('DatePicker', (_a = mergedStyles.popup.root) === null || _a === void 0 ? void 0 : _a.zIndex);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- space: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PickerInput_RangePicker, Object.assign({
- separator: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- "aria-label": "to",
- className: `${prefixCls}-separator`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SwapRightOutlined, null)),
- disabled: mergedDisabled,
- ref: innerRef,
- placement: placement,
- placeholder: getRangePlaceholder(locale, picker, placeholder),
- suffixIcon: suffixNode,
- prevIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-prev-icon`
- }),
- nextIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-next-icon`
- }),
- superPrevIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-super-prev-icon`
- }),
- superNextIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-super-next-icon`
- }),
- transitionName: `${rootPrefixCls}-slide-up`,
- picker: picker
- }, restProps, {
- className: classnames_default()({
- [`${prefixCls}-${mergedSize}`]: mergedSize,
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), hashId, compactItemClassnames, className, rangePicker === null || rangePicker === void 0 ? void 0 : rangePicker.className, cssVarCls, rootCls, rootClassName, mergedClassNames.root),
- style: Object.assign(Object.assign(Object.assign({}, rangePicker === null || rangePicker === void 0 ? void 0 : rangePicker.style), style), mergedStyles.root),
- locale: locale.lang,
- prefixCls: prefixCls,
- getPopupContainer: customGetPopupContainer || getPopupContainer,
- generateConfig: generateConfig,
- components: mergedComponents,
- direction: direction,
- classNames: {
- popup: classnames_default()(hashId, cssVarCls, rootCls, rootClassName, mergedClassNames.popup.root)
- },
- styles: {
- popup: Object.assign(Object.assign({}, mergedStyles.popup.root), {
- zIndex
- })
- },
- allowClear: mergedAllowClear
- }))));
- });
- if (true) {
- RangePicker.displayName = 'RangePicker';
- }
- return RangePicker;
- };
- /* harmony default export */ var generatePicker_generateRangePicker = (generateRangePicker);
- ;// ./components/date-picker/generatePicker/generateSinglePicker.tsx
- var generateSinglePicker_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const generatePicker = generateConfig => {
- const getPicker = (picker, displayName) => {
- const consumerName = displayName === TIMEPICKER ? 'timePicker' : 'datePicker';
- const Picker = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- getPopupContainer: customizeGetPopupContainer,
- components,
- style,
- className,
- rootClassName,
- size: customizeSize,
- bordered,
- placement,
- placeholder,
- popupStyle,
- popupClassName,
- dropdownClassName,
- disabled: customDisabled,
- status: customStatus,
- variant: customVariant,
- onCalendarChange,
- styles,
- classNames
- } = props,
- restProps = generateSinglePicker_rest(props, ["prefixCls", "getPopupContainer", "components", "style", "className", "rootClassName", "size", "bordered", "placement", "placeholder", "popupStyle", "popupClassName", "dropdownClassName", "disabled", "status", "variant", "onCalendarChange", "styles", "classNames"]);
- const {
- getPrefixCls,
- direction,
- getPopupContainer,
- // Consume different styles according to different names
- [consumerName]: consumerStyle
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('picker', customizePrefixCls);
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const innerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [variant, enableVariantCls] = useVariants('datePicker', customVariant, bordered);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,date_picker_style["default"])(prefixCls, rootCls);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => innerRef.current);
- const additionalProps = {
- showToday: true
- };
- const mergedPicker = picker || props.picker;
- const rootPrefixCls = getPrefixCls();
- // ==================== Legacy =====================
- const {
- onSelect,
- multiple
- } = restProps;
- const hasLegacyOnSelect = onSelect && picker === 'time' && !multiple;
- const onInternalCalendarChange = (date, dateStr, info) => {
- onCalendarChange === null || onCalendarChange === void 0 ? void 0 : onCalendarChange(date, dateStr, info);
- if (hasLegacyOnSelect) {
- onSelect(date);
- }
- };
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)(displayName || 'DatePicker');
- true ? warning(picker !== 'quarter', 'deprecated', `DatePicker.${displayName} is legacy usage. Please use DatePicker[picker='${picker}'] directly.`) : 0;
- // ==================== Deprecated =====================
- const deprecatedProps = {
- dropdownClassName: 'classNames.popup.root',
- popupClassName: 'classNames.popup.root',
- popupStyle: 'styles.popup.root',
- bordered: 'variant',
- onSelect: 'onCalendarChange'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- }
- const [mergedClassNames, mergedStyles] = hooks_useMergedPickerSemantic(consumerName, classNames, styles, popupClassName || dropdownClassName, popupStyle);
- // ===================== Icon =====================
- const [mergedAllowClear, removeIcon] = util_useIcons(props, prefixCls);
- // ================== components ==================
- const mergedComponents = useComponents(components);
- // ===================== Size =====================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- // ===================== FormItemInput =====================
- const formItemContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const {
- hasFeedback,
- status: contextStatus,
- feedbackIcon
- } = formItemContext;
- const suffixNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, mergedPicker === 'time' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ClockCircleOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CalendarOutlined, null), hasFeedback && feedbackIcon);
- const [contextLocale] = (0,useLocale["default"])('DatePicker', date_picker_locale_en_US["default"]);
- const locale = Object.assign(Object.assign({}, contextLocale), props.locale);
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('DatePicker', (_a = mergedStyles.popup.root) === null || _a === void 0 ? void 0 : _a.zIndex);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- space: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_picker_es, Object.assign({
- ref: innerRef,
- placeholder: getPlaceholder(locale, mergedPicker, placeholder),
- suffixIcon: suffixNode,
- placement: placement,
- prevIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-prev-icon`
- }),
- nextIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-next-icon`
- }),
- superPrevIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-super-prev-icon`
- }),
- superNextIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-super-next-icon`
- }),
- transitionName: `${rootPrefixCls}-slide-up`,
- picker: picker,
- onCalendarChange: onInternalCalendarChange
- }, additionalProps, restProps, {
- locale: locale.lang,
- className: classnames_default()({
- [`${prefixCls}-${mergedSize}`]: mergedSize,
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), hashId, compactItemClassnames, consumerStyle === null || consumerStyle === void 0 ? void 0 : consumerStyle.className, className, cssVarCls, rootCls, rootClassName, mergedClassNames.root),
- style: Object.assign(Object.assign(Object.assign({}, consumerStyle === null || consumerStyle === void 0 ? void 0 : consumerStyle.style), style), mergedStyles.root),
- prefixCls: prefixCls,
- getPopupContainer: customizeGetPopupContainer || getPopupContainer,
- generateConfig: generateConfig,
- components: mergedComponents,
- direction: direction,
- disabled: mergedDisabled,
- classNames: {
- popup: classnames_default()(hashId, cssVarCls, rootCls, rootClassName, mergedClassNames.popup.root)
- },
- styles: {
- popup: Object.assign(Object.assign({}, mergedStyles.popup.root), {
- zIndex
- })
- },
- allowClear: mergedAllowClear,
- removeIcon: removeIcon
- }))));
- });
- if ( true && displayName) {
- Picker.displayName = displayName;
- }
- return Picker;
- };
- const DatePicker = getPicker();
- const WeekPicker = getPicker(WEEK, WEEKPICKER);
- const MonthPicker = getPicker(MONTH, MONTHPICKER);
- const YearPicker = getPicker(YEAR, YEARPICKER);
- const QuarterPicker = getPicker(QUARTER, QUARTERPICKER);
- const TimePicker = getPicker(TIME, TIMEPICKER);
- return {
- DatePicker,
- WeekPicker,
- MonthPicker,
- YearPicker,
- TimePicker,
- QuarterPicker
- };
- };
- /* harmony default export */ var generateSinglePicker = (generatePicker);
- ;// ./components/date-picker/generatePicker/index.tsx
- const generatePicker_generatePicker = generateConfig => {
- // =========================== Picker ===========================
- const {
- DatePicker,
- WeekPicker,
- MonthPicker,
- YearPicker,
- TimePicker,
- QuarterPicker
- } = generateSinglePicker(generateConfig);
- // ======================== Range Picker ========================
- const RangePicker = generatePicker_generateRangePicker(generateConfig);
- const MergedDatePicker = DatePicker;
- MergedDatePicker.WeekPicker = WeekPicker;
- MergedDatePicker.MonthPicker = MonthPicker;
- MergedDatePicker.YearPicker = YearPicker;
- MergedDatePicker.RangePicker = RangePicker;
- MergedDatePicker.TimePicker = TimePicker;
- MergedDatePicker.QuarterPicker = QuarterPicker;
- if (true) {
- MergedDatePicker.displayName = 'DatePicker';
- }
- return MergedDatePicker;
- };
- /* harmony default export */ var date_picker_generatePicker = (generatePicker_generatePicker);
- ;// ./components/date-picker/index.tsx
- const DatePicker = date_picker_generatePicker(dayjs);
- // We don't care debug panel
- /* istanbul ignore next */
- const date_picker_PurePanel = _util_PurePanel(DatePicker, 'popupAlign', undefined, 'picker');
- DatePicker._InternalPanelDoNotUseOrYouWillBeFired = date_picker_PurePanel;
- const PureRangePanel = _util_PurePanel(DatePicker.RangePicker, 'popupAlign', undefined, 'picker');
- DatePicker._InternalRangePanelDoNotUseOrYouWillBeFired = PureRangePanel;
- DatePicker.generatePicker = date_picker_generatePicker;
- /* harmony default export */ var date_picker = (DatePicker);
- ;// ./components/descriptions/constant.ts
- const DEFAULT_COLUMN_MAP = {
- xxl: 3,
- xl: 3,
- lg: 3,
- md: 3,
- sm: 2,
- xs: 1
- };
- /* harmony default export */ var constant = (DEFAULT_COLUMN_MAP);
- ;// ./components/descriptions/DescriptionsContext.ts
- const DescriptionsContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- /* harmony default export */ var descriptions_DescriptionsContext = (DescriptionsContext);
- ;// ./components/descriptions/hooks/useItems.ts
- var hooks_useItems_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- // Convert children into items
- const transChildren2Items = childNodes => (0,toArray["default"])(childNodes).map(node => Object.assign(Object.assign({}, node === null || node === void 0 ? void 0 : node.props), {
- key: node.key
- }));
- function useItems_useItems(screens, items, children) {
- const mergedItems = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() =>
- // Take `items` first or convert `children` into items
- items || transChildren2Items(children), [items, children]);
- const responsiveItems = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => mergedItems.map(_a => {
- var {
- span
- } = _a,
- restItem = hooks_useItems_rest(_a, ["span"]);
- if (span === 'filled') {
- return Object.assign(Object.assign({}, restItem), {
- filled: true
- });
- }
- return Object.assign(Object.assign({}, restItem), {
- span: typeof span === 'number' ? span : matchScreen(screens, span)
- });
- }), [mergedItems, screens]);
- return responsiveItems;
- }
- ;// ./components/descriptions/hooks/useRow.ts
- var useRow_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- // Calculate the sum of span in a row
- function getCalcRows(rowItems, mergedColumn) {
- let rows = [];
- let tmpRow = [];
- let exceed = false;
- let count = 0;
- rowItems.filter(n => n).forEach(rowItem => {
- const {
- filled
- } = rowItem,
- restItem = useRow_rest(rowItem, ["filled"]);
- if (filled) {
- tmpRow.push(restItem);
- rows.push(tmpRow);
- // reset
- tmpRow = [];
- count = 0;
- return;
- }
- const restSpan = mergedColumn - count;
- count += rowItem.span || 1;
- if (count >= mergedColumn) {
- if (count > mergedColumn) {
- exceed = true;
- tmpRow.push(Object.assign(Object.assign({}, restItem), {
- span: restSpan
- }));
- } else {
- tmpRow.push(restItem);
- }
- rows.push(tmpRow);
- // reset
- tmpRow = [];
- count = 0;
- } else {
- tmpRow.push(restItem);
- }
- });
- if (tmpRow.length > 0) {
- rows.push(tmpRow);
- }
- rows = rows.map(rows => {
- const count = rows.reduce((acc, item) => acc + (item.span || 1), 0);
- if (count < mergedColumn) {
- // If the span of the last element in the current row is less than the column, then add its span to the remaining columns
- const last = rows[rows.length - 1];
- last.span = mergedColumn - (count - (last.span || 1));
- return rows;
- }
- return rows;
- });
- return [rows, exceed];
- }
- const useRow = (mergedColumn, items) => {
- const [rows, exceed] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => getCalcRows(items, mergedColumn), [items, mergedColumn]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Descriptions');
- true ? warning(!exceed, 'usage', 'Sum of column `span` in a line not match `column` of Descriptions.') : 0;
- }
- return rows;
- };
- /* harmony default export */ var hooks_useRow = (useRow);
- ;// ./components/descriptions/Item.ts
- // JSX Structure Syntactic Sugar. Never reach the render code.
- /* istanbul ignore next */
- const DescriptionsItem = ({
- children
- }) => children;
- /* harmony default export */ var descriptions_Item = (DescriptionsItem);
- ;// ./components/descriptions/Cell.tsx
- function notEmpty(val) {
- return val !== undefined && val !== null;
- }
- const Cell = props => {
- const {
- itemPrefixCls,
- component,
- span,
- className,
- style,
- labelStyle,
- contentStyle,
- bordered,
- label,
- content,
- colon,
- type,
- styles
- } = props;
- const Component = component;
- const descContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(descriptions_DescriptionsContext);
- const {
- classNames: descriptionsClassNames
- } = descContext;
- if (bordered) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, {
- className: classnames_default()({
- [`${itemPrefixCls}-item-label`]: type === 'label',
- [`${itemPrefixCls}-item-content`]: type === 'content',
- [`${descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label}`]: type === 'label',
- [`${descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content}`]: type === 'content'
- }, className),
- style: style,
- colSpan: span
- }, notEmpty(label) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: Object.assign(Object.assign({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.label)
- }, label), notEmpty(content) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: Object.assign(Object.assign({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.content)
- }, content));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, {
- className: classnames_default()(`${itemPrefixCls}-item`, className),
- style: style,
- colSpan: span
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${itemPrefixCls}-item-container`
- }, (label || label === 0) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${itemPrefixCls}-item-label`, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label, {
- [`${itemPrefixCls}-item-no-colon`]: !colon
- }),
- style: Object.assign(Object.assign({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.label)
- }, label)), (content || content === 0) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${itemPrefixCls}-item-content`, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content),
- style: Object.assign(Object.assign({}, contentStyle), styles === null || styles === void 0 ? void 0 : styles.content)
- }, content))));
- };
- /* harmony default export */ var descriptions_Cell = (Cell);
- ;// ./components/descriptions/Row.tsx
- function renderCells(items, {
- colon,
- prefixCls,
- bordered
- }, {
- component,
- type,
- showLabel,
- showContent,
- labelStyle: rootLabelStyle,
- contentStyle: rootContentStyle,
- styles: rootStyles
- }) {
- return items.map(({
- label,
- children,
- prefixCls: itemPrefixCls = prefixCls,
- className,
- style,
- labelStyle,
- contentStyle,
- span = 1,
- key,
- styles
- }, index) => {
- if (typeof component === 'string') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(descriptions_Cell, {
- key: `${type}-${key || index}`,
- className: className,
- style: style,
- styles: {
- label: Object.assign(Object.assign(Object.assign(Object.assign({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
- content: Object.assign(Object.assign(Object.assign(Object.assign({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content)
- },
- span: span,
- colon: colon,
- component: component,
- itemPrefixCls: itemPrefixCls,
- bordered: bordered,
- label: showLabel ? label : null,
- content: showContent ? children : null,
- type: type
- });
- }
- return [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(descriptions_Cell, {
- key: `label-${key || index}`,
- className: className,
- style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), style), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
- span: 1,
- colon: colon,
- component: component[0],
- itemPrefixCls: itemPrefixCls,
- bordered: bordered,
- label: label,
- type: "label"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(descriptions_Cell, {
- key: `content-${key || index}`,
- className: className,
- style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), style), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
- span: span * 2 - 1,
- component: component[1],
- itemPrefixCls: itemPrefixCls,
- bordered: bordered,
- content: children,
- type: "content"
- })];
- });
- }
- const Row = props => {
- const descContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(descriptions_DescriptionsContext);
- const {
- prefixCls,
- vertical,
- row,
- index,
- bordered
- } = props;
- if (vertical) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", {
- key: `label-${index}`,
- className: `${prefixCls}-row`
- }, renderCells(row, props, Object.assign({
- component: 'th',
- type: 'label',
- showLabel: true
- }, descContext))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", {
- key: `content-${index}`,
- className: `${prefixCls}-row`
- }, renderCells(row, props, Object.assign({
- component: 'td',
- type: 'content',
- showContent: true
- }, descContext))));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", {
- key: index,
- className: `${prefixCls}-row`
- }, renderCells(row, props, Object.assign({
- component: bordered ? ['th', 'td'] : 'td',
- type: 'item',
- showLabel: true,
- showContent: true
- }, descContext)));
- };
- /* harmony default export */ var descriptions_Row = (Row);
- // EXTERNAL MODULE: ./components/descriptions/style/index.ts
- var descriptions_style = __webpack_require__("./components/descriptions/style/index.ts");
- ;// ./components/descriptions/index.tsx
- var descriptions_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- /* eslint-disable react/no-array-index-key */
- const Descriptions = props => {
- const {
- prefixCls: customizePrefixCls,
- title,
- extra,
- column,
- colon = true,
- bordered,
- layout,
- children,
- className,
- rootClassName,
- style,
- size: customizeSize,
- labelStyle,
- contentStyle,
- styles,
- items,
- classNames: descriptionsClassNames
- } = props,
- restProps = descriptions_rest(props, ["prefixCls", "title", "extra", "column", "colon", "bordered", "layout", "children", "className", "rootClassName", "style", "size", "labelStyle", "contentStyle", "styles", "items", "classNames"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('descriptions');
- const prefixCls = getPrefixCls('descriptions', customizePrefixCls);
- const screens = hooks_useBreakpoint();
- // ============================== Warn ==============================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Descriptions');
- [['labelStyle', 'styles={{ label: {} }}'], ['contentStyle', 'styles={{ content: {} }}']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- }
- // Column count
- const mergedColumn = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a;
- if (typeof column === 'number') {
- return column;
- }
- return (_a = matchScreen(screens, Object.assign(Object.assign({}, constant), column))) !== null && _a !== void 0 ? _a : 3;
- }, [screens, column]);
- // Items with responsive
- const mergedItems = useItems_useItems(screens, items, children);
- const mergedSize = (0,useSize["default"])(customizeSize);
- const rows = hooks_useRow(mergedColumn, mergedItems);
- const [wrapCSSVar, hashId, cssVarCls] = (0,descriptions_style["default"])(prefixCls);
- // ======================== Render ========================
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- labelStyle,
- contentStyle,
- styles: {
- content: Object.assign(Object.assign({}, contextStyles.content), styles === null || styles === void 0 ? void 0 : styles.content),
- label: Object.assign(Object.assign({}, contextStyles.label), styles === null || styles === void 0 ? void 0 : styles.label)
- },
- classNames: {
- label: classnames_default()(contextClassNames.label, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label),
- content: classnames_default()(contextClassNames.content, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content)
- }
- }), [labelStyle, contentStyle, styles, descriptionsClassNames, contextClassNames, contextStyles]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(descriptions_DescriptionsContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- className: classnames_default()(prefixCls, contextClassName, contextClassNames.root, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.root, {
- [`${prefixCls}-${mergedSize}`]: mergedSize && mergedSize !== 'default',
- [`${prefixCls}-bordered`]: !!bordered,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId, cssVarCls),
- style: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyle), contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), style)
- }, restProps), (title || extra) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-header`, contextClassNames.header, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.header),
- style: Object.assign(Object.assign({}, contextStyles.header), styles === null || styles === void 0 ? void 0 : styles.header)
- }, title && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-title`, contextClassNames.title, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.title),
- style: Object.assign(Object.assign({}, contextStyles.title), styles === null || styles === void 0 ? void 0 : styles.title)
- }, title)), extra && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-extra`, contextClassNames.extra, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.extra),
- style: Object.assign(Object.assign({}, contextStyles.extra), styles === null || styles === void 0 ? void 0 : styles.extra)
- }, extra)))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-view`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("table", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tbody", null, rows.map((row, index) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(descriptions_Row, {
- key: index,
- index: index,
- colon: colon,
- prefixCls: prefixCls,
- vertical: layout === 'vertical',
- bordered: bordered,
- row: row
- })))))))));
- };
- if (true) {
- Descriptions.displayName = 'Descriptions';
- }
- Descriptions.Item = descriptions_Item;
- /* harmony default export */ var descriptions = (Descriptions);
- ;// ./node_modules/rc-drawer/es/context.js
- var DrawerContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- var context_RefContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- /* harmony default export */ var rc_drawer_es_context = (DrawerContext);
- ;// ./node_modules/rc-drawer/es/DrawerPanel.js
- var DrawerPanel_excluded = ["prefixCls", "className", "containerRef"];
- var DrawerPanel = function DrawerPanel(props) {
- var prefixCls = props.prefixCls,
- className = props.className,
- containerRef = props.containerRef,
- restProps = (0,objectWithoutProperties["default"])(props, DrawerPanel_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_RefContext),
- panelRef = _React$useContext.panel;
- var mergedRef = (0,es_ref.useComposeRef)(panelRef, containerRef);
- // =============================== Render ===============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-content"), className),
- role: "dialog",
- ref: mergedRef
- }, (0,pickAttrs["default"])(props, {
- aria: true
- }), {
- "aria-modal": "true"
- }, restProps));
- };
- if (true) {
- DrawerPanel.displayName = 'DrawerPanel';
- }
- /* harmony default export */ var es_DrawerPanel = (DrawerPanel);
- ;// ./node_modules/rc-drawer/es/util.js
- function parseWidthHeight(value) {
- if (typeof value === 'string' && String(Number(value)) === value) {
- (0,warning["default"])(false, 'Invalid value type of `width` or `height` which should be number type instead.');
- return Number(value);
- }
- return value;
- }
- function warnCheck(props) {
- (0,warning["default"])(!('wrapperClassName' in props), "'wrapperClassName' is removed. Please use 'rootClassName' instead.");
- (0,warning["default"])((0,canUseDom["default"])() || !props.open, "Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.");
- }
- ;// ./node_modules/rc-drawer/es/DrawerPopup.js
- var DrawerPopup_sentinelStyle = {
- width: 0,
- height: 0,
- overflow: 'hidden',
- outline: 'none',
- position: 'absolute'
- };
- function DrawerPopup(props, ref) {
- var _ref, _pushConfig$distance, _pushConfig;
- var prefixCls = props.prefixCls,
- open = props.open,
- placement = props.placement,
- inline = props.inline,
- push = props.push,
- forceRender = props.forceRender,
- autoFocus = props.autoFocus,
- keyboard = props.keyboard,
- drawerClassNames = props.classNames,
- rootClassName = props.rootClassName,
- rootStyle = props.rootStyle,
- zIndex = props.zIndex,
- className = props.className,
- id = props.id,
- style = props.style,
- motion = props.motion,
- width = props.width,
- height = props.height,
- children = props.children,
- mask = props.mask,
- maskClosable = props.maskClosable,
- maskMotion = props.maskMotion,
- maskClassName = props.maskClassName,
- maskStyle = props.maskStyle,
- afterOpenChange = props.afterOpenChange,
- onClose = props.onClose,
- onMouseEnter = props.onMouseEnter,
- onMouseOver = props.onMouseOver,
- onMouseLeave = props.onMouseLeave,
- onClick = props.onClick,
- onKeyDown = props.onKeyDown,
- onKeyUp = props.onKeyUp,
- styles = props.styles,
- drawerRender = props.drawerRender;
- // ================================ Refs ================================
- var panelRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var sentinelStartRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var sentinelEndRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return panelRef.current;
- });
- var onPanelKeyDown = function onPanelKeyDown(event) {
- var keyCode = event.keyCode,
- shiftKey = event.shiftKey;
- switch (keyCode) {
- // Tab active
- case KeyCode["default"].TAB:
- {
- if (keyCode === KeyCode["default"].TAB) {
- if (!shiftKey && document.activeElement === sentinelEndRef.current) {
- var _sentinelStartRef$cur;
- (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
- preventScroll: true
- });
- } else if (shiftKey && document.activeElement === sentinelStartRef.current) {
- var _sentinelEndRef$curre;
- (_sentinelEndRef$curre = sentinelEndRef.current) === null || _sentinelEndRef$curre === void 0 || _sentinelEndRef$curre.focus({
- preventScroll: true
- });
- }
- }
- break;
- }
- // Close
- case KeyCode["default"].ESC:
- {
- if (onClose && keyboard) {
- event.stopPropagation();
- onClose(event);
- }
- break;
- }
- }
- };
- // ========================== Control ===========================
- // Auto Focus
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (open && autoFocus) {
- var _panelRef$current;
- (_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 || _panelRef$current.focus({
- preventScroll: true
- });
- }
- }, [open]);
- // ============================ Push ============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- pushed = _React$useState2[0],
- setPushed = _React$useState2[1];
- var parentContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(rc_drawer_es_context);
- // Merge push distance
- var pushConfig;
- if (typeof push === 'boolean') {
- pushConfig = push ? {} : {
- distance: 0
- };
- } else {
- pushConfig = push || {};
- }
- var pushDistance = (_ref = (_pushConfig$distance = (_pushConfig = pushConfig) === null || _pushConfig === void 0 ? void 0 : _pushConfig.distance) !== null && _pushConfig$distance !== void 0 ? _pushConfig$distance : parentContext === null || parentContext === void 0 ? void 0 : parentContext.pushDistance) !== null && _ref !== void 0 ? _ref : 180;
- var mergedContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- pushDistance: pushDistance,
- push: function push() {
- setPushed(true);
- },
- pull: function pull() {
- setPushed(false);
- }
- };
- }, [pushDistance]);
- // ========================= ScrollLock =========================
- // Tell parent to push
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (open) {
- var _parentContext$push;
- parentContext === null || parentContext === void 0 || (_parentContext$push = parentContext.push) === null || _parentContext$push === void 0 || _parentContext$push.call(parentContext);
- } else {
- var _parentContext$pull;
- parentContext === null || parentContext === void 0 || (_parentContext$pull = parentContext.pull) === null || _parentContext$pull === void 0 || _parentContext$pull.call(parentContext);
- }
- }, [open]);
- // Clean up
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- var _parentContext$pull2;
- parentContext === null || parentContext === void 0 || (_parentContext$pull2 = parentContext.pull) === null || _parentContext$pull2 === void 0 || _parentContext$pull2.call(parentContext);
- };
- }, []);
- // ============================ Mask ============================
- var maskNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- key: "mask"
- }, maskMotion, {
- visible: mask && open
- }), function (_ref2, maskRef) {
- var motionMaskClassName = _ref2.className,
- motionMaskStyle = _ref2.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-mask"), motionMaskClassName, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.mask, maskClassName),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, motionMaskStyle), maskStyle), styles === null || styles === void 0 ? void 0 : styles.mask),
- onClick: maskClosable && open ? onClose : undefined,
- ref: maskRef
- });
- });
- // =========================== Panel ============================
- var motionProps = typeof motion === 'function' ? motion(placement) : motion;
- var wrapperStyle = {};
- if (pushed && pushDistance) {
- switch (placement) {
- case 'top':
- wrapperStyle.transform = "translateY(".concat(pushDistance, "px)");
- break;
- case 'bottom':
- wrapperStyle.transform = "translateY(".concat(-pushDistance, "px)");
- break;
- case 'left':
- wrapperStyle.transform = "translateX(".concat(pushDistance, "px)");
- break;
- default:
- wrapperStyle.transform = "translateX(".concat(-pushDistance, "px)");
- break;
- }
- }
- if (placement === 'left' || placement === 'right') {
- wrapperStyle.width = parseWidthHeight(width);
- } else {
- wrapperStyle.height = parseWidthHeight(height);
- }
- var eventHandlers = {
- onMouseEnter: onMouseEnter,
- onMouseOver: onMouseOver,
- onMouseLeave: onMouseLeave,
- onClick: onClick,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp
- };
- var panelNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- key: "panel"
- }, motionProps, {
- visible: open,
- forceRender: forceRender,
- onVisibleChanged: function onVisibleChanged(nextVisible) {
- afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(nextVisible);
- },
- removeOnLeave: false,
- leavedClassName: "".concat(prefixCls, "-content-wrapper-hidden")
- }), function (_ref3, motionRef) {
- var motionClassName = _ref3.className,
- motionStyle = _ref3.style;
- var content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_DrawerPanel, (0,esm_extends["default"])({
- id: id,
- containerRef: motionRef,
- prefixCls: prefixCls,
- className: classnames_default()(className, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.content),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), styles === null || styles === void 0 ? void 0 : styles.content)
- }, (0,pickAttrs["default"])(props, {
- aria: true
- }), eventHandlers), children);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-content-wrapper"), drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.wrapper, motionClassName),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, wrapperStyle), motionStyle), styles === null || styles === void 0 ? void 0 : styles.wrapper)
- }, (0,pickAttrs["default"])(props, {
- data: true
- })), drawerRender ? drawerRender(content) : content);
- });
- // =========================== Render ===========================
- var containerStyle = (0,objectSpread2["default"])({}, rootStyle);
- if (zIndex) {
- containerStyle.zIndex = zIndex;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_drawer_es_context.Provider, {
- value: mergedContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(placement), rootClassName, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-open"), open), "".concat(prefixCls, "-inline"), inline)),
- style: containerStyle,
- tabIndex: -1,
- ref: panelRef,
- onKeyDown: onPanelKeyDown
- }, maskNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- tabIndex: 0,
- ref: sentinelStartRef,
- style: DrawerPopup_sentinelStyle,
- "aria-hidden": "true",
- "data-sentinel": "start"
- }), panelNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- tabIndex: 0,
- ref: sentinelEndRef,
- style: DrawerPopup_sentinelStyle,
- "aria-hidden": "true",
- "data-sentinel": "end"
- })));
- }
- var RefDrawerPopup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DrawerPopup);
- if (true) {
- RefDrawerPopup.displayName = 'DrawerPopup';
- }
- /* harmony default export */ var es_DrawerPopup = (RefDrawerPopup);
- ;// ./node_modules/rc-drawer/es/Drawer.js
- var Drawer = function Drawer(props) {
- var _props$open = props.open,
- open = _props$open === void 0 ? false : _props$open,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-drawer' : _props$prefixCls,
- _props$placement = props.placement,
- placement = _props$placement === void 0 ? 'right' : _props$placement,
- _props$autoFocus = props.autoFocus,
- autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,
- _props$keyboard = props.keyboard,
- keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
- _props$width = props.width,
- width = _props$width === void 0 ? 378 : _props$width,
- _props$mask = props.mask,
- mask = _props$mask === void 0 ? true : _props$mask,
- _props$maskClosable = props.maskClosable,
- maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
- getContainer = props.getContainer,
- forceRender = props.forceRender,
- afterOpenChange = props.afterOpenChange,
- destroyOnClose = props.destroyOnClose,
- onMouseEnter = props.onMouseEnter,
- onMouseOver = props.onMouseOver,
- onMouseLeave = props.onMouseLeave,
- onClick = props.onClick,
- onKeyDown = props.onKeyDown,
- onKeyUp = props.onKeyUp,
- panelRef = props.panelRef;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- animatedVisible = _React$useState2[0],
- setAnimatedVisible = _React$useState2[1];
- // ============================= Warn =============================
- if (true) {
- warnCheck(props);
- }
- // ============================= Open =============================
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- mounted = _React$useState4[0],
- setMounted = _React$useState4[1];
- (0,useLayoutEffect["default"])(function () {
- setMounted(true);
- }, []);
- var mergedOpen = mounted ? open : false;
- // ============================ Focus =============================
- var popupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var lastActiveRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- (0,useLayoutEffect["default"])(function () {
- if (mergedOpen) {
- lastActiveRef.current = document.activeElement;
- }
- }, [mergedOpen]);
- // ============================= Open =============================
- var internalAfterOpenChange = function internalAfterOpenChange(nextVisible) {
- var _popupRef$current;
- setAnimatedVisible(nextVisible);
- afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(nextVisible);
- if (!nextVisible && lastActiveRef.current && !((_popupRef$current = popupRef.current) !== null && _popupRef$current !== void 0 && _popupRef$current.contains(lastActiveRef.current))) {
- var _lastActiveRef$curren;
- (_lastActiveRef$curren = lastActiveRef.current) === null || _lastActiveRef$curren === void 0 || _lastActiveRef$curren.focus({
- preventScroll: true
- });
- }
- };
- // =========================== Context ============================
- var refContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- panel: panelRef
- };
- }, [panelRef]);
- // ============================ Render ============================
- if (!forceRender && !animatedVisible && !mergedOpen && destroyOnClose) {
- return null;
- }
- var eventHandlers = {
- onMouseEnter: onMouseEnter,
- onMouseOver: onMouseOver,
- onMouseLeave: onMouseLeave,
- onClick: onClick,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp
- };
- var drawerPopupProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- open: mergedOpen,
- prefixCls: prefixCls,
- placement: placement,
- autoFocus: autoFocus,
- keyboard: keyboard,
- width: width,
- mask: mask,
- maskClosable: maskClosable,
- inline: getContainer === false,
- afterOpenChange: internalAfterOpenChange,
- ref: popupRef
- }, eventHandlers);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_RefContext.Provider, {
- value: refContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(portal_es, {
- open: mergedOpen || forceRender || animatedVisible,
- autoDestroy: false,
- getContainer: getContainer,
- autoLock: mask && (mergedOpen || animatedVisible)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_DrawerPopup, drawerPopupProps)));
- };
- if (true) {
- Drawer.displayName = 'Drawer';
- }
- /* harmony default export */ var es_Drawer = (Drawer);
- ;// ./node_modules/rc-drawer/es/index.js
- // export this package's api
- /* harmony default export */ var rc_drawer_es = (es_Drawer);
- ;// ./components/drawer/DrawerPanel.tsx
- const DrawerPanel_DrawerPanel = props => {
- var _a, _b;
- const {
- prefixCls,
- title,
- footer,
- extra,
- loading,
- onClose,
- headerStyle,
- bodyStyle,
- footerStyle,
- children,
- classNames: drawerClassNames,
- styles: drawerStyles
- } = props;
- const drawerContext = (0,config_provider_context.useComponentConfig)('drawer');
- const customCloseIconRender = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(icon => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- onClick: onClose,
- className: `${prefixCls}-close`
- }, icon)), [onClose]);
- const [mergedClosable, mergedCloseIcon] = useClosable(pickClosable(props), pickClosable(drawerContext), {
- closable: true,
- closeIconRender: customCloseIconRender
- });
- const headerNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- if (!title && !mergedClosable) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: Object.assign(Object.assign(Object.assign({}, (_a = drawerContext.styles) === null || _a === void 0 ? void 0 : _a.header), headerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.header),
- className: classnames_default()(`${prefixCls}-header`, {
- [`${prefixCls}-header-close-only`]: mergedClosable && !title && !extra
- }, (_b = drawerContext.classNames) === null || _b === void 0 ? void 0 : _b.header, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.header)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-header-title`
- }, mergedCloseIcon, title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-title`
- }, title)), extra && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-extra`
- }, extra));
- }, [mergedClosable, mergedCloseIcon, extra, headerStyle, prefixCls, title]);
- const footerNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- if (!footer) {
- return null;
- }
- const footerClassName = `${prefixCls}-footer`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(footerClassName, (_a = drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.footer, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.footer),
- style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext.styles) === null || _b === void 0 ? void 0 : _b.footer), footerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.footer)
- }, footer);
- }, [footer, footerStyle, prefixCls]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, headerNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-body`, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.body, (_a = drawerContext.classNames) === null || _a === void 0 ? void 0 : _a.body),
- style: Object.assign(Object.assign(Object.assign({}, (_b = drawerContext.styles) === null || _b === void 0 ? void 0 : _b.body), bodyStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.body)
- }, loading ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton, {
- active: true,
- title: false,
- paragraph: {
- rows: 5
- },
- className: `${prefixCls}-body-skeleton`
- })) : children), footerNode);
- };
- /* harmony default export */ var drawer_DrawerPanel = (DrawerPanel_DrawerPanel);
- // EXTERNAL MODULE: ./components/drawer/style/index.ts + 1 modules
- var drawer_style = __webpack_require__("./components/drawer/style/index.ts");
- ;// ./components/drawer/index.tsx
- var drawer_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const _SizeTypes = ['default', 'large'];
- const defaultPushState = {
- distance: 180
- };
- const drawer_Drawer = props => {
- var _a;
- const {
- rootClassName,
- width,
- height,
- size = 'default',
- mask = true,
- push = defaultPushState,
- open,
- afterOpenChange,
- onClose,
- prefixCls: customizePrefixCls,
- getContainer: customizeGetContainer,
- panelRef = null,
- style,
- className,
- // Deprecated
- visible,
- afterVisibleChange,
- maskStyle,
- drawerStyle,
- contentWrapperStyle,
- destroyOnClose,
- destroyOnHidden
- } = props,
- rest = drawer_rest(props, ["rootClassName", "width", "height", "size", "mask", "push", "open", "afterOpenChange", "onClose", "prefixCls", "getContainer", "panelRef", "style", "className", "visible", "afterVisibleChange", "maskStyle", "drawerStyle", "contentWrapperStyle", "destroyOnClose", "destroyOnHidden"]);
- const {
- getPopupContainer,
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('drawer');
- const prefixCls = getPrefixCls('drawer', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,drawer_style["default"])(prefixCls);
- const getContainer =
- // 有可能为 false,所以不能直接判断
- customizeGetContainer === undefined && getPopupContainer ? () => getPopupContainer(document.body) : customizeGetContainer;
- const drawerClassName = classnames_default()({
- 'no-mask': !mask,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, rootClassName, hashId, cssVarCls);
- // ========================== Warning ===========================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Drawer');
- [['visible', 'open'], ['afterVisibleChange', 'afterOpenChange'], ['headerStyle', 'styles.header'], ['bodyStyle', 'styles.body'], ['footerStyle', 'styles.footer'], ['contentWrapperStyle', 'styles.wrapper'], ['maskStyle', 'styles.mask'], ['drawerStyle', 'styles.content'], ['destroyInactivePanel', 'destroyOnHidden']].forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
- });
- if (getContainer !== undefined && ((_a = props.style) === null || _a === void 0 ? void 0 : _a.position) === 'absolute') {
- true ? warning(false, 'breaking', '`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.') : 0;
- }
- }
- // ============================ Size ============================
- const mergedWidth = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => width !== null && width !== void 0 ? width : size === 'large' ? 736 : 378, [width, size]);
- const mergedHeight = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => height !== null && height !== void 0 ? height : size === 'large' ? 736 : 378, [height, size]);
- // =========================== Motion ===========================
- const maskMotion = {
- motionName: (0,_util_motion.getTransitionName)(prefixCls, 'mask-motion'),
- motionAppear: true,
- motionEnter: true,
- motionLeave: true,
- motionDeadline: 500
- };
- const panelMotion = motionPlacement => ({
- motionName: (0,_util_motion.getTransitionName)(prefixCls, `panel-motion-${motionPlacement}`),
- motionAppear: true,
- motionEnter: true,
- motionLeave: true,
- motionDeadline: 500
- });
- // ============================ Refs ============================
- // Select `ant-drawer-content` by `panelRef`
- const innerPanelRef = usePanelRef();
- const mergedPanelRef = (0,es_ref.composeRef)(panelRef, innerPanelRef);
- // ============================ zIndex ============================
- const [zIndex, contextZIndex] = (0,useZIndex.useZIndex)('Drawer', rest.zIndex);
- // =========================== Render ===========================
- const {
- classNames: propClassNames = {},
- styles: propStyles = {}
- } = rest;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ContextIsolator, {
- form: true,
- space: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(zindexContext["default"].Provider, {
- value: contextZIndex
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_drawer_es, Object.assign({
- prefixCls: prefixCls,
- onClose: onClose,
- maskMotion: maskMotion,
- motion: panelMotion
- }, rest, {
- classNames: {
- mask: classnames_default()(propClassNames.mask, contextClassNames.mask),
- content: classnames_default()(propClassNames.content, contextClassNames.content),
- wrapper: classnames_default()(propClassNames.wrapper, contextClassNames.wrapper)
- },
- styles: {
- mask: Object.assign(Object.assign(Object.assign({}, propStyles.mask), maskStyle), contextStyles.mask),
- content: Object.assign(Object.assign(Object.assign({}, propStyles.content), drawerStyle), contextStyles.content),
- wrapper: Object.assign(Object.assign(Object.assign({}, propStyles.wrapper), contentWrapperStyle), contextStyles.wrapper)
- },
- open: open !== null && open !== void 0 ? open : visible,
- mask: mask,
- push: push,
- width: mergedWidth,
- height: mergedHeight,
- style: Object.assign(Object.assign({}, contextStyle), style),
- className: classnames_default()(contextClassName, className),
- rootClassName: drawerClassName,
- getContainer: getContainer,
- afterOpenChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
- panelRef: mergedPanelRef,
- zIndex: zIndex,
- // TODO: In the future, destroyOnClose in rc-drawer needs to be upgrade to destroyOnHidden
- destroyOnClose: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyOnClose
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(drawer_DrawerPanel, Object.assign({
- prefixCls: prefixCls
- }, rest, {
- onClose: onClose
- }))))));
- };
- /** @private Internal Component. Do not use in your production. */
- const drawer_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- style,
- className,
- placement = 'right'
- } = props,
- restProps = drawer_rest(props, ["prefixCls", "style", "className", "placement"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('drawer', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,drawer_style["default"])(prefixCls);
- const cls = classnames_default()(prefixCls, `${prefixCls}-pure`, `${prefixCls}-${placement}`, hashId, cssVarCls, className);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: cls,
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(drawer_DrawerPanel, Object.assign({
- prefixCls: prefixCls
- }, restProps))));
- };
- drawer_Drawer._InternalPanelDoNotUseOrYouWillBeFired = drawer_PurePanel;
- if (true) {
- drawer_Drawer.displayName = 'Drawer';
- }
- /* harmony default export */ var drawer = (drawer_Drawer);
- ;// ./components/_util/gapSize.ts
- function isPresetSize(size) {
- return ['small', 'middle', 'large'].includes(size);
- }
- function isValidGapNumber(size) {
- if (!size) {
- // The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
- return false;
- }
- return typeof size === 'number' && !Number.isNaN(size);
- }
- ;// ./components/space/context.ts
- const SpaceContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({
- latestIndex: 0
- });
- const SpaceContextProvider = SpaceContext.Provider;
- ;// ./components/space/Item.tsx
- const space_Item_Item = ({
- className,
- index,
- children,
- split,
- style
- }) => {
- const {
- latestIndex
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(SpaceContext);
- if (children === null || children === undefined) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className,
- style: style
- }, children), index < latestIndex && split && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${className}-split`
- }, split));
- };
- /* harmony default export */ var space_Item = (space_Item_Item);
- ;// ./components/space/index.tsx
- var space_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalSpace = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a;
- const {
- getPrefixCls,
- direction: directionConfig,
- size: contextSize,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('space');
- const {
- size = contextSize !== null && contextSize !== void 0 ? contextSize : 'small',
- align,
- className,
- rootClassName,
- children,
- direction = 'horizontal',
- prefixCls: customizePrefixCls,
- split,
- style,
- wrap = false,
- classNames: customClassNames,
- styles
- } = props,
- otherProps = space_rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
- const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
- const isPresetVerticalSize = isPresetSize(verticalSize);
- const isPresetHorizontalSize = isPresetSize(horizontalSize);
- const isValidVerticalSize = isValidGapNumber(verticalSize);
- const isValidHorizontalSize = isValidGapNumber(horizontalSize);
- const childNodes = (0,toArray["default"])(children, {
- keepEmpty: true
- });
- const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
- const prefixCls = getPrefixCls('space', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,space_style["default"])(prefixCls);
- const cls = classnames_default()(prefixCls, contextClassName, hashId, `${prefixCls}-${direction}`, {
- [`${prefixCls}-rtl`]: directionConfig === 'rtl',
- [`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
- [`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
- [`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
- }, className, rootClassName, cssVarCls);
- const itemClassName = classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : contextClassNames.item);
- // Calculate latest one
- let latestIndex = 0;
- const nodes = childNodes.map((child, i) => {
- var _a;
- if (child !== null && child !== undefined) {
- latestIndex = i;
- }
- const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(space_Item, {
- className: itemClassName,
- key: key,
- index: i,
- split: split,
- style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : contextStyles.item
- }, child);
- });
- const spaceContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- latestIndex
- }), [latestIndex]);
- // =========================== Render ===========================
- if (childNodes.length === 0) {
- return null;
- }
- const gapStyle = {};
- if (wrap) {
- gapStyle.flexWrap = 'wrap';
- }
- if (!isPresetHorizontalSize && isValidHorizontalSize) {
- gapStyle.columnGap = horizontalSize;
- }
- if (!isPresetVerticalSize && isValidVerticalSize) {
- gapStyle.rowGap = verticalSize;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- ref: ref,
- className: cls,
- style: Object.assign(Object.assign(Object.assign({}, gapStyle), contextStyle), style)
- }, otherProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SpaceContextProvider, {
- value: spaceContext
- }, nodes)));
- });
- const Space = InternalSpace;
- Space.Compact = space_Compact;
- if (true) {
- Space.displayName = 'Space';
- }
- /* harmony default export */ var space = (Space);
- ;// ./components/dropdown/dropdown-button.tsx
- var dropdown_button_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const DropdownButton = props => {
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- type = 'default',
- danger,
- disabled,
- loading,
- onClick,
- htmlType,
- children,
- className,
- menu,
- arrow,
- autoFocus,
- overlay,
- trigger,
- align,
- open,
- onOpenChange,
- placement,
- getPopupContainer,
- href,
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EllipsisOutlined, null),
- title,
- buttonsRender = buttons => buttons,
- mouseEnterDelay,
- mouseLeaveDelay,
- overlayClassName,
- overlayStyle,
- destroyOnHidden,
- destroyPopupOnHide,
- dropdownRender,
- popupRender
- } = props,
- restProps = dropdown_button_rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyOnHidden", "destroyPopupOnHide", "dropdownRender", "popupRender"]);
- const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
- const buttonPrefixCls = `${prefixCls}-button`;
- const mergedPopupRender = popupRender || dropdownRender;
- const dropdownProps = {
- menu,
- arrow,
- autoFocus,
- align,
- disabled,
- trigger: disabled ? [] : trigger,
- onOpenChange,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- mouseEnterDelay,
- mouseLeaveDelay,
- overlayClassName,
- overlayStyle,
- destroyOnHidden,
- popupRender: mergedPopupRender
- };
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const classes = classnames_default()(buttonPrefixCls, compactItemClassnames, className);
- if ('destroyPopupOnHide' in props) {
- dropdownProps.destroyPopupOnHide = destroyPopupOnHide;
- }
- if ('overlay' in props) {
- dropdownProps.overlay = overlay;
- }
- if ('open' in props) {
- dropdownProps.open = open;
- }
- if ('placement' in props) {
- dropdownProps.placement = placement;
- } else {
- dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
- }
- const leftButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: type,
- danger: danger,
- disabled: disabled,
- loading: loading,
- onClick: onClick,
- htmlType: htmlType,
- href: href,
- title: title
- }, children);
- const rightButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: type,
- danger: danger,
- icon: icon
- });
- const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(space.Compact, Object.assign({
- className: classes,
- size: compactSize,
- block: true
- }, restProps), leftButtonToRender, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(dropdown, Object.assign({}, dropdownProps), rightButtonToRender));
- };
- DropdownButton.__ANT_BUTTON = true;
- /* harmony default export */ var dropdown_button = (DropdownButton);
- ;// ./components/dropdown/index.tsx
- const components_dropdown_Dropdown = dropdown;
- components_dropdown_Dropdown.Button = dropdown_button;
- /* harmony default export */ var components_dropdown = (components_dropdown_Dropdown);
- // EXTERNAL MODULE: ./components/flex/style/index.ts
- var flex_style = __webpack_require__("./components/flex/style/index.ts");
- // EXTERNAL MODULE: ./components/flex/utils.ts
- var utils = __webpack_require__("./components/flex/utils.ts");
- ;// ./components/flex/index.tsx
- var flex_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Flex = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- rootClassName,
- className,
- style,
- flex,
- gap,
- vertical = false,
- component: Component = 'div'
- } = props,
- othersProps = flex_rest(props, ["prefixCls", "rootClassName", "className", "style", "flex", "gap", "vertical", "component"]);
- const {
- flex: ctxFlex,
- direction: ctxDirection,
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('flex', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,flex_style["default"])(prefixCls);
- const mergedVertical = vertical !== null && vertical !== void 0 ? vertical : ctxFlex === null || ctxFlex === void 0 ? void 0 : ctxFlex.vertical;
- const mergedCls = classnames_default()(className, rootClassName, ctxFlex === null || ctxFlex === void 0 ? void 0 : ctxFlex.className, prefixCls, hashId, cssVarCls, (0,utils["default"])(prefixCls, props), {
- [`${prefixCls}-rtl`]: ctxDirection === 'rtl',
- [`${prefixCls}-gap-${gap}`]: isPresetSize(gap),
- [`${prefixCls}-vertical`]: mergedVertical
- });
- const mergedStyle = Object.assign(Object.assign({}, ctxFlex === null || ctxFlex === void 0 ? void 0 : ctxFlex.style), style);
- if (flex) {
- mergedStyle.flex = flex;
- }
- if (gap && !isPresetSize(gap)) {
- mergedStyle.gap = gap;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Component, Object.assign({
- ref: ref,
- className: mergedCls,
- style: mergedStyle
- }, (0,omit["default"])(othersProps, ['justify', 'wrap', 'align']))));
- });
- if (true) {
- Flex.displayName = 'Flex';
- }
- /* harmony default export */ var flex = (Flex);
- ;// ./components/float-button/context.ts
- const FloatButtonGroupContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext(undefined);
- const {
- Provider: FloatButtonGroupProvider
- } = FloatButtonGroupContext;
- /* harmony default export */ var float_button_context = (FloatButtonGroupContext);
- ;// ./components/_util/convertToTooltipProps.ts
- function convertToTooltipProps(tooltip) {
- // isNil
- if (tooltip === undefined || tooltip === null) {
- return null;
- }
- if (typeof tooltip === 'object' && ! /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(tooltip)) {
- return tooltip;
- }
- return {
- title: tooltip
- };
- }
- /* harmony default export */ var _util_convertToTooltipProps = (convertToTooltipProps);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FileTextOutlined.js
- // This icon file is generated automatically.
- var FileTextOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z" } }] }, "name": "file-text", "theme": "outlined" };
- /* harmony default export */ var asn_FileTextOutlined = (FileTextOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/FileTextOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FileTextOutlined_FileTextOutlined = function FileTextOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FileTextOutlined
- }));
- };
- /** */
- var FileTextOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FileTextOutlined_FileTextOutlined);
- if (true) {
- FileTextOutlined_RefIcon.displayName = 'FileTextOutlined';
- }
- /* harmony default export */ var icons_FileTextOutlined = (FileTextOutlined_RefIcon);
- ;// ./components/float-button/FloatButtonContent.tsx
- var FloatButtonContent_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const FloatButtonContent = props => {
- const {
- icon,
- description,
- prefixCls,
- className
- } = props,
- rest = FloatButtonContent_rest(props, ["icon", "description", "prefixCls", "className"]);
- const defaultElement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-icon`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_FileTextOutlined, null));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({}, rest, {
- className: classnames_default()(className, `${prefixCls}-content`)
- }), icon || description ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, icon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-icon`
- }, icon), description && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-description`
- }, description))) : defaultElement);
- };
- /* harmony default export */ var float_button_FloatButtonContent = (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.memo)(FloatButtonContent));
- // EXTERNAL MODULE: ./components/float-button/style/index.ts + 2 modules
- var float_button_style = __webpack_require__("./components/float-button/style/index.ts");
- ;// ./components/float-button/FloatButton.tsx
- var FloatButton_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const floatButtonPrefixCls = 'float-btn';
- const InternalFloatButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- type = 'default',
- shape = 'circle',
- icon,
- description,
- tooltip,
- htmlType = 'button',
- badge = {}
- } = props,
- restProps = FloatButton_rest(props, ["prefixCls", "className", "rootClassName", "style", "type", "shape", "icon", "description", "tooltip", "htmlType", "badge"]);
- const {
- getPrefixCls,
- direction
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const groupShape = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(float_button_context);
- const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,float_button_style["default"])(prefixCls, rootCls);
- const mergedShape = groupShape || shape;
- const classString = classnames_default()(hashId, cssVarCls, rootCls, prefixCls, className, rootClassName, `${prefixCls}-${type}`, `${prefixCls}-${mergedShape}`, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- });
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('FloatButton', style === null || style === void 0 ? void 0 : style.zIndex);
- const mergedStyle = Object.assign(Object.assign({}, style), {
- zIndex
- });
- // 虽然在 ts 中已经 omit 过了,但是为了防止多余的属性被透传进来,这里再 omit 一遍,以防万一
- const badgeProps = (0,omit["default"])(badge, ['title', 'children', 'status', 'text']);
- let buttonNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-body`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(float_button_FloatButtonContent, {
- prefixCls: prefixCls,
- description: description,
- icon: icon
- }));
- if ('badge' in props) {
- buttonNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_badge, Object.assign({}, badgeProps), buttonNode);
- }
- // ============================ Tooltip ============================
- const tooltipProps = _util_convertToTooltipProps(tooltip);
- if (tooltipProps) {
- buttonNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_tooltip, Object.assign({}, tooltipProps), buttonNode);
- }
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('FloatButton');
- true ? warning(!(mergedShape === 'circle' && description), 'usage', 'supported only when `shape` is `square`. Due to narrow space for text, short sentence is recommended.') : 0;
- }
- return wrapCSSVar(props.href ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", Object.assign({
- ref: ref
- }, restProps, {
- className: classString,
- style: mergedStyle
- }), buttonNode)) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", Object.assign({
- ref: ref
- }, restProps, {
- className: classString,
- style: mergedStyle,
- type: htmlType
- }), buttonNode)));
- });
- const FloatButton = InternalFloatButton;
- if (true) {
- FloatButton.displayName = 'FloatButton';
- }
- /* harmony default export */ var float_button_FloatButton = (FloatButton);
- ;// ./components/float-button/BackTop.tsx
- var BackTop_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const defaultIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_VerticalAlignTopOutlined, null);
- const BackTop_BackTop = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- var _a;
- const {
- backTopIcon: contextIcon
- } = (0,config_provider_context.useComponentConfig)('floatButton');
- const {
- prefixCls: customizePrefixCls,
- className,
- type = 'default',
- shape = 'circle',
- visibilityHeight = 400,
- icon,
- target,
- onClick,
- duration = 450
- } = props,
- restProps = BackTop_rest(props, ["prefixCls", "className", "type", "shape", "visibilityHeight", "icon", "target", "onClick", "duration"]);
- const mergedIcon = (_a = icon !== null && icon !== void 0 ? icon : contextIcon) !== null && _a !== void 0 ? _a : defaultIcon;
- const [visible, setVisible] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(visibilityHeight === 0);
- const internalRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => ({
- nativeElement: internalRef.current
- }));
- const getDefaultTarget = () => {
- var _a;
- return ((_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) || window;
- };
- const handleScroll = _util_throttleByAnimationFrame(e => {
- const scrollTop = _util_getScroll(e.target);
- setVisible(scrollTop >= visibilityHeight);
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- const getTarget = target || getDefaultTarget;
- const container = getTarget();
- handleScroll({
- target: container
- });
- container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);
- return () => {
- handleScroll.cancel();
- container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);
- };
- }, [target]);
- const scrollToTop = e => {
- scrollTo(0, {
- getContainer: target || getDefaultTarget,
- duration
- });
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
- };
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const groupShape = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(float_button_context);
- const mergedShape = groupShape || shape;
- const contentProps = Object.assign({
- prefixCls,
- icon: mergedIcon,
- type,
- shape: mergedShape
- }, restProps);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_motion_es["default"], {
- visible: visible,
- motionName: `${rootPrefixCls}-fade`
- }, ({
- className: motionClassName
- }, setRef) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(float_button_FloatButton, Object.assign({
- ref: (0,es_ref.composeRef)(internalRef, setRef)
- }, contentProps, {
- onClick: scrollToTop,
- className: classnames_default()(className, motionClassName)
- }))));
- });
- if (true) {
- BackTop_BackTop.displayName = 'BackTop';
- }
- /* harmony default export */ var float_button_BackTop = (BackTop_BackTop);
- ;// ./components/float-button/FloatButtonGroup.tsx
- var FloatButtonGroup_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const FloatButtonGroup = props => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- className,
- style,
- shape = 'circle',
- type = 'default',
- placement = 'top',
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_FileTextOutlined, null),
- closeIcon,
- description,
- trigger,
- children,
- onOpenChange,
- open: customOpen,
- onClick: onTriggerButtonClick
- } = props,
- floatButtonProps = FloatButtonGroup_rest(props, ["prefixCls", "className", "style", "shape", "type", "placement", "icon", "closeIcon", "description", "trigger", "children", "onOpenChange", "open", "onClick"]);
- const {
- direction,
- getPrefixCls,
- closeIcon: contextCloseIcon
- } = (0,config_provider_context.useComponentConfig)('floatButtonGroup');
- const mergedCloseIcon = (_a = closeIcon !== null && closeIcon !== void 0 ? closeIcon : contextCloseIcon) !== null && _a !== void 0 ? _a : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_CloseOutlined, null);
- const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,float_button_style["default"])(prefixCls, rootCls);
- const groupPrefixCls = `${prefixCls}-group`;
- const isMenuMode = trigger && ['click', 'hover'].includes(trigger);
- const isValidPlacement = placement && ['top', 'left', 'right', 'bottom'].includes(placement);
- const groupCls = classnames_default()(groupPrefixCls, hashId, cssVarCls, rootCls, className, {
- [`${groupPrefixCls}-rtl`]: direction === 'rtl',
- [`${groupPrefixCls}-${shape}`]: shape,
- [`${groupPrefixCls}-${shape}-shadow`]: !isMenuMode,
- [`${groupPrefixCls}-${placement}`]: isMenuMode && isValidPlacement // 只有菜单模式才支持弹出方向
- });
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('FloatButton', style === null || style === void 0 ? void 0 : style.zIndex);
- const mergedStyle = Object.assign(Object.assign({}, style), {
- zIndex
- });
- const wrapperCls = classnames_default()(hashId, `${groupPrefixCls}-wrap`);
- const [open, setOpen] = (0,useMergedState["default"])(false, {
- value: customOpen
- });
- const floatButtonGroupRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- // ========================== Open ==========================
- const hoverTrigger = trigger === 'hover';
- const clickTrigger = trigger === 'click';
- const triggerOpen = (0,useEvent["default"])(nextOpen => {
- if (open !== nextOpen) {
- setOpen(nextOpen);
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
- }
- });
- // ===================== Trigger: Hover =====================
- const onMouseEnter = () => {
- if (hoverTrigger) {
- triggerOpen(true);
- }
- };
- const onMouseLeave = () => {
- if (hoverTrigger) {
- triggerOpen(false);
- }
- };
- // ===================== Trigger: Click =====================
- const onInternalTriggerButtonClick = e => {
- if (clickTrigger) {
- triggerOpen(!open);
- }
- onTriggerButtonClick === null || onTriggerButtonClick === void 0 ? void 0 : onTriggerButtonClick(e);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(() => {
- if (clickTrigger) {
- const onDocClick = e => {
- var _a;
- // Skip if click on the group
- if ((_a = floatButtonGroupRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
- return;
- }
- triggerOpen(false);
- };
- document.addEventListener('click', onDocClick, {
- capture: true
- });
- return () => document.removeEventListener('click', onDocClick, {
- capture: true
- });
- }
- }, [clickTrigger]);
- // ======================== Warning =========================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('FloatButton.Group');
- true ? warning(!('open' in props) || !!trigger, 'usage', '`open` need to be used together with `trigger`') : 0;
- }
- // ========================= Render =========================
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(FloatButtonGroupProvider, {
- value: shape
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: floatButtonGroupRef,
- className: groupCls,
- style: mergedStyle,
- // Hover trigger
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave
- }, isMenuMode ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_motion_es["default"], {
- visible: open,
- motionName: `${groupPrefixCls}-wrap`
- }, ({
- className: motionClassName
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(motionClassName, wrapperCls)
- }, children))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(float_button_FloatButton, Object.assign({
- type: type,
- icon: open ? mergedCloseIcon : icon,
- description: description,
- "aria-label": props['aria-label'],
- className: `${groupPrefixCls}-trigger`,
- onClick: onInternalTriggerButtonClick
- }, floatButtonProps)))) : children)));
- };
- /* harmony default export */ var float_button_FloatButtonGroup = (FloatButtonGroup);
- ;// ./components/float-button/PurePanel.tsx
- var float_button_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- /* eslint-disable react/no-array-index-key */
- const PureFloatButton = _a => {
- var {
- backTop
- } = _a,
- props = float_button_PurePanel_rest(_a, ["backTop"]);
- return backTop ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(float_button_BackTop, Object.assign({}, props, {
- visibilityHeight: 0
- })) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(float_button_FloatButton, Object.assign({}, props));
- };
- /** @private Internal Component. Do not use in your production. */
- const float_button_PurePanel_PurePanel = _a => {
- var {
- className,
- items
- } = _a,
- props = float_button_PurePanel_rest(_a, ["className", "items"]);
- const {
- prefixCls: customizePrefixCls
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
- const pureCls = `${prefixCls}-pure`;
- if (items) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(float_button_FloatButtonGroup, Object.assign({
- className: classnames_default()(className, pureCls)
- }, props), items.map((item, index) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PureFloatButton, Object.assign({
- key: index
- }, item)))));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PureFloatButton, Object.assign({
- className: classnames_default()(className, pureCls)
- }, props));
- };
- /* harmony default export */ var float_button_PurePanel = (float_button_PurePanel_PurePanel);
- ;// ./components/float-button/index.tsx
- float_button_FloatButton.BackTop = float_button_BackTop;
- float_button_FloatButton.Group = float_button_FloatButtonGroup;
- float_button_FloatButton._InternalPanelDoNotUseOrYouWillBeFired = float_button_PurePanel;
- /* harmony default export */ var float_button = (float_button_FloatButton);
- ;// ./components/form/hooks/useDebounce.ts
- function useDebounce(value) {
- const [cacheValue, setCacheValue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(value);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const timeout = setTimeout(() => {
- setCacheValue(value);
- }, value.length ? 0 : 10);
- return () => {
- clearTimeout(timeout);
- };
- }, [value]);
- return cacheValue;
- }
- // EXTERNAL MODULE: ./components/form/style/index.ts + 1 modules
- var form_style = __webpack_require__("./components/form/style/index.ts");
- ;// ./components/form/ErrorList.tsx
- const ErrorList_EMPTY_LIST = [];
- function toErrorEntity(error, prefix, errorStatus, index = 0) {
- return {
- key: typeof error === 'string' ? error : `${prefix}-${index}`,
- error,
- errorStatus
- };
- }
- const ErrorList = ({
- help,
- helpStatus,
- errors = ErrorList_EMPTY_LIST,
- warnings = ErrorList_EMPTY_LIST,
- className: rootClassName,
- fieldId,
- onVisibleChanged
- }) => {
- const {
- prefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemPrefixContext);
- const baseClassName = `${prefixCls}-item-explain`;
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,form_style["default"])(prefixCls, rootCls);
- const collapseMotion = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => (0,_util_motion["default"])(prefixCls), [prefixCls]);
- // We have to debounce here again since somewhere use ErrorList directly still need no shaking
- // ref: https://github.com/ant-design/ant-design/issues/36336
- const debounceErrors = useDebounce(errors);
- const debounceWarnings = useDebounce(warnings);
- const fullKeyList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (help !== undefined && help !== null) {
- return [toErrorEntity(help, 'help', helpStatus)];
- }
- return [].concat((0,toConsumableArray["default"])(debounceErrors.map((error, index) => toErrorEntity(error, 'error', 'error', index))), (0,toConsumableArray["default"])(debounceWarnings.map((warning, index) => toErrorEntity(warning, 'warning', 'warning', index))));
- }, [help, helpStatus, debounceErrors, debounceWarnings]);
- const filledKeyFullKeyList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const keysCount = {};
- fullKeyList.forEach(({
- key
- }) => {
- keysCount[key] = (keysCount[key] || 0) + 1;
- });
- return fullKeyList.map((entity, index) => Object.assign(Object.assign({}, entity), {
- key: keysCount[entity.key] > 1 ? `${entity.key}-fallback-${index}` : entity.key
- }));
- }, [fullKeyList]);
- const helpProps = {};
- if (fieldId) {
- helpProps.id = `${fieldId}_help`;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- motionDeadline: collapseMotion.motionDeadline,
- motionName: `${prefixCls}-show-help`,
- visible: !!filledKeyFullKeyList.length,
- onVisibleChanged: onVisibleChanged
- }, holderProps => {
- const {
- className: holderClassName,
- style: holderStyle
- } = holderProps;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, helpProps, {
- className: classnames_default()(baseClassName, holderClassName, cssVarCls, rootCls, rootClassName, hashId),
- style: holderStyle
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es.CSSMotionList, Object.assign({
- keys: filledKeyFullKeyList
- }, (0,_util_motion["default"])(prefixCls), {
- motionName: `${prefixCls}-show-help-item`,
- component: false
- }), itemProps => {
- const {
- key,
- error,
- errorStatus,
- className: itemClassName,
- style: itemStyle
- } = itemProps;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: key,
- className: classnames_default()(itemClassName, {
- [`${baseClassName}-${errorStatus}`]: errorStatus
- }),
- style: itemStyle
- }, error);
- }));
- }));
- };
- /* harmony default export */ var form_ErrorList = (ErrorList);
- ;// ./components/form/hooks/useFormWarning.ts
- const names = {};
- function useFormWarning({
- name
- }) {
- const warning = (0,_util_warning.devUseWarning)('Form');
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (name) {
- names[name] = (names[name] || 0) + 1;
- true ? warning(names[name] <= 1, 'usage', 'There exist multiple Form with same `name`.') : 0;
- return () => {
- names[name] -= 1;
- };
- }
- }, [name]);
- }
- ;// ./components/form/Form.tsx
- var Form_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Form_InternalForm = (props, ref) => {
- const contextDisabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const {
- getPrefixCls,
- direction,
- requiredMark: contextRequiredMark,
- colon: contextColon,
- scrollToFirstError: contextScrollToFirstError,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('form');
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- size,
- disabled = contextDisabled,
- form,
- colon,
- labelAlign,
- labelWrap,
- labelCol,
- wrapperCol,
- hideRequiredMark,
- layout = 'horizontal',
- scrollToFirstError,
- requiredMark,
- onFinishFailed,
- name,
- style,
- feedbackIcons,
- variant
- } = props,
- restFormProps = Form_rest(props, ["prefixCls", "className", "rootClassName", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "style", "feedbackIcons", "variant"]);
- const mergedSize = (0,useSize["default"])(size);
- const contextValidateMessages = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(validateMessagesContext);
- if (true) {
- // eslint-disable-next-line react-hooks/rules-of-hooks
- useFormWarning(props);
- }
- const mergedRequiredMark = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (requiredMark !== undefined) {
- return requiredMark;
- }
- if (hideRequiredMark) {
- return false;
- }
- if (contextRequiredMark !== undefined) {
- return contextRequiredMark;
- }
- return true;
- }, [hideRequiredMark, requiredMark, contextRequiredMark]);
- const mergedColon = colon !== null && colon !== void 0 ? colon : contextColon;
- const prefixCls = getPrefixCls('form', customizePrefixCls);
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,form_style["default"])(prefixCls, rootCls);
- const formClassName = classnames_default()(prefixCls, `${prefixCls}-${layout}`, {
- [`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,
- // todo: remove in next major version
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-${mergedSize}`]: mergedSize
- }, cssVarCls, rootCls, hashId, contextClassName, className, rootClassName);
- const [wrapForm] = useForm_useForm(form);
- const {
- __INTERNAL__
- } = wrapForm;
- __INTERNAL__.name = name;
- const formContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- name,
- labelAlign,
- labelCol,
- labelWrap,
- wrapperCol,
- layout,
- colon: mergedColon,
- requiredMark: mergedRequiredMark,
- itemRef: __INTERNAL__.itemRef,
- form: wrapForm,
- feedbackIcons
- }), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm, feedbackIcons]);
- const nativeElementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => {
- var _a;
- return Object.assign(Object.assign({}, wrapForm), {
- nativeElement: (_a = nativeElementRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement
- });
- });
- const scrollToField = (options, fieldName) => {
- if (options) {
- let defaultScrollToFirstError = {
- block: 'nearest'
- };
- if (typeof options === 'object') {
- defaultScrollToFirstError = Object.assign(Object.assign({}, defaultScrollToFirstError), options);
- }
- wrapForm.scrollToField(fieldName, defaultScrollToFirstError);
- }
- };
- const onInternalFinishFailed = errorInfo => {
- onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errorInfo);
- if (errorInfo.errorFields.length) {
- const fieldName = errorInfo.errorFields[0].name;
- if (scrollToFirstError !== undefined) {
- scrollToField(scrollToFirstError, fieldName);
- return;
- }
- if (contextScrollToFirstError !== undefined) {
- scrollToField(contextScrollToFirstError, fieldName);
- }
- }
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(VariantContext.Provider, {
- value: variant
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DisabledContextProvider, {
- disabled: disabled
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SizeContext["default"].Provider, {
- value: mergedSize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_FormProvider, {
- // This is not list in API, we pass with spread
- validateMessages: contextValidateMessages
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_FormContext.Provider, {
- value: formContextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(NoFormStyle, {
- status: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_field_form_es, Object.assign({
- id: name
- }, restFormProps, {
- name: name,
- onFinishFailed: onInternalFinishFailed,
- form: wrapForm,
- ref: nativeElementRef,
- style: Object.assign(Object.assign({}, contextStyle), style),
- className: formClassName
- })))))))));
- };
- const Form_Form = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Form_InternalForm);
- if (true) {
- Form_Form.displayName = 'Form';
- }
- /* harmony default export */ var form_Form = (Form_Form);
- ;// ./components/form/hooks/useChildren.ts
- function useChildren_useChildren(children) {
- if (typeof children === 'function') {
- return children;
- }
- const childList = (0,toArray["default"])(children);
- return childList.length <= 1 ? childList[0] : childList;
- }
- ;// ./components/form/hooks/useFormItemStatus.ts
- const useFormItemStatus = () => {
- const {
- status,
- errors = [],
- warnings = []
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Form.Item');
- true ? warning(status !== undefined, 'usage', 'Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus') : 0;
- }
- return {
- status,
- errors,
- warnings
- };
- };
- // Only used for compatible package. Not promise this will work on future version.
- useFormItemStatus.Context = FormItemInputContext;
- /* harmony default export */ var hooks_useFormItemStatus = (useFormItemStatus);
- ;// ./components/form/hooks/useFrameState.ts
- function useFrameState(defaultValue) {
- const [value, setValue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(defaultValue);
- const frameRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const batchRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- const destroyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- destroyRef.current = false;
- return () => {
- destroyRef.current = true;
- raf["default"].cancel(frameRef.current);
- frameRef.current = null;
- };
- }, []);
- function setFrameValue(updater) {
- if (destroyRef.current) {
- return;
- }
- if (frameRef.current === null) {
- batchRef.current = [];
- frameRef.current = (0,raf["default"])(() => {
- frameRef.current = null;
- setValue(prevValue => {
- let current = prevValue;
- batchRef.current.forEach(func => {
- current = func(current);
- });
- return current;
- });
- });
- }
- batchRef.current.push(updater);
- }
- return [value, setFrameValue];
- }
- ;// ./components/form/hooks/useItemRef.ts
- function useItemRef() {
- const {
- itemRef
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- const cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- function getRef(name, children) {
- // Outer caller already check the `supportRef`
- const childrenRef = children && typeof children === 'object' && (0,es_ref.getNodeRef)(children);
- const nameStr = name.join('_');
- if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
- cacheRef.current.name = nameStr;
- cacheRef.current.originRef = childrenRef;
- cacheRef.current.ref = (0,es_ref.composeRef)(itemRef(name), childrenRef);
- }
- return cacheRef.current.ref;
- }
- return getRef;
- }
- ;// ./components/grid/hooks/useGutter.ts
- function useGutter(gutter, screens) {
- const results = [undefined, undefined];
- const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, undefined];
- // By default use as `xs`
- const mergedScreens = screens || {
- xs: true,
- sm: true,
- md: true,
- lg: true,
- xl: true,
- xxl: true
- };
- normalizedGutter.forEach((g, index) => {
- if (typeof g === 'object' && g !== null) {
- for (let i = 0; i < responsiveArray.length; i++) {
- const breakpoint = responsiveArray[i];
- if (mergedScreens[breakpoint] && g[breakpoint] !== undefined) {
- results[index] = g[breakpoint];
- break;
- }
- }
- } else {
- results[index] = g;
- }
- });
- return results;
- }
- ;// ./components/grid/row.tsx
- var row_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const _RowAligns = ['top', 'middle', 'bottom', 'stretch'];
- const _RowJustify = ['start', 'end', 'center', 'space-around', 'space-between', 'space-evenly'];
- function useMergedPropByScreen(oriProp, screen) {
- const [prop, setProp] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(typeof oriProp === 'string' ? oriProp : '');
- const calcMergedAlignOrJustify = () => {
- if (typeof oriProp === 'string') {
- setProp(oriProp);
- }
- if (typeof oriProp !== 'object') {
- return;
- }
- for (let i = 0; i < responsiveArray.length; i++) {
- const breakpoint = responsiveArray[i];
- // if do not match, do nothing
- if (!screen || !screen[breakpoint]) {
- continue;
- }
- const curVal = oriProp[breakpoint];
- if (curVal !== undefined) {
- setProp(curVal);
- return;
- }
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- calcMergedAlignOrJustify();
- }, [JSON.stringify(oriProp), screen]);
- return prop;
- }
- const row_Row = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- justify,
- align,
- className,
- style,
- children,
- gutter = 0,
- wrap
- } = props,
- others = row_rest(props, ["prefixCls", "justify", "align", "className", "style", "children", "gutter", "wrap"]);
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const screens = hooks_useBreakpoint(true, null);
- const mergedAlign = useMergedPropByScreen(align, screens);
- const mergedJustify = useMergedPropByScreen(justify, screens);
- const prefixCls = getPrefixCls('row', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,grid_style.useRowStyle)(prefixCls);
- const gutters = useGutter(gutter, screens);
- const classes = classnames_default()(prefixCls, {
- [`${prefixCls}-no-wrap`]: wrap === false,
- [`${prefixCls}-${mergedJustify}`]: mergedJustify,
- [`${prefixCls}-${mergedAlign}`]: mergedAlign,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, hashId, cssVarCls);
- // Add gutter related style
- const rowStyle = {};
- const horizontalGutter = gutters[0] != null && gutters[0] > 0 ? gutters[0] / -2 : undefined;
- if (horizontalGutter) {
- rowStyle.marginLeft = horizontalGutter;
- rowStyle.marginRight = horizontalGutter;
- }
- // "gutters" is a new array in each rendering phase, it'll make 'React.useMemo' effectless.
- // So we deconstruct "gutters" variable here.
- const [gutterH, gutterV] = gutters;
- rowStyle.rowGap = gutterV;
- const rowContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- gutter: [gutterH, gutterV],
- wrap
- }), [gutterH, gutterV, wrap]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(grid_RowContext.Provider, {
- value: rowContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, others, {
- className: classes,
- style: Object.assign(Object.assign({}, rowStyle), style),
- ref: ref
- }), children)));
- });
- if (true) {
- row_Row.displayName = 'Row';
- }
- /* harmony default export */ var row = (row_Row);
- ;// ./components/form/style/fallbackCmp.ts
- /**
- * Fallback of IE.
- * Safe to remove.
- */
- // Style as inline component
- // ============================= Fallback =============================
- const genFallbackStyle = token => {
- const {
- formItemCls
- } = token;
- return {
- '@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)': {
- // Fallback for IE, safe to remove we not support it anymore
- [`${formItemCls}-control`]: {
- display: 'flex'
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var fallbackCmp = ((0,genStyleUtils.genSubStyleComponent)(['Form', 'item-item'], (token, {
- rootPrefixCls
- }) => {
- const formToken = (0,form_style.prepareToken)(token, rootPrefixCls);
- return genFallbackStyle(formToken);
- }));
- ;// ./components/form/FormItemInput.tsx
- var FormItemInput_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const GRID_MAX = 24;
- const FormItemInput = props => {
- const {
- prefixCls,
- status,
- labelCol,
- wrapperCol,
- children,
- errors,
- warnings,
- _internalItemRender: formItemRender,
- extra,
- help,
- fieldId,
- marginBottom,
- onErrorVisibleChanged,
- label
- } = props;
- const baseClassName = `${prefixCls}-item`;
- const formContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- const mergedWrapperCol = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- let mergedWrapper = Object.assign({}, wrapperCol || formContext.wrapperCol || {});
- if (label === null && !labelCol && !wrapperCol && formContext.labelCol) {
- const list = [undefined, 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
- list.forEach(size => {
- const _size = size ? [size] : [];
- const formLabel = (0,rc_util_es.get)(formContext.labelCol, _size);
- const formLabelObj = typeof formLabel === 'object' ? formLabel : {};
- const wrapper = (0,rc_util_es.get)(mergedWrapper, _size);
- const wrapperObj = typeof wrapper === 'object' ? wrapper : {};
- if ('span' in formLabelObj && !('offset' in wrapperObj) && formLabelObj.span < GRID_MAX) {
- mergedWrapper = (0,rc_util_es.set)(mergedWrapper, [].concat(_size, ['offset']), formLabelObj.span);
- }
- });
- }
- return mergedWrapper;
- }, [wrapperCol, formContext]);
- const className = classnames_default()(`${baseClassName}-control`, mergedWrapperCol.className);
- // Pass to sub FormItem should not with col info
- const subFormContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const {
- labelCol,
- wrapperCol
- } = formContext,
- rest = FormItemInput_rest(formContext, ["labelCol", "wrapperCol"]);
- return rest;
- }, [formContext]);
- const extraRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [extraHeight, setExtraHeight] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- (0,useLayoutEffect["default"])(() => {
- if (extra && extraRef.current) {
- setExtraHeight(extraRef.current.clientHeight);
- } else {
- setExtraHeight(0);
- }
- }, [extra]);
- const inputDom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${baseClassName}-control-input`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${baseClassName}-control-input-content`
- }, children));
- const formItemContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- prefixCls,
- status
- }), [prefixCls, status]);
- const errorListDom = marginBottom !== null || errors.length || warnings.length ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemPrefixContext.Provider, {
- value: formItemContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(form_ErrorList, {
- fieldId: fieldId,
- errors: errors,
- warnings: warnings,
- help: help,
- helpStatus: status,
- className: `${baseClassName}-explain-connected`,
- onVisibleChanged: onErrorVisibleChanged
- }))) : null;
- const extraProps = {};
- if (fieldId) {
- extraProps.id = `${fieldId}_extra`;
- }
- // If extra = 0, && will goes wrong
- // 0&&error -> 0
- const extraDom = extra ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, extraProps, {
- className: `${baseClassName}-extra`,
- ref: extraRef
- }), extra)) : null;
- const additionalDom = errorListDom || extraDom ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${baseClassName}-additional`,
- style: marginBottom ? {
- minHeight: marginBottom + extraHeight
- } : {}
- }, errorListDom, extraDom)) : null;
- const dom = formItemRender && formItemRender.mark === 'pro_table_render' && formItemRender.render ? formItemRender.render(props, {
- input: inputDom,
- errorList: errorListDom,
- extra: extraDom
- }) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, inputDom, additionalDom));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_FormContext.Provider, {
- value: subFormContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(col, Object.assign({}, mergedWrapperCol, {
- className: className
- }), dom), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(fallbackCmp, {
- prefixCls: prefixCls
- }));
- };
- /* harmony default export */ var form_FormItemInput = (FormItemInput);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/QuestionCircleOutlined.js
- // This icon file is generated automatically.
- var QuestionCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, "name": "question-circle", "theme": "outlined" };
- /* harmony default export */ var asn_QuestionCircleOutlined = (QuestionCircleOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var QuestionCircleOutlined_QuestionCircleOutlined = function QuestionCircleOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_QuestionCircleOutlined
- }));
- };
- /** */
- var QuestionCircleOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(QuestionCircleOutlined_QuestionCircleOutlined);
- if (true) {
- QuestionCircleOutlined_RefIcon.displayName = 'QuestionCircleOutlined';
- }
- /* harmony default export */ var icons_QuestionCircleOutlined = (QuestionCircleOutlined_RefIcon);
- ;// ./components/form/FormItemLabel.tsx
- var FormItemLabel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const FormItemLabel = ({
- prefixCls,
- label,
- htmlFor,
- labelCol,
- labelAlign,
- colon,
- required,
- requiredMark,
- tooltip,
- vertical
- }) => {
- var _a;
- const [formLocale] = (0,useLocale["default"])('Form');
- const {
- labelAlign: contextLabelAlign,
- labelCol: contextLabelCol,
- labelWrap,
- colon: contextColon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- if (!label) {
- return null;
- }
- const mergedLabelCol = labelCol || contextLabelCol || {};
- const mergedLabelAlign = labelAlign || contextLabelAlign;
- const labelClsBasic = `${prefixCls}-item-label`;
- const labelColClassName = classnames_default()(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {
- [`${labelClsBasic}-wrap`]: !!labelWrap
- });
- let labelChildren = label;
- // Keep label is original where there should have no colon
- const computedColon = colon === true || contextColon !== false && colon !== false;
- const haveColon = computedColon && !vertical;
- // Remove duplicated user input colon
- if (haveColon && typeof label === 'string' && label.trim()) {
- labelChildren = label.replace(/[:|:]\s*$/, '');
- }
- // Tooltip
- const tooltipProps = _util_convertToTooltipProps(tooltip);
- if (tooltipProps) {
- const {
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_QuestionCircleOutlined, null)
- } = tooltipProps,
- restTooltipProps = FormItemLabel_rest(tooltipProps, ["icon"]);
- const tooltipNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({}, restTooltipProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(icon, {
- className: `${prefixCls}-item-tooltip`,
- title: '',
- onClick: e => {
- // Prevent label behavior in tooltip icon
- // https://github.com/ant-design/ant-design/issues/46154
- e.preventDefault();
- },
- tabIndex: null
- }));
- labelChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, labelChildren, tooltipNode);
- }
- // Required Mark
- const isOptionalMark = requiredMark === 'optional';
- const isRenderMark = typeof requiredMark === 'function';
- const hideRequiredMark = requiredMark === false;
- if (isRenderMark) {
- labelChildren = requiredMark(labelChildren, {
- required: !!required
- });
- } else if (isOptionalMark && !required) {
- labelChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, labelChildren, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-item-optional`,
- title: ""
- }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = en_US["default"].Form) === null || _a === void 0 ? void 0 : _a.optional)));
- }
- // https://github.com/ant-design/ant-design/pull/52950#discussion_r1980880316
- let markType;
- if (hideRequiredMark) {
- markType = 'hidden';
- } else if (isOptionalMark || isRenderMark) {
- markType = 'optional';
- }
- const labelClassName = classnames_default()({
- [`${prefixCls}-item-required`]: required,
- [`${prefixCls}-item-required-mark-${markType}`]: markType,
- [`${prefixCls}-item-no-colon`]: !computedColon
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(col, Object.assign({}, mergedLabelCol, {
- className: labelColClassName
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("label", {
- htmlFor: htmlFor,
- className: labelClassName,
- title: typeof label === 'string' ? label : ''
- }, labelChildren));
- };
- /* harmony default export */ var form_FormItemLabel = (FormItemLabel);
- ;// ./components/form/FormItem/StatusProvider.tsx
- const iconMap = {
- success: icons_CheckCircleFilled,
- warning: icons_ExclamationCircleFilled,
- error: icons_CloseCircleFilled,
- validating: icons_LoadingOutlined
- };
- function StatusProvider({
- children,
- errors,
- warnings,
- hasFeedback,
- validateStatus,
- prefixCls,
- meta,
- noStyle,
- name
- }) {
- const itemPrefixCls = `${prefixCls}-item`;
- const {
- feedbackIcons
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);
- const {
- isFormItemInput: parentIsFormItemInput,
- status: parentStatus,
- hasFeedback: parentHasFeedback,
- feedbackIcon: parentFeedbackIcon,
- name: parentName
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- // ====================== Context =======================
- const formItemStatusContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a;
- let feedbackIcon;
- if (hasFeedback) {
- const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;
- const customIconNode = mergedValidateStatus && ((_a = customIcons === null || customIcons === void 0 ? void 0 : customIcons({
- status: mergedValidateStatus,
- errors,
- warnings
- })) === null || _a === void 0 ? void 0 : _a[mergedValidateStatus]);
- const IconNode = mergedValidateStatus && iconMap[mergedValidateStatus];
- feedbackIcon = customIconNode !== false && IconNode ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)
- }, customIconNode || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(IconNode, null))) : null;
- }
- const context = {
- status: mergedValidateStatus || '',
- errors,
- warnings,
- hasFeedback: !!hasFeedback,
- feedbackIcon,
- isFormItemInput: true,
- name
- };
- // No style will follow parent context
- if (noStyle) {
- context.status = (mergedValidateStatus !== null && mergedValidateStatus !== void 0 ? mergedValidateStatus : parentStatus) || '';
- context.isFormItemInput = parentIsFormItemInput;
- context.hasFeedback = !!(hasFeedback !== null && hasFeedback !== void 0 ? hasFeedback : parentHasFeedback);
- context.feedbackIcon = hasFeedback !== undefined ? context.feedbackIcon : parentFeedbackIcon;
- context.name = name !== null && name !== void 0 ? name : parentName;
- }
- return context;
- }, [mergedValidateStatus, hasFeedback, noStyle, parentIsFormItemInput, parentStatus]);
- // ======================= Render =======================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemInputContext.Provider, {
- value: formItemStatusContext
- }, children);
- }
- ;// ./components/form/FormItem/ItemHolder.tsx
- var ItemHolder_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function ItemHolder(props) {
- const {
- prefixCls,
- className,
- rootClassName,
- style,
- help,
- errors,
- warnings,
- validateStatus,
- meta,
- hasFeedback,
- hidden,
- children,
- fieldId,
- required,
- isRequired,
- onSubItemMetaChange,
- layout: propsLayout,
- name
- } = props,
- restProps = ItemHolder_rest(props, ["prefixCls", "className", "rootClassName", "style", "help", "errors", "warnings", "validateStatus", "meta", "hasFeedback", "hidden", "children", "fieldId", "required", "isRequired", "onSubItemMetaChange", "layout", "name"]);
- const itemPrefixCls = `${prefixCls}-item`;
- const {
- requiredMark,
- layout: formLayout
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- const layout = propsLayout || formLayout;
- const vertical = layout === 'vertical';
- // ======================== Margin ========================
- const itemRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const debounceErrors = useDebounce(errors);
- const debounceWarnings = useDebounce(warnings);
- const hasHelp = help !== undefined && help !== null;
- const hasError = !!(hasHelp || errors.length || warnings.length);
- const isOnScreen = !!itemRef.current && isVisible(itemRef.current);
- const [marginBottom, setMarginBottom] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- (0,useLayoutEffect["default"])(() => {
- if (hasError && itemRef.current) {
- // The element must be part of the DOMTree to use getComputedStyle
- // https://stackoverflow.com/questions/35360711/getcomputedstyle-returns-a-cssstyledeclaration-but-all-properties-are-empty-on-a
- const itemStyle = getComputedStyle(itemRef.current);
- setMarginBottom(parseInt(itemStyle.marginBottom, 10));
- }
- }, [hasError, isOnScreen]);
- const onErrorVisibleChanged = nextVisible => {
- if (!nextVisible) {
- setMarginBottom(null);
- }
- };
- // ======================== Status ========================
- const getValidateState = (isDebounce = false) => {
- const _errors = isDebounce ? debounceErrors : meta.errors;
- const _warnings = isDebounce ? debounceWarnings : meta.warnings;
- return getStatus(_errors, _warnings, meta, '', !!hasFeedback, validateStatus);
- };
- const mergedValidateStatus = getValidateState();
- // ======================== Render ========================
- const itemClassName = classnames_default()(itemPrefixCls, className, rootClassName, {
- [`${itemPrefixCls}-with-help`]: hasHelp || debounceErrors.length || debounceWarnings.length,
- // Status
- [`${itemPrefixCls}-has-feedback`]: mergedValidateStatus && hasFeedback,
- [`${itemPrefixCls}-has-success`]: mergedValidateStatus === 'success',
- [`${itemPrefixCls}-has-warning`]: mergedValidateStatus === 'warning',
- [`${itemPrefixCls}-has-error`]: mergedValidateStatus === 'error',
- [`${itemPrefixCls}-is-validating`]: mergedValidateStatus === 'validating',
- [`${itemPrefixCls}-hidden`]: hidden,
- // Layout
- [`${itemPrefixCls}-${layout}`]: layout
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: itemClassName,
- style: style,
- ref: itemRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(row, Object.assign({
- className: `${itemPrefixCls}-row`
- }, (0,omit["default"])(restProps, ['_internalItemRender', 'colon', 'dependencies', 'extra', 'fieldKey', 'getValueFromEvent', 'getValueProps', 'htmlFor', 'id',
- // It is deprecated because `htmlFor` is its replacement.
- 'initialValue', 'isListField', 'label', 'labelAlign', 'labelCol', 'labelWrap', 'messageVariables', 'name', 'normalize', 'noStyle', 'preserve', 'requiredMark', 'rules', 'shouldUpdate', 'trigger', 'tooltip', 'validateFirst', 'validateTrigger', 'valuePropName', 'wrapperCol', 'validateDebounce'])), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(form_FormItemLabel, Object.assign({
- htmlFor: fieldId
- }, props, {
- requiredMark: requiredMark,
- required: required !== null && required !== void 0 ? required : isRequired,
- prefixCls: prefixCls,
- vertical: vertical
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(form_FormItemInput, Object.assign({}, props, meta, {
- errors: debounceErrors,
- warnings: debounceWarnings,
- prefixCls: prefixCls,
- status: mergedValidateStatus,
- help: help,
- marginBottom: marginBottom,
- onErrorVisibleChanged: onErrorVisibleChanged
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(NoStyleItemContext.Provider, {
- value: onSubItemMetaChange
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StatusProvider, {
- prefixCls: prefixCls,
- meta: meta,
- errors: meta.errors,
- warnings: meta.warnings,
- hasFeedback: hasFeedback,
- // Already calculated
- validateStatus: mergedValidateStatus,
- name: name
- }, children)))), !!marginBottom && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${itemPrefixCls}-margin-offset`,
- style: {
- marginBottom: -marginBottom
- }
- })));
- }
- ;// ./components/form/FormItem/index.tsx
- const NAME_SPLIT = '__SPLIT__';
- const _ValidateStatuses = ['success', 'warning', 'error', 'validating', ''];
- // https://github.com/ant-design/ant-design/issues/46417
- // `getValueProps` may modify the value props name,
- // we should check if the control is similar.
- function isSimilarControl(a, b) {
- const keysA = Object.keys(a);
- const keysB = Object.keys(b);
- return keysA.length === keysB.length && keysA.every(key => {
- const propValueA = a[key];
- const propValueB = b[key];
- return propValueA === propValueB || typeof propValueA === 'function' || typeof propValueB === 'function';
- });
- }
- const MemoInput = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(({
- children
- }) => children, (prev, next) => isSimilarControl(prev.control, next.control) && prev.update === next.update && prev.childProps.length === next.childProps.length && prev.childProps.every((value, index) => value === next.childProps[index]));
- function genEmptyMeta() {
- return {
- errors: [],
- warnings: [],
- touched: false,
- validating: false,
- name: [],
- validated: false
- };
- }
- function InternalFormItem(props) {
- const {
- name,
- noStyle,
- className,
- dependencies,
- prefixCls: customizePrefixCls,
- shouldUpdate,
- rules,
- children,
- required,
- label,
- messageVariables,
- trigger = 'onChange',
- validateTrigger,
- hidden,
- help,
- layout
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- name: formName
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- const mergedChildren = useChildren_useChildren(children);
- const isRenderProps = typeof mergedChildren === 'function';
- const notifyParentMetaChange = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(NoStyleItemContext);
- const {
- validateTrigger: contextValidateTrigger
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FieldContext);
- const mergedValidateTrigger = validateTrigger !== undefined ? validateTrigger : contextValidateTrigger;
- const hasName = !(name === undefined || name === null);
- const prefixCls = getPrefixCls('form', customizePrefixCls);
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,form_style["default"])(prefixCls, rootCls);
- // ========================= Warn =========================
- const warning = (0,_util_warning.devUseWarning)('Form.Item');
- if (true) {
- true ? warning(name !== null, 'usage', '`null` is passed as `name` property') : 0;
- }
- // ========================= MISC =========================
- // Get `noStyle` required info
- const listContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_ListContext);
- const fieldKeyPathRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ======================== Errors ========================
- // >>>>> Collect sub field errors
- const [subFieldErrors, setSubFieldErrors] = useFrameState({});
- // >>>>> Current field errors
- const [meta, setMeta] = (0,useState["default"])(() => genEmptyMeta());
- const onMetaChange = nextMeta => {
- // This keyInfo is not correct when field is removed
- // Since origin keyManager no longer keep the origin key anymore
- // Which means we need cache origin one and reuse when removed
- const keyInfo = listContext === null || listContext === void 0 ? void 0 : listContext.getKey(nextMeta.name);
- // Destroy will reset all the meta
- setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);
- // Bump to parent since noStyle
- if (noStyle && help !== false && notifyParentMetaChange) {
- let namePath = nextMeta.name;
- if (!nextMeta.destroy) {
- if (keyInfo !== undefined) {
- const [fieldKey, restPath] = keyInfo;
- namePath = [fieldKey].concat((0,toConsumableArray["default"])(restPath));
- fieldKeyPathRef.current = namePath;
- }
- } else {
- // Use origin cache data
- namePath = fieldKeyPathRef.current || namePath;
- }
- notifyParentMetaChange(nextMeta, namePath);
- }
- };
- // >>>>> Collect noStyle Field error to the top FormItem
- const onSubItemMetaChange = (subMeta, uniqueKeys) => {
- // Only `noStyle` sub item will trigger
- setSubFieldErrors(prevSubFieldErrors => {
- const clone = Object.assign({}, prevSubFieldErrors);
- // name: ['user', 1] + key: [4] = ['user', 4]
- const mergedNamePath = [].concat((0,toConsumableArray["default"])(subMeta.name.slice(0, -1)), (0,toConsumableArray["default"])(uniqueKeys));
- const mergedNameKey = mergedNamePath.join(NAME_SPLIT);
- if (subMeta.destroy) {
- // Remove
- delete clone[mergedNameKey];
- } else {
- // Update
- clone[mergedNameKey] = subMeta;
- }
- return clone;
- });
- };
- // >>>>> Get merged errors
- const [mergedErrors, mergedWarnings] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const errorList = (0,toConsumableArray["default"])(meta.errors);
- const warningList = (0,toConsumableArray["default"])(meta.warnings);
- Object.values(subFieldErrors).forEach(subFieldError => {
- errorList.push.apply(errorList, (0,toConsumableArray["default"])(subFieldError.errors || []));
- warningList.push.apply(warningList, (0,toConsumableArray["default"])(subFieldError.warnings || []));
- });
- return [errorList, warningList];
- }, [subFieldErrors, meta.errors, meta.warnings]);
- // ===================== Children Ref =====================
- const getItemRef = useItemRef();
- // ======================== Render ========================
- function renderLayout(baseChildren, fieldId, isRequired) {
- if (noStyle && !hidden) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StatusProvider, {
- prefixCls: prefixCls,
- hasFeedback: props.hasFeedback,
- validateStatus: props.validateStatus,
- meta: meta,
- errors: mergedErrors,
- warnings: mergedWarnings,
- noStyle: true,
- name: name
- }, baseChildren);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ItemHolder, Object.assign({
- key: "row"
- }, props, {
- className: classnames_default()(className, cssVarCls, rootCls, hashId),
- prefixCls: prefixCls,
- fieldId: fieldId,
- isRequired: isRequired,
- errors: mergedErrors,
- warnings: mergedWarnings,
- meta: meta,
- onSubItemMetaChange: onSubItemMetaChange,
- layout: layout,
- name: name
- }), baseChildren);
- }
- if (!hasName && !isRenderProps && !dependencies) {
- return wrapCSSVar(renderLayout(mergedChildren));
- }
- let variables = {};
- if (typeof label === 'string') {
- variables.label = label;
- } else if (name) {
- variables.label = String(name);
- }
- if (messageVariables) {
- variables = Object.assign(Object.assign({}, variables), messageVariables);
- }
- // >>>>> With Field
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Field, Object.assign({}, props, {
- messageVariables: variables,
- trigger: trigger,
- validateTrigger: mergedValidateTrigger,
- onMetaChange: onMetaChange
- }), (control, renderMeta, context) => {
- const mergedName = util_toArray(name).length && renderMeta ? renderMeta.name : [];
- const fieldId = getFieldId(mergedName, formName);
- const isRequired = required !== undefined ? required : !!(rules === null || rules === void 0 ? void 0 : rules.some(rule => {
- if (rule && typeof rule === 'object' && rule.required && !rule.warningOnly) {
- return true;
- }
- if (typeof rule === 'function') {
- const ruleEntity = rule(context);
- return (ruleEntity === null || ruleEntity === void 0 ? void 0 : ruleEntity.required) && !(ruleEntity === null || ruleEntity === void 0 ? void 0 : ruleEntity.warningOnly);
- }
- return false;
- }));
- // ======================= Children =======================
- const mergedControl = Object.assign({}, control);
- let childNode = null;
- true ? warning(!(shouldUpdate && dependencies), 'usage', "`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.") : 0;
- if (Array.isArray(mergedChildren) && hasName) {
- true ? warning(false, 'usage', 'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.') : 0;
- childNode = mergedChildren;
- } else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {
- true ? warning(!!(shouldUpdate || dependencies), 'usage', 'A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.') : 0;
- true ? warning(!hasName, 'usage', 'A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.') : 0;
- } else if (dependencies && !isRenderProps && !hasName) {
- true ? warning(false, 'usage', 'Must set `name` or use a render function when `dependencies` is set.') : 0;
- } else if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mergedChildren)) {
- true ? warning(mergedChildren.props.defaultValue === undefined, 'usage', '`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.') : 0;
- const childProps = Object.assign(Object.assign({}, mergedChildren.props), mergedControl);
- if (!childProps.id) {
- childProps.id = fieldId;
- }
- if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {
- const describedbyArr = [];
- if (help || mergedErrors.length > 0) {
- describedbyArr.push(`${fieldId}_help`);
- }
- if (props.extra) {
- describedbyArr.push(`${fieldId}_extra`);
- }
- childProps['aria-describedby'] = describedbyArr.join(' ');
- }
- if (mergedErrors.length > 0) {
- childProps['aria-invalid'] = 'true';
- }
- if (isRequired) {
- childProps['aria-required'] = 'true';
- }
- if ((0,es_ref.supportRef)(mergedChildren)) {
- childProps.ref = getItemRef(mergedName, mergedChildren);
- }
- // We should keep user origin event handler
- const triggers = new Set([].concat((0,toConsumableArray["default"])(util_toArray(trigger)), (0,toConsumableArray["default"])(util_toArray(mergedValidateTrigger))));
- triggers.forEach(eventName => {
- childProps[eventName] = (...args) => {
- var _a2, _c2;
- var _a, _b, _c;
- (_a = mergedControl[eventName]) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [mergedControl].concat(args));
- (_c = (_b = mergedChildren.props)[eventName]) === null || _c === void 0 ? void 0 : (_c2 = _c).call.apply(_c2, [_b].concat(args));
- };
- });
- // List of props that need to be watched for changes -> if changes are detected in MemoInput -> rerender
- const watchingChildProps = [childProps['aria-required'], childProps['aria-invalid'], childProps['aria-describedby']];
- childNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MemoInput, {
- control: mergedControl,
- update: mergedChildren,
- childProps: watchingChildProps
- }, (0,reactNode.cloneElement)(mergedChildren, childProps));
- } else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {
- childNode = mergedChildren(context);
- } else {
- true ? warning(!mergedName.length || !!noStyle, 'usage', '`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.') : 0;
- childNode = mergedChildren;
- }
- return renderLayout(childNode, fieldId, isRequired);
- }));
- }
- const FormItem = InternalFormItem;
- FormItem.useStatus = hooks_useFormItemStatus;
- /* harmony default export */ var form_FormItem = (FormItem);
- ;// ./components/form/FormList.tsx
- var FormList_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const FormList = _a => {
- var {
- prefixCls: customizePrefixCls,
- children
- } = _a,
- props = FormList_rest(_a, ["prefixCls", "children"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Form.List');
- true ? warning(typeof props.name === 'number' || (Array.isArray(props.name) ? !!props.name.length : !!props.name), 'usage', 'Miss `name` prop.') : 0;
- }
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('form', customizePrefixCls);
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- prefixCls,
- status: 'error'
- }), [prefixCls]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_List, Object.assign({}, props), (fields, operation, meta) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemPrefixContext.Provider, {
- value: contextValue
- }, children(fields.map(field => Object.assign(Object.assign({}, field), {
- fieldKey: field.key
- })), operation, {
- errors: meta.errors,
- warnings: meta.warnings
- }))));
- };
- /* harmony default export */ var form_FormList = (FormList);
- ;// ./components/form/hooks/useFormInstance.ts
- function useFormInstance() {
- const {
- form
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_FormContext);
- return form;
- }
- ;// ./components/form/index.tsx
- const components_form_Form = form_Form;
- components_form_Form.Item = form_FormItem;
- components_form_Form.List = form_FormList;
- components_form_Form.ErrorList = form_ErrorList;
- components_form_Form.useForm = useForm_useForm;
- components_form_Form.useFormInstance = useFormInstance;
- components_form_Form.useWatch = es_useWatch;
- components_form_Form.Provider = context_FormProvider;
- components_form_Form.create = () => {
- true ? (0,_util_warning["default"])(false, 'Form', 'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.') : 0;
- };
- /* harmony default export */ var components_form = (components_form_Form);
- ;// ./components/grid/index.tsx
- // Do not export params
- function grid_useBreakpoint() {
- return hooks_useBreakpoint();
- }
- /* harmony default export */ var grid = ({
- useBreakpoint: grid_useBreakpoint
- });
- ;// ./node_modules/@ant-design/icons-svg/es/asn/EyeOutlined.js
- // This icon file is generated automatically.
- var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
- /* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/EyeOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_EyeOutlined
- }));
- };
- /** */
- var EyeOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(EyeOutlined_EyeOutlined);
- if (true) {
- EyeOutlined_RefIcon.displayName = 'EyeOutlined';
- }
- /* harmony default export */ var icons_EyeOutlined = (EyeOutlined_RefIcon);
- ;// ./node_modules/rc-util/es/Dom/css.js
- /* eslint-disable no-nested-ternary */
- var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;
- var removePixel = {
- left: true,
- top: true
- };
- var floatMap = {
- cssFloat: 1,
- styleFloat: 1,
- float: 1
- };
- function css_getComputedStyle(node) {
- return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
- }
- function getStyleValue(node, type, value) {
- type = type.toLowerCase();
- if (value === 'auto') {
- if (type === 'height') {
- return node.offsetHeight;
- }
- if (type === 'width') {
- return node.offsetWidth;
- }
- }
- if (!(type in removePixel)) {
- removePixel[type] = PIXEL_PATTERN.test(type);
- }
- return removePixel[type] ? parseFloat(value) || 0 : value;
- }
- function css_get(node, name) {
- var length = arguments.length;
- var style = css_getComputedStyle(node);
- name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
- return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);
- }
- function css_set(node, name, value) {
- var length = arguments.length;
- name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
- if (length === 3) {
- if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {
- value = "".concat(value, "px");
- }
- node.style[name] = value; // Number
- return value;
- }
- for (var x in name) {
- if (name.hasOwnProperty(x)) {
- css_set(node, x, name[x]);
- }
- }
- return css_getComputedStyle(node);
- }
- function getOuterWidth(el) {
- if (el === document.body) {
- return document.documentElement.clientWidth;
- }
- return el.offsetWidth;
- }
- function getOuterHeight(el) {
- if (el === document.body) {
- return window.innerHeight || document.documentElement.clientHeight;
- }
- return el.offsetHeight;
- }
- function getDocSize() {
- var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
- var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
- return {
- width: width,
- height: height
- };
- }
- function getClientSize() {
- var width = document.documentElement.clientWidth;
- var height = window.innerHeight || document.documentElement.clientHeight;
- return {
- width: width,
- height: height
- };
- }
- function css_getScroll() {
- return {
- scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
- scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
- };
- }
- function css_getOffset(node) {
- var box = node.getBoundingClientRect();
- var docElem = document.documentElement;
- // < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft
- return {
- left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
- top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
- };
- }
- ;// ./node_modules/rc-util/es/Dom/addEventListener.js
- function addEventListenerWrap(target, eventType, cb, option) {
- /* eslint camelcase: 2 */
- var callback = (external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default()).unstable_batchedUpdates ? function run(e) {
- external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().unstable_batchedUpdates(cb, e);
- } : cb;
- if (target !== null && target !== void 0 && target.addEventListener) {
- target.addEventListener(eventType, callback, option);
- }
- return {
- remove: function remove() {
- if (target !== null && target !== void 0 && target.removeEventListener) {
- target.removeEventListener(eventType, callback, option);
- }
- }
- };
- }
- ;// ./node_modules/rc-image/es/context.js
- var PreviewGroupContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- ;// ./node_modules/rc-image/es/Operations.js
- var Operations = function Operations(props) {
- var visible = props.visible,
- maskTransitionName = props.maskTransitionName,
- getContainer = props.getContainer,
- prefixCls = props.prefixCls,
- rootClassName = props.rootClassName,
- icons = props.icons,
- countRender = props.countRender,
- showSwitch = props.showSwitch,
- showProgress = props.showProgress,
- current = props.current,
- transform = props.transform,
- count = props.count,
- scale = props.scale,
- minScale = props.minScale,
- maxScale = props.maxScale,
- closeIcon = props.closeIcon,
- onActive = props.onActive,
- onClose = props.onClose,
- onZoomIn = props.onZoomIn,
- onZoomOut = props.onZoomOut,
- onRotateRight = props.onRotateRight,
- onRotateLeft = props.onRotateLeft,
- onFlipX = props.onFlipX,
- onFlipY = props.onFlipY,
- onReset = props.onReset,
- toolbarRender = props.toolbarRender,
- zIndex = props.zIndex,
- image = props.image;
- var groupContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PreviewGroupContext);
- var rotateLeft = icons.rotateLeft,
- rotateRight = icons.rotateRight,
- zoomIn = icons.zoomIn,
- zoomOut = icons.zoomOut,
- close = icons.close,
- left = icons.left,
- right = icons.right,
- flipX = icons.flipX,
- flipY = icons.flipY;
- var toolClassName = "".concat(prefixCls, "-operations-operation");
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var onKeyDown = function onKeyDown(e) {
- if (e.keyCode === KeyCode["default"].ESC) {
- onClose();
- }
- };
- if (visible) {
- window.addEventListener('keydown', onKeyDown);
- }
- return function () {
- window.removeEventListener('keydown', onKeyDown);
- };
- }, [visible]);
- var handleActive = function handleActive(e, offset) {
- e.preventDefault();
- e.stopPropagation();
- onActive(offset);
- };
- var renderOperation = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (_ref) {
- var type = _ref.type,
- disabled = _ref.disabled,
- onClick = _ref.onClick,
- icon = _ref.icon;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: type,
- className: classnames_default()(toolClassName, "".concat(prefixCls, "-operations-operation-").concat(type), (0,defineProperty["default"])({}, "".concat(prefixCls, "-operations-operation-disabled"), !!disabled)),
- onClick: onClick
- }, icon);
- }, [toolClassName, prefixCls]);
- var switchPrevNode = showSwitch ? renderOperation({
- icon: left,
- onClick: function onClick(e) {
- return handleActive(e, -1);
- },
- type: 'prev',
- disabled: current === 0
- }) : undefined;
- var switchNextNode = showSwitch ? renderOperation({
- icon: right,
- onClick: function onClick(e) {
- return handleActive(e, 1);
- },
- type: 'next',
- disabled: current === count - 1
- }) : undefined;
- var flipYNode = renderOperation({
- icon: flipY,
- onClick: onFlipY,
- type: 'flipY'
- });
- var flipXNode = renderOperation({
- icon: flipX,
- onClick: onFlipX,
- type: 'flipX'
- });
- var rotateLeftNode = renderOperation({
- icon: rotateLeft,
- onClick: onRotateLeft,
- type: 'rotateLeft'
- });
- var rotateRightNode = renderOperation({
- icon: rotateRight,
- onClick: onRotateRight,
- type: 'rotateRight'
- });
- var zoomOutNode = renderOperation({
- icon: zoomOut,
- onClick: onZoomOut,
- type: 'zoomOut',
- disabled: scale <= minScale
- });
- var zoomInNode = renderOperation({
- icon: zoomIn,
- onClick: onZoomIn,
- type: 'zoomIn',
- disabled: scale === maxScale
- });
- var toolbarNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-operations")
- }, flipYNode, flipXNode, rotateLeftNode, rotateRightNode, zoomOutNode, zoomInNode);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- visible: visible,
- motionName: maskTransitionName
- }, function (_ref2) {
- var className = _ref2.className,
- style = _ref2.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(portal_es, {
- open: true,
- getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : document.body
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-operations-wrapper"), className, rootClassName),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), {}, {
- zIndex: zIndex
- })
- }, closeIcon === null ? null : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: "".concat(prefixCls, "-close"),
- onClick: onClose
- }, closeIcon || close), showSwitch && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-switch-left"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-switch-left-disabled"), current === 0)),
- onClick: function onClick(e) {
- return handleActive(e, -1);
- }
- }, left), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-switch-right"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-switch-right-disabled"), current === count - 1)),
- onClick: function onClick(e) {
- return handleActive(e, 1);
- }
- }, right)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-footer")
- }, showProgress && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-progress")
- }, countRender ? countRender(current + 1, count) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("bdi", null, "".concat(current + 1, " / ").concat(count))), toolbarRender ? toolbarRender(toolbarNode, (0,objectSpread2["default"])((0,objectSpread2["default"])({
- icons: {
- prevIcon: switchPrevNode,
- nextIcon: switchNextNode,
- flipYIcon: flipYNode,
- flipXIcon: flipXNode,
- rotateLeftIcon: rotateLeftNode,
- rotateRightIcon: rotateRightNode,
- zoomOutIcon: zoomOutNode,
- zoomInIcon: zoomInNode
- },
- actions: {
- onActive: onActive,
- onFlipY: onFlipY,
- onFlipX: onFlipX,
- onRotateLeft: onRotateLeft,
- onRotateRight: onRotateRight,
- onZoomOut: onZoomOut,
- onZoomIn: onZoomIn,
- onReset: onReset,
- onClose: onClose
- },
- transform: transform
- }, groupContext ? {
- current: current,
- total: count
- } : {}), {}, {
- image: image
- })) : toolbarNode)));
- });
- };
- /* harmony default export */ var es_Operations = (Operations);
- ;// ./node_modules/rc-image/es/hooks/useImageTransform.js
- var initialTransform = {
- x: 0,
- y: 0,
- rotate: 0,
- scale: 1,
- flipX: false,
- flipY: false
- };
- function useImageTransform(imgRef, minScale, maxScale, onTransform) {
- var frame = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var queue = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(initialTransform),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- transform = _useState2[0],
- setTransform = _useState2[1];
- var resetTransform = function resetTransform(action) {
- setTransform(initialTransform);
- if (!(0,isEqual["default"])(initialTransform, transform)) {
- onTransform === null || onTransform === void 0 || onTransform({
- transform: initialTransform,
- action: action
- });
- }
- };
- /** Direct update transform */
- var updateTransform = function updateTransform(newTransform, action) {
- if (frame.current === null) {
- queue.current = [];
- frame.current = (0,raf["default"])(function () {
- setTransform(function (preState) {
- var memoState = preState;
- queue.current.forEach(function (queueState) {
- memoState = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, memoState), queueState);
- });
- frame.current = null;
- onTransform === null || onTransform === void 0 || onTransform({
- transform: memoState,
- action: action
- });
- return memoState;
- });
- });
- }
- queue.current.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, transform), newTransform));
- };
- /** Scale according to the position of centerX and centerY */
- var dispatchZoomChange = function dispatchZoomChange(ratio, action, centerX, centerY, isTouch) {
- var _imgRef$current = imgRef.current,
- width = _imgRef$current.width,
- height = _imgRef$current.height,
- offsetWidth = _imgRef$current.offsetWidth,
- offsetHeight = _imgRef$current.offsetHeight,
- offsetLeft = _imgRef$current.offsetLeft,
- offsetTop = _imgRef$current.offsetTop;
- var newRatio = ratio;
- var newScale = transform.scale * ratio;
- if (newScale > maxScale) {
- newScale = maxScale;
- newRatio = maxScale / transform.scale;
- } else if (newScale < minScale) {
- // For mobile interactions, allow scaling down to the minimum scale.
- newScale = isTouch ? newScale : minScale;
- newRatio = newScale / transform.scale;
- }
- /** Default center point scaling */
- var mergedCenterX = centerX !== null && centerX !== void 0 ? centerX : innerWidth / 2;
- var mergedCenterY = centerY !== null && centerY !== void 0 ? centerY : innerHeight / 2;
- var diffRatio = newRatio - 1;
- /** Deviation calculated from image size */
- var diffImgX = diffRatio * width * 0.5;
- var diffImgY = diffRatio * height * 0.5;
- /** The difference between the click position and the edge of the document */
- var diffOffsetLeft = diffRatio * (mergedCenterX - transform.x - offsetLeft);
- var diffOffsetTop = diffRatio * (mergedCenterY - transform.y - offsetTop);
- /** Final positioning */
- var newX = transform.x - (diffOffsetLeft - diffImgX);
- var newY = transform.y - (diffOffsetTop - diffImgY);
- /**
- * When zooming the image
- * When the image size is smaller than the width and height of the window, the position is initialized
- */
- if (ratio < 1 && newScale === 1) {
- var mergedWidth = offsetWidth * newScale;
- var mergedHeight = offsetHeight * newScale;
- var _getClientSize = getClientSize(),
- clientWidth = _getClientSize.width,
- clientHeight = _getClientSize.height;
- if (mergedWidth <= clientWidth && mergedHeight <= clientHeight) {
- newX = 0;
- newY = 0;
- }
- }
- updateTransform({
- x: newX,
- y: newY,
- scale: newScale
- }, action);
- };
- return {
- transform: transform,
- resetTransform: resetTransform,
- updateTransform: updateTransform,
- dispatchZoomChange: dispatchZoomChange
- };
- }
- ;// ./node_modules/rc-image/es/getFixScaleEleTransPosition.js
- function fixPoint(key, start, width, clientWidth) {
- var startAddWidth = start + width;
- var offsetStart = (width - clientWidth) / 2;
- if (width > clientWidth) {
- if (start > 0) {
- return (0,defineProperty["default"])({}, key, offsetStart);
- }
- if (start < 0 && startAddWidth < clientWidth) {
- return (0,defineProperty["default"])({}, key, -offsetStart);
- }
- } else if (start < 0 || startAddWidth > clientWidth) {
- return (0,defineProperty["default"])({}, key, start < 0 ? offsetStart : -offsetStart);
- }
- return {};
- }
- /**
- * Fix positon x,y point when
- *
- * Ele width && height < client
- * - Back origin
- *
- * - Ele width | height > clientWidth | clientHeight
- * - left | top > 0 -> Back 0
- * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight
- *
- * Regardless of other
- */
- function getFixScaleEleTransPosition(width, height, left, top) {
- var _getClientSize = getClientSize(),
- clientWidth = _getClientSize.width,
- clientHeight = _getClientSize.height;
- var fixPos = null;
- if (width <= clientWidth && height <= clientHeight) {
- fixPos = {
- x: 0,
- y: 0
- };
- } else if (width > clientWidth || height > clientHeight) {
- fixPos = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));
- }
- return fixPos;
- }
- ;// ./node_modules/rc-image/es/previewConfig.js
- /** Scale the ratio base */
- var BASE_SCALE_RATIO = 1;
- /** The maximum zoom ratio when the mouse zooms in, adjustable */
- var WHEEL_MAX_SCALE_RATIO = 1;
- ;// ./node_modules/rc-image/es/hooks/useMouseEvent.js
- function useMouseEvent(imgRef, movable, visible, scaleStep, transform, updateTransform, dispatchZoomChange) {
- var rotate = transform.rotate,
- scale = transform.scale,
- x = transform.x,
- y = transform.y;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- isMoving = _useState2[0],
- setMoving = _useState2[1];
- var startPositionInfo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
- diffX: 0,
- diffY: 0,
- transformX: 0,
- transformY: 0
- });
- var onMouseDown = function onMouseDown(event) {
- // Only allow main button
- if (!movable || event.button !== 0) return;
- event.preventDefault();
- event.stopPropagation();
- startPositionInfo.current = {
- diffX: event.pageX - x,
- diffY: event.pageY - y,
- transformX: x,
- transformY: y
- };
- setMoving(true);
- };
- var onMouseMove = function onMouseMove(event) {
- if (visible && isMoving) {
- updateTransform({
- x: event.pageX - startPositionInfo.current.diffX,
- y: event.pageY - startPositionInfo.current.diffY
- }, 'move');
- }
- };
- var onMouseUp = function onMouseUp() {
- if (visible && isMoving) {
- setMoving(false);
- /** No need to restore the position when the picture is not moved, So as not to interfere with the click */
- var _startPositionInfo$cu = startPositionInfo.current,
- transformX = _startPositionInfo$cu.transformX,
- transformY = _startPositionInfo$cu.transformY;
- var hasChangedPosition = x !== transformX && y !== transformY;
- if (!hasChangedPosition) return;
- var width = imgRef.current.offsetWidth * scale;
- var height = imgRef.current.offsetHeight * scale;
- // eslint-disable-next-line @typescript-eslint/no-shadow
- var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),
- left = _imgRef$current$getBo.left,
- top = _imgRef$current$getBo.top;
- var isRotate = rotate % 180 !== 0;
- var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);
- if (fixState) {
- updateTransform((0,objectSpread2["default"])({}, fixState), 'dragRebound');
- }
- }
- };
- var onWheel = function onWheel(event) {
- if (!visible || event.deltaY == 0) return;
- // Scale ratio depends on the deltaY size
- var scaleRatio = Math.abs(event.deltaY / 100);
- // Limit the maximum scale ratio
- var mergedScaleRatio = Math.min(scaleRatio, WHEEL_MAX_SCALE_RATIO);
- // Scale the ratio each time
- var ratio = BASE_SCALE_RATIO + mergedScaleRatio * scaleStep;
- if (event.deltaY > 0) {
- ratio = BASE_SCALE_RATIO / ratio;
- }
- dispatchZoomChange(ratio, 'wheel', event.clientX, event.clientY);
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var onTopMouseUpListener;
- var onTopMouseMoveListener;
- var onMouseUpListener;
- var onMouseMoveListener;
- if (movable) {
- onMouseUpListener = addEventListenerWrap(window, 'mouseup', onMouseUp, false);
- onMouseMoveListener = addEventListenerWrap(window, 'mousemove', onMouseMove, false);
- try {
- // Resolve if in iframe lost event
- /* istanbul ignore next */
- if (window.top !== window.self) {
- onTopMouseUpListener = addEventListenerWrap(window.top, 'mouseup', onMouseUp, false);
- onTopMouseMoveListener = addEventListenerWrap(window.top, 'mousemove', onMouseMove, false);
- }
- } catch (error) {
- /* istanbul ignore next */
- (0,warning.warning)(false, "[rc-image] ".concat(error));
- }
- }
- return function () {
- var _onMouseUpListener, _onMouseMoveListener, _onTopMouseUpListener, _onTopMouseMoveListen;
- (_onMouseUpListener = onMouseUpListener) === null || _onMouseUpListener === void 0 || _onMouseUpListener.remove();
- (_onMouseMoveListener = onMouseMoveListener) === null || _onMouseMoveListener === void 0 || _onMouseMoveListener.remove();
- /* istanbul ignore next */
- (_onTopMouseUpListener = onTopMouseUpListener) === null || _onTopMouseUpListener === void 0 || _onTopMouseUpListener.remove();
- /* istanbul ignore next */
- (_onTopMouseMoveListen = onTopMouseMoveListener) === null || _onTopMouseMoveListen === void 0 || _onTopMouseMoveListen.remove();
- };
- }, [visible, isMoving, x, y, rotate, movable]);
- return {
- isMoving: isMoving,
- onMouseDown: onMouseDown,
- onMouseMove: onMouseMove,
- onMouseUp: onMouseUp,
- onWheel: onWheel
- };
- }
- ;// ./node_modules/rc-image/es/util.js
- function isImageValid(src) {
- return new Promise(function (resolve) {
- if (!src) {
- resolve(false);
- return;
- }
- var img = document.createElement('img');
- img.onerror = function () {
- return resolve(false);
- };
- img.onload = function () {
- return resolve(true);
- };
- img.src = src;
- });
- }
- ;// ./node_modules/rc-image/es/hooks/useStatus.js
- function useStatus(_ref) {
- var src = _ref.src,
- isCustomPlaceholder = _ref.isCustomPlaceholder,
- fallback = _ref.fallback;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(isCustomPlaceholder ? 'loading' : 'normal'),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- status = _useState2[0],
- setStatus = _useState2[1];
- var isLoaded = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var isError = status === 'error';
- // https://github.com/react-component/image/pull/187
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var isCurrentSrc = true;
- isImageValid(src).then(function (isValid) {
- // https://github.com/ant-design/ant-design/issues/44948
- // If src changes, the previous setStatus should not be triggered
- if (!isValid && isCurrentSrc) {
- setStatus('error');
- }
- });
- return function () {
- isCurrentSrc = false;
- };
- }, [src]);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (isCustomPlaceholder && !isLoaded.current) {
- setStatus('loading');
- } else if (isError) {
- setStatus('normal');
- }
- }, [src]);
- var onLoad = function onLoad() {
- setStatus('normal');
- };
- var getImgRef = function getImgRef(img) {
- isLoaded.current = false;
- if (status === 'loading' && img !== null && img !== void 0 && img.complete && (img.naturalWidth || img.naturalHeight)) {
- isLoaded.current = true;
- onLoad();
- }
- };
- var srcAndOnload = isError && fallback ? {
- src: fallback
- } : {
- onLoad: onLoad,
- src: src
- };
- return [getImgRef, srcAndOnload, status];
- }
- ;// ./node_modules/rc-image/es/hooks/useTouchEvent.js
- function getDistance(a, b) {
- var x = a.x - b.x;
- var y = a.y - b.y;
- return Math.hypot(x, y);
- }
- function getCenter(oldPoint1, oldPoint2, newPoint1, newPoint2) {
- // Calculate the distance each point has moved
- var distance1 = getDistance(oldPoint1, newPoint1);
- var distance2 = getDistance(oldPoint2, newPoint2);
- // If both distances are 0, return the original points
- if (distance1 === 0 && distance2 === 0) {
- return [oldPoint1.x, oldPoint1.y];
- }
- // Calculate the ratio of the distances
- var ratio = distance1 / (distance1 + distance2);
- // Calculate the new center point based on the ratio
- var x = oldPoint1.x + ratio * (oldPoint2.x - oldPoint1.x);
- var y = oldPoint1.y + ratio * (oldPoint2.y - oldPoint1.y);
- return [x, y];
- }
- function useTouchEvent(imgRef, movable, visible, minScale, transform, updateTransform, dispatchZoomChange) {
- var rotate = transform.rotate,
- scale = transform.scale,
- x = transform.x,
- y = transform.y;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- isTouching = _useState2[0],
- setIsTouching = _useState2[1];
- var touchPointInfo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
- point1: {
- x: 0,
- y: 0
- },
- point2: {
- x: 0,
- y: 0
- },
- eventType: 'none'
- });
- var updateTouchPointInfo = function updateTouchPointInfo(values) {
- touchPointInfo.current = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, touchPointInfo.current), values);
- };
- var onTouchStart = function onTouchStart(event) {
- if (!movable) return;
- event.stopPropagation();
- setIsTouching(true);
- var _event$touches = event.touches,
- touches = _event$touches === void 0 ? [] : _event$touches;
- if (touches.length > 1) {
- // touch zoom
- updateTouchPointInfo({
- point1: {
- x: touches[0].clientX,
- y: touches[0].clientY
- },
- point2: {
- x: touches[1].clientX,
- y: touches[1].clientY
- },
- eventType: 'touchZoom'
- });
- } else {
- // touch move
- updateTouchPointInfo({
- point1: {
- x: touches[0].clientX - x,
- y: touches[0].clientY - y
- },
- eventType: 'move'
- });
- }
- };
- var onTouchMove = function onTouchMove(event) {
- var _event$touches2 = event.touches,
- touches = _event$touches2 === void 0 ? [] : _event$touches2;
- var _touchPointInfo$curre = touchPointInfo.current,
- point1 = _touchPointInfo$curre.point1,
- point2 = _touchPointInfo$curre.point2,
- eventType = _touchPointInfo$curre.eventType;
- if (touches.length > 1 && eventType === 'touchZoom') {
- // touch zoom
- var newPoint1 = {
- x: touches[0].clientX,
- y: touches[0].clientY
- };
- var newPoint2 = {
- x: touches[1].clientX,
- y: touches[1].clientY
- };
- var _getCenter = getCenter(point1, point2, newPoint1, newPoint2),
- _getCenter2 = (0,slicedToArray["default"])(_getCenter, 2),
- centerX = _getCenter2[0],
- centerY = _getCenter2[1];
- var ratio = getDistance(newPoint1, newPoint2) / getDistance(point1, point2);
- dispatchZoomChange(ratio, 'touchZoom', centerX, centerY, true);
- updateTouchPointInfo({
- point1: newPoint1,
- point2: newPoint2,
- eventType: 'touchZoom'
- });
- } else if (eventType === 'move') {
- // touch move
- updateTransform({
- x: touches[0].clientX - point1.x,
- y: touches[0].clientY - point1.y
- }, 'move');
- updateTouchPointInfo({
- eventType: 'move'
- });
- }
- };
- var onTouchEnd = function onTouchEnd() {
- if (!visible) return;
- if (isTouching) {
- setIsTouching(false);
- }
- updateTouchPointInfo({
- eventType: 'none'
- });
- if (minScale > scale) {
- /** When the scaling ratio is less than the minimum scaling ratio, reset the scaling ratio */
- return updateTransform({
- x: 0,
- y: 0,
- scale: minScale
- }, 'touchZoom');
- }
- var width = imgRef.current.offsetWidth * scale;
- var height = imgRef.current.offsetHeight * scale;
- // eslint-disable-next-line @typescript-eslint/no-shadow
- var _imgRef$current$getBo = imgRef.current.getBoundingClientRect(),
- left = _imgRef$current$getBo.left,
- top = _imgRef$current$getBo.top;
- var isRotate = rotate % 180 !== 0;
- var fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);
- if (fixState) {
- updateTransform((0,objectSpread2["default"])({}, fixState), 'dragRebound');
- }
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var onTouchMoveListener;
- if (visible && movable) {
- onTouchMoveListener = addEventListenerWrap(window, 'touchmove', function (e) {
- return e.preventDefault();
- }, {
- passive: false
- });
- }
- return function () {
- var _onTouchMoveListener;
- (_onTouchMoveListener = onTouchMoveListener) === null || _onTouchMoveListener === void 0 || _onTouchMoveListener.remove();
- };
- }, [visible, movable]);
- return {
- isTouching: isTouching,
- onTouchStart: onTouchStart,
- onTouchMove: onTouchMove,
- onTouchEnd: onTouchEnd
- };
- }
- ;// ./node_modules/rc-image/es/Preview.js
- var Preview_excluded = ["fallback", "src", "imgRef"],
- Preview_excluded2 = ["prefixCls", "src", "alt", "imageInfo", "fallback", "movable", "onClose", "visible", "icons", "rootClassName", "closeIcon", "getContainer", "current", "count", "countRender", "scaleStep", "minScale", "maxScale", "transitionName", "maskTransitionName", "imageRender", "imgCommonProps", "toolbarRender", "onTransform", "onChange"];
- var PreviewImage = function PreviewImage(_ref) {
- var fallback = _ref.fallback,
- src = _ref.src,
- imgRef = _ref.imgRef,
- props = (0,objectWithoutProperties["default"])(_ref, Preview_excluded);
- var _useStatus = useStatus({
- src: src,
- fallback: fallback
- }),
- _useStatus2 = (0,slicedToArray["default"])(_useStatus, 2),
- getImgRef = _useStatus2[0],
- srcAndOnload = _useStatus2[1];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("img", (0,esm_extends["default"])({
- ref: function ref(_ref2) {
- imgRef.current = _ref2;
- getImgRef(_ref2);
- }
- }, props, srcAndOnload));
- };
- var Preview = function Preview(props) {
- var prefixCls = props.prefixCls,
- src = props.src,
- alt = props.alt,
- imageInfo = props.imageInfo,
- fallback = props.fallback,
- _props$movable = props.movable,
- movable = _props$movable === void 0 ? true : _props$movable,
- onClose = props.onClose,
- visible = props.visible,
- _props$icons = props.icons,
- icons = _props$icons === void 0 ? {} : _props$icons,
- rootClassName = props.rootClassName,
- closeIcon = props.closeIcon,
- getContainer = props.getContainer,
- _props$current = props.current,
- current = _props$current === void 0 ? 0 : _props$current,
- _props$count = props.count,
- count = _props$count === void 0 ? 1 : _props$count,
- countRender = props.countRender,
- _props$scaleStep = props.scaleStep,
- scaleStep = _props$scaleStep === void 0 ? 0.5 : _props$scaleStep,
- _props$minScale = props.minScale,
- minScale = _props$minScale === void 0 ? 1 : _props$minScale,
- _props$maxScale = props.maxScale,
- maxScale = _props$maxScale === void 0 ? 50 : _props$maxScale,
- _props$transitionName = props.transitionName,
- transitionName = _props$transitionName === void 0 ? 'zoom' : _props$transitionName,
- _props$maskTransition = props.maskTransitionName,
- maskTransitionName = _props$maskTransition === void 0 ? 'fade' : _props$maskTransition,
- imageRender = props.imageRender,
- imgCommonProps = props.imgCommonProps,
- toolbarRender = props.toolbarRender,
- onTransform = props.onTransform,
- onChange = props.onChange,
- restProps = (0,objectWithoutProperties["default"])(props, Preview_excluded2);
- var imgRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var groupContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PreviewGroupContext);
- var showLeftOrRightSwitches = groupContext && count > 1;
- var showOperationsProgress = groupContext && count >= 1;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(true),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- enableTransition = _useState2[0],
- setEnableTransition = _useState2[1];
- var _useImageTransform = useImageTransform(imgRef, minScale, maxScale, onTransform),
- transform = _useImageTransform.transform,
- resetTransform = _useImageTransform.resetTransform,
- updateTransform = _useImageTransform.updateTransform,
- dispatchZoomChange = _useImageTransform.dispatchZoomChange;
- var _useMouseEvent = useMouseEvent(imgRef, movable, visible, scaleStep, transform, updateTransform, dispatchZoomChange),
- isMoving = _useMouseEvent.isMoving,
- onMouseDown = _useMouseEvent.onMouseDown,
- onWheel = _useMouseEvent.onWheel;
- var _useTouchEvent = useTouchEvent(imgRef, movable, visible, minScale, transform, updateTransform, dispatchZoomChange),
- isTouching = _useTouchEvent.isTouching,
- onTouchStart = _useTouchEvent.onTouchStart,
- onTouchMove = _useTouchEvent.onTouchMove,
- onTouchEnd = _useTouchEvent.onTouchEnd;
- var rotate = transform.rotate,
- scale = transform.scale;
- var wrapClassName = classnames_default()((0,defineProperty["default"])({}, "".concat(prefixCls, "-moving"), isMoving));
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (!enableTransition) {
- setEnableTransition(true);
- }
- }, [enableTransition]);
- var onAfterClose = function onAfterClose() {
- resetTransform('close');
- };
- var onZoomIn = function onZoomIn() {
- dispatchZoomChange(BASE_SCALE_RATIO + scaleStep, 'zoomIn');
- };
- var onZoomOut = function onZoomOut() {
- dispatchZoomChange(BASE_SCALE_RATIO / (BASE_SCALE_RATIO + scaleStep), 'zoomOut');
- };
- var onRotateRight = function onRotateRight() {
- updateTransform({
- rotate: rotate + 90
- }, 'rotateRight');
- };
- var onRotateLeft = function onRotateLeft() {
- updateTransform({
- rotate: rotate - 90
- }, 'rotateLeft');
- };
- var onFlipX = function onFlipX() {
- updateTransform({
- flipX: !transform.flipX
- }, 'flipX');
- };
- var onFlipY = function onFlipY() {
- updateTransform({
- flipY: !transform.flipY
- }, 'flipY');
- };
- var onReset = function onReset() {
- resetTransform('reset');
- };
- var onActive = function onActive(offset) {
- var position = current + offset;
- if (!Number.isInteger(position) || position < 0 || position > count - 1) {
- return;
- }
- setEnableTransition(false);
- resetTransform(offset < 0 ? 'prev' : 'next');
- onChange === null || onChange === void 0 || onChange(position, current);
- };
- var onKeyDown = function onKeyDown(event) {
- if (!visible || !showLeftOrRightSwitches) return;
- if (event.keyCode === KeyCode["default"].LEFT) {
- onActive(-1);
- } else if (event.keyCode === KeyCode["default"].RIGHT) {
- onActive(1);
- }
- };
- var onDoubleClick = function onDoubleClick(event) {
- if (visible) {
- if (scale !== 1) {
- updateTransform({
- x: 0,
- y: 0,
- scale: 1
- }, 'doubleClick');
- } else {
- dispatchZoomChange(BASE_SCALE_RATIO + scaleStep, 'doubleClick', event.clientX, event.clientY);
- }
- }
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var onKeyDownListener = addEventListenerWrap(window, 'keydown', onKeyDown, false);
- return function () {
- onKeyDownListener.remove();
- };
- }, [visible, showLeftOrRightSwitches, current]);
- var imgNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PreviewImage, (0,esm_extends["default"])({}, imgCommonProps, {
- width: props.width,
- height: props.height,
- imgRef: imgRef,
- className: "".concat(prefixCls, "-img"),
- alt: alt,
- style: {
- transform: "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale3d(").concat(transform.flipX ? '-' : '').concat(scale, ", ").concat(transform.flipY ? '-' : '').concat(scale, ", 1) rotate(").concat(rotate, "deg)"),
- transitionDuration: (!enableTransition || isTouching) && '0s'
- },
- fallback: fallback,
- src: src,
- onWheel: onWheel,
- onMouseDown: onMouseDown,
- onDoubleClick: onDoubleClick,
- onTouchStart: onTouchStart,
- onTouchMove: onTouchMove,
- onTouchEnd: onTouchEnd,
- onTouchCancel: onTouchEnd
- }));
- var image = (0,objectSpread2["default"])({
- url: src,
- alt: alt
- }, imageInfo);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_dialog_es, (0,esm_extends["default"])({
- transitionName: transitionName,
- maskTransitionName: maskTransitionName,
- closable: false,
- keyboard: true,
- prefixCls: prefixCls,
- onClose: onClose,
- visible: visible,
- classNames: {
- wrapper: wrapClassName
- },
- rootClassName: rootClassName,
- getContainer: getContainer
- }, restProps, {
- afterClose: onAfterClose
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-img-wrapper")
- }, imageRender ? imageRender(imgNode, (0,objectSpread2["default"])({
- transform: transform,
- image: image
- }, groupContext ? {
- current: current
- } : {})) : imgNode)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Operations, {
- visible: visible,
- transform: transform,
- maskTransitionName: maskTransitionName,
- closeIcon: closeIcon,
- getContainer: getContainer,
- prefixCls: prefixCls,
- rootClassName: rootClassName,
- icons: icons,
- countRender: countRender,
- showSwitch: showLeftOrRightSwitches,
- showProgress: showOperationsProgress,
- current: current,
- count: count,
- scale: scale,
- minScale: minScale,
- maxScale: maxScale,
- toolbarRender: toolbarRender,
- onActive: onActive,
- onZoomIn: onZoomIn,
- onZoomOut: onZoomOut,
- onRotateRight: onRotateRight,
- onRotateLeft: onRotateLeft,
- onFlipX: onFlipX,
- onFlipY: onFlipY,
- onClose: onClose,
- onReset: onReset,
- zIndex: restProps.zIndex !== undefined ? restProps.zIndex + 1 : undefined,
- image: image
- }));
- };
- /* harmony default export */ var es_Preview = (Preview);
- ;// ./node_modules/rc-image/es/common.js
- var COMMON_PROPS = ['crossOrigin', 'decoding', 'draggable', 'loading', 'referrerPolicy', 'sizes', 'srcSet', 'useMap', 'alt'];
- ;// ./node_modules/rc-image/es/hooks/usePreviewItems.js
- /**
- * Merge props provided `items` or context collected images
- */
- function usePreviewItems(items) {
- // Context collection image data
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- images = _React$useState2[0],
- setImages = _React$useState2[1];
- var registerImage = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (id, data) {
- setImages(function (imgs) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, imgs), {}, (0,defineProperty["default"])({}, id, data));
- });
- return function () {
- setImages(function (imgs) {
- var cloneImgs = (0,objectSpread2["default"])({}, imgs);
- delete cloneImgs[id];
- return cloneImgs;
- });
- };
- }, []);
- // items
- var mergedItems = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // use `items` first
- if (items) {
- return items.map(function (item) {
- if (typeof item === 'string') {
- return {
- data: {
- src: item
- }
- };
- }
- var data = {};
- Object.keys(item).forEach(function (key) {
- if (['src'].concat((0,toConsumableArray["default"])(COMMON_PROPS)).includes(key)) {
- data[key] = item[key];
- }
- });
- return {
- data: data
- };
- });
- }
- // use registered images secondly
- return Object.keys(images).reduce(function (total, id) {
- var _images$id = images[id],
- canPreview = _images$id.canPreview,
- data = _images$id.data;
- if (canPreview) {
- total.push({
- data: data,
- id: id
- });
- }
- return total;
- }, []);
- }, [items, images]);
- return [mergedItems, registerImage, !!items];
- }
- ;// ./node_modules/rc-image/es/PreviewGroup.js
- var PreviewGroup_excluded = ["visible", "onVisibleChange", "getContainer", "current", "movable", "minScale", "maxScale", "countRender", "closeIcon", "onChange", "onTransform", "toolbarRender", "imageRender"],
- PreviewGroup_excluded2 = ["src"];
- var PreviewGroup_Group = function Group(_ref) {
- var _mergedItems$current;
- var _ref$previewPrefixCls = _ref.previewPrefixCls,
- previewPrefixCls = _ref$previewPrefixCls === void 0 ? 'rc-image-preview' : _ref$previewPrefixCls,
- children = _ref.children,
- _ref$icons = _ref.icons,
- icons = _ref$icons === void 0 ? {} : _ref$icons,
- items = _ref.items,
- preview = _ref.preview,
- fallback = _ref.fallback;
- var _ref2 = (0,esm_typeof["default"])(preview) === 'object' ? preview : {},
- previewVisible = _ref2.visible,
- onVisibleChange = _ref2.onVisibleChange,
- getContainer = _ref2.getContainer,
- currentIndex = _ref2.current,
- movable = _ref2.movable,
- minScale = _ref2.minScale,
- maxScale = _ref2.maxScale,
- countRender = _ref2.countRender,
- closeIcon = _ref2.closeIcon,
- onChange = _ref2.onChange,
- onTransform = _ref2.onTransform,
- toolbarRender = _ref2.toolbarRender,
- imageRender = _ref2.imageRender,
- dialogProps = (0,objectWithoutProperties["default"])(_ref2, PreviewGroup_excluded);
- // ========================== Items ===========================
- var _usePreviewItems = usePreviewItems(items),
- _usePreviewItems2 = (0,slicedToArray["default"])(_usePreviewItems, 3),
- mergedItems = _usePreviewItems2[0],
- register = _usePreviewItems2[1],
- fromItems = _usePreviewItems2[2];
- // ========================= Preview ==========================
- // >>> Index
- var _useMergedState = (0,useMergedState["default"])(0, {
- value: currentIndex
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- current = _useMergedState2[0],
- setCurrent = _useMergedState2[1];
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- keepOpenIndex = _useState2[0],
- setKeepOpenIndex = _useState2[1];
- // >>> Image
- var _ref3 = ((_mergedItems$current = mergedItems[current]) === null || _mergedItems$current === void 0 ? void 0 : _mergedItems$current.data) || {},
- src = _ref3.src,
- imgCommonProps = (0,objectWithoutProperties["default"])(_ref3, PreviewGroup_excluded2);
- // >>> Visible
- var _useMergedState3 = (0,useMergedState["default"])(!!previewVisible, {
- value: previewVisible,
- onChange: function onChange(val, prevVal) {
- onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(val, prevVal, current);
- }
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- isShowPreview = _useMergedState4[0],
- setShowPreview = _useMergedState4[1];
- // >>> Position
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- mousePosition = _useState4[0],
- setMousePosition = _useState4[1];
- var onPreviewFromImage = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (id, imageSrc, mouseX, mouseY) {
- var index = fromItems ? mergedItems.findIndex(function (item) {
- return item.data.src === imageSrc;
- }) : mergedItems.findIndex(function (item) {
- return item.id === id;
- });
- setCurrent(index < 0 ? 0 : index);
- setShowPreview(true);
- setMousePosition({
- x: mouseX,
- y: mouseY
- });
- setKeepOpenIndex(true);
- }, [mergedItems, fromItems]);
- // Reset current when reopen
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (isShowPreview) {
- if (!keepOpenIndex) {
- setCurrent(0);
- }
- } else {
- setKeepOpenIndex(false);
- }
- }, [isShowPreview]);
- // ========================== Events ==========================
- var onInternalChange = function onInternalChange(next, prev) {
- setCurrent(next);
- onChange === null || onChange === void 0 || onChange(next, prev);
- };
- var onPreviewClose = function onPreviewClose() {
- setShowPreview(false);
- setMousePosition(null);
- };
- // ========================= Context ==========================
- var previewGroupContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- register: register,
- onPreview: onPreviewFromImage
- };
- }, [register, onPreviewFromImage]);
- // ========================== Render ==========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PreviewGroupContext.Provider, {
- value: previewGroupContext
- }, children, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Preview, (0,esm_extends["default"])({
- "aria-hidden": !isShowPreview,
- movable: movable,
- visible: isShowPreview,
- prefixCls: previewPrefixCls,
- closeIcon: closeIcon,
- onClose: onPreviewClose,
- mousePosition: mousePosition,
- imgCommonProps: imgCommonProps,
- src: src,
- fallback: fallback,
- icons: icons,
- minScale: minScale,
- maxScale: maxScale,
- getContainer: getContainer,
- current: current,
- count: mergedItems.length,
- countRender: countRender,
- onTransform: onTransform,
- toolbarRender: toolbarRender,
- imageRender: imageRender,
- onChange: onInternalChange
- }, dialogProps)));
- };
- /* harmony default export */ var PreviewGroup = (PreviewGroup_Group);
- ;// ./node_modules/rc-image/es/hooks/useRegisterImage.js
- var uid = 0;
- function useRegisterImage(canPreview, data) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- uid += 1;
- return String(uid);
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 1),
- id = _React$useState2[0];
- var groupContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(PreviewGroupContext);
- var registerData = {
- data: data,
- canPreview: canPreview
- };
- // Keep order start
- // Resolve https://github.com/ant-design/ant-design/issues/28881
- // Only need unRegister when component unMount
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (groupContext) {
- return groupContext.register(id, registerData);
- }
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (groupContext) {
- groupContext.register(id, registerData);
- }
- }, [canPreview, data]);
- return id;
- }
- ;// ./node_modules/rc-image/es/Image.js
- var Image_excluded = ["src", "alt", "onPreviewClose", "prefixCls", "previewPrefixCls", "placeholder", "fallback", "width", "height", "style", "preview", "className", "onClick", "onError", "wrapperClassName", "wrapperStyle", "rootClassName"],
- Image_excluded2 = ["src", "visible", "onVisibleChange", "getContainer", "mask", "maskClassName", "movable", "icons", "scaleStep", "minScale", "maxScale", "imageRender", "toolbarRender"];
- var ImageInternal = function ImageInternal(props) {
- var imgSrc = props.src,
- alt = props.alt,
- onInitialPreviewClose = props.onPreviewClose,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-image' : _props$prefixCls,
- _props$previewPrefixC = props.previewPrefixCls,
- previewPrefixCls = _props$previewPrefixC === void 0 ? "".concat(prefixCls, "-preview") : _props$previewPrefixC,
- placeholder = props.placeholder,
- fallback = props.fallback,
- width = props.width,
- height = props.height,
- style = props.style,
- _props$preview = props.preview,
- preview = _props$preview === void 0 ? true : _props$preview,
- className = props.className,
- onClick = props.onClick,
- onError = props.onError,
- wrapperClassName = props.wrapperClassName,
- wrapperStyle = props.wrapperStyle,
- rootClassName = props.rootClassName,
- otherProps = (0,objectWithoutProperties["default"])(props, Image_excluded);
- var isCustomPlaceholder = placeholder && placeholder !== true;
- var _ref = (0,esm_typeof["default"])(preview) === 'object' ? preview : {},
- previewSrc = _ref.src,
- _ref$visible = _ref.visible,
- previewVisible = _ref$visible === void 0 ? undefined : _ref$visible,
- _ref$onVisibleChange = _ref.onVisibleChange,
- onPreviewVisibleChange = _ref$onVisibleChange === void 0 ? onInitialPreviewClose : _ref$onVisibleChange,
- _ref$getContainer = _ref.getContainer,
- getPreviewContainer = _ref$getContainer === void 0 ? undefined : _ref$getContainer,
- previewMask = _ref.mask,
- maskClassName = _ref.maskClassName,
- movable = _ref.movable,
- icons = _ref.icons,
- scaleStep = _ref.scaleStep,
- minScale = _ref.minScale,
- maxScale = _ref.maxScale,
- imageRender = _ref.imageRender,
- toolbarRender = _ref.toolbarRender,
- dialogProps = (0,objectWithoutProperties["default"])(_ref, Image_excluded2);
- var src = previewSrc !== null && previewSrc !== void 0 ? previewSrc : imgSrc;
- var _useMergedState = (0,useMergedState["default"])(!!previewVisible, {
- value: previewVisible,
- onChange: onPreviewVisibleChange
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- isShowPreview = _useMergedState2[0],
- setShowPreview = _useMergedState2[1];
- var _useStatus = useStatus({
- src: imgSrc,
- isCustomPlaceholder: isCustomPlaceholder,
- fallback: fallback
- }),
- _useStatus2 = (0,slicedToArray["default"])(_useStatus, 3),
- getImgRef = _useStatus2[0],
- srcAndOnload = _useStatus2[1],
- status = _useStatus2[2];
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- mousePosition = _useState2[0],
- setMousePosition = _useState2[1];
- var groupContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PreviewGroupContext);
- var canPreview = !!preview;
- var onPreviewClose = function onPreviewClose() {
- setShowPreview(false);
- setMousePosition(null);
- };
- var wrapperClass = classnames_default()(prefixCls, wrapperClassName, rootClassName, (0,defineProperty["default"])({}, "".concat(prefixCls, "-error"), status === 'error'));
- // ========================= ImageProps =========================
- var imgCommonProps = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var obj = {};
- COMMON_PROPS.forEach(function (prop) {
- if (props[prop] !== undefined) {
- obj[prop] = props[prop];
- }
- });
- return obj;
- }, COMMON_PROPS.map(function (prop) {
- return props[prop];
- }));
- // ========================== Register ==========================
- var registerData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, imgCommonProps), {}, {
- src: src
- });
- }, [src, imgCommonProps]);
- var imageId = useRegisterImage(canPreview, registerData);
- // ========================== Preview ===========================
- var onPreview = function onPreview(e) {
- var _getOffset = css_getOffset(e.target),
- left = _getOffset.left,
- top = _getOffset.top;
- if (groupContext) {
- groupContext.onPreview(imageId, src, left, top);
- } else {
- setMousePosition({
- x: left,
- y: top
- });
- setShowPreview(true);
- }
- onClick === null || onClick === void 0 || onClick(e);
- };
- // =========================== Render ===========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, otherProps, {
- className: wrapperClass,
- onClick: canPreview ? onPreview : onClick,
- style: (0,objectSpread2["default"])({
- width: width,
- height: height
- }, wrapperStyle)
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("img", (0,esm_extends["default"])({}, imgCommonProps, {
- className: classnames_default()("".concat(prefixCls, "-img"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-img-placeholder"), placeholder === true), className),
- style: (0,objectSpread2["default"])({
- height: height
- }, style),
- ref: getImgRef
- }, srcAndOnload, {
- width: width,
- height: height,
- onError: onError
- })), status === 'loading' && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- "aria-hidden": "true",
- className: "".concat(prefixCls, "-placeholder")
- }, placeholder), previewMask && canPreview && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-mask"), maskClassName),
- style: {
- display: (style === null || style === void 0 ? void 0 : style.display) === 'none' ? 'none' : undefined
- }
- }, previewMask)), !groupContext && canPreview && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Preview, (0,esm_extends["default"])({
- "aria-hidden": !isShowPreview,
- visible: isShowPreview,
- prefixCls: previewPrefixCls,
- onClose: onPreviewClose,
- mousePosition: mousePosition,
- src: src,
- alt: alt,
- imageInfo: {
- width: width,
- height: height
- },
- fallback: fallback,
- getContainer: getPreviewContainer,
- icons: icons,
- movable: movable,
- scaleStep: scaleStep,
- minScale: minScale,
- maxScale: maxScale,
- rootClassName: rootClassName,
- imageRender: imageRender,
- imgCommonProps: imgCommonProps,
- toolbarRender: toolbarRender
- }, dialogProps)));
- };
- ImageInternal.PreviewGroup = PreviewGroup;
- if (true) {
- ImageInternal.displayName = 'Image';
- }
- /* harmony default export */ var es_Image = (ImageInternal);
- ;// ./node_modules/rc-image/es/index.js
- /* harmony default export */ var rc_image_es = (es_Image);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/RotateLeftOutlined.js
- // This icon file is generated automatically.
- var RotateLeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z" } }, { "tag": "path", "attrs": { "d": "M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z" } }] }, "name": "rotate-left", "theme": "outlined" };
- /* harmony default export */ var asn_RotateLeftOutlined = (RotateLeftOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/RotateLeftOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var RotateLeftOutlined_RotateLeftOutlined = function RotateLeftOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_RotateLeftOutlined
- }));
- };
- /** */
- var RotateLeftOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RotateLeftOutlined_RotateLeftOutlined);
- if (true) {
- RotateLeftOutlined_RefIcon.displayName = 'RotateLeftOutlined';
- }
- /* harmony default export */ var icons_RotateLeftOutlined = (RotateLeftOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/RotateRightOutlined.js
- // This icon file is generated automatically.
- var RotateRightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M480.5 251.2c13-1.6 25.9-2.4 38.8-2.5v63.9c0 6.5 7.5 10.1 12.6 6.1L660 217.6c4-3.2 4-9.2 0-12.3l-128-101c-5.1-4-12.6-.4-12.6 6.1l-.2 64c-118.6.5-235.8 53.4-314.6 154.2A399.75 399.75 0 00123.5 631h74.9c-.9-5.3-1.7-10.7-2.4-16.1-5.1-42.1-2.1-84.1 8.9-124.8 11.4-42.2 31-81.1 58.1-115.8 27.2-34.7 60.3-63.2 98.4-84.3 37-20.6 76.9-33.6 119.1-38.8z" } }, { "tag": "path", "attrs": { "d": "M880 418H352c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H396V494h440v326z" } }] }, "name": "rotate-right", "theme": "outlined" };
- /* harmony default export */ var asn_RotateRightOutlined = (RotateRightOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/RotateRightOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var RotateRightOutlined_RotateRightOutlined = function RotateRightOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_RotateRightOutlined
- }));
- };
- /** */
- var RotateRightOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RotateRightOutlined_RotateRightOutlined);
- if (true) {
- RotateRightOutlined_RefIcon.displayName = 'RotateRightOutlined';
- }
- /* harmony default export */ var icons_RotateRightOutlined = (RotateRightOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/SwapOutlined.js
- // This icon file is generated automatically.
- var SwapOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "swap", "theme": "outlined" };
- /* harmony default export */ var asn_SwapOutlined = (SwapOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/SwapOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var SwapOutlined_SwapOutlined = function SwapOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_SwapOutlined
- }));
- };
- /** */
- var SwapOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(SwapOutlined_SwapOutlined);
- if (true) {
- SwapOutlined_RefIcon.displayName = 'SwapOutlined';
- }
- /* harmony default export */ var icons_SwapOutlined = (SwapOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/ZoomInOutlined.js
- // This icon file is generated automatically.
- var ZoomInOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-in", "theme": "outlined" };
- /* harmony default export */ var asn_ZoomInOutlined = (ZoomInOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/ZoomInOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var ZoomInOutlined_ZoomInOutlined = function ZoomInOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_ZoomInOutlined
- }));
- };
- /** */
- var ZoomInOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ZoomInOutlined_ZoomInOutlined);
- if (true) {
- ZoomInOutlined_RefIcon.displayName = 'ZoomInOutlined';
- }
- /* harmony default export */ var icons_ZoomInOutlined = (ZoomInOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/ZoomOutOutlined.js
- // This icon file is generated automatically.
- var ZoomOutOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z" } }] }, "name": "zoom-out", "theme": "outlined" };
- /* harmony default export */ var asn_ZoomOutOutlined = (ZoomOutOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/ZoomOutOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var ZoomOutOutlined_ZoomOutOutlined = function ZoomOutOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_ZoomOutOutlined
- }));
- };
- /** */
- var ZoomOutOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ZoomOutOutlined_ZoomOutOutlined);
- if (true) {
- ZoomOutOutlined_RefIcon.displayName = 'ZoomOutOutlined';
- }
- /* harmony default export */ var icons_ZoomOutOutlined = (ZoomOutOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/image/style/index.ts
- var image_style = __webpack_require__("./components/image/style/index.ts");
- ;// ./components/image/PreviewGroup.tsx
- var PreviewGroup_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const icons = {
- rotateLeft: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_RotateLeftOutlined, null),
- rotateRight: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_RotateRightOutlined, null),
- zoomIn: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ZoomInOutlined, null),
- zoomOut: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ZoomOutOutlined, null),
- close: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, null),
- left: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null),
- right: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null),
- flipX: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SwapOutlined, null),
- flipY: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SwapOutlined, {
- rotate: 90
- })
- };
- const InternalPreviewGroup = _a => {
- var {
- previewPrefixCls: customizePrefixCls,
- preview
- } = _a,
- otherProps = PreviewGroup_rest(_a, ["previewPrefixCls", "preview"]);
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('image', customizePrefixCls);
- const previewPrefixCls = `${prefixCls}-preview`;
- const rootPrefixCls = getPrefixCls();
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,image_style["default"])(prefixCls, rootCls);
- const [zIndex] = (0,useZIndex.useZIndex)('ImagePreview', typeof preview === 'object' ? preview.zIndex : undefined);
- const memoizedIcons = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, icons), {
- left: direction === 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null),
- right: direction === 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null)
- }), [direction]);
- const mergedPreview = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a;
- if (preview === false) {
- return preview;
- }
- const _preview = typeof preview === 'object' ? preview : {};
- const mergedRootClassName = classnames_default()(hashId, cssVarCls, rootCls, (_a = _preview.rootClassName) !== null && _a !== void 0 ? _a : '');
- return Object.assign(Object.assign({}, _preview), {
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'zoom', _preview.transitionName),
- maskTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'fade', _preview.maskTransitionName),
- rootClassName: mergedRootClassName,
- zIndex
- });
- }, [preview]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_image_es.PreviewGroup, Object.assign({
- preview: mergedPreview,
- previewPrefixCls: previewPrefixCls,
- icons: memoizedIcons
- }, otherProps)));
- };
- /* harmony default export */ var image_PreviewGroup = (InternalPreviewGroup);
- ;// ./components/image/index.tsx
- var image_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const image_Image = props => {
- const {
- prefixCls: customizePrefixCls,
- preview,
- className,
- rootClassName,
- style
- } = props,
- otherProps = image_rest(props, ["prefixCls", "preview", "className", "rootClassName", "style"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Image');
- warning.deprecated(!(preview && typeof preview === 'object' && 'destroyOnClose' in preview), 'destroyOnClose', 'destroyOnHidden');
- }
- const {
- getPrefixCls,
- getPopupContainer: getContextPopupContainer,
- className: contextClassName,
- style: contextStyle,
- preview: contextPreview
- } = (0,config_provider_context.useComponentConfig)('image');
- const [imageLocale] = (0,useLocale["default"])('Image');
- const prefixCls = getPrefixCls('image', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,image_style["default"])(prefixCls, rootCls);
- const mergedRootClassName = classnames_default()(rootClassName, hashId, cssVarCls, rootCls);
- const mergedClassName = classnames_default()(className, hashId, contextClassName);
- const [zIndex] = (0,useZIndex.useZIndex)('ImagePreview', typeof preview === 'object' ? preview.zIndex : undefined);
- const mergedPreview = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (preview === false) {
- return preview;
- }
- const _preview = typeof preview === 'object' ? preview : {};
- const {
- getContainer,
- closeIcon,
- rootClassName,
- destroyOnClose,
- destroyOnHidden
- } = _preview,
- restPreviewProps = image_rest(_preview, ["getContainer", "closeIcon", "rootClassName", "destroyOnClose", "destroyOnHidden"]);
- return Object.assign(Object.assign({
- mask: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-mask-info`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EyeOutlined, null), imageLocale === null || imageLocale === void 0 ? void 0 : imageLocale.preview)),
- icons: icons
- }, restPreviewProps), {
- // TODO: In the future, destroyOnClose in rc-image needs to be upgrade to destroyOnHidden
- destroyOnClose: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyOnClose,
- rootClassName: classnames_default()(mergedRootClassName, rootClassName),
- getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : getContextPopupContainer,
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'zoom', _preview.transitionName),
- maskTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'fade', _preview.maskTransitionName),
- zIndex,
- closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : contextPreview === null || contextPreview === void 0 ? void 0 : contextPreview.closeIcon
- });
- }, [preview, imageLocale, contextPreview === null || contextPreview === void 0 ? void 0 : contextPreview.closeIcon]);
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_image_es, Object.assign({
- prefixCls: prefixCls,
- preview: mergedPreview,
- rootClassName: mergedRootClassName,
- className: mergedClassName,
- style: mergedStyle
- }, otherProps)));
- };
- image_Image.PreviewGroup = image_PreviewGroup;
- if (true) {
- image_Image.displayName = 'Image';
- }
- /* harmony default export */ var components_image = (image_Image);
- ;// ./components/input/Group.tsx
- /** @deprecated Please use `Space.Compact` */
- const Group_Group = props => {
- const {
- getPrefixCls,
- direction
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- className
- } = props;
- const prefixCls = getPrefixCls('input-group', customizePrefixCls);
- const inputPrefixCls = getPrefixCls('input');
- const [wrapCSSVar, hashId, cssVarCls] = (0,input_style["default"])(inputPrefixCls);
- const cls = classnames_default()(prefixCls, cssVarCls, {
- [`${prefixCls}-lg`]: props.size === 'large',
- [`${prefixCls}-sm`]: props.size === 'small',
- [`${prefixCls}-compact`]: props.compact,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, hashId, className);
- const formItemContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const groupFormItemContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
- isFormItemInput: false
- }), [formItemContext]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Input.Group');
- warning.deprecated(false, 'Input.Group', 'Space.Compact');
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: cls,
- style: props.style,
- onMouseEnter: props.onMouseEnter,
- onMouseLeave: props.onMouseLeave,
- onFocus: props.onFocus,
- onBlur: props.onBlur
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemInputContext.Provider, {
- value: groupFormItemContext
- }, props.children)));
- };
- /* harmony default export */ var input_Group = (Group_Group);
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var cssinjs_utils_es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/input/style/token.ts
- var input_style_token = __webpack_require__("./components/input/style/token.ts");
- ;// ./components/input/style/otp.ts
- // =============================== OTP ================================
- const genOTPStyle = token => {
- const {
- componentCls,
- paddingXS
- } = token;
- return {
- [componentCls]: {
- display: 'inline-flex',
- alignItems: 'center',
- flexWrap: 'nowrap',
- columnGap: paddingXS,
- [`${componentCls}-input-wrapper`]: {
- position: 'relative',
- [`${componentCls}-mask-icon`]: {
- position: 'absolute',
- zIndex: '1',
- top: '50%',
- right: '50%',
- transform: 'translate(50%, -50%)',
- pointerEvents: 'none'
- },
- [`${componentCls}-mask-input`]: {
- color: 'transparent',
- caretColor: token.colorText
- },
- [`${componentCls}-mask-input[type=number]::-webkit-inner-spin-button`]: {
- '-webkit-appearance': 'none',
- margin: 0
- },
- [`${componentCls}-mask-input[type=number]`]: {
- '-moz-appearance': 'textfield'
- }
- },
- '&-rtl': {
- direction: 'rtl'
- },
- [`${componentCls}-input`]: {
- textAlign: 'center',
- paddingInline: token.paddingXXS
- },
- // ================= Size =================
- [`&${componentCls}-sm ${componentCls}-input`]: {
- paddingInline: token.calc(token.paddingXXS).div(2).equal()
- },
- [`&${componentCls}-lg ${componentCls}-input`]: {
- paddingInline: token.paddingXS
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var otp = ((0,genStyleUtils.genStyleHooks)(['Input', 'OTP'], token => {
- const inputToken = (0,cssinjs_utils_es.mergeToken)(token, (0,input_style_token.initInputToken)(token));
- return genOTPStyle(inputToken);
- }, input_style_token.initComponentToken));
- ;// ./components/input/OTP/OTPInput.tsx
- var OTPInput_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const OTPInput = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- className,
- value,
- onChange,
- onActiveChange,
- index,
- mask
- } = props,
- restProps = OTPInput_rest(props, ["className", "value", "onChange", "onActiveChange", "index", "mask"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('otp');
- const maskValue = typeof mask === 'string' ? mask : value;
- // ========================== Ref ===========================
- const inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => inputRef.current);
- // ========================= Input ==========================
- const onInternalChange = e => {
- onChange(index, e.target.value);
- };
- // ========================= Focus ==========================
- const syncSelection = () => {
- (0,raf["default"])(() => {
- var _a;
- const inputEle = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
- if (document.activeElement === inputEle && inputEle) {
- inputEle.select();
- }
- });
- };
- // ======================== Keyboard ========================
- const onInternalKeyDown = event => {
- const {
- key,
- ctrlKey,
- metaKey
- } = event;
- if (key === 'ArrowLeft') {
- onActiveChange(index - 1);
- } else if (key === 'ArrowRight') {
- onActiveChange(index + 1);
- } else if (key === 'z' && (ctrlKey || metaKey)) {
- event.preventDefault();
- } else if (key === 'Backspace' && !value) {
- onActiveChange(index - 1);
- }
- syncSelection();
- };
- // ========================= Render =========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-input-wrapper`,
- role: "presentation"
- }, mask && value !== '' && value !== undefined && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-mask-icon`,
- "aria-hidden": "true"
- }, maskValue)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_Input, Object.assign({
- "aria-label": `OTP Input ${index + 1}`,
- type: mask === true ? 'password' : 'text'
- }, restProps, {
- ref: inputRef,
- value: value,
- onInput: onInternalChange,
- onFocus: syncSelection,
- onKeyDown: onInternalKeyDown,
- onMouseDown: syncSelection,
- onMouseUp: syncSelection,
- className: classnames_default()(className, {
- [`${prefixCls}-mask-input`]: mask
- })
- })));
- });
- /* harmony default export */ var OTP_OTPInput = (OTPInput);
- ;// ./components/input/OTP/index.tsx
- var OTP_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function strToArr(str) {
- return (str || '').split('');
- }
- const Separator = props => {
- const {
- index,
- prefixCls,
- separator
- } = props;
- const separatorNode = typeof separator === 'function' ? separator(index) : separator;
- if (!separatorNode) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-separator`
- }, separatorNode);
- };
- const OTP = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- length = 6,
- size: customSize,
- defaultValue,
- value,
- onChange,
- formatter,
- separator,
- variant,
- disabled,
- status: customStatus,
- autoFocus,
- mask,
- type,
- onInput,
- inputMode
- } = props,
- restProps = OTP_rest(props, ["prefixCls", "length", "size", "defaultValue", "value", "onChange", "formatter", "separator", "variant", "disabled", "status", "autoFocus", "mask", "type", "onInput", "inputMode"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Input.OTP');
- true ? warning(!(typeof mask === 'string' && mask.length > 1), 'usage', '`mask` prop should be a single character.') : 0;
- }
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('otp', customizePrefixCls);
- const domAttrs = (0,pickAttrs["default"])(restProps, {
- aria: true,
- data: true,
- attr: true
- });
- // ========================= Root =========================
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = otp(prefixCls);
- // ========================= Size =========================
- const mergedSize = (0,useSize["default"])(ctx => customSize !== null && customSize !== void 0 ? customSize : ctx);
- // ======================== Status ========================
- const formContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(formContext.status, customStatus);
- const proxyFormContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => Object.assign(Object.assign({}, formContext), {
- status: mergedStatus,
- hasFeedback: false,
- feedbackIcon: null
- }), [formContext, mergedStatus]);
- // ========================= Refs =========================
- const containerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const refs = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- focus: () => {
- var _a;
- (_a = refs.current[0]) === null || _a === void 0 ? void 0 : _a.focus();
- },
- blur: () => {
- var _a;
- for (let i = 0; i < length; i += 1) {
- (_a = refs.current[i]) === null || _a === void 0 ? void 0 : _a.blur();
- }
- },
- nativeElement: containerRef.current
- }));
- // ======================= Formatter ======================
- const internalFormatter = txt => formatter ? formatter(txt) : txt;
- // ======================== Values ========================
- const [valueCells, setValueCells] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(() => strToArr(internalFormatter(defaultValue || '')));
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (value !== undefined) {
- setValueCells(strToArr(value));
- }
- }, [value]);
- const triggerValueCellsChange = (0,useEvent["default"])(nextValueCells => {
- setValueCells(nextValueCells);
- if (onInput) {
- onInput(nextValueCells);
- }
- // Trigger if all cells are filled
- if (onChange && nextValueCells.length === length && nextValueCells.every(c => c) && nextValueCells.some((c, index) => valueCells[index] !== c)) {
- onChange(nextValueCells.join(''));
- }
- });
- const patchValue = (0,useEvent["default"])((index, txt) => {
- let nextCells = (0,toConsumableArray["default"])(valueCells);
- // Fill cells till index
- for (let i = 0; i < index; i += 1) {
- if (!nextCells[i]) {
- nextCells[i] = '';
- }
- }
- if (txt.length <= 1) {
- nextCells[index] = txt;
- } else {
- nextCells = nextCells.slice(0, index).concat(strToArr(txt));
- }
- nextCells = nextCells.slice(0, length);
- // Clean the last empty cell
- for (let i = nextCells.length - 1; i >= 0; i -= 1) {
- if (nextCells[i]) {
- break;
- }
- nextCells.pop();
- }
- // Format if needed
- const formattedValue = internalFormatter(nextCells.map(c => c || ' ').join(''));
- nextCells = strToArr(formattedValue).map((c, i) => {
- if (c === ' ' && !nextCells[i]) {
- return nextCells[i];
- }
- return c;
- });
- return nextCells;
- });
- // ======================== Change ========================
- const onInputChange = (index, txt) => {
- var _a;
- const nextCells = patchValue(index, txt);
- const nextIndex = Math.min(index + txt.length, length - 1);
- if (nextIndex !== index && nextCells[index] !== undefined) {
- (_a = refs.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
- }
- triggerValueCellsChange(nextCells);
- };
- const onInputActiveChange = nextIndex => {
- var _a;
- (_a = refs.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus();
- };
- // ======================== Render ========================
- const inputSharedProps = {
- variant,
- disabled,
- status: mergedStatus,
- mask,
- type,
- inputMode
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, domAttrs, {
- ref: containerRef,
- className: classnames_default()(prefixCls, {
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, cssVarCls, hashId),
- role: "group"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FormItemInputContext.Provider, {
- value: proxyFormContext
- }, Array.from({
- length
- }).map((_, index) => {
- const key = `otp-${index}`;
- const singleValue = valueCells[index] || '';
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
- key: key
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OTP_OTPInput, Object.assign({
- ref: inputEle => {
- refs.current[index] = inputEle;
- },
- index: index,
- size: mergedSize,
- htmlSize: 1,
- className: `${prefixCls}-input`,
- onChange: onInputChange,
- value: singleValue,
- onActiveChange: onInputActiveChange,
- autoFocus: index === 0 && autoFocus
- }, inputSharedProps)), index < length - 1 && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Separator, {
- separator: separator,
- index: index,
- prefixCls: prefixCls
- })));
- }))));
- });
- /* harmony default export */ var input_OTP = (OTP);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
- // This icon file is generated automatically.
- var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
- /* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_EyeInvisibleOutlined
- }));
- };
- /** */
- var EyeInvisibleOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined);
- if (true) {
- EyeInvisibleOutlined_RefIcon.displayName = 'EyeInvisibleOutlined';
- }
- /* harmony default export */ var icons_EyeInvisibleOutlined = (EyeInvisibleOutlined_RefIcon);
- ;// ./components/input/Password.tsx
- var Password_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const defaultIconRender = visible => visible ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EyeOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EyeInvisibleOutlined, null);
- const actionMap = {
- click: 'onClick',
- hover: 'onMouseOver'
- };
- const Password = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- disabled: customDisabled,
- action = 'click',
- visibilityToggle = true,
- iconRender = defaultIconRender,
- suffix
- } = props;
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
- const [visible, setVisible] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
- const inputRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (visibilityControlled) {
- setVisible(visibilityToggle.visible);
- }
- }, [visibilityControlled, visibilityToggle]);
- // Remove Password value
- const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
- const onVisibleChange = () => {
- var _a;
- if (mergedDisabled) {
- return;
- }
- if (visible) {
- removePasswordTimeout();
- }
- const nextVisible = !visible;
- setVisible(nextVisible);
- if (typeof visibilityToggle === 'object') {
- (_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, nextVisible);
- }
- };
- const getIcon = prefixCls => {
- const iconTrigger = actionMap[action] || '';
- const icon = iconRender(visible);
- const iconProps = {
- [iconTrigger]: onVisibleChange,
- className: `${prefixCls}-icon`,
- key: 'passwordIcon',
- onMouseDown: e => {
- // Prevent focused state lost
- // https://github.com/ant-design/ant-design/issues/15173
- e.preventDefault();
- },
- onMouseUp: e => {
- // Prevent caret position change
- // https://github.com/ant-design/ant-design/issues/23524
- e.preventDefault();
- }
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(icon) ? icon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, icon), iconProps);
- };
- const {
- className,
- prefixCls: customizePrefixCls,
- inputPrefixCls: customizeInputPrefixCls,
- size
- } = props,
- restProps = Password_rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
- const prefixCls = getPrefixCls('input-password', customizePrefixCls);
- const suffixIcon = visibilityToggle && getIcon(prefixCls);
- const inputClassName = classnames_default()(prefixCls, className, {
- [`${prefixCls}-${size}`]: !!size
- });
- const omittedProps = Object.assign(Object.assign({}, (0,omit["default"])(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
- type: visible ? 'text' : 'password',
- className: inputClassName,
- prefixCls: inputPrefixCls,
- suffix: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, suffixIcon, suffix))
- });
- if (size) {
- omittedProps.size = size;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_Input, Object.assign({
- ref: (0,es_ref.composeRef)(ref, inputRef)
- }, omittedProps));
- });
- if (true) {
- Password.displayName = 'Input.Password';
- }
- /* harmony default export */ var input_Password = (Password);
- ;// ./components/input/Search.tsx
- var Search_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Search = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- inputPrefixCls: customizeInputPrefixCls,
- className,
- size: customizeSize,
- suffix,
- enterButton = false,
- addonAfter,
- loading,
- disabled,
- onSearch: customOnSearch,
- onChange: customOnChange,
- onCompositionStart,
- onCompositionEnd,
- variant,
- onPressEnter: customOnPressEnter
- } = props,
- restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd", "variant", "onPressEnter"]);
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const composedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- const prefixCls = getPrefixCls('input-search', customizePrefixCls);
- const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
- const {
- compactSize
- } = useCompactItemContext(prefixCls, direction);
- const size = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- const inputRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const onChange = e => {
- if ((e === null || e === void 0 ? void 0 : e.target) && e.type === 'click' && customOnSearch) {
- customOnSearch(e.target.value, e, {
- source: 'clear'
- });
- }
- customOnChange === null || customOnChange === void 0 ? void 0 : customOnChange(e);
- };
- const onMouseDown = e => {
- var _a;
- if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
- e.preventDefault();
- }
- };
- const onSearch = e => {
- var _a, _b;
- if (customOnSearch) {
- customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e, {
- source: 'input'
- });
- }
- };
- const onPressEnter = e => {
- if (composedRef.current || loading) {
- return;
- }
- customOnPressEnter === null || customOnPressEnter === void 0 ? void 0 : customOnPressEnter(e);
- onSearch(e);
- };
- const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SearchOutlined, null) : null;
- const btnClassName = `${prefixCls}-button`;
- let button;
- const enterButtonAsElement = enterButton || {};
- const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
- if (isAntdButton || enterButtonAsElement.type === 'button') {
- button = (0,reactNode.cloneElement)(enterButtonAsElement, Object.assign({
- onMouseDown,
- onClick: e => {
- var _a, _b;
- (_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
- onSearch(e);
- },
- key: 'enterButton'
- }, isAntdButton ? {
- className: btnClassName,
- size
- } : {}));
- } else {
- button = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- className: btnClassName,
- color: enterButton ? 'primary' : 'default',
- size: size,
- disabled: disabled,
- key: "enterButton",
- onMouseDown: onMouseDown,
- onClick: onSearch,
- loading: loading,
- icon: searchIcon,
- variant: variant === 'borderless' || variant === 'filled' || variant === 'underlined' ? 'text' : enterButton ? 'solid' : undefined
- }, enterButton);
- }
- if (addonAfter) {
- button = [button, (0,reactNode.cloneElement)(addonAfter, {
- key: 'addonAfter'
- })];
- }
- const cls = classnames_default()(prefixCls, {
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-${size}`]: !!size,
- [`${prefixCls}-with-button`]: !!enterButton
- }, className);
- const handleOnCompositionStart = e => {
- composedRef.current = true;
- onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
- };
- const handleOnCompositionEnd = e => {
- composedRef.current = false;
- onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
- };
- const inputProps = Object.assign(Object.assign({}, restProps), {
- className: cls,
- prefixCls: inputPrefixCls,
- type: 'search',
- size,
- variant,
- onPressEnter,
- onCompositionStart: handleOnCompositionStart,
- onCompositionEnd: handleOnCompositionEnd,
- addonAfter: button,
- suffix,
- onChange,
- disabled
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_Input, Object.assign({
- ref: (0,es_ref.composeRef)(inputRef, ref)
- }, inputProps));
- });
- if (true) {
- Search.displayName = 'Search';
- }
- /* harmony default export */ var input_Search = (Search);
- ;// ./node_modules/rc-textarea/es/calculateNodeHeight.js
- // Thanks to https://github.com/andreypopp/react-textarea-autosize/
- /**
- * calculateNodeHeight(uiTextNode, useCache = false)
- */
- var HIDDEN_TEXTAREA_STYLE = "\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n";
- var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'font-variant', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing', 'word-break', 'white-space'];
- var computedStyleCache = {};
- var hiddenTextarea;
- function calculateNodeStyling(node) {
- var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
- if (useCache && computedStyleCache[nodeRef]) {
- return computedStyleCache[nodeRef];
- }
- var style = window.getComputedStyle(node);
- var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
- var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
- var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
- var sizingStyle = SIZING_STYLE.map(function (name) {
- return "".concat(name, ":").concat(style.getPropertyValue(name));
- }).join(';');
- var nodeInfo = {
- sizingStyle: sizingStyle,
- paddingSize: paddingSize,
- borderSize: borderSize,
- boxSizing: boxSizing
- };
- if (useCache && nodeRef) {
- computedStyleCache[nodeRef] = nodeInfo;
- }
- return nodeInfo;
- }
- function calculateAutoSizeStyle(uiTextNode) {
- var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- var maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- if (!hiddenTextarea) {
- hiddenTextarea = document.createElement('textarea');
- hiddenTextarea.setAttribute('tab-index', '-1');
- hiddenTextarea.setAttribute('aria-hidden', 'true');
- // fix: A form field element should have an id or name attribute
- // A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form.
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
- hiddenTextarea.setAttribute('name', 'hiddenTextarea');
- document.body.appendChild(hiddenTextarea);
- }
- // Fix wrap="off" issue
- // https://github.com/ant-design/ant-design/issues/6577
- if (uiTextNode.getAttribute('wrap')) {
- hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
- } else {
- hiddenTextarea.removeAttribute('wrap');
- }
- // Copy all CSS properties that have an impact on the height of the content in
- // the textbox
- var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
- paddingSize = _calculateNodeStyling.paddingSize,
- borderSize = _calculateNodeStyling.borderSize,
- boxSizing = _calculateNodeStyling.boxSizing,
- sizingStyle = _calculateNodeStyling.sizingStyle;
- // Need to have the overflow attribute to hide the scrollbar otherwise
- // text-lines will not calculated properly as the shadow will technically be
- // narrower for content
- hiddenTextarea.setAttribute('style', "".concat(sizingStyle, ";").concat(HIDDEN_TEXTAREA_STYLE));
- hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
- var minHeight = undefined;
- var maxHeight = undefined;
- var overflowY;
- var height = hiddenTextarea.scrollHeight;
- if (boxSizing === 'border-box') {
- // border-box: add border, since height = content + padding + border
- height += borderSize;
- } else if (boxSizing === 'content-box') {
- // remove padding, since height = content
- height -= paddingSize;
- }
- if (minRows !== null || maxRows !== null) {
- // measure height of a textarea with a single row
- hiddenTextarea.value = ' ';
- var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
- if (minRows !== null) {
- minHeight = singleRowHeight * minRows;
- if (boxSizing === 'border-box') {
- minHeight = minHeight + paddingSize + borderSize;
- }
- height = Math.max(minHeight, height);
- }
- if (maxRows !== null) {
- maxHeight = singleRowHeight * maxRows;
- if (boxSizing === 'border-box') {
- maxHeight = maxHeight + paddingSize + borderSize;
- }
- overflowY = height > maxHeight ? '' : 'hidden';
- height = Math.min(maxHeight, height);
- }
- }
- var style = {
- height: height,
- overflowY: overflowY,
- resize: 'none'
- };
- if (minHeight) {
- style.minHeight = minHeight;
- }
- if (maxHeight) {
- style.maxHeight = maxHeight;
- }
- return style;
- }
- ;// ./node_modules/rc-textarea/es/ResizableTextArea.js
- var ResizableTextArea_excluded = ["prefixCls", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"];
- var RESIZE_START = 0;
- var RESIZE_MEASURING = 1;
- var RESIZE_STABLE = 2;
- var ResizableTextArea = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _ref = props,
- prefixCls = _ref.prefixCls,
- defaultValue = _ref.defaultValue,
- value = _ref.value,
- autoSize = _ref.autoSize,
- onResize = _ref.onResize,
- className = _ref.className,
- style = _ref.style,
- disabled = _ref.disabled,
- onChange = _ref.onChange,
- onInternalAutoSize = _ref.onInternalAutoSize,
- restProps = (0,objectWithoutProperties["default"])(_ref, ResizableTextArea_excluded);
- // =============================== Value ================================
- var _useMergedState = (0,useMergedState["default"])(defaultValue, {
- value: value,
- postState: function postState(val) {
- return val !== null && val !== void 0 ? val : '';
- }
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedValue = _useMergedState2[0],
- setMergedValue = _useMergedState2[1];
- var onInternalChange = function onInternalChange(event) {
- setMergedValue(event.target.value);
- onChange === null || onChange === void 0 || onChange(event);
- };
- // ================================ Ref =================================
- var textareaRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- textArea: textareaRef.current
- };
- });
- // ============================== AutoSize ==============================
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (autoSize && (0,esm_typeof["default"])(autoSize) === 'object') {
- return [autoSize.minRows, autoSize.maxRows];
- }
- return [];
- }, [autoSize]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- minRows = _React$useMemo2[0],
- maxRows = _React$useMemo2[1];
- var needAutoSize = !!autoSize;
- // =============================== Resize ===============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(RESIZE_STABLE),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- resizeState = _React$useState2[0],
- setResizeState = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- autoSizeStyle = _React$useState4[0],
- setAutoSizeStyle = _React$useState4[1];
- var startResize = function startResize() {
- setResizeState(RESIZE_START);
- if (false) // removed by dead control flow
- {}
- };
- // Change to trigger resize measure
- (0,useLayoutEffect["default"])(function () {
- if (needAutoSize) {
- startResize();
- }
- }, [value, minRows, maxRows, needAutoSize]);
- (0,useLayoutEffect["default"])(function () {
- if (resizeState === RESIZE_START) {
- setResizeState(RESIZE_MEASURING);
- } else if (resizeState === RESIZE_MEASURING) {
- var textareaStyles = calculateAutoSizeStyle(textareaRef.current, false, minRows, maxRows);
- // Safari has bug that text will keep break line on text cut when it's prev is break line.
- // ZombieJ: This not often happen. So we just skip it.
- // const { selectionStart, selectionEnd, scrollTop } = textareaRef.current;
- // const { value: tmpValue } = textareaRef.current;
- // textareaRef.current.value = '';
- // textareaRef.current.value = tmpValue;
- // if (document.activeElement === textareaRef.current) {
- // textareaRef.current.scrollTop = scrollTop;
- // textareaRef.current.setSelectionRange(selectionStart, selectionEnd);
- // }
- setResizeState(RESIZE_STABLE);
- setAutoSizeStyle(textareaStyles);
- } else {
- // https://github.com/react-component/textarea/pull/23
- // Firefox has blink issue before but fixed in latest version.
- }
- }, [resizeState]);
- // We lock resize trigger by raf to avoid Safari warning
- var resizeRafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var cleanRaf = function cleanRaf() {
- raf["default"].cancel(resizeRafRef.current);
- };
- var onInternalResize = function onInternalResize(size) {
- if (resizeState === RESIZE_STABLE) {
- onResize === null || onResize === void 0 || onResize(size);
- if (autoSize) {
- cleanRaf();
- resizeRafRef.current = (0,raf["default"])(function () {
- startResize();
- });
- }
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return cleanRaf;
- }, []);
- // =============================== Render ===============================
- var mergedAutoSizeStyle = needAutoSize ? autoSizeStyle : null;
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), mergedAutoSizeStyle);
- if (resizeState === RESIZE_START || resizeState === RESIZE_MEASURING) {
- mergedStyle.overflowY = 'hidden';
- mergedStyle.overflowX = 'hidden';
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onInternalResize,
- disabled: !(autoSize || onResize)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("textarea", (0,esm_extends["default"])({}, restProps, {
- ref: textareaRef,
- style: mergedStyle,
- className: classnames_default()(prefixCls, className, (0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), disabled)),
- disabled: disabled,
- value: mergedValue,
- onChange: onInternalChange
- })));
- });
- /* harmony default export */ var es_ResizableTextArea = (ResizableTextArea);
- ;// ./node_modules/rc-textarea/es/TextArea.js
- var TextArea_excluded = ["defaultValue", "value", "onFocus", "onBlur", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "showCount", "count", "className", "style", "disabled", "hidden", "classNames", "styles", "onResize", "onClear", "onPressEnter", "readOnly", "autoSize", "onKeyDown"];
- var TextArea = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function (_ref, ref) {
- var _countConfig$max;
- var defaultValue = _ref.defaultValue,
- customValue = _ref.value,
- onFocus = _ref.onFocus,
- onBlur = _ref.onBlur,
- onChange = _ref.onChange,
- allowClear = _ref.allowClear,
- maxLength = _ref.maxLength,
- onCompositionStart = _ref.onCompositionStart,
- onCompositionEnd = _ref.onCompositionEnd,
- suffix = _ref.suffix,
- _ref$prefixCls = _ref.prefixCls,
- prefixCls = _ref$prefixCls === void 0 ? 'rc-textarea' : _ref$prefixCls,
- showCount = _ref.showCount,
- count = _ref.count,
- className = _ref.className,
- style = _ref.style,
- disabled = _ref.disabled,
- hidden = _ref.hidden,
- classNames = _ref.classNames,
- styles = _ref.styles,
- onResize = _ref.onResize,
- onClear = _ref.onClear,
- onPressEnter = _ref.onPressEnter,
- readOnly = _ref.readOnly,
- autoSize = _ref.autoSize,
- onKeyDown = _ref.onKeyDown,
- rest = (0,objectWithoutProperties["default"])(_ref, TextArea_excluded);
- var _useMergedState = (0,useMergedState["default"])(defaultValue, {
- value: customValue,
- defaultValue: defaultValue
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- value = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var formatValue = value === undefined || value === null ? '' : String(value);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- focused = _React$useState2[0],
- setFocused = _React$useState2[1];
- var compositionRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(false);
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- textareaResized = _React$useState4[0],
- setTextareaResized = _React$useState4[1];
- // =============================== Ref ================================
- var holderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var resizableTextAreaRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var getTextArea = function getTextArea() {
- var _resizableTextAreaRef;
- return (_resizableTextAreaRef = resizableTextAreaRef.current) === null || _resizableTextAreaRef === void 0 ? void 0 : _resizableTextAreaRef.textArea;
- };
- var focus = function focus() {
- getTextArea().focus();
- };
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- var _holderRef$current;
- return {
- resizableTextArea: resizableTextAreaRef.current,
- focus: focus,
- blur: function blur() {
- getTextArea().blur();
- },
- nativeElement: ((_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.nativeElement) || getTextArea()
- };
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- setFocused(function (prev) {
- return !disabled && prev;
- });
- }, [disabled]);
- // =========================== Select Range ===========================
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- selection = _React$useState6[0],
- setSelection = _React$useState6[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
- if (selection) {
- var _getTextArea;
- (_getTextArea = getTextArea()).setSelectionRange.apply(_getTextArea, (0,toConsumableArray["default"])(selection));
- }
- }, [selection]);
- // ============================== Count ===============================
- var countConfig = useCount(count, showCount);
- var mergedMax = (_countConfig$max = countConfig.max) !== null && _countConfig$max !== void 0 ? _countConfig$max : maxLength;
- // Max length value
- var hasMaxLength = Number(mergedMax) > 0;
- var valueLength = countConfig.strategy(formatValue);
- var isOutOfRange = !!mergedMax && valueLength > mergedMax;
- // ============================== Change ==============================
- var triggerChange = function triggerChange(e, currentValue) {
- var cutValue = currentValue;
- if (!compositionRef.current && countConfig.exceedFormatter && countConfig.max && countConfig.strategy(currentValue) > countConfig.max) {
- cutValue = countConfig.exceedFormatter(currentValue, {
- max: countConfig.max
- });
- if (currentValue !== cutValue) {
- setSelection([getTextArea().selectionStart || 0, getTextArea().selectionEnd || 0]);
- }
- }
- setValue(cutValue);
- resolveOnChange(e.currentTarget, e, onChange, cutValue);
- };
- // =========================== Value Update ===========================
- var onInternalCompositionStart = function onInternalCompositionStart(e) {
- compositionRef.current = true;
- onCompositionStart === null || onCompositionStart === void 0 || onCompositionStart(e);
- };
- var onInternalCompositionEnd = function onInternalCompositionEnd(e) {
- compositionRef.current = false;
- triggerChange(e, e.currentTarget.value);
- onCompositionEnd === null || onCompositionEnd === void 0 || onCompositionEnd(e);
- };
- var onInternalChange = function onInternalChange(e) {
- triggerChange(e, e.target.value);
- };
- var handleKeyDown = function handleKeyDown(e) {
- if (e.key === 'Enter' && onPressEnter) {
- onPressEnter(e);
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
- };
- var handleFocus = function handleFocus(e) {
- setFocused(true);
- onFocus === null || onFocus === void 0 || onFocus(e);
- };
- var handleBlur = function handleBlur(e) {
- setFocused(false);
- onBlur === null || onBlur === void 0 || onBlur(e);
- };
- // ============================== Reset ===============================
- var handleReset = function handleReset(e) {
- setValue('');
- focus();
- resolveOnChange(getTextArea(), e, onChange);
- };
- var suffixNode = suffix;
- var dataCount;
- if (countConfig.show) {
- if (countConfig.showFormatter) {
- dataCount = countConfig.showFormatter({
- value: formatValue,
- count: valueLength,
- maxLength: mergedMax
- });
- } else {
- dataCount = "".concat(valueLength).concat(hasMaxLength ? " / ".concat(mergedMax) : '');
- }
- suffixNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, suffixNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(prefixCls, "-data-count"), classNames === null || classNames === void 0 ? void 0 : classNames.count),
- style: styles === null || styles === void 0 ? void 0 : styles.count
- }, dataCount));
- }
- var handleResize = function handleResize(size) {
- var _getTextArea2;
- onResize === null || onResize === void 0 || onResize(size);
- if ((_getTextArea2 = getTextArea()) !== null && _getTextArea2 !== void 0 && _getTextArea2.style.height) {
- setTextareaResized(true);
- }
- };
- var isPureTextArea = !autoSize && !showCount && !allowClear;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_BaseInput, {
- ref: holderRef,
- value: formatValue,
- allowClear: allowClear,
- handleReset: handleReset,
- suffix: suffixNode,
- prefixCls: prefixCls,
- classNames: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, classNames), {}, {
- affixWrapper: classnames_default()(classNames === null || classNames === void 0 ? void 0 : classNames.affixWrapper, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-show-count"), showCount), "".concat(prefixCls, "-textarea-allow-clear"), allowClear))
- }),
- disabled: disabled,
- focused: focused,
- className: classnames_default()(className, isOutOfRange && "".concat(prefixCls, "-out-of-range")),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), textareaResized && !isPureTextArea ? {
- height: 'auto'
- } : {}),
- dataAttrs: {
- affixWrapper: {
- 'data-count': typeof dataCount === 'string' ? dataCount : undefined
- }
- },
- hidden: hidden,
- readOnly: readOnly,
- onClear: onClear
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_ResizableTextArea, (0,esm_extends["default"])({}, rest, {
- autoSize: autoSize,
- maxLength: maxLength,
- onKeyDown: handleKeyDown,
- onChange: onInternalChange,
- onFocus: handleFocus,
- onBlur: handleBlur,
- onCompositionStart: onInternalCompositionStart,
- onCompositionEnd: onInternalCompositionEnd,
- className: classnames_default()(classNames === null || classNames === void 0 ? void 0 : classNames.textarea),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, styles === null || styles === void 0 ? void 0 : styles.textarea), {}, {
- resize: style === null || style === void 0 ? void 0 : style.resize
- }),
- disabled: disabled,
- prefixCls: prefixCls,
- onResize: handleResize,
- ref: resizableTextAreaRef,
- readOnly: readOnly
- })));
- });
- /* harmony default export */ var es_TextArea = (TextArea);
- ;// ./node_modules/rc-textarea/es/index.js
- /* harmony default export */ var rc_textarea_es = (es_TextArea);
- ;// ./components/input/style/textarea.ts
- const genTextAreaStyle = token => {
- const {
- componentCls,
- paddingLG
- } = token;
- const textareaPrefixCls = `${componentCls}-textarea`;
- return {
- // Raw Textarea
- [`textarea${componentCls}`]: {
- maxWidth: '100%',
- // prevent textarea resize from coming out of its container
- height: 'auto',
- minHeight: token.controlHeight,
- lineHeight: token.lineHeight,
- verticalAlign: 'bottom',
- transition: `all ${token.motionDurationSlow}`,
- resize: 'vertical',
- [`&${componentCls}-mouse-active`]: {
- transition: `all ${token.motionDurationSlow}, height 0s, width 0s`
- }
- },
- // Wrapper for resize
- [`${componentCls}-textarea-affix-wrapper-resize-dirty`]: {
- width: 'auto'
- },
- [textareaPrefixCls]: {
- position: 'relative',
- '&-show-count': {
- [`${componentCls}-data-count`]: {
- position: 'absolute',
- bottom: token.calc(token.fontSize).mul(token.lineHeight).mul(-1).equal(),
- insetInlineEnd: 0,
- color: token.colorTextDescription,
- whiteSpace: 'nowrap',
- pointerEvents: 'none'
- }
- },
- [`
- &-allow-clear > ${componentCls},
- &-affix-wrapper${textareaPrefixCls}-has-feedback ${componentCls}
- `]: {
- paddingInlineEnd: paddingLG
- },
- [`&-affix-wrapper${componentCls}-affix-wrapper`]: {
- padding: 0,
- [`> textarea${componentCls}`]: {
- fontSize: 'inherit',
- border: 'none',
- outline: 'none',
- background: 'transparent',
- minHeight: token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal(),
- '&:focus': {
- boxShadow: 'none !important'
- }
- },
- [`${componentCls}-suffix`]: {
- margin: 0,
- '> *:not(:last-child)': {
- marginInline: 0
- },
- // Clear Icon
- [`${componentCls}-clear-icon`]: {
- position: 'absolute',
- insetInlineEnd: token.paddingInline,
- insetBlockStart: token.paddingXS
- },
- // Feedback Icon
- [`${textareaPrefixCls}-suffix`]: {
- position: 'absolute',
- top: 0,
- insetInlineEnd: token.paddingInline,
- bottom: 0,
- zIndex: 1,
- display: 'inline-flex',
- alignItems: 'center',
- margin: 'auto',
- pointerEvents: 'none'
- }
- }
- },
- [`&-affix-wrapper${componentCls}-affix-wrapper-rtl`]: {
- [`${componentCls}-suffix`]: {
- [`${componentCls}-data-count`]: {
- direction: 'ltr',
- insetInlineStart: 0
- }
- }
- },
- [`&-affix-wrapper${componentCls}-affix-wrapper-sm`]: {
- [`${componentCls}-suffix`]: {
- [`${componentCls}-clear-icon`]: {
- insetInlineEnd: token.paddingInlineSM
- }
- }
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var style_textarea = ((0,genStyleUtils.genStyleHooks)(['Input', 'TextArea'], token => {
- const inputToken = (0,cssinjs_utils_es.mergeToken)(token, (0,input_style_token.initInputToken)(token));
- return genTextAreaStyle(inputToken);
- }, input_style_token.initComponentToken, {
- resetFont: false
- }));
- ;// ./components/input/TextArea.tsx
- var TextArea_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TextArea_TextArea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- bordered = true,
- size: customizeSize,
- disabled: customDisabled,
- status: customStatus,
- allowClear,
- classNames: classes,
- rootClassName,
- className,
- style,
- styles,
- variant: customVariant,
- showCount,
- onMouseDown,
- onResize
- } = props,
- rest = TextArea_rest(props, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant", "showCount", "onMouseDown", "onResize"]);
- if (true) {
- const {
- deprecated
- } = (0,_util_warning.devUseWarning)('TextArea');
- deprecated(!('bordered' in props), 'bordered', 'variant');
- }
- const {
- getPrefixCls,
- direction,
- allowClear: contextAllowClear,
- autoComplete: contextAutoComplete,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('textArea');
- // =================== Disabled ===================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- // ==================== Status ====================
- const {
- status: contextStatus,
- hasFeedback,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- // ===================== Ref ======================
- const innerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => {
- var _a;
- return {
- resizableTextArea: (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea,
- focus: option => {
- var _a, _b;
- triggerFocus((_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) === null || _b === void 0 ? void 0 : _b.textArea, option);
- },
- blur: () => {
- var _a;
- return (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();
- }
- };
- });
- const prefixCls = getPrefixCls('input', customizePrefixCls);
- // ==================== Style =====================
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapSharedCSSVar, hashId, cssVarCls] = (0,input_style.useSharedStyle)(prefixCls, rootClassName);
- const [wrapCSSVar] = style_textarea(prefixCls, rootCls);
- // ================= Compact Item =================
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- // ===================== Size =====================
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- const [variant, enableVariantCls] = useVariants('textArea', customVariant, bordered);
- const mergedAllowClear = _util_getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
- // ==================== Resize ====================
- // https://github.com/ant-design/ant-design/issues/51594
- const [isMouseDown, setIsMouseDown] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- // When has wrapper, resize will make as dirty for `resize: both` style
- const [resizeDirty, setResizeDirty] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const onInternalMouseDown = e => {
- setIsMouseDown(true);
- onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
- const onMouseUp = () => {
- setIsMouseDown(false);
- document.removeEventListener('mouseup', onMouseUp);
- };
- document.addEventListener('mouseup', onMouseUp);
- };
- const onInternalResize = size => {
- var _a, _b;
- onResize === null || onResize === void 0 ? void 0 : onResize(size);
- // Change to dirty since this maybe from the `resize: both` style
- if (isMouseDown && typeof getComputedStyle === 'function') {
- const ele = (_b = (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('textarea');
- if (ele && getComputedStyle(ele).resize === 'both') {
- setResizeDirty(true);
- }
- }
- };
- // ==================== Render ====================
- return wrapSharedCSSVar(wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_textarea_es, Object.assign({
- autoComplete: contextAutoComplete
- }, rest, {
- style: Object.assign(Object.assign({}, contextStyle), style),
- styles: Object.assign(Object.assign({}, contextStyles), styles),
- disabled: mergedDisabled,
- allowClear: mergedAllowClear,
- className: classnames_default()(cssVarCls, rootCls, className, rootClassName, compactItemClassnames, contextClassName,
- // Only for wrapper
- resizeDirty && `${prefixCls}-textarea-affix-wrapper-resize-dirty`),
- classNames: Object.assign(Object.assign(Object.assign({}, classes), contextClassNames), {
- textarea: classnames_default()({
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-lg`]: mergedSize === 'large'
- }, hashId, classes === null || classes === void 0 ? void 0 : classes.textarea, contextClassNames.textarea, isMouseDown && `${prefixCls}-mouse-active`),
- variant: classnames_default()({
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, mergedStatus)),
- affixWrapper: classnames_default()(`${prefixCls}-textarea-affix-wrapper`, {
- [`${prefixCls}-affix-wrapper-rtl`]: direction === 'rtl',
- [`${prefixCls}-affix-wrapper-sm`]: mergedSize === 'small',
- [`${prefixCls}-affix-wrapper-lg`]: mergedSize === 'large',
- [`${prefixCls}-textarea-show-count`]: showCount || ((_a = props.count) === null || _a === void 0 ? void 0 : _a.show)
- }, hashId)
- }),
- prefixCls: prefixCls,
- suffix: hasFeedback && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-textarea-suffix`
- }, feedbackIcon),
- showCount: showCount,
- ref: innerRef,
- onResize: onInternalResize,
- onMouseDown: onInternalMouseDown
- }))));
- });
- /* harmony default export */ var input_TextArea = (TextArea_TextArea);
- ;// ./components/input/index.tsx
- const components_input_Input = input_Input;
- components_input_Input.Group = input_Group;
- components_input_Input.Search = input_Search;
- components_input_Input.TextArea = input_TextArea;
- components_input_Input.Password = input_Password;
- components_input_Input.OTP = input_OTP;
- /* harmony default export */ var input = (components_input_Input);
- ;// ./components/layout/hooks/useHasSider.ts
- function useHasSider(siders, children, hasSider) {
- if (typeof hasSider === 'boolean') {
- return hasSider;
- }
- if (siders.length) {
- return true;
- }
- const childNodes = (0,toArray["default"])(children);
- return childNodes.some(node => node.type === layout_Sider);
- }
- ;// ./components/layout/layout.tsx
- var layout_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function generator({
- suffixCls,
- tagName,
- displayName
- }) {
- return BasicComponent => {
- const Adapter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(BasicComponent, Object.assign({
- ref: ref,
- suffixCls: suffixCls,
- tagName: tagName
- }, props))));
- if (true) {
- Adapter.displayName = displayName;
- }
- return Adapter;
- };
- }
- const Basic = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- suffixCls,
- className,
- tagName: TagName
- } = props,
- others = layout_rest(props, ["prefixCls", "suffixCls", "className", "tagName"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('layout', customizePrefixCls);
- const [wrapSSR, hashId, cssVarCls] = (0,layout_style["default"])(prefixCls);
- const prefixWithSuffixCls = suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
- return wrapSSR(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TagName, Object.assign({
- className: classnames_default()(customizePrefixCls || prefixWithSuffixCls, className, hashId, cssVarCls),
- ref: ref
- }, others)));
- });
- const BasicLayout = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [siders, setSiders] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- children,
- hasSider,
- tagName: Tag,
- style
- } = props,
- others = layout_rest(props, ["prefixCls", "className", "rootClassName", "children", "hasSider", "tagName", "style"]);
- const passedProps = (0,omit["default"])(others, ['suffixCls']);
- const {
- getPrefixCls,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('layout');
- const prefixCls = getPrefixCls('layout', customizePrefixCls);
- const mergedHasSider = useHasSider(siders, children, hasSider);
- const [wrapCSSVar, hashId, cssVarCls] = (0,layout_style["default"])(prefixCls);
- const classString = classnames_default()(prefixCls, {
- [`${prefixCls}-has-sider`]: mergedHasSider,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- siderHook: {
- addSider: id => {
- setSiders(prev => [].concat((0,toConsumableArray["default"])(prev), [id]));
- },
- removeSider: id => {
- setSiders(prev => prev.filter(currentId => currentId !== id));
- }
- }
- }), []);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(LayoutContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Tag, Object.assign({
- ref: ref,
- className: classString,
- style: Object.assign(Object.assign({}, contextStyle), style)
- }, passedProps), children)));
- });
- const Layout = generator({
- tagName: 'div',
- displayName: 'Layout'
- })(BasicLayout);
- const layout_Header = generator({
- suffixCls: 'header',
- tagName: 'header',
- displayName: 'Header'
- })(Basic);
- const layout_Footer = generator({
- suffixCls: 'footer',
- tagName: 'footer',
- displayName: 'Footer'
- })(Basic);
- const layout_Content = generator({
- suffixCls: 'content',
- tagName: 'main',
- displayName: 'Content'
- })(Basic);
- /* harmony default export */ var layout = (Layout);
- ;// ./components/layout/index.tsx
- const layout_Layout = layout;
- layout_Layout.Header = layout_Header;
- layout_Layout.Footer = layout_Footer;
- layout_Layout.Content = layout_Content;
- layout_Layout.Sider = layout_Sider;
- layout_Layout._InternalSiderContext = SiderContext;
- /* harmony default export */ var components_layout = (layout_Layout);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/DoubleLeftOutlined.js
- // This icon file is generated automatically.
- var DoubleLeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z" } }] }, "name": "double-left", "theme": "outlined" };
- /* harmony default export */ var asn_DoubleLeftOutlined = (DoubleLeftOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/DoubleLeftOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var DoubleLeftOutlined_DoubleLeftOutlined = function DoubleLeftOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_DoubleLeftOutlined
- }));
- };
- /** */
- var DoubleLeftOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DoubleLeftOutlined_DoubleLeftOutlined);
- if (true) {
- DoubleLeftOutlined_RefIcon.displayName = 'DoubleLeftOutlined';
- }
- /* harmony default export */ var icons_DoubleLeftOutlined = (DoubleLeftOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/DoubleRightOutlined.js
- // This icon file is generated automatically.
- var DoubleRightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z" } }] }, "name": "double-right", "theme": "outlined" };
- /* harmony default export */ var asn_DoubleRightOutlined = (DoubleRightOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/DoubleRightOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var DoubleRightOutlined_DoubleRightOutlined = function DoubleRightOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_DoubleRightOutlined
- }));
- };
- /** */
- var DoubleRightOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DoubleRightOutlined_DoubleRightOutlined);
- if (true) {
- DoubleRightOutlined_RefIcon.displayName = 'DoubleRightOutlined';
- }
- /* harmony default export */ var icons_DoubleRightOutlined = (DoubleRightOutlined_RefIcon);
- // EXTERNAL MODULE: ./node_modules/rc-pagination/es/locale/zh_CN.js
- var zh_CN = __webpack_require__("./node_modules/rc-pagination/es/locale/zh_CN.js");
- ;// ./node_modules/rc-pagination/es/Options.js
- var defaultPageSizeOptions = [10, 20, 50, 100];
- var Options = function Options(props) {
- var _props$pageSizeOption = props.pageSizeOptions,
- pageSizeOptions = _props$pageSizeOption === void 0 ? defaultPageSizeOptions : _props$pageSizeOption,
- locale = props.locale,
- changeSize = props.changeSize,
- pageSize = props.pageSize,
- goButton = props.goButton,
- quickGo = props.quickGo,
- rootPrefixCls = props.rootPrefixCls,
- disabled = props.disabled,
- buildOptionText = props.buildOptionText,
- showSizeChanger = props.showSizeChanger,
- sizeChangerRender = props.sizeChangerRender;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(''),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- goInputText = _React$useState2[0],
- setGoInputText = _React$useState2[1];
- var getValidValue = function getValidValue() {
- return !goInputText || Number.isNaN(goInputText) ? undefined : Number(goInputText);
- };
- var mergeBuildOptionText = typeof buildOptionText === 'function' ? buildOptionText : function (value) {
- return "".concat(value, " ").concat(locale.items_per_page);
- };
- var handleChange = function handleChange(e) {
- setGoInputText(e.target.value);
- };
- var handleBlur = function handleBlur(e) {
- if (goButton || goInputText === '') {
- return;
- }
- setGoInputText('');
- if (e.relatedTarget && (e.relatedTarget.className.indexOf("".concat(rootPrefixCls, "-item-link")) >= 0 || e.relatedTarget.className.indexOf("".concat(rootPrefixCls, "-item")) >= 0)) {
- return;
- }
- quickGo === null || quickGo === void 0 || quickGo(getValidValue());
- };
- var go = function go(e) {
- if (goInputText === '') {
- return;
- }
- if (e.keyCode === KeyCode["default"].ENTER || e.type === 'click') {
- setGoInputText('');
- quickGo === null || quickGo === void 0 || quickGo(getValidValue());
- }
- };
- var getPageSizeOptions = function getPageSizeOptions() {
- if (pageSizeOptions.some(function (option) {
- return option.toString() === pageSize.toString();
- })) {
- return pageSizeOptions;
- }
- return pageSizeOptions.concat([pageSize]).sort(function (a, b) {
- var numberA = Number.isNaN(Number(a)) ? 0 : Number(a);
- var numberB = Number.isNaN(Number(b)) ? 0 : Number(b);
- return numberA - numberB;
- });
- };
- // ============== cls ==============
- var prefixCls = "".concat(rootPrefixCls, "-options");
- // ============== render ==============
- if (!showSizeChanger && !quickGo) {
- return null;
- }
- var changeSelect = null;
- var goInput = null;
- var gotoButton = null;
- // >>>>> Size Changer
- if (showSizeChanger && sizeChangerRender) {
- changeSelect = sizeChangerRender({
- disabled: disabled,
- size: pageSize,
- onSizeChange: function onSizeChange(nextValue) {
- changeSize === null || changeSize === void 0 || changeSize(Number(nextValue));
- },
- 'aria-label': locale.page_size,
- className: "".concat(prefixCls, "-size-changer"),
- options: getPageSizeOptions().map(function (opt) {
- return {
- label: mergeBuildOptionText(opt),
- value: opt
- };
- })
- });
- }
- // >>>>> Quick Go
- if (quickGo) {
- if (goButton) {
- gotoButton = typeof goButton === 'boolean' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
- type: "button",
- onClick: go,
- onKeyUp: go,
- disabled: disabled,
- className: "".concat(prefixCls, "-quick-jumper-button")
- }, locale.jump_to_confirm) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- onClick: go,
- onKeyUp: go
- }, goButton);
- }
- goInput = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-quick-jumper")
- }, locale.jump_to, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
- disabled: disabled,
- type: "text",
- value: goInputText,
- onChange: handleChange,
- onKeyUp: go,
- onBlur: handleBlur,
- "aria-label": locale.page
- }), locale.page, gotoButton);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- className: prefixCls
- }, changeSelect, goInput);
- };
- if (true) {
- Options.displayName = 'Options';
- }
- /* harmony default export */ var es_Options = (Options);
- ;// ./node_modules/rc-pagination/es/Pager.js
- /* eslint react/prop-types: 0 */
- var Pager = function Pager(props) {
- var rootPrefixCls = props.rootPrefixCls,
- page = props.page,
- active = props.active,
- className = props.className,
- showTitle = props.showTitle,
- onClick = props.onClick,
- onKeyPress = props.onKeyPress,
- itemRender = props.itemRender;
- var prefixCls = "".concat(rootPrefixCls, "-item");
- var cls = classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(page), (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-active"), active), "".concat(prefixCls, "-disabled"), !page), className);
- var handleClick = function handleClick() {
- onClick(page);
- };
- var handleKeyPress = function handleKeyPress(e) {
- onKeyPress(e, onClick, page);
- };
- var pager = itemRender(page, 'page', /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("a", {
- rel: "nofollow"
- }, page));
- return pager ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? String(page) : null,
- className: cls,
- onClick: handleClick,
- onKeyDown: handleKeyPress,
- tabIndex: 0
- }, pager) : null;
- };
- if (true) {
- Pager.displayName = 'Pager';
- }
- /* harmony default export */ var es_Pager = (Pager);
- ;// ./node_modules/rc-pagination/es/Pagination.js
- var defaultItemRender = function defaultItemRender(page, type, element) {
- return element;
- };
- function Pagination_noop() {}
- function isInteger(v) {
- var value = Number(v);
- return typeof value === 'number' && !Number.isNaN(value) && isFinite(value) && Math.floor(value) === value;
- }
- function calculatePage(p, pageSize, total) {
- var _pageSize = typeof p === 'undefined' ? pageSize : p;
- return Math.floor((total - 1) / _pageSize) + 1;
- }
- var Pagination = function Pagination(props) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-pagination' : _props$prefixCls,
- _props$selectPrefixCl = props.selectPrefixCls,
- selectPrefixCls = _props$selectPrefixCl === void 0 ? 'rc-select' : _props$selectPrefixCl,
- className = props.className,
- currentProp = props.current,
- _props$defaultCurrent = props.defaultCurrent,
- defaultCurrent = _props$defaultCurrent === void 0 ? 1 : _props$defaultCurrent,
- _props$total = props.total,
- total = _props$total === void 0 ? 0 : _props$total,
- pageSizeProp = props.pageSize,
- _props$defaultPageSiz = props.defaultPageSize,
- defaultPageSize = _props$defaultPageSiz === void 0 ? 10 : _props$defaultPageSiz,
- _props$onChange = props.onChange,
- onChange = _props$onChange === void 0 ? Pagination_noop : _props$onChange,
- hideOnSinglePage = props.hideOnSinglePage,
- align = props.align,
- _props$showPrevNextJu = props.showPrevNextJumpers,
- showPrevNextJumpers = _props$showPrevNextJu === void 0 ? true : _props$showPrevNextJu,
- showQuickJumper = props.showQuickJumper,
- showLessItems = props.showLessItems,
- _props$showTitle = props.showTitle,
- showTitle = _props$showTitle === void 0 ? true : _props$showTitle,
- _props$onShowSizeChan = props.onShowSizeChange,
- onShowSizeChange = _props$onShowSizeChan === void 0 ? Pagination_noop : _props$onShowSizeChan,
- _props$locale = props.locale,
- locale = _props$locale === void 0 ? zh_CN["default"] : _props$locale,
- style = props.style,
- _props$totalBoundaryS = props.totalBoundaryShowSizeChanger,
- totalBoundaryShowSizeChanger = _props$totalBoundaryS === void 0 ? 50 : _props$totalBoundaryS,
- disabled = props.disabled,
- simple = props.simple,
- showTotal = props.showTotal,
- _props$showSizeChange = props.showSizeChanger,
- showSizeChanger = _props$showSizeChange === void 0 ? total > totalBoundaryShowSizeChanger : _props$showSizeChange,
- sizeChangerRender = props.sizeChangerRender,
- pageSizeOptions = props.pageSizeOptions,
- _props$itemRender = props.itemRender,
- itemRender = _props$itemRender === void 0 ? defaultItemRender : _props$itemRender,
- jumpPrevIcon = props.jumpPrevIcon,
- jumpNextIcon = props.jumpNextIcon,
- prevIcon = props.prevIcon,
- nextIcon = props.nextIcon;
- var paginationRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var _useMergedState = (0,useMergedState["default"])(10, {
- value: pageSizeProp,
- defaultValue: defaultPageSize
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- pageSize = _useMergedState2[0],
- setPageSize = _useMergedState2[1];
- var _useMergedState3 = (0,useMergedState["default"])(1, {
- value: currentProp,
- defaultValue: defaultCurrent,
- postState: function postState(c) {
- return Math.max(1, Math.min(c, calculatePage(undefined, pageSize, total)));
- }
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- current = _useMergedState4[0],
- setCurrent = _useMergedState4[1];
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(current),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- internalInputVal = _React$useState2[0],
- setInternalInputVal = _React$useState2[1];
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- setInternalInputVal(current);
- }, [current]);
- var hasOnChange = onChange !== Pagination_noop;
- var hasCurrent = ('current' in props);
- if (true) {
- (0,warning["default"])(hasCurrent ? hasOnChange : true, 'You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.');
- }
- var jumpPrevPage = Math.max(1, current - (showLessItems ? 3 : 5));
- var jumpNextPage = Math.min(calculatePage(undefined, pageSize, total), current + (showLessItems ? 3 : 5));
- function getItemIcon(icon, label) {
- var iconNode = icon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
- type: "button",
- "aria-label": label,
- className: "".concat(prefixCls, "-item-link")
- });
- if (typeof icon === 'function') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icon, (0,objectSpread2["default"])({}, props));
- }
- return iconNode;
- }
- function getValidValue(e) {
- var inputValue = e.target.value;
- var allPages = calculatePage(undefined, pageSize, total);
- var value;
- if (inputValue === '') {
- value = inputValue;
- } else if (Number.isNaN(Number(inputValue))) {
- value = internalInputVal;
- } else if (inputValue >= allPages) {
- value = allPages;
- } else {
- value = Number(inputValue);
- }
- return value;
- }
- function isValid(page) {
- return isInteger(page) && page !== current && isInteger(total) && total > 0;
- }
- var shouldDisplayQuickJumper = total > pageSize ? showQuickJumper : false;
- /**
- * prevent "up arrow" key reseting cursor position within textbox
- * @see https://stackoverflow.com/a/1081114
- */
- function handleKeyDown(event) {
- if (event.keyCode === KeyCode["default"].UP || event.keyCode === KeyCode["default"].DOWN) {
- event.preventDefault();
- }
- }
- function handleKeyUp(event) {
- var value = getValidValue(event);
- if (value !== internalInputVal) {
- setInternalInputVal(value);
- }
- switch (event.keyCode) {
- case KeyCode["default"].ENTER:
- handleChange(value);
- break;
- case KeyCode["default"].UP:
- handleChange(value - 1);
- break;
- case KeyCode["default"].DOWN:
- handleChange(value + 1);
- break;
- default:
- break;
- }
- }
- function handleBlur(event) {
- handleChange(getValidValue(event));
- }
- function changePageSize(size) {
- var newCurrent = calculatePage(size, pageSize, total);
- var nextCurrent = current > newCurrent && newCurrent !== 0 ? newCurrent : current;
- setPageSize(size);
- setInternalInputVal(nextCurrent);
- onShowSizeChange === null || onShowSizeChange === void 0 || onShowSizeChange(current, size);
- setCurrent(nextCurrent);
- onChange === null || onChange === void 0 || onChange(nextCurrent, size);
- }
- function handleChange(page) {
- if (isValid(page) && !disabled) {
- var currentPage = calculatePage(undefined, pageSize, total);
- var newPage = page;
- if (page > currentPage) {
- newPage = currentPage;
- } else if (page < 1) {
- newPage = 1;
- }
- if (newPage !== internalInputVal) {
- setInternalInputVal(newPage);
- }
- setCurrent(newPage);
- onChange === null || onChange === void 0 || onChange(newPage, pageSize);
- return newPage;
- }
- return current;
- }
- var hasPrev = current > 1;
- var hasNext = current < calculatePage(undefined, pageSize, total);
- function prevHandle() {
- if (hasPrev) handleChange(current - 1);
- }
- function nextHandle() {
- if (hasNext) handleChange(current + 1);
- }
- function jumpPrevHandle() {
- handleChange(jumpPrevPage);
- }
- function jumpNextHandle() {
- handleChange(jumpNextPage);
- }
- function runIfEnter(event, callback) {
- if (event.key === 'Enter' || event.charCode === KeyCode["default"].ENTER || event.keyCode === KeyCode["default"].ENTER) {
- for (var _len = arguments.length, restParams = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- restParams[_key - 2] = arguments[_key];
- }
- callback.apply(void 0, restParams);
- }
- }
- function runIfEnterPrev(event) {
- runIfEnter(event, prevHandle);
- }
- function runIfEnterNext(event) {
- runIfEnter(event, nextHandle);
- }
- function runIfEnterJumpPrev(event) {
- runIfEnter(event, jumpPrevHandle);
- }
- function runIfEnterJumpNext(event) {
- runIfEnter(event, jumpNextHandle);
- }
- function renderPrev(prevPage) {
- var prevButton = itemRender(prevPage, 'prev', getItemIcon(prevIcon, 'prev page'));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(prevButton) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(prevButton, {
- disabled: !hasPrev
- }) : prevButton;
- }
- function renderNext(nextPage) {
- var nextButton = itemRender(nextPage, 'next', getItemIcon(nextIcon, 'next page'));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(nextButton) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(nextButton, {
- disabled: !hasNext
- }) : nextButton;
- }
- function handleGoTO(event) {
- if (event.type === 'click' || event.keyCode === KeyCode["default"].ENTER) {
- handleChange(internalInputVal);
- }
- }
- var jumpPrev = null;
- var dataOrAriaAttributeProps = (0,pickAttrs["default"])(props, {
- aria: true,
- data: true
- });
- var totalText = showTotal && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- className: "".concat(prefixCls, "-total-text")
- }, showTotal(total, [total === 0 ? 0 : (current - 1) * pageSize + 1, current * pageSize > total ? total : current * pageSize]));
- var jumpNext = null;
- var allPages = calculatePage(undefined, pageSize, total);
- // ================== Render ==================
- // When hideOnSinglePage is true and there is only 1 page, hide the pager
- if (hideOnSinglePage && total <= pageSize) {
- return null;
- }
- var pagerList = [];
- var pagerProps = {
- rootPrefixCls: prefixCls,
- onClick: handleChange,
- onKeyPress: runIfEnter,
- showTitle: showTitle,
- itemRender: itemRender,
- page: -1
- };
- var prevPage = current - 1 > 0 ? current - 1 : 0;
- var nextPage = current + 1 < allPages ? current + 1 : allPages;
- var goButton = showQuickJumper && showQuickJumper.goButton;
- // ================== Simple ==================
- // FIXME: ts type
- var isReadOnly = (0,esm_typeof["default"])(simple) === 'object' ? simple.readOnly : !simple;
- var gotoButton = goButton;
- var simplePager = null;
- if (simple) {
- // ====== Simple quick jump ======
- if (goButton) {
- if (typeof goButton === 'boolean') {
- gotoButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", {
- type: "button",
- onClick: handleGoTO,
- onKeyUp: handleGoTO
- }, locale.jump_to_confirm);
- } else {
- gotoButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- onClick: handleGoTO,
- onKeyUp: handleGoTO
- }, goButton);
- }
- gotoButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? "".concat(locale.jump_to).concat(current, "/").concat(allPages) : null,
- className: "".concat(prefixCls, "-simple-pager")
- }, gotoButton);
- }
- simplePager = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? "".concat(current, "/").concat(allPages) : null,
- className: "".concat(prefixCls, "-simple-pager")
- }, isReadOnly ? internalInputVal : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", {
- type: "text",
- "aria-label": locale.jump_to,
- value: internalInputVal,
- disabled: disabled,
- onKeyDown: handleKeyDown,
- onKeyUp: handleKeyUp,
- onChange: handleKeyUp,
- onBlur: handleBlur,
- size: 3
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: "".concat(prefixCls, "-slash")
- }, "/"), allPages);
- }
- // ====================== Normal ======================
- var pageBufferSize = showLessItems ? 1 : 2;
- if (allPages <= 3 + pageBufferSize * 2) {
- if (!allPages) {
- pagerList.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Pager, (0,esm_extends["default"])({}, pagerProps, {
- key: "noPager",
- page: 1,
- className: "".concat(prefixCls, "-item-disabled")
- })));
- }
- for (var i = 1; i <= allPages; i += 1) {
- pagerList.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Pager, (0,esm_extends["default"])({}, pagerProps, {
- key: i,
- page: i,
- active: current === i
- })));
- }
- } else {
- var prevItemTitle = showLessItems ? locale.prev_3 : locale.prev_5;
- var nextItemTitle = showLessItems ? locale.next_3 : locale.next_5;
- var jumpPrevContent = itemRender(jumpPrevPage, 'jump-prev', getItemIcon(jumpPrevIcon, 'prev page'));
- var jumpNextContent = itemRender(jumpNextPage, 'jump-next', getItemIcon(jumpNextIcon, 'next page'));
- if (showPrevNextJumpers) {
- jumpPrev = jumpPrevContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? prevItemTitle : null,
- key: "prev",
- onClick: jumpPrevHandle,
- tabIndex: 0,
- onKeyDown: runIfEnterJumpPrev,
- className: classnames_default()("".concat(prefixCls, "-jump-prev"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-jump-prev-custom-icon"), !!jumpPrevIcon))
- }, jumpPrevContent) : null;
- jumpNext = jumpNextContent ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? nextItemTitle : null,
- key: "next",
- onClick: jumpNextHandle,
- tabIndex: 0,
- onKeyDown: runIfEnterJumpNext,
- className: classnames_default()("".concat(prefixCls, "-jump-next"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-jump-next-custom-icon"), !!jumpNextIcon))
- }, jumpNextContent) : null;
- }
- var left = Math.max(1, current - pageBufferSize);
- var right = Math.min(current + pageBufferSize, allPages);
- if (current - 1 <= pageBufferSize) {
- right = 1 + pageBufferSize * 2;
- }
- if (allPages - current <= pageBufferSize) {
- left = allPages - pageBufferSize * 2;
- }
- for (var _i = left; _i <= right; _i += 1) {
- pagerList.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Pager, (0,esm_extends["default"])({}, pagerProps, {
- key: _i,
- page: _i,
- active: current === _i
- })));
- }
- if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {
- pagerList[0] = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(pagerList[0], {
- className: classnames_default()("".concat(prefixCls, "-item-after-jump-prev"), pagerList[0].props.className)
- });
- pagerList.unshift(jumpPrev);
- }
- if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) {
- var lastOne = pagerList[pagerList.length - 1];
- pagerList[pagerList.length - 1] = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(lastOne, {
- className: classnames_default()("".concat(prefixCls, "-item-before-jump-next"), lastOne.props.className)
- });
- pagerList.push(jumpNext);
- }
- if (left !== 1) {
- pagerList.unshift( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Pager, (0,esm_extends["default"])({}, pagerProps, {
- key: 1,
- page: 1
- })));
- }
- if (right !== allPages) {
- pagerList.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Pager, (0,esm_extends["default"])({}, pagerProps, {
- key: allPages,
- page: allPages
- })));
- }
- }
- var prev = renderPrev(prevPage);
- if (prev) {
- var prevDisabled = !hasPrev || !allPages;
- prev = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? locale.prev_page : null,
- onClick: prevHandle,
- tabIndex: prevDisabled ? null : 0,
- onKeyDown: runIfEnterPrev,
- className: classnames_default()("".concat(prefixCls, "-prev"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), prevDisabled)),
- "aria-disabled": prevDisabled
- }, prev);
- }
- var next = renderNext(nextPage);
- if (next) {
- var nextDisabled, nextTabIndex;
- if (simple) {
- nextDisabled = !hasNext;
- nextTabIndex = hasPrev ? 0 : null;
- } else {
- nextDisabled = !hasNext || !allPages;
- nextTabIndex = nextDisabled ? null : 0;
- }
- next = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- title: showTitle ? locale.next_page : null,
- onClick: nextHandle,
- tabIndex: nextTabIndex,
- onKeyDown: runIfEnterNext,
- className: classnames_default()("".concat(prefixCls, "-next"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), nextDisabled)),
- "aria-disabled": nextDisabled
- }, next);
- }
- var cls = classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-start"), align === 'start'), "".concat(prefixCls, "-center"), align === 'center'), "".concat(prefixCls, "-end"), align === 'end'), "".concat(prefixCls, "-simple"), simple), "".concat(prefixCls, "-disabled"), disabled));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", (0,esm_extends["default"])({
- className: cls,
- style: style,
- ref: paginationRef
- }, dataOrAriaAttributeProps), totalText, prev, simple ? simplePager : pagerList, next, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Options, {
- locale: locale,
- rootPrefixCls: prefixCls,
- disabled: disabled,
- selectPrefixCls: selectPrefixCls,
- changeSize: changePageSize,
- pageSize: pageSize,
- pageSizeOptions: pageSizeOptions,
- quickGo: shouldDisplayQuickJumper ? handleChange : null,
- goButton: gotoButton,
- showSizeChanger: showSizeChanger,
- sizeChangerRender: sizeChangerRender
- }));
- };
- if (true) {
- Pagination.displayName = 'Pagination';
- }
- /* harmony default export */ var es_Pagination = (Pagination);
- ;// ./node_modules/rc-pagination/es/index.js
- // EXTERNAL MODULE: ./node_modules/rc-pagination/es/locale/en_US.js
- var es_locale_en_US = __webpack_require__("./node_modules/rc-pagination/es/locale/en_US.js");
- // EXTERNAL MODULE: ./components/pagination/style/index.ts
- var pagination_style = __webpack_require__("./components/pagination/style/index.ts");
- ;// ./components/pagination/style/bordered.ts
- const genBorderedStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}${componentCls}-bordered${componentCls}-disabled:not(${componentCls}-mini)`]: {
- '&, &:hover': {
- [`${componentCls}-item-link`]: {
- borderColor: token.colorBorder
- }
- },
- '&:focus-visible': {
- [`${componentCls}-item-link`]: {
- borderColor: token.colorBorder
- }
- },
- [`${componentCls}-item, ${componentCls}-item-link`]: {
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- [`&:hover:not(${componentCls}-item-active)`]: {
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- a: {
- color: token.colorTextDisabled
- }
- },
- [`&${componentCls}-item-active`]: {
- backgroundColor: token.itemActiveBgDisabled
- }
- },
- [`${componentCls}-prev, ${componentCls}-next`]: {
- '&:hover button': {
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- color: token.colorTextDisabled
- },
- [`${componentCls}-item-link`]: {
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder
- }
- }
- },
- [`${componentCls}${componentCls}-bordered:not(${componentCls}-mini)`]: {
- [`${componentCls}-prev, ${componentCls}-next`]: {
- '&:hover button': {
- borderColor: token.colorPrimaryHover,
- backgroundColor: token.itemBg
- },
- [`${componentCls}-item-link`]: {
- backgroundColor: token.itemLinkBg,
- borderColor: token.colorBorder
- },
- [`&:hover ${componentCls}-item-link`]: {
- borderColor: token.colorPrimary,
- backgroundColor: token.itemBg,
- color: token.colorPrimary
- },
- [`&${componentCls}-disabled`]: {
- [`${componentCls}-item-link`]: {
- borderColor: token.colorBorder,
- color: token.colorTextDisabled
- }
- }
- },
- [`${componentCls}-item`]: {
- backgroundColor: token.itemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- [`&:hover:not(${componentCls}-item-active)`]: {
- borderColor: token.colorPrimary,
- backgroundColor: token.itemBg,
- a: {
- color: token.colorPrimary
- }
- },
- '&-active': {
- borderColor: token.colorPrimary
- }
- }
- }
- };
- };
- /* harmony default export */ var bordered = ((0,genStyleUtils.genSubStyleComponent)(['Pagination', 'bordered'], token => {
- const paginationToken = (0,pagination_style.prepareToken)(token);
- return genBorderedStyle(paginationToken);
- }, pagination_style.prepareComponentToken));
- ;// ./components/pagination/useShowSizeChanger.ts
- function useShowSizeChanger(showSizeChanger) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (typeof showSizeChanger === 'boolean') {
- return [showSizeChanger, {}];
- }
- if (showSizeChanger && typeof showSizeChanger === 'object') {
- return [true, showSizeChanger];
- }
- return [undefined, undefined];
- }, [showSizeChanger]);
- }
- ;// ./components/pagination/Pagination.tsx
- var Pagination_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Pagination_Pagination = props => {
- const {
- align,
- prefixCls: customizePrefixCls,
- selectPrefixCls: customizeSelectPrefixCls,
- className,
- rootClassName,
- style,
- size: customizeSize,
- locale: customLocale,
- responsive,
- showSizeChanger,
- selectComponentClass,
- pageSizeOptions
- } = props,
- restProps = Pagination_rest(props, ["align", "prefixCls", "selectPrefixCls", "className", "rootClassName", "style", "size", "locale", "responsive", "showSizeChanger", "selectComponentClass", "pageSizeOptions"]);
- const {
- xs
- } = hooks_useBreakpoint(responsive);
- const [, token] = (0,useToken["default"])();
- const {
- getPrefixCls,
- direction,
- showSizeChanger: contextShowSizeChangerConfig,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('pagination');
- const prefixCls = getPrefixCls('pagination', customizePrefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,pagination_style["default"])(prefixCls);
- // ============================== Size ==============================
- const mergedSize = (0,useSize["default"])(customizeSize);
- const isSmall = mergedSize === 'small' || !!(xs && !mergedSize && responsive);
- // ============================= Locale =============================
- const [contextLocale] = (0,useLocale["default"])('Pagination', es_locale_en_US["default"]);
- const locale = Object.assign(Object.assign({}, contextLocale), customLocale);
- // ========================== Size Changer ==========================
- // Merge the props showSizeChanger
- const [propShowSizeChanger, propSizeChangerSelectProps] = useShowSizeChanger(showSizeChanger);
- const [contextShowSizeChanger, contextSizeChangerSelectProps] = useShowSizeChanger(contextShowSizeChangerConfig);
- const mergedShowSizeChanger = propShowSizeChanger !== null && propShowSizeChanger !== void 0 ? propShowSizeChanger : contextShowSizeChanger;
- const mergedShowSizeChangerSelectProps = propSizeChangerSelectProps !== null && propSizeChangerSelectProps !== void 0 ? propSizeChangerSelectProps : contextSizeChangerSelectProps;
- const SizeChanger = selectComponentClass || components_select;
- // Generate options
- const mergedPageSizeOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- return pageSizeOptions ? pageSizeOptions.map(option => Number(option)) : undefined;
- }, [pageSizeOptions]);
- // Render size changer
- const sizeChangerRender = info => {
- var _a;
- const {
- disabled,
- size: pageSize,
- onSizeChange,
- 'aria-label': ariaLabel,
- className: sizeChangerClassName,
- options
- } = info;
- const {
- className: propSizeChangerClassName,
- onChange: propSizeChangerOnChange
- } = mergedShowSizeChangerSelectProps || {};
- // Origin Select is using Select.Option,
- // So it make the option value must be string
- // Just for compatible
- const selectedValue = (_a = options.find(option => String(option.value) === String(pageSize))) === null || _a === void 0 ? void 0 : _a.value;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SizeChanger, Object.assign({
- disabled: disabled,
- showSearch: true,
- popupMatchSelectWidth: false,
- getPopupContainer: triggerNode => triggerNode.parentNode,
- "aria-label": ariaLabel,
- options: options
- }, mergedShowSizeChangerSelectProps, {
- value: selectedValue,
- onChange: (nextSize, option) => {
- onSizeChange === null || onSizeChange === void 0 ? void 0 : onSizeChange(nextSize);
- propSizeChangerOnChange === null || propSizeChangerOnChange === void 0 ? void 0 : propSizeChangerOnChange(nextSize, option);
- },
- size: isSmall ? 'small' : 'middle',
- className: classnames_default()(sizeChangerClassName, propSizeChangerClassName)
- }));
- };
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Pagination');
- true ? warning(!selectComponentClass, 'usage', '`selectComponentClass` is not official api which will be removed.') : 0;
- }
- // ============================= Render =============================
- const iconsProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const ellipsis = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-item-ellipsis`
- }, "\u2022\u2022\u2022");
- const prevIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: `${prefixCls}-item-link`,
- type: "button",
- tabIndex: -1
- }, direction === 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null));
- const nextIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: `${prefixCls}-item-link`,
- type: "button",
- tabIndex: -1
- }, direction === 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null));
- const jumpPrevIcon =
- /*#__PURE__*/
- // biome-ignore lint/a11y/useValidAnchor: it is hard to refactor
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- className: `${prefixCls}-item-link`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-item-container`
- }, direction === 'rtl' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DoubleRightOutlined, {
- className: `${prefixCls}-item-link-icon`
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DoubleLeftOutlined, {
- className: `${prefixCls}-item-link-icon`
- })), ellipsis));
- const jumpNextIcon =
- /*#__PURE__*/
- // biome-ignore lint/a11y/useValidAnchor: it is hard to refactor
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- className: `${prefixCls}-item-link`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-item-container`
- }, direction === 'rtl' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DoubleLeftOutlined, {
- className: `${prefixCls}-item-link-icon`
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DoubleRightOutlined, {
- className: `${prefixCls}-item-link-icon`
- })), ellipsis));
- return {
- prevIcon,
- nextIcon,
- jumpPrevIcon,
- jumpNextIcon
- };
- }, [direction, prefixCls]);
- const selectPrefixCls = getPrefixCls('select', customizeSelectPrefixCls);
- const extendedClassName = classnames_default()({
- [`${prefixCls}-${align}`]: !!align,
- [`${prefixCls}-mini`]: isSmall,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-bordered`]: token.wireframe
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, token.wireframe && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(bordered, {
- prefixCls: prefixCls
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Pagination, Object.assign({}, iconsProps, restProps, {
- style: mergedStyle,
- prefixCls: prefixCls,
- selectPrefixCls: selectPrefixCls,
- className: extendedClassName,
- locale: locale,
- pageSizeOptions: mergedPageSizeOptions,
- showSizeChanger: mergedShowSizeChanger,
- sizeChangerRender: sizeChangerRender
- }))));
- };
- if (true) {
- Pagination_Pagination.displayName = 'Pagination';
- }
- /* harmony default export */ var pagination_Pagination = (Pagination_Pagination);
- ;// ./components/pagination/index.tsx
- /* harmony default export */ var components_pagination = (pagination_Pagination);
- ;// ./components/spin/Indicator/Progress.tsx
- const viewSize = 100;
- const borderWidth = viewSize / 5;
- const radius = viewSize / 2 - borderWidth / 2;
- const circumference = radius * 2 * Math.PI;
- const position = 50;
- const CustomCircle = props => {
- const {
- dotClassName,
- style,
- hasCircleCls
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- className: classnames_default()(`${dotClassName}-circle`, {
- [`${dotClassName}-circle-bg`]: hasCircleCls
- }),
- r: radius,
- cx: position,
- cy: position,
- strokeWidth: borderWidth,
- style: style
- });
- };
- const Progress = ({
- percent,
- prefixCls
- }) => {
- const dotClassName = `${prefixCls}-dot`;
- const holderClassName = `${dotClassName}-holder`;
- const hideClassName = `${holderClassName}-hidden`;
- const [render, setRender] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- // ==================== Visible =====================
- (0,useLayoutEffect["default"])(() => {
- if (percent !== 0) {
- setRender(true);
- }
- }, [percent !== 0]);
- // ==================== Progress ====================
- const safePtg = Math.max(Math.min(percent, 100), 0);
- // ===================== Render =====================
- if (!render) {
- return null;
- }
- const circleStyle = {
- strokeDashoffset: `${circumference / 4}`,
- strokeDasharray: `${circumference * safePtg / 100} ${circumference * (100 - safePtg) / 100}`
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(holderClassName, `${dotClassName}-progress`, safePtg <= 0 && hideClassName)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- viewBox: `0 0 ${viewSize} ${viewSize}`,
- role: "progressbar",
- "aria-valuemin": 0,
- "aria-valuemax": 100,
- "aria-valuenow": safePtg
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CustomCircle, {
- dotClassName: dotClassName,
- hasCircleCls: true
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CustomCircle, {
- dotClassName: dotClassName,
- style: circleStyle
- })));
- };
- /* harmony default export */ var Indicator_Progress = (Progress);
- ;// ./components/spin/Indicator/Looper.tsx
- function Looper(props) {
- const {
- prefixCls,
- percent = 0
- } = props;
- const dotClassName = `${prefixCls}-dot`;
- const holderClassName = `${dotClassName}-holder`;
- const hideClassName = `${holderClassName}-hidden`;
- // ===================== Render =====================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(holderClassName, percent > 0 && hideClassName)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(dotClassName, `${prefixCls}-dot-spin`)
- }, [1, 2, 3, 4].map(i => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("i", {
- className: `${prefixCls}-dot-item`,
- key: i
- }))))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Indicator_Progress, {
- prefixCls: prefixCls,
- percent: percent
- }));
- }
- ;// ./components/spin/Indicator/index.tsx
- function Indicator(props) {
- var _a;
- const {
- prefixCls,
- indicator,
- percent
- } = props;
- const dotClassName = `${prefixCls}-dot`;
- if (indicator && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(indicator)) {
- return (0,reactNode.cloneElement)(indicator, {
- className: classnames_default()((_a = indicator.props) === null || _a === void 0 ? void 0 : _a.className, dotClassName),
- percent
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Looper, {
- prefixCls: prefixCls,
- percent: percent
- });
- }
- // EXTERNAL MODULE: ./components/spin/style/index.ts
- var spin_style = __webpack_require__("./components/spin/style/index.ts");
- ;// ./components/spin/usePercent.ts
- const AUTO_INTERVAL = 200;
- const STEP_BUCKETS = [[30, 0.05], [70, 0.03], [96, 0.01]];
- function usePercent(spinning, percent) {
- const [mockPercent, setMockPercent] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const mockIntervalRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const isAuto = percent === 'auto';
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (isAuto && spinning) {
- setMockPercent(0);
- mockIntervalRef.current = setInterval(() => {
- setMockPercent(prev => {
- const restPTG = 100 - prev;
- for (let i = 0; i < STEP_BUCKETS.length; i += 1) {
- const [limit, stepPtg] = STEP_BUCKETS[i];
- if (prev <= limit) {
- return prev + restPTG * stepPtg;
- }
- }
- return prev;
- });
- }, AUTO_INTERVAL);
- }
- return () => {
- clearInterval(mockIntervalRef.current);
- };
- }, [isAuto, spinning]);
- return isAuto ? mockPercent : percent;
- }
- ;// ./components/spin/index.tsx
- var spin_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const _SpinSizes = ['small', 'default', 'large'];
- // Render indicator
- let defaultIndicator;
- function shouldDelay(spinning, delay) {
- return !!spinning && !!delay && !Number.isNaN(Number(delay));
- }
- const Spin = props => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- spinning: customSpinning = true,
- delay = 0,
- className,
- rootClassName,
- size = 'default',
- tip,
- wrapperClassName,
- style,
- children,
- fullscreen = false,
- indicator,
- percent
- } = props,
- restProps = spin_rest(props, ["prefixCls", "spinning", "delay", "className", "rootClassName", "size", "tip", "wrapperClassName", "style", "children", "fullscreen", "indicator", "percent"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle,
- indicator: contextIndicator
- } = (0,config_provider_context.useComponentConfig)('spin');
- const prefixCls = getPrefixCls('spin', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,spin_style["default"])(prefixCls);
- const [spinning, setSpinning] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(() => customSpinning && !shouldDelay(customSpinning, delay));
- const mergedPercent = usePercent(spinning, percent);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (customSpinning) {
- const showSpinning = debounce(delay, () => {
- setSpinning(true);
- });
- showSpinning();
- return () => {
- var _a;
- (_a = showSpinning === null || showSpinning === void 0 ? void 0 : showSpinning.cancel) === null || _a === void 0 ? void 0 : _a.call(showSpinning);
- };
- }
- setSpinning(false);
- }, [delay, customSpinning]);
- const isNestedPattern = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => typeof children !== 'undefined' && !fullscreen, [children, fullscreen]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Spin');
- true ? warning(!tip || isNestedPattern || fullscreen, 'usage', '`tip` only work in nest or fullscreen pattern.') : 0;
- }
- const spinClassName = classnames_default()(prefixCls, contextClassName, {
- [`${prefixCls}-sm`]: size === 'small',
- [`${prefixCls}-lg`]: size === 'large',
- [`${prefixCls}-spinning`]: spinning,
- [`${prefixCls}-show-text`]: !!tip,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, !fullscreen && rootClassName, hashId, cssVarCls);
- const containerClassName = classnames_default()(`${prefixCls}-container`, {
- [`${prefixCls}-blur`]: spinning
- });
- const mergedIndicator = (_a = indicator !== null && indicator !== void 0 ? indicator : contextIndicator) !== null && _a !== void 0 ? _a : defaultIndicator;
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- const spinElement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, restProps, {
- style: mergedStyle,
- className: spinClassName,
- "aria-live": "polite",
- "aria-busy": spinning
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Indicator, {
- prefixCls: prefixCls,
- indicator: mergedIndicator,
- percent: mergedPercent
- }), tip && (isNestedPattern || fullscreen) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-text`
- }, tip)) : null);
- if (isNestedPattern) {
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, restProps, {
- className: classnames_default()(`${prefixCls}-nested-loading`, wrapperClassName, hashId, cssVarCls)
- }), spinning && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: "loading"
- }, spinElement), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: containerClassName,
- key: "container"
- }, children)));
- }
- if (fullscreen) {
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-fullscreen`, {
- [`${prefixCls}-fullscreen-show`]: spinning
- }, rootClassName, hashId, cssVarCls)
- }, spinElement));
- }
- return wrapCSSVar(spinElement);
- };
- Spin.setDefaultIndicator = indicator => {
- defaultIndicator = indicator;
- };
- if (true) {
- Spin.displayName = 'Spin';
- }
- /* harmony default export */ var spin = (Spin);
- ;// ./components/list/context.ts
- const context_ListContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
- const ListConsumer = context_ListContext.Consumer;
- ;// ./components/list/Item.tsx
- var Item_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Item_Meta = _a => {
- var {
- prefixCls: customizePrefixCls,
- className,
- avatar,
- title,
- description
- } = _a,
- others = Item_rest(_a, ["prefixCls", "className", "avatar", "title", "description"]);
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('list', customizePrefixCls);
- const classString = classnames_default()(`${prefixCls}-item-meta`, className);
- const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-item-meta-content`
- }, title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("h4", {
- className: `${prefixCls}-item-meta-title`
- }, title), description && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-item-meta-description`
- }, description));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({}, others, {
- className: classString
- }), avatar && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-item-meta-avatar`
- }, avatar), (title || description) && content);
- };
- const Item_InternalItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- children,
- actions,
- extra,
- styles,
- className,
- classNames: customizeClassNames,
- colStyle
- } = props,
- others = Item_rest(props, ["prefixCls", "children", "actions", "extra", "styles", "className", "classNames", "colStyle"]);
- const {
- grid,
- itemLayout
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(context_ListContext);
- const {
- getPrefixCls,
- list
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const moduleClass = moduleName => {
- var _a, _b;
- return classnames_default()((_b = (_a = list === null || list === void 0 ? void 0 : list.item) === null || _a === void 0 ? void 0 : _a.classNames) === null || _b === void 0 ? void 0 : _b[moduleName], customizeClassNames === null || customizeClassNames === void 0 ? void 0 : customizeClassNames[moduleName]);
- };
- const moduleStyle = moduleName => {
- var _a, _b;
- return Object.assign(Object.assign({}, (_b = (_a = list === null || list === void 0 ? void 0 : list.item) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b[moduleName]), styles === null || styles === void 0 ? void 0 : styles[moduleName]);
- };
- const isItemContainsTextNodeAndNotSingular = () => {
- let result = false;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.forEach(children, element => {
- if (typeof element === 'string') {
- result = true;
- }
- });
- return result && external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.count(children) > 1;
- };
- const isFlexMode = () => {
- if (itemLayout === 'vertical') {
- return !!extra;
- }
- return !isItemContainsTextNodeAndNotSingular();
- };
- const prefixCls = getPrefixCls('list', customizePrefixCls);
- const actionsContent = actions && actions.length > 0 && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", {
- className: classnames_default()(`${prefixCls}-item-action`, moduleClass('actions')),
- key: "actions",
- style: moduleStyle('actions')
- }, actions.map((action, i) => (
- /*#__PURE__*/
- // eslint-disable-next-line react/no-array-index-key
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- key: `${prefixCls}-item-action-${i}`
- }, action, i !== actions.length - 1 && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("em", {
- className: `${prefixCls}-item-action-split`
- }))))));
- const Element = grid ? 'div' : 'li';
- const itemChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Element, Object.assign({}, others, !grid ? {
- ref
- } : {}, {
- className: classnames_default()(`${prefixCls}-item`, {
- [`${prefixCls}-item-no-flex`]: !isFlexMode()
- }, className)
- }), itemLayout === 'vertical' && extra ? [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-item-main`,
- key: "content"
- }, children, actionsContent), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${prefixCls}-item-extra`, moduleClass('extra')),
- key: "extra",
- style: moduleStyle('extra')
- }, extra)] : [children, actionsContent, (0,reactNode.cloneElement)(extra, {
- key: 'extra'
- })]);
- return grid ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(col, {
- ref: ref,
- flex: 1,
- style: colStyle
- }, itemChildren)) : itemChildren;
- });
- const list_Item_Item = Item_InternalItem;
- list_Item_Item.Meta = Item_Meta;
- /* harmony default export */ var list_Item = (list_Item_Item);
- // EXTERNAL MODULE: ./components/list/style/index.ts
- var list_style = __webpack_require__("./components/list/style/index.ts");
- ;// ./components/list/index.tsx
- var list_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function InternalList(props, ref) {
- const {
- pagination = false,
- prefixCls: customizePrefixCls,
- bordered = false,
- split = true,
- className,
- rootClassName,
- style,
- children,
- itemLayout,
- loadMore,
- grid,
- dataSource = [],
- size: customizeSize,
- header,
- footer,
- loading = false,
- rowKey,
- renderItem,
- locale
- } = props,
- rest = list_rest(props, ["pagination", "prefixCls", "bordered", "split", "className", "rootClassName", "style", "children", "itemLayout", "loadMore", "grid", "dataSource", "size", "header", "footer", "loading", "rowKey", "renderItem", "locale"]);
- const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};
- const [paginationCurrent, setPaginationCurrent] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(paginationObj.defaultCurrent || 1);
- const [paginationSize, setPaginationSize] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(paginationObj.defaultPageSize || 10);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('list');
- const {
- renderEmpty
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const defaultPaginationProps = {
- current: 1,
- total: 0,
- position: 'bottom'
- };
- const triggerPaginationEvent = eventName => (page, pageSize) => {
- var _a;
- setPaginationCurrent(page);
- setPaginationSize(pageSize);
- if (pagination) {
- (_a = pagination === null || pagination === void 0 ? void 0 : pagination[eventName]) === null || _a === void 0 ? void 0 : _a.call(pagination, page, pageSize);
- }
- };
- const onPaginationChange = triggerPaginationEvent('onChange');
- const onPaginationShowSizeChange = triggerPaginationEvent('onShowSizeChange');
- const renderInternalItem = (item, index) => {
- if (!renderItem) {
- return null;
- }
- let key;
- if (typeof rowKey === 'function') {
- key = rowKey(item);
- } else if (rowKey) {
- key = item[rowKey];
- } else {
- key = item.key;
- }
- if (!key) {
- key = `list-item-${index}`;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
- key: key
- }, renderItem(item, index));
- };
- const isSomethingAfterLastItem = !!(loadMore || pagination || footer);
- const prefixCls = getPrefixCls('list', customizePrefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,list_style["default"])(prefixCls);
- let loadingProp = loading;
- if (typeof loadingProp === 'boolean') {
- loadingProp = {
- spinning: loadingProp
- };
- }
- const isLoading = !!(loadingProp === null || loadingProp === void 0 ? void 0 : loadingProp.spinning);
- const mergedSize = (0,useSize["default"])(customizeSize);
- // large => lg
- // small => sm
- let sizeCls = '';
- switch (mergedSize) {
- case 'large':
- sizeCls = 'lg';
- break;
- case 'small':
- sizeCls = 'sm';
- break;
- default:
- break;
- }
- const classString = classnames_default()(prefixCls, {
- [`${prefixCls}-vertical`]: itemLayout === 'vertical',
- [`${prefixCls}-${sizeCls}`]: sizeCls,
- [`${prefixCls}-split`]: split,
- [`${prefixCls}-bordered`]: bordered,
- [`${prefixCls}-loading`]: isLoading,
- [`${prefixCls}-grid`]: !!grid,
- [`${prefixCls}-something-after-last-item`]: isSomethingAfterLastItem,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- const paginationProps = extendsObject(defaultPaginationProps, {
- total: dataSource.length,
- current: paginationCurrent,
- pageSize: paginationSize
- }, pagination || {});
- const largestPage = Math.ceil(paginationProps.total / paginationProps.pageSize);
- paginationProps.current = Math.min(paginationProps.current, largestPage);
- const paginationContent = pagination && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-pagination`)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_pagination, Object.assign({
- align: "end"
- }, paginationProps, {
- onChange: onPaginationChange,
- onShowSizeChange: onPaginationShowSizeChange
- }))));
- let splitDataSource = (0,toConsumableArray["default"])(dataSource);
- if (pagination) {
- if (dataSource.length > (paginationProps.current - 1) * paginationProps.pageSize) {
- splitDataSource = (0,toConsumableArray["default"])(dataSource).splice((paginationProps.current - 1) * paginationProps.pageSize, paginationProps.pageSize);
- }
- }
- const needResponsive = Object.keys(grid || {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
- const screens = hooks_useBreakpoint(needResponsive);
- const currentBreakpoint = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- for (let i = 0; i < responsiveArray.length; i += 1) {
- const breakpoint = responsiveArray[i];
- if (screens[breakpoint]) {
- return breakpoint;
- }
- }
- return undefined;
- }, [screens]);
- const colStyle = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!grid) {
- return undefined;
- }
- const columnCount = currentBreakpoint && grid[currentBreakpoint] ? grid[currentBreakpoint] : grid.column;
- if (columnCount) {
- return {
- width: `${100 / columnCount}%`,
- maxWidth: `${100 / columnCount}%`
- };
- }
- }, [JSON.stringify(grid), currentBreakpoint]);
- let childrenContent = isLoading && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- minHeight: 53
- }
- });
- if (splitDataSource.length > 0) {
- const items = splitDataSource.map(renderInternalItem);
- childrenContent = grid ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(row, {
- gutter: grid.gutter
- }, external_root_React_commonjs2_react_commonjs_react_amd_react_.Children.map(items, child => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: child === null || child === void 0 ? void 0 : child.key,
- style: colStyle
- }, child))))) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: `${prefixCls}-items`
- }, items));
- } else if (!children && !isLoading) {
- childrenContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-empty-text`
- }, (locale === null || locale === void 0 ? void 0 : locale.emptyText) || (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('List')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "List"
- }));
- }
- const paginationPosition = paginationProps.position;
- const contextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => ({
- grid,
- itemLayout
- }), [JSON.stringify(grid), itemLayout]);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_ListContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- ref: ref,
- style: Object.assign(Object.assign({}, contextStyle), style),
- className: classString
- }, rest), (paginationPosition === 'top' || paginationPosition === 'both') && paginationContent, header && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-header`
- }, header), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(spin, Object.assign({}, loadingProp), childrenContent, children), footer && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-footer`
- }, footer), loadMore || (paginationPosition === 'bottom' || paginationPosition === 'both') && paginationContent)));
- }
- const ListWithForwardRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalList);
- if (true) {
- ListWithForwardRef.displayName = 'List';
- }
- const list_List = ListWithForwardRef;
- list_List.Item = list_Item;
- /* harmony default export */ var list = (list_List);
- ;// ./node_modules/rc-mentions/es/hooks/useEffectState.js
- /**
- * Trigger a callback on state change
- */
- function useEffectState_useEffectState() {
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
- id: 0,
- callback: null
- }),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- effectId = _useState2[0],
- setEffectId = _useState2[1];
- var update = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (callback) {
- setEffectId(function (_ref) {
- var id = _ref.id;
- return {
- id: id + 1,
- callback: callback
- };
- });
- }, []);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var _effectId$callback;
- (_effectId$callback = effectId.callback) === null || _effectId$callback === void 0 || _effectId$callback.call(effectId);
- }, [effectId]);
- return update;
- }
- ;// ./node_modules/rc-mentions/es/MentionsContext.js
- /* tslint:disable: no-object-literal-type-assertion */
- // We will never use default, here only to fix TypeScript warning
- var MentionsContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_MentionsContext = (MentionsContext);
- ;// ./node_modules/rc-mentions/es/DropdownMenu.js
- /**
- * We only use Menu to display the candidate.
- * The focus is controlled by textarea to make accessibility easy.
- */
- function DropdownMenu(props) {
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_MentionsContext),
- notFoundContent = _React$useContext.notFoundContent,
- activeIndex = _React$useContext.activeIndex,
- setActiveIndex = _React$useContext.setActiveIndex,
- selectOption = _React$useContext.selectOption,
- onFocus = _React$useContext.onFocus,
- onBlur = _React$useContext.onBlur,
- onScroll = _React$useContext.onScroll;
- var prefixCls = props.prefixCls,
- options = props.options;
- var activeOption = options[activeIndex] || {};
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_menu_es, {
- prefixCls: "".concat(prefixCls, "-menu"),
- activeKey: activeOption.key,
- onSelect: function onSelect(_ref) {
- var key = _ref.key;
- var option = options.find(function (_ref2) {
- var optionKey = _ref2.key;
- return optionKey === key;
- });
- selectOption(option);
- },
- onFocus: onFocus,
- onBlur: onBlur,
- onScroll: onScroll
- }, options.map(function (option, index) {
- var key = option.key,
- disabled = option.disabled,
- className = option.className,
- style = option.style,
- label = option.label;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_MenuItem, {
- key: key,
- disabled: disabled,
- className: className,
- style: style,
- onMouseEnter: function onMouseEnter() {
- setActiveIndex(index);
- }
- }, label);
- }), !options.length && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_MenuItem, {
- disabled: true
- }, notFoundContent));
- }
- /* harmony default export */ var es_DropdownMenu = (DropdownMenu);
- ;// ./node_modules/rc-mentions/es/KeywordTrigger.js
- var KeywordTrigger_BUILT_IN_PLACEMENTS = {
- bottomRight: {
- points: ['tl', 'br'],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- bottomLeft: {
- points: ['tr', 'bl'],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- topRight: {
- points: ['bl', 'tr'],
- offset: [0, -4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- topLeft: {
- points: ['br', 'tl'],
- offset: [0, -4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- }
- };
- var KeywordTrigger = function KeywordTrigger(props) {
- var prefixCls = props.prefixCls,
- options = props.options,
- children = props.children,
- visible = props.visible,
- transitionName = props.transitionName,
- getPopupContainer = props.getPopupContainer,
- dropdownClassName = props.dropdownClassName,
- direction = props.direction,
- placement = props.placement;
- var dropdownPrefix = "".concat(prefixCls, "-dropdown");
- var dropdownElement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_DropdownMenu, {
- prefixCls: dropdownPrefix,
- options: options
- });
- var dropdownPlacement = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var popupPlacement;
- if (direction === 'rtl') {
- popupPlacement = placement === 'top' ? 'topLeft' : 'bottomLeft';
- } else {
- popupPlacement = placement === 'top' ? 'topRight' : 'bottomRight';
- }
- return popupPlacement;
- }, [direction, placement]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, {
- prefixCls: dropdownPrefix,
- popupVisible: visible,
- popup: dropdownElement,
- popupPlacement: dropdownPlacement,
- popupTransitionName: transitionName,
- builtinPlacements: KeywordTrigger_BUILT_IN_PLACEMENTS,
- getPopupContainer: getPopupContainer,
- popupClassName: dropdownClassName
- }, children);
- };
- /* harmony default export */ var es_KeywordTrigger = (KeywordTrigger);
- ;// ./node_modules/rc-mentions/es/Option.js
- var Option_Option = function Option() {
- return null;
- };
- /* harmony default export */ var rc_mentions_es_Option = (Option_Option);
- ;// ./node_modules/rc-mentions/es/util.js
- /**
- * Cut input selection into 2 part and return text before selection start
- */
- function getBeforeSelectionText(input) {
- var selectionStart = input.selectionStart;
- return input.value.slice(0, selectionStart);
- }
- /**
- * Find the last match prefix index
- */
- function getLastMeasureIndex(text, prefix) {
- return prefix.reduce(function (lastMatch, prefixStr) {
- var lastIndex = text.lastIndexOf(prefixStr);
- if (lastIndex > lastMatch.location) {
- return {
- location: lastIndex,
- prefix: prefixStr
- };
- }
- return lastMatch;
- }, {
- location: -1,
- prefix: ''
- });
- }
- function lower(char) {
- return (char || '').toLowerCase();
- }
- function reduceText(text, targetText, split) {
- var firstChar = text[0];
- if (!firstChar || firstChar === split) {
- return text;
- }
- // Reuse rest text as it can
- var restText = text;
- var targetTextLen = targetText.length;
- for (var i = 0; i < targetTextLen; i += 1) {
- if (lower(restText[i]) !== lower(targetText[i])) {
- restText = restText.slice(i);
- break;
- } else if (i === targetTextLen - 1) {
- restText = restText.slice(targetTextLen);
- }
- }
- return restText;
- }
- /**
- * Paint targetText into current text:
- * text: little@litest
- * targetText: light
- * => little @light test
- */
- function replaceWithMeasure(text, measureConfig) {
- var measureLocation = measureConfig.measureLocation,
- prefix = measureConfig.prefix,
- targetText = measureConfig.targetText,
- selectionStart = measureConfig.selectionStart,
- split = measureConfig.split;
- // Before text will append one space if have other text
- var beforeMeasureText = text.slice(0, measureLocation);
- if (beforeMeasureText[beforeMeasureText.length - split.length] === split) {
- beforeMeasureText = beforeMeasureText.slice(0, beforeMeasureText.length - split.length);
- }
- if (beforeMeasureText) {
- beforeMeasureText = "".concat(beforeMeasureText).concat(split);
- }
- // Cut duplicate string with current targetText
- var restText = reduceText(text.slice(selectionStart), targetText.slice(selectionStart - measureLocation - prefix.length), split);
- if (restText.slice(0, split.length) === split) {
- restText = restText.slice(split.length);
- }
- var connectedStartText = "".concat(beforeMeasureText).concat(prefix).concat(targetText).concat(split);
- return {
- text: "".concat(connectedStartText).concat(restText),
- selectionLocation: connectedStartText.length
- };
- }
- function setInputSelection(input, location) {
- input.setSelectionRange(location, location);
- /**
- * Reset caret into view.
- * Since this function always called by user control, it's safe to focus element.
- */
- input.blur();
- input.focus();
- }
- function util_validateSearch(text, split) {
- return !split || text.indexOf(split) === -1;
- }
- function util_filterOption(input, _ref) {
- var _ref$value = _ref.value,
- value = _ref$value === void 0 ? '' : _ref$value;
- var lowerCase = input.toLowerCase();
- return value.toLowerCase().indexOf(lowerCase) !== -1;
- }
- ;// ./node_modules/rc-mentions/es/Mentions.js
- var Mentions_excluded = ["prefixCls", "className", "style", "prefix", "split", "notFoundContent", "value", "defaultValue", "children", "options", "open", "allowClear", "silent", "validateSearch", "filterOption", "onChange", "onKeyDown", "onKeyUp", "onPressEnter", "onSearch", "onSelect", "onFocus", "onBlur", "transitionName", "placement", "direction", "getPopupContainer", "dropdownClassName", "rows", "visible", "onPopupScroll"],
- Mentions_excluded2 = ["suffix", "prefixCls", "defaultValue", "value", "allowClear", "onChange", "classNames", "className", "disabled", "onClear"];
- var InternalMentions = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var prefixCls = props.prefixCls,
- className = props.className,
- style = props.style,
- _props$prefix = props.prefix,
- prefix = _props$prefix === void 0 ? '@' : _props$prefix,
- _props$split = props.split,
- split = _props$split === void 0 ? ' ' : _props$split,
- _props$notFoundConten = props.notFoundContent,
- notFoundContent = _props$notFoundConten === void 0 ? 'Not Found' : _props$notFoundConten,
- value = props.value,
- defaultValue = props.defaultValue,
- children = props.children,
- options = props.options,
- open = props.open,
- allowClear = props.allowClear,
- silent = props.silent,
- _props$validateSearch = props.validateSearch,
- validateSearch = _props$validateSearch === void 0 ? util_validateSearch : _props$validateSearch,
- _props$filterOption = props.filterOption,
- filterOption = _props$filterOption === void 0 ? util_filterOption : _props$filterOption,
- onChange = props.onChange,
- onKeyDown = props.onKeyDown,
- onKeyUp = props.onKeyUp,
- onPressEnter = props.onPressEnter,
- onSearch = props.onSearch,
- onSelect = props.onSelect,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- transitionName = props.transitionName,
- placement = props.placement,
- direction = props.direction,
- getPopupContainer = props.getPopupContainer,
- dropdownClassName = props.dropdownClassName,
- _props$rows = props.rows,
- rows = _props$rows === void 0 ? 1 : _props$rows,
- visible = props.visible,
- onPopupScroll = props.onPopupScroll,
- restProps = (0,objectWithoutProperties["default"])(props, Mentions_excluded);
- var mergedPrefix = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return Array.isArray(prefix) ? prefix : [prefix];
- }, [prefix]);
- // =============================== Refs ===============================
- var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var textareaRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var measureRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var getTextArea = function getTextArea() {
- var _textareaRef$current;
- return (_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 || (_textareaRef$current = _textareaRef$current.resizableTextArea) === null || _textareaRef$current === void 0 ? void 0 : _textareaRef$current.textArea;
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, function () {
- var _textareaRef$current4;
- return {
- focus: function focus() {
- var _textareaRef$current2;
- return (_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 ? void 0 : _textareaRef$current2.focus();
- },
- blur: function blur() {
- var _textareaRef$current3;
- return (_textareaRef$current3 = textareaRef.current) === null || _textareaRef$current3 === void 0 ? void 0 : _textareaRef$current3.blur();
- },
- textarea: (_textareaRef$current4 = textareaRef.current) === null || _textareaRef$current4 === void 0 || (_textareaRef$current4 = _textareaRef$current4.resizableTextArea) === null || _textareaRef$current4 === void 0 ? void 0 : _textareaRef$current4.textArea,
- nativeElement: containerRef.current
- };
- });
- // ============================== State ===============================
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- measuring = _useState2[0],
- setMeasuring = _useState2[1];
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- measureText = _useState4[0],
- setMeasureText = _useState4[1];
- var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
- _useState6 = (0,slicedToArray["default"])(_useState5, 2),
- measurePrefix = _useState6[0],
- setMeasurePrefix = _useState6[1];
- var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState8 = (0,slicedToArray["default"])(_useState7, 2),
- measureLocation = _useState8[0],
- setMeasureLocation = _useState8[1];
- var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
- _useState10 = (0,slicedToArray["default"])(_useState9, 2),
- activeIndex = _useState10[0],
- setActiveIndex = _useState10[1];
- var _useState11 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState12 = (0,slicedToArray["default"])(_useState11, 2),
- isFocus = _useState12[0],
- setIsFocus = _useState12[1];
- // ============================== Value ===============================
- var _useMergedState = (0,useMergedState["default"])('', {
- defaultValue: defaultValue,
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedValue = _useMergedState2[0],
- setMergedValue = _useMergedState2[1];
- // =============================== Open ===============================
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- // Sync measure div top with textarea for rc-trigger usage
- if (measuring && measureRef.current) {
- measureRef.current.scrollTop = getTextArea().scrollTop;
- }
- }, [measuring]);
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (open) {
- if (true) {
- (0,warning["default"])(false, '`open` of Mentions is only used for debug usage. Do not use in you production.');
- }
- for (var i = 0; i < mergedPrefix.length; i += 1) {
- var curPrefix = mergedPrefix[i];
- var index = mergedValue.lastIndexOf(curPrefix);
- if (index >= 0) {
- return [true, '', curPrefix, index];
- }
- }
- }
- return [measuring, measureText, measurePrefix, measureLocation];
- }, [open, measuring, mergedPrefix, mergedValue, measureText, measurePrefix, measureLocation]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 4),
- mergedMeasuring = _React$useMemo2[0],
- mergedMeasureText = _React$useMemo2[1],
- mergedMeasurePrefix = _React$useMemo2[2],
- mergedMeasureLocation = _React$useMemo2[3];
- // ============================== Option ==============================
- var getOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useCallback(function (targetMeasureText) {
- var list;
- if (options && options.length > 0) {
- list = options.map(function (item) {
- var _item$key;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- key: (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : item.value
- });
- });
- } else {
- list = (0,toArray["default"])(children).map(function (_ref) {
- var optionProps = _ref.props,
- key = _ref.key;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, optionProps), {}, {
- label: optionProps.children,
- key: key || optionProps.value
- });
- });
- }
- return list.filter(function (option) {
- /** Return all result if `filterOption` is false. */
- if (filterOption === false) {
- return true;
- }
- return filterOption(targetMeasureText, option);
- });
- }, [children, options, filterOption]);
- var mergedOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- return getOptions(mergedMeasureText);
- }, [getOptions, mergedMeasureText]);
- // ============================= Measure ==============================
- // Mark that we will reset input selection to target position when user select option
- var onSelectionEffect = useEffectState_useEffectState();
- var startMeasure = function startMeasure(nextMeasureText, nextMeasurePrefix, nextMeasureLocation) {
- setMeasuring(true);
- setMeasureText(nextMeasureText);
- setMeasurePrefix(nextMeasurePrefix);
- setMeasureLocation(nextMeasureLocation);
- setActiveIndex(0);
- };
- var stopMeasure = function stopMeasure(callback) {
- setMeasuring(false);
- setMeasureLocation(0);
- setMeasureText('');
- onSelectionEffect(callback);
- };
- // ============================== Change ==============================
- var triggerChange = function triggerChange(nextValue) {
- setMergedValue(nextValue);
- onChange === null || onChange === void 0 || onChange(nextValue);
- };
- var onInternalChange = function onInternalChange(_ref2) {
- var nextValue = _ref2.target.value;
- triggerChange(nextValue);
- };
- var selectOption = function selectOption(option) {
- var _getTextArea;
- var _option$value = option.value,
- mentionValue = _option$value === void 0 ? '' : _option$value;
- var _replaceWithMeasure = replaceWithMeasure(mergedValue, {
- measureLocation: mergedMeasureLocation,
- targetText: mentionValue,
- prefix: mergedMeasurePrefix,
- selectionStart: (_getTextArea = getTextArea()) === null || _getTextArea === void 0 ? void 0 : _getTextArea.selectionStart,
- split: split
- }),
- text = _replaceWithMeasure.text,
- selectionLocation = _replaceWithMeasure.selectionLocation;
- triggerChange(text);
- stopMeasure(function () {
- // We need restore the selection position
- setInputSelection(getTextArea(), selectionLocation);
- });
- onSelect === null || onSelect === void 0 || onSelect(option, mergedMeasurePrefix);
- };
- // ============================= KeyEvent =============================
- // Check if hit the measure keyword
- var onInternalKeyDown = function onInternalKeyDown(event) {
- var which = event.which;
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
- // Skip if not measuring
- if (!mergedMeasuring) {
- return;
- }
- if (which === KeyCode["default"].UP || which === KeyCode["default"].DOWN) {
- // Control arrow function
- var optionLen = mergedOptions.length;
- var offset = which === KeyCode["default"].UP ? -1 : 1;
- var newActiveIndex = (activeIndex + offset + optionLen) % optionLen;
- setActiveIndex(newActiveIndex);
- event.preventDefault();
- } else if (which === KeyCode["default"].ESC) {
- stopMeasure();
- } else if (which === KeyCode["default"].ENTER) {
- // Measure hit
- event.preventDefault();
- // loading skip
- if (silent) {
- return;
- }
- if (!mergedOptions.length) {
- stopMeasure();
- return;
- }
- var _option = mergedOptions[activeIndex];
- selectOption(_option);
- }
- };
- /**
- * When to start measure:
- * 1. When user press `prefix`
- * 2. When measureText !== prevMeasureText
- * - If measure hit
- * - If measuring
- *
- * When to stop measure:
- * 1. Selection is out of range
- * 2. Contains `space`
- * 3. ESC or select one
- */
- var onInternalKeyUp = function onInternalKeyUp(event) {
- var key = event.key,
- which = event.which;
- var target = event.target;
- var selectionStartText = getBeforeSelectionText(target);
- var _getLastMeasureIndex = getLastMeasureIndex(selectionStartText, mergedPrefix),
- measureIndex = _getLastMeasureIndex.location,
- nextMeasurePrefix = _getLastMeasureIndex.prefix;
- // If the client implements an onKeyUp handler, call it
- onKeyUp === null || onKeyUp === void 0 || onKeyUp(event);
- // Skip if match the white key list
- if ([KeyCode["default"].ESC, KeyCode["default"].UP, KeyCode["default"].DOWN, KeyCode["default"].ENTER].indexOf(which) !== -1) {
- return;
- }
- if (measureIndex !== -1) {
- var nextMeasureText = selectionStartText.slice(measureIndex + nextMeasurePrefix.length);
- var validateMeasure = validateSearch(nextMeasureText, split);
- var matchOption = !!getOptions(nextMeasureText).length;
- if (validateMeasure) {
- // adding AltGraph also fort azert keyboard
- if (key === nextMeasurePrefix || key === 'Shift' || which === KeyCode["default"].ALT || key === 'AltGraph' || mergedMeasuring || nextMeasureText !== mergedMeasureText && matchOption) {
- startMeasure(nextMeasureText, nextMeasurePrefix, measureIndex);
- }
- } else if (mergedMeasuring) {
- // Stop if measureText is invalidate
- stopMeasure();
- }
- /**
- * We will trigger `onSearch` to developer since they may use for async update.
- * If met `space` means user finished searching.
- */
- if (onSearch && validateMeasure) {
- onSearch(nextMeasureText, nextMeasurePrefix);
- }
- } else if (mergedMeasuring) {
- stopMeasure();
- }
- };
- var onInternalPressEnter = function onInternalPressEnter(event) {
- if (!mergedMeasuring && onPressEnter) {
- onPressEnter(event);
- }
- };
- // ============================ Focus Blur ============================
- var focusRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var onInternalFocus = function onInternalFocus(event) {
- window.clearTimeout(focusRef.current);
- if (!isFocus && event && onFocus) {
- onFocus(event);
- }
- setIsFocus(true);
- };
- var onInternalBlur = function onInternalBlur(event) {
- focusRef.current = window.setTimeout(function () {
- setIsFocus(false);
- stopMeasure();
- onBlur === null || onBlur === void 0 || onBlur(event);
- }, 0);
- };
- var onDropdownFocus = function onDropdownFocus() {
- onInternalFocus();
- };
- var onDropdownBlur = function onDropdownBlur() {
- onInternalBlur();
- };
- // ============================== Scroll ===============================
- var onInternalPopupScroll = function onInternalPopupScroll(event) {
- onPopupScroll === null || onPopupScroll === void 0 || onPopupScroll(event);
- };
- // ============================== Render ==============================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(prefixCls, className),
- style: style,
- ref: containerRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_textarea_es, (0,esm_extends["default"])({
- ref: textareaRef,
- value: mergedValue
- }, restProps, {
- rows: rows,
- onChange: onInternalChange,
- onKeyDown: onInternalKeyDown,
- onKeyUp: onInternalKeyUp,
- onPressEnter: onInternalPressEnter,
- onFocus: onInternalFocus,
- onBlur: onInternalBlur
- })), mergedMeasuring && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: measureRef,
- className: "".concat(prefixCls, "-measure")
- }, mergedValue.slice(0, mergedMeasureLocation), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_MentionsContext.Provider, {
- value: {
- notFoundContent: notFoundContent,
- activeIndex: activeIndex,
- setActiveIndex: setActiveIndex,
- selectOption: selectOption,
- onFocus: onDropdownFocus,
- onBlur: onDropdownBlur,
- onScroll: onInternalPopupScroll
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_KeywordTrigger, {
- prefixCls: prefixCls,
- transitionName: transitionName,
- placement: placement,
- direction: direction,
- options: mergedOptions,
- visible: true,
- getPopupContainer: getPopupContainer,
- dropdownClassName: dropdownClassName
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, mergedMeasurePrefix))), mergedValue.slice(mergedMeasureLocation + mergedMeasurePrefix.length)));
- });
- var Mentions = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (_ref3, ref) {
- var suffix = _ref3.suffix,
- _ref3$prefixCls = _ref3.prefixCls,
- prefixCls = _ref3$prefixCls === void 0 ? 'rc-mentions' : _ref3$prefixCls,
- defaultValue = _ref3.defaultValue,
- customValue = _ref3.value,
- allowClear = _ref3.allowClear,
- onChange = _ref3.onChange,
- classes = _ref3.classNames,
- className = _ref3.className,
- disabled = _ref3.disabled,
- onClear = _ref3.onClear,
- rest = (0,objectWithoutProperties["default"])(_ref3, Mentions_excluded2);
- // =============================== Ref ================================
- var holderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var mentionRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
- var _holderRef$current, _mentionRef$current;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, mentionRef.current), {}, {
- nativeElement: ((_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.nativeElement) || ((_mentionRef$current = mentionRef.current) === null || _mentionRef$current === void 0 ? void 0 : _mentionRef$current.nativeElement)
- });
- });
- // ============================== Value ===============================
- var _useMergedState3 = (0,useMergedState["default"])('', {
- defaultValue: defaultValue,
- value: customValue
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedValue = _useMergedState4[0],
- setMergedValue = _useMergedState4[1];
- // ============================== Change ==============================
- var triggerChange = function triggerChange(currentValue) {
- setMergedValue(currentValue);
- onChange === null || onChange === void 0 || onChange(currentValue);
- };
- // ============================== Reset ===============================
- var handleReset = function handleReset() {
- triggerChange('');
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_BaseInput, {
- suffix: suffix,
- prefixCls: prefixCls,
- value: mergedValue,
- allowClear: allowClear,
- handleReset: handleReset,
- className: className,
- classNames: classes,
- disabled: disabled,
- ref: holderRef,
- onClear: onClear
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(InternalMentions, (0,esm_extends["default"])({
- className: classes === null || classes === void 0 ? void 0 : classes.mentions,
- prefixCls: prefixCls,
- ref: mentionRef,
- onChange: triggerChange,
- disabled: disabled
- }, rest)));
- });
- Mentions.Option = rc_mentions_es_Option;
- /* harmony default export */ var es_Mentions = (Mentions);
- ;// ./node_modules/rc-mentions/es/index.js
- /* harmony default export */ var rc_mentions_es = (es_Mentions);
- ;// ./components/_util/toList.ts
- const toList = (candidate, skipEmpty = false) => {
- if (skipEmpty && (candidate === undefined || candidate === null)) {
- return [];
- }
- return Array.isArray(candidate) ? candidate : [candidate];
- };
- /* harmony default export */ var _util_toList = (toList);
- // EXTERNAL MODULE: ./components/mentions/style/index.ts
- var mentions_style = __webpack_require__("./components/mentions/style/index.ts");
- ;// ./components/mentions/index.tsx
- var mentions_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const {
- Option: mentions_Option
- } = rc_mentions_es;
- function loadingFilterOption() {
- return true;
- }
- const mentions_InternalMentions = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- disabled,
- loading,
- filterOption,
- children,
- notFoundContent,
- options,
- status: customStatus,
- allowClear = false,
- popupClassName,
- style,
- variant: customVariant
- } = props,
- restProps = mentions_rest(props, ["prefixCls", "className", "rootClassName", "disabled", "loading", "filterOption", "children", "notFoundContent", "options", "status", "allowClear", "popupClassName", "style", "variant"]);
- const [focused, setFocused] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const innerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const mergedRef = (0,es_ref.composeRef)(ref, innerRef);
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Mentions');
- warning.deprecated(!children, 'Mentions.Option', 'options');
- }
- const {
- getPrefixCls,
- renderEmpty,
- direction,
- mentions: contextMentions
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- status: contextStatus,
- hasFeedback,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- const onFocus = (...args) => {
- if (restProps.onFocus) {
- restProps.onFocus.apply(restProps, args);
- }
- setFocused(true);
- };
- const onBlur = (...args) => {
- if (restProps.onBlur) {
- restProps.onBlur.apply(restProps, args);
- }
- setFocused(false);
- };
- const notFoundContentEle = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (notFoundContent !== undefined) {
- return notFoundContent;
- }
- return (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Select"
- });
- }, [notFoundContent, renderEmpty]);
- const mentionOptions = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (loading) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(mentions_Option, {
- value: "ANTD_SEARCHING",
- disabled: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(spin, {
- size: "small"
- }));
- }
- return children;
- }, [loading, children]);
- const mergedOptions = loading ? [{
- value: 'ANTD_SEARCHING',
- disabled: true,
- label: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(spin, {
- size: "small"
- })
- }] : options;
- const mentionsfilterOption = loading ? loadingFilterOption : filterOption;
- const prefixCls = getPrefixCls('mentions', customizePrefixCls);
- const mergedAllowClear = _util_getAllowClear(allowClear);
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,mentions_style["default"])(prefixCls, rootCls);
- const [variant, enableVariantCls] = useVariants('mentions', customVariant);
- const suffixNode = hasFeedback && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, feedbackIcon);
- const mergedClassName = classnames_default()(contextMentions === null || contextMentions === void 0 ? void 0 : contextMentions.className, className, rootClassName, cssVarCls, rootCls);
- const mentions = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_mentions_es, Object.assign({
- silent: loading,
- prefixCls: prefixCls,
- notFoundContent: notFoundContentEle,
- className: mergedClassName,
- disabled: disabled,
- allowClear: mergedAllowClear,
- direction: direction,
- style: Object.assign(Object.assign({}, contextMentions === null || contextMentions === void 0 ? void 0 : contextMentions.style), style)
- }, restProps, {
- filterOption: mentionsfilterOption,
- onFocus: onFocus,
- onBlur: onBlur,
- dropdownClassName: classnames_default()(popupClassName, rootClassName, hashId, cssVarCls, rootCls),
- ref: mergedRef,
- options: mergedOptions,
- suffix: suffixNode,
- classNames: {
- mentions: classnames_default()({
- [`${prefixCls}-disabled`]: disabled,
- [`${prefixCls}-focused`]: focused,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, hashId),
- variant: classnames_default()({
- [`${prefixCls}-${variant}`]: enableVariantCls
- }, getStatusClassNames(prefixCls, mergedStatus)),
- affixWrapper: hashId
- }
- }), mentionOptions);
- return wrapCSSVar(mentions);
- });
- const mentions_Mentions = mentions_InternalMentions;
- if (true) {
- mentions_Mentions.displayName = 'Mentions';
- }
- mentions_Mentions.Option = mentions_Option;
- // We don't care debug panel
- /* istanbul ignore next */
- const mentions_PurePanel = _util_PurePanel(mentions_Mentions, undefined, undefined, 'mentions');
- mentions_Mentions._InternalPanelDoNotUseOrYouWillBeFired = mentions_PurePanel;
- mentions_Mentions.getMentions = (value = '', config = {}) => {
- const {
- prefix = '@',
- split = ' '
- } = config;
- const prefixList = _util_toList(prefix);
- return value.split(split).map((str = '') => {
- let hitPrefix = null;
- prefixList.some(prefixStr => {
- const startStr = str.slice(0, prefixStr.length);
- if (startStr === prefixStr) {
- hitPrefix = prefixStr;
- return true;
- }
- return false;
- });
- if (hitPrefix !== null) {
- return {
- prefix: hitPrefix,
- value: str.slice(hitPrefix.length)
- };
- }
- return null;
- }).filter(entity => !!entity && !!entity.value);
- };
- /* harmony default export */ var mentions = (mentions_Mentions);
- ;// ./components/message/index.tsx
- let message = null;
- let act = callback => callback();
- let taskQueue = [];
- let defaultGlobalConfig = {};
- function getGlobalContext() {
- const {
- getContainer,
- duration,
- rtl,
- maxCount,
- top
- } = defaultGlobalConfig;
- const mergedContainer = (getContainer === null || getContainer === void 0 ? void 0 : getContainer()) || document.body;
- return {
- getContainer: () => mergedContainer,
- duration,
- rtl,
- maxCount,
- top
- };
- }
- const GlobalHolder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- messageConfig,
- sync
- } = props;
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls('message');
- const appConfig = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AppConfigContext);
- const [api, holder] = useInternalMessage(Object.assign(Object.assign(Object.assign({}, messageConfig), {
- prefixCls
- }), appConfig.message));
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => {
- const instance = Object.assign({}, api);
- Object.keys(instance).forEach(method => {
- instance[method] = (...args) => {
- sync();
- return api[method].apply(api, args);
- };
- });
- return {
- instance,
- sync
- };
- });
- return holder;
- });
- const GlobalHolderWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((_, ref) => {
- const [messageConfig, setMessageConfig] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(getGlobalContext);
- const sync = () => {
- setMessageConfig(getGlobalContext);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(sync, []);
- const global = globalConfig();
- const rootPrefixCls = global.getRootPrefixCls();
- const rootIconPrefixCls = global.getIconPrefixCls();
- const theme = global.getTheme();
- const dom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(GlobalHolder, {
- ref: ref,
- sync: sync,
- messageConfig: messageConfig
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(config_provider, {
- prefixCls: rootPrefixCls,
- iconPrefixCls: rootIconPrefixCls,
- theme: theme
- }, global.holderRender ? global.holderRender(dom) : dom);
- });
- const flushMessageQueue = () => {
- if (!message) {
- const holderFragment = document.createDocumentFragment();
- const newMessage = {
- fragment: holderFragment
- };
- message = newMessage;
- // Delay render to avoid sync issue
- act(() => {
- const reactRender = unstableSetRender();
- reactRender(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(GlobalHolderWrapper, {
- ref: node => {
- const {
- instance,
- sync
- } = node || {};
- // React 18 test env will throw if call immediately in ref
- Promise.resolve().then(() => {
- if (!newMessage.instance && instance) {
- newMessage.instance = instance;
- newMessage.sync = sync;
- flushMessageQueue();
- }
- });
- }
- }), holderFragment);
- });
- return;
- }
- // Notification not ready
- if (!message.instance) {
- return;
- }
- // >>> Execute task
- taskQueue.forEach(task => {
- const {
- type,
- skipped
- } = task;
- // Only `skipped` when user call notice but cancel it immediately
- // and instance not ready
- if (!skipped) {
- switch (type) {
- case 'open':
- {
- act(() => {
- const closeFn = message.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));
- closeFn === null || closeFn === void 0 ? void 0 : closeFn.then(task.resolve);
- task.setCloseFn(closeFn);
- });
- break;
- }
- case 'destroy':
- act(() => {
- message === null || message === void 0 ? void 0 : message.instance.destroy(task.key);
- });
- break;
- // Other type open
- default:
- {
- act(() => {
- var _message$instance;
- const closeFn = (_message$instance = message.instance)[type].apply(_message$instance, (0,toConsumableArray["default"])(task.args));
- closeFn === null || closeFn === void 0 ? void 0 : closeFn.then(task.resolve);
- task.setCloseFn(closeFn);
- });
- }
- }
- }
- });
- // Clean up
- taskQueue = [];
- };
- // ==============================================================================
- // == Export ==
- // ==============================================================================
- function setMessageGlobalConfig(config) {
- defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);
- // Trigger sync for it
- act(() => {
- var _a;
- (_a = message === null || message === void 0 ? void 0 : message.sync) === null || _a === void 0 ? void 0 : _a.call(message);
- });
- }
- function message_open(config) {
- const result = wrapPromiseFn(resolve => {
- let closeFn;
- const task = {
- type: 'open',
- config,
- resolve,
- setCloseFn: fn => {
- closeFn = fn;
- }
- };
- taskQueue.push(task);
- return () => {
- if (closeFn) {
- act(() => {
- closeFn();
- });
- } else {
- task.skipped = true;
- }
- };
- });
- flushMessageQueue();
- return result;
- }
- function typeOpen(type, args) {
- const global = globalConfig();
- if ( true && !global.holderRender) {
- warnContext('message');
- }
- const result = wrapPromiseFn(resolve => {
- let closeFn;
- const task = {
- type,
- args,
- resolve,
- setCloseFn: fn => {
- closeFn = fn;
- }
- };
- taskQueue.push(task);
- return () => {
- if (closeFn) {
- act(() => {
- closeFn();
- });
- } else {
- task.skipped = true;
- }
- };
- });
- flushMessageQueue();
- return result;
- }
- const destroy = key => {
- taskQueue.push({
- type: 'destroy',
- key
- });
- flushMessageQueue();
- };
- const methods = ['success', 'info', 'warning', 'error', 'loading'];
- const baseStaticMethods = {
- open: message_open,
- destroy,
- config: setMessageGlobalConfig,
- useMessage: useMessage,
- _InternalPanelDoNotUseOrYouWillBeFired: message_PurePanel
- };
- const staticMethods = baseStaticMethods;
- methods.forEach(type => {
- staticMethods[type] = (...args) => typeOpen(type, args);
- });
- // ==============================================================================
- // == Test ==
- // ==============================================================================
- const message_noop = () => {};
- let _actWrapper = message_noop;
- if (false) // removed by dead control flow
- {}
- const actWrapper = _actWrapper;
- let _actDestroy = message_noop;
- if (false) // removed by dead control flow
- {}
- const actDestroy = _actDestroy;
- /* harmony default export */ var components_message = (staticMethods);
- ;// ./components/modal/PurePanel.tsx
- var modal_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const modal_PurePanel_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- closeIcon,
- closable,
- type,
- title,
- children,
- footer
- } = props,
- restProps = modal_PurePanel_rest(props, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const rootPrefixCls = getPrefixCls();
- const prefixCls = customizePrefixCls || getPrefixCls('modal');
- const rootCls = hooks_useCSSVarCls(rootPrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,modal_style["default"])(prefixCls, rootCls);
- const confirmPrefixCls = `${prefixCls}-confirm`;
- // Choose target props by confirm mark
- let additionalProps = {};
- if (type) {
- additionalProps = {
- closable: closable !== null && closable !== void 0 ? closable : false,
- title: '',
- footer: '',
- children: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ConfirmContent, Object.assign({}, props, {
- prefixCls: prefixCls,
- confirmPrefixCls: confirmPrefixCls,
- rootPrefixCls: rootPrefixCls,
- content: children
- })))
- };
- } else {
- additionalProps = {
- closable: closable !== null && closable !== void 0 ? closable : true,
- title,
- footer: footer !== null && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Footer, Object.assign({}, props)),
- children
- };
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Content_Panel, Object.assign({
- prefixCls: prefixCls,
- className: classnames_default()(hashId, `${prefixCls}-pure-panel`, type && confirmPrefixCls, type && `${confirmPrefixCls}-${type}`, className, cssVarCls, rootCls)
- }, restProps, {
- closeIcon: renderCloseIcon(prefixCls, closeIcon),
- closable: closable
- }, additionalProps)));
- };
- /* harmony default export */ var modal_PurePanel = (withPureRenderTheme(modal_PurePanel_PurePanel));
- ;// ./components/modal/index.tsx
- function modalWarn(props) {
- return confirm_confirm(withWarn(props));
- }
- const components_modal_Modal = modal_Modal;
- components_modal_Modal.useModal = modal_useModal;
- components_modal_Modal.info = function infoFn(props) {
- return confirm_confirm(withInfo(props));
- };
- components_modal_Modal.success = function successFn(props) {
- return confirm_confirm(withSuccess(props));
- };
- components_modal_Modal.error = function errorFn(props) {
- return confirm_confirm(withError(props));
- };
- components_modal_Modal.warning = modalWarn;
- components_modal_Modal.warn = modalWarn;
- components_modal_Modal.confirm = function confirmFn(props) {
- return confirm_confirm(withConfirm(props));
- };
- components_modal_Modal.destroyAll = function destroyAllFn() {
- while (modal_destroyFns.length) {
- const close = modal_destroyFns.pop();
- if (close) {
- close();
- }
- }
- };
- components_modal_Modal.config = modalGlobalConfig;
- components_modal_Modal._InternalPanelDoNotUseOrYouWillBeFired = modal_PurePanel;
- if (true) {
- components_modal_Modal.displayName = 'Modal';
- }
- /* harmony default export */ var modal = (components_modal_Modal);
- ;// ./components/notification/index.tsx
- let notification = null;
- let notification_act = callback => callback();
- let notification_taskQueue = [];
- let notification_defaultGlobalConfig = {};
- function notification_getGlobalContext() {
- const {
- getContainer,
- rtl,
- maxCount,
- top,
- bottom,
- showProgress,
- pauseOnHover
- } = notification_defaultGlobalConfig;
- const mergedContainer = (getContainer === null || getContainer === void 0 ? void 0 : getContainer()) || document.body;
- return {
- getContainer: () => mergedContainer,
- rtl,
- maxCount,
- top,
- bottom,
- showProgress,
- pauseOnHover
- };
- }
- const notification_GlobalHolder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- const {
- notificationConfig,
- sync
- } = props;
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = notification_defaultGlobalConfig.prefixCls || getPrefixCls('notification');
- const appConfig = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(AppConfigContext);
- const [api, holder] = useInternalNotification(Object.assign(Object.assign(Object.assign({}, notificationConfig), {
- prefixCls
- }), appConfig.notification));
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(sync, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, () => {
- const instance = Object.assign({}, api);
- Object.keys(instance).forEach(method => {
- instance[method] = (...args) => {
- sync();
- return api[method].apply(api, args);
- };
- });
- return {
- instance,
- sync
- };
- });
- return holder;
- });
- const notification_GlobalHolderWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((_, ref) => {
- const [notificationConfig, setNotificationConfig] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(notification_getGlobalContext);
- const sync = () => {
- setNotificationConfig(notification_getGlobalContext);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(sync, []);
- const global = globalConfig();
- const rootPrefixCls = global.getRootPrefixCls();
- const rootIconPrefixCls = global.getIconPrefixCls();
- const theme = global.getTheme();
- const dom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(notification_GlobalHolder, {
- ref: ref,
- sync: sync,
- notificationConfig: notificationConfig
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(config_provider, {
- prefixCls: rootPrefixCls,
- iconPrefixCls: rootIconPrefixCls,
- theme: theme
- }, global.holderRender ? global.holderRender(dom) : dom);
- });
- const flushNotificationQueue = () => {
- if (!notification) {
- const holderFragment = document.createDocumentFragment();
- const newNotification = {
- fragment: holderFragment
- };
- notification = newNotification;
- // Delay render to avoid sync issue
- notification_act(() => {
- const reactRender = unstableSetRender();
- reactRender(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(notification_GlobalHolderWrapper, {
- ref: node => {
- const {
- instance,
- sync
- } = node || {};
- Promise.resolve().then(() => {
- if (!newNotification.instance && instance) {
- newNotification.instance = instance;
- newNotification.sync = sync;
- flushNotificationQueue();
- }
- });
- }
- }), holderFragment);
- });
- return;
- }
- // Notification not ready
- if (!notification.instance) {
- return;
- }
- // >>> Execute task
- notification_taskQueue.forEach(task => {
- switch (task.type) {
- case 'open':
- {
- notification_act(() => {
- notification.instance.open(Object.assign(Object.assign({}, notification_defaultGlobalConfig), task.config));
- });
- break;
- }
- case 'destroy':
- notification_act(() => {
- var _a;
- (_a = notification === null || notification === void 0 ? void 0 : notification.instance) === null || _a === void 0 ? void 0 : _a.destroy(task.key);
- });
- break;
- }
- });
- // Clean up
- notification_taskQueue = [];
- };
- // ==============================================================================
- // == Export ==
- // ==============================================================================
- function setNotificationGlobalConfig(config) {
- notification_defaultGlobalConfig = Object.assign(Object.assign({}, notification_defaultGlobalConfig), config);
- // Trigger sync for it
- notification_act(() => {
- var _a;
- (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);
- });
- }
- function notification_open(config) {
- const global = globalConfig();
- if ( true && !global.holderRender) {
- warnContext('notification');
- }
- notification_taskQueue.push({
- type: 'open',
- config
- });
- flushNotificationQueue();
- }
- const notification_destroy = key => {
- notification_taskQueue.push({
- type: 'destroy',
- key
- });
- flushNotificationQueue();
- };
- const notification_methods = ['success', 'info', 'warning', 'error'];
- const notification_baseStaticMethods = {
- open: notification_open,
- destroy: notification_destroy,
- config: setNotificationGlobalConfig,
- useNotification: useNotification_useNotification,
- _InternalPanelDoNotUseOrYouWillBeFired: notification_PurePanel
- };
- const notification_staticMethods = notification_baseStaticMethods;
- notification_methods.forEach(type => {
- notification_staticMethods[type] = config => notification_open(Object.assign(Object.assign({}, config), {
- type
- }));
- });
- // ==============================================================================
- // == Test ==
- // ==============================================================================
- const notification_noop = () => {};
- let notification_actWrapper = notification_noop;
- if (false) // removed by dead control flow
- {}
- const components_notification_actWrapper = notification_actWrapper;
- let notification_actDestroy = notification_noop;
- if (false) // removed by dead control flow
- {}
- const components_notification_actDestroy = notification_actDestroy;
- /* harmony default export */ var components_notification = (notification_staticMethods);
- // EXTERNAL MODULE: ./components/popconfirm/style/index.ts
- var popconfirm_style = __webpack_require__("./components/popconfirm/style/index.ts");
- ;// ./components/popconfirm/PurePanel.tsx
- var popconfirm_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const PurePanel_Overlay = props => {
- const {
- prefixCls,
- okButtonProps,
- cancelButtonProps,
- title,
- description,
- cancelText,
- okText,
- okType = 'primary',
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ExclamationCircleFilled, null),
- showCancel = true,
- close,
- onConfirm,
- onCancel,
- onPopupClick
- } = props;
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [contextLocale] = (0,useLocale["default"])('Popconfirm', en_US["default"].Popconfirm);
- const titleNode = getRenderPropValue(title);
- const descriptionNode = getRenderPropValue(description);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-inner-content`,
- onClick: onPopupClick
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-message`
- }, icon && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-message-icon`
- }, icon), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-message-text`
- }, titleNode && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-title`
- }, titleNode), descriptionNode && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-description`
- }, descriptionNode))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-buttons`
- }, showCancel && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, Object.assign({
- onClick: onCancel,
- size: "small"
- }, cancelButtonProps), cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.cancelText))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(_util_ActionButton, {
- buttonProps: Object.assign(Object.assign({
- size: 'small'
- }, convertLegacyProps(okType)), okButtonProps),
- actionFn: onConfirm,
- close: close,
- prefixCls: getPrefixCls('btn'),
- quitOnNullishReturnValue: true,
- emitEvent: true
- }, okText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.okText))));
- };
- const popconfirm_PurePanel_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- placement,
- className,
- style
- } = props,
- restProps = popconfirm_PurePanel_rest(props, ["prefixCls", "placement", "className", "style"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('popconfirm', customizePrefixCls);
- const [wrapCSSVar] = (0,popconfirm_style["default"])(prefixCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(popover_PurePanel, {
- placement: placement,
- className: classnames_default()(prefixCls, className),
- style: style,
- content: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PurePanel_Overlay, Object.assign({
- prefixCls: prefixCls
- }, restProps))
- }));
- };
- /* harmony default export */ var popconfirm_PurePanel = (popconfirm_PurePanel_PurePanel);
- ;// ./components/popconfirm/index.tsx
- var popconfirm_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalPopconfirm = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- placement = 'top',
- trigger = 'click',
- okType = 'primary',
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_ExclamationCircleFilled, null),
- children,
- overlayClassName,
- onOpenChange,
- onVisibleChange,
- overlayStyle,
- styles,
- classNames: popconfirmClassNames
- } = props,
- restProps = popconfirm_rest(props, ["prefixCls", "placement", "trigger", "okType", "icon", "children", "overlayClassName", "onOpenChange", "onVisibleChange", "overlayStyle", "styles", "classNames"]);
- const {
- getPrefixCls,
- className: contextClassName,
- style: contextStyle,
- classNames: contextClassNames,
- styles: contextStyles
- } = (0,config_provider_context.useComponentConfig)('popconfirm');
- const [open, setOpen] = (0,useMergedState["default"])(false, {
- value: (_a = props.open) !== null && _a !== void 0 ? _a : props.visible,
- defaultValue: (_b = props.defaultOpen) !== null && _b !== void 0 ? _b : props.defaultVisible
- });
- const settingOpen = (value, e) => {
- setOpen(value, true);
- onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(value);
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(value, e);
- };
- const close = e => {
- settingOpen(false, e);
- };
- const onConfirm = e => {
- var _a;
- return (_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(undefined, e);
- };
- const onCancel = e => {
- var _a;
- settingOpen(false, e);
- (_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(undefined, e);
- };
- const onInternalOpenChange = (value, e) => {
- const {
- disabled = false
- } = props;
- if (disabled) {
- return;
- }
- settingOpen(value, e);
- };
- const prefixCls = getPrefixCls('popconfirm', customizePrefixCls);
- const rootClassNames = classnames_default()(prefixCls, contextClassName, overlayClassName, contextClassNames.root, popconfirmClassNames === null || popconfirmClassNames === void 0 ? void 0 : popconfirmClassNames.root);
- const bodyClassNames = classnames_default()(contextClassNames.body, popconfirmClassNames === null || popconfirmClassNames === void 0 ? void 0 : popconfirmClassNames.body);
- const [wrapCSSVar] = (0,popconfirm_style["default"])(prefixCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(popover, Object.assign({}, (0,omit["default"])(restProps, ['title']), {
- trigger: trigger,
- placement: placement,
- onOpenChange: onInternalOpenChange,
- open: open,
- ref: ref,
- classNames: {
- root: rootClassNames,
- body: bodyClassNames
- },
- styles: {
- root: Object.assign(Object.assign(Object.assign(Object.assign({}, contextStyles.root), contextStyle), overlayStyle), styles === null || styles === void 0 ? void 0 : styles.root),
- body: Object.assign(Object.assign({}, contextStyles.body), styles === null || styles === void 0 ? void 0 : styles.body)
- },
- content: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(PurePanel_Overlay, Object.assign({
- okType: okType,
- icon: icon
- }, props, {
- prefixCls: prefixCls,
- close: close,
- onConfirm: onConfirm,
- onCancel: onCancel
- })),
- "data-popover-inject": true
- }), children));
- });
- const Popconfirm = InternalPopconfirm;
- // We don't care debug panel
- /* istanbul ignore next */
- Popconfirm._InternalPanelDoNotUseOrYouWillBeFired = popconfirm_PurePanel;
- if (true) {
- Popconfirm.displayName = 'Popconfirm';
- }
- /* harmony default export */ var popconfirm = (Popconfirm);
- ;// ./node_modules/rc-progress/es/common.js
- var common_defaultProps = {
- percent: 0,
- prefixCls: 'rc-progress',
- strokeColor: '#2db7f5',
- strokeLinecap: 'round',
- strokeWidth: 1,
- trailColor: '#D9D9D9',
- trailWidth: 1,
- gapPosition: 'bottom'
- };
- var useTransitionDuration = function useTransitionDuration() {
- var pathsRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
- var prevTimeStamp = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var now = Date.now();
- var updated = false;
- pathsRef.current.forEach(function (path) {
- if (!path) {
- return;
- }
- updated = true;
- var pathStyle = path.style;
- pathStyle.transitionDuration = '.3s, .3s, .3s, .06s';
- if (prevTimeStamp.current && now - prevTimeStamp.current < 100) {
- pathStyle.transitionDuration = '0s, 0s';
- }
- });
- if (updated) {
- prevTimeStamp.current = Date.now();
- }
- });
- return pathsRef.current;
- };
- ;// ./node_modules/rc-progress/es/Line.js
- var Line_excluded = ["className", "percent", "prefixCls", "strokeColor", "strokeLinecap", "strokeWidth", "style", "trailColor", "trailWidth", "transition"];
- var Line = function Line(props) {
- var _defaultProps$props = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, common_defaultProps), props),
- className = _defaultProps$props.className,
- percent = _defaultProps$props.percent,
- prefixCls = _defaultProps$props.prefixCls,
- strokeColor = _defaultProps$props.strokeColor,
- strokeLinecap = _defaultProps$props.strokeLinecap,
- strokeWidth = _defaultProps$props.strokeWidth,
- style = _defaultProps$props.style,
- trailColor = _defaultProps$props.trailColor,
- trailWidth = _defaultProps$props.trailWidth,
- transition = _defaultProps$props.transition,
- restProps = (0,objectWithoutProperties["default"])(_defaultProps$props, Line_excluded);
- // eslint-disable-next-line no-param-reassign
- delete restProps.gapPosition;
- var percentList = Array.isArray(percent) ? percent : [percent];
- var strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];
- var paths = useTransitionDuration();
- var center = strokeWidth / 2;
- var right = 100 - strokeWidth / 2;
- var pathString = "M ".concat(strokeLinecap === 'round' ? center : 0, ",").concat(center, "\n L ").concat(strokeLinecap === 'round' ? right : 100, ",").concat(center);
- var viewBoxString = "0 0 100 ".concat(strokeWidth);
- var stackPtg = 0;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-line"), className),
- viewBox: viewBoxString,
- preserveAspectRatio: "none",
- style: style
- }, restProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- className: "".concat(prefixCls, "-line-trail"),
- d: pathString,
- strokeLinecap: strokeLinecap,
- stroke: trailColor,
- strokeWidth: trailWidth || strokeWidth,
- fillOpacity: "0"
- }), percentList.map(function (ptg, index) {
- var dashPercent = 1;
- switch (strokeLinecap) {
- case 'round':
- dashPercent = 1 - strokeWidth / 100;
- break;
- case 'square':
- dashPercent = 1 - strokeWidth / 2 / 100;
- break;
- default:
- dashPercent = 1;
- break;
- }
- var pathStyle = {
- strokeDasharray: "".concat(ptg * dashPercent, "px, 100px"),
- strokeDashoffset: "-".concat(stackPtg, "px"),
- transition: transition || 'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear'
- };
- var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
- stackPtg += ptg;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- key: index,
- className: "".concat(prefixCls, "-line-path"),
- d: pathString,
- strokeLinecap: strokeLinecap,
- stroke: color,
- strokeWidth: strokeWidth,
- fillOpacity: "0",
- ref: function ref(elem) {
- // https://reactjs.org/docs/refs-and-the-dom.html#callback-refs
- // React will call the ref callback with the DOM element when the component mounts,
- // and call it with `null` when it unmounts.
- // Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
- paths[index] = elem;
- },
- style: pathStyle
- });
- }));
- };
- if (true) {
- Line.displayName = 'Line';
- }
- /* harmony default export */ var es_Line = (Line);
- ;// ./node_modules/rc-progress/es/hooks/useId.js
- var es_hooks_useId_uuid = 0;
- /** Is client side and not jsdom */
- var hooks_useId_isBrowserClient = true && (0,canUseDom["default"])();
- /** Get unique id for accessibility usage */
- function useId_getUUID() {
- var retId;
- // Test never reach
- /* istanbul ignore if */
- if (hooks_useId_isBrowserClient) {
- retId = es_hooks_useId_uuid;
- es_hooks_useId_uuid += 1;
- } else {
- retId = 'TEST_OR_SSR';
- }
- return retId;
- }
- /* harmony default export */ var es_hooks_useId = (function (id) {
- // Inner id for accessibility usage. Only work in client side
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- innerId = _React$useState2[0],
- setInnerId = _React$useState2[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- setInnerId("rc_progress_".concat(useId_getUUID()));
- }, []);
- return id || innerId;
- });
- ;// ./node_modules/rc-progress/es/Circle/PtgCircle.js
- var Block = function Block(_ref) {
- var bg = _ref.bg,
- children = _ref.children;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- width: '100%',
- height: '100%',
- background: bg
- }
- }, children);
- };
- function getPtgColors(color, scale) {
- return Object.keys(color).map(function (key) {
- var parsedKey = parseFloat(key);
- var ptgKey = "".concat(Math.floor(parsedKey * scale), "%");
- return "".concat(color[key], " ").concat(ptgKey);
- });
- }
- var PtgCircle = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- color = props.color,
- gradientId = props.gradientId,
- radius = props.radius,
- circleStyleForStack = props.style,
- ptg = props.ptg,
- strokeLinecap = props.strokeLinecap,
- strokeWidth = props.strokeWidth,
- size = props.size,
- gapDegree = props.gapDegree;
- var isGradient = color && (0,esm_typeof["default"])(color) === 'object';
- var stroke = isGradient ? "#FFF" : undefined;
- // ========================== Circle ==========================
- var halfSize = size / 2;
- var circleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- className: "".concat(prefixCls, "-circle-path"),
- r: radius,
- cx: halfSize,
- cy: halfSize,
- stroke: stroke,
- strokeLinecap: strokeLinecap,
- strokeWidth: strokeWidth,
- opacity: ptg === 0 ? 0 : 1,
- style: circleStyleForStack,
- ref: ref
- });
- // ========================== Render ==========================
- if (!isGradient) {
- return circleNode;
- }
- var maskId = "".concat(gradientId, "-conic");
- var fromDeg = gapDegree ? "".concat(180 + gapDegree / 2, "deg") : '0deg';
- var conicColors = getPtgColors(color, (360 - gapDegree) / 360);
- var linearColors = getPtgColors(color, 1);
- var conicColorBg = "conic-gradient(from ".concat(fromDeg, ", ").concat(conicColors.join(', '), ")");
- var linearColorBg = "linear-gradient(to ".concat(gapDegree ? 'bottom' : 'top', ", ").concat(linearColors.join(', '), ")");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("mask", {
- id: maskId
- }, circleNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("foreignObject", {
- x: 0,
- y: 0,
- width: size,
- height: size,
- mask: "url(#".concat(maskId, ")")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Block, {
- bg: linearColorBg
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Block, {
- bg: conicColorBg
- }))));
- });
- if (true) {
- PtgCircle.displayName = 'PtgCircle';
- }
- /* harmony default export */ var Circle_PtgCircle = (PtgCircle);
- ;// ./node_modules/rc-progress/es/Circle/util.js
- var VIEW_BOX_SIZE = 100;
- var getCircleStyle = function getCircleStyle(perimeter, perimeterWithoutGap, offset, percent, rotateDeg, gapDegree, gapPosition, strokeColor, strokeLinecap, strokeWidth) {
- var stepSpace = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 0;
- var offsetDeg = offset / 100 * 360 * ((360 - gapDegree) / 360);
- var positionDeg = gapDegree === 0 ? 0 : {
- bottom: 0,
- top: 180,
- left: 90,
- right: -90
- }[gapPosition];
- var strokeDashoffset = (100 - percent) / 100 * perimeterWithoutGap;
- // Fix percent accuracy when strokeLinecap is round
- // https://github.com/ant-design/ant-design/issues/35009
- if (strokeLinecap === 'round' && percent !== 100) {
- strokeDashoffset += strokeWidth / 2;
- // when percent is small enough (<= 1%), keep smallest value to avoid it's disappearance
- if (strokeDashoffset >= perimeterWithoutGap) {
- strokeDashoffset = perimeterWithoutGap - 0.01;
- }
- }
- var halfSize = VIEW_BOX_SIZE / 2;
- return {
- stroke: typeof strokeColor === 'string' ? strokeColor : undefined,
- strokeDasharray: "".concat(perimeterWithoutGap, "px ").concat(perimeter),
- strokeDashoffset: strokeDashoffset + stepSpace,
- transform: "rotate(".concat(rotateDeg + offsetDeg + positionDeg, "deg)"),
- transformOrigin: "".concat(halfSize, "px ").concat(halfSize, "px"),
- transition: 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s',
- fillOpacity: 0
- };
- };
- ;// ./node_modules/rc-progress/es/Circle/index.js
- var Circle_excluded = ["id", "prefixCls", "steps", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "style", "className", "strokeColor", "percent"];
- function Circle_toArray(value) {
- var mergedValue = value !== null && value !== void 0 ? value : [];
- return Array.isArray(mergedValue) ? mergedValue : [mergedValue];
- }
- var Circle = function Circle(props) {
- var _defaultProps$props = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, common_defaultProps), props),
- id = _defaultProps$props.id,
- prefixCls = _defaultProps$props.prefixCls,
- steps = _defaultProps$props.steps,
- strokeWidth = _defaultProps$props.strokeWidth,
- trailWidth = _defaultProps$props.trailWidth,
- _defaultProps$props$g = _defaultProps$props.gapDegree,
- gapDegree = _defaultProps$props$g === void 0 ? 0 : _defaultProps$props$g,
- gapPosition = _defaultProps$props.gapPosition,
- trailColor = _defaultProps$props.trailColor,
- strokeLinecap = _defaultProps$props.strokeLinecap,
- style = _defaultProps$props.style,
- className = _defaultProps$props.className,
- strokeColor = _defaultProps$props.strokeColor,
- percent = _defaultProps$props.percent,
- restProps = (0,objectWithoutProperties["default"])(_defaultProps$props, Circle_excluded);
- var halfSize = VIEW_BOX_SIZE / 2;
- var mergedId = es_hooks_useId(id);
- var gradientId = "".concat(mergedId, "-gradient");
- var radius = halfSize - strokeWidth / 2;
- var perimeter = Math.PI * 2 * radius;
- var rotateDeg = gapDegree > 0 ? 90 + gapDegree / 2 : -90;
- var perimeterWithoutGap = perimeter * ((360 - gapDegree) / 360);
- var _ref = (0,esm_typeof["default"])(steps) === 'object' ? steps : {
- count: steps,
- gap: 2
- },
- stepCount = _ref.count,
- stepGap = _ref.gap;
- var percentList = Circle_toArray(percent);
- var strokeColorList = Circle_toArray(strokeColor);
- var gradient = strokeColorList.find(function (color) {
- return color && (0,esm_typeof["default"])(color) === 'object';
- });
- var isConicGradient = gradient && (0,esm_typeof["default"])(gradient) === 'object';
- var mergedStrokeLinecap = isConicGradient ? 'butt' : strokeLinecap;
- var circleStyle = getCircleStyle(perimeter, perimeterWithoutGap, 0, 100, rotateDeg, gapDegree, gapPosition, trailColor, mergedStrokeLinecap, strokeWidth);
- var paths = useTransitionDuration();
- var getStokeList = function getStokeList() {
- var stackPtg = 0;
- return percentList.map(function (ptg, index) {
- var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
- var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, ptg, rotateDeg, gapDegree, gapPosition, color, mergedStrokeLinecap, strokeWidth);
- stackPtg += ptg;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Circle_PtgCircle, {
- key: index,
- color: color,
- ptg: ptg,
- radius: radius,
- prefixCls: prefixCls,
- gradientId: gradientId,
- style: circleStyleForStack,
- strokeLinecap: mergedStrokeLinecap,
- strokeWidth: strokeWidth,
- gapDegree: gapDegree,
- ref: function ref(elem) {
- // https://reactjs.org/docs/refs-and-the-dom.html#callback-refs
- // React will call the ref callback with the DOM element when the component mounts,
- // and call it with `null` when it unmounts.
- // Refs are guaranteed to be up-to-date before componentDidMount or componentDidUpdate fires.
- paths[index] = elem;
- },
- size: VIEW_BOX_SIZE
- });
- }).reverse();
- };
- var getStepStokeList = function getStepStokeList() {
- // only show the first percent when pass steps
- var current = Math.round(stepCount * (percentList[0] / 100));
- var stepPtg = 100 / stepCount;
- var stackPtg = 0;
- return new Array(stepCount).fill(null).map(function (_, index) {
- var color = index <= current - 1 ? strokeColorList[0] : trailColor;
- var stroke = color && (0,esm_typeof["default"])(color) === 'object' ? "url(#".concat(gradientId, ")") : undefined;
- var circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, stepPtg, rotateDeg, gapDegree, gapPosition, color, 'butt', strokeWidth, stepGap);
- stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepGap) * 100 / perimeterWithoutGap;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- key: index,
- className: "".concat(prefixCls, "-circle-path"),
- r: radius,
- cx: halfSize,
- cy: halfSize,
- stroke: stroke,
- strokeWidth: strokeWidth,
- opacity: 1,
- style: circleStyleForStack,
- ref: function ref(elem) {
- paths[index] = elem;
- }
- });
- });
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", (0,esm_extends["default"])({
- className: classnames_default()("".concat(prefixCls, "-circle"), className),
- viewBox: "0 0 ".concat(VIEW_BOX_SIZE, " ").concat(VIEW_BOX_SIZE),
- style: style,
- id: id,
- role: "presentation"
- }, restProps), !stepCount && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- className: "".concat(prefixCls, "-circle-trail"),
- r: radius,
- cx: halfSize,
- cy: halfSize,
- stroke: trailColor,
- strokeLinecap: mergedStrokeLinecap,
- strokeWidth: trailWidth || strokeWidth,
- style: circleStyle
- }), stepCount ? getStepStokeList() : getStokeList());
- };
- if (true) {
- Circle.displayName = 'Circle';
- }
- /* harmony default export */ var es_Circle = (Circle);
- ;// ./node_modules/rc-progress/es/index.js
- /* harmony default export */ var rc_progress_es = ({
- Line: es_Line,
- Circle: es_Circle
- });
- ;// ./components/progress/utils.ts
- function validProgress(progress) {
- if (!progress || progress < 0) {
- return 0;
- }
- if (progress > 100) {
- return 100;
- }
- return progress;
- }
- function getSuccessPercent({
- success,
- successPercent
- }) {
- let percent = successPercent;
- /** @deprecated Use `percent` instead */
- if (success && 'progress' in success) {
- percent = success.progress;
- }
- if (success && 'percent' in success) {
- percent = success.percent;
- }
- return percent;
- }
- const getPercentage = ({
- percent,
- success,
- successPercent
- }) => {
- const realSuccessPercent = validProgress(getSuccessPercent({
- success,
- successPercent
- }));
- return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
- };
- const getStrokeColor = ({
- success = {},
- strokeColor
- }) => {
- const {
- strokeColor: successColor
- } = success;
- return [successColor || colors_es.presetPrimaryColors.green, strokeColor || null];
- };
- const utils_getSize = (size, type, extra) => {
- var _a, _b, _c, _d;
- let width = -1;
- let height = -1;
- if (type === 'step') {
- const steps = extra.steps;
- const strokeWidth = extra.strokeWidth;
- if (typeof size === 'string' || typeof size === 'undefined') {
- width = size === 'small' ? 2 : 14;
- height = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 8;
- } else if (typeof size === 'number') {
- [width, height] = [size, size];
- } else {
- [width = 14, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
- }
- width *= steps;
- } else if (type === 'line') {
- const strokeWidth = extra === null || extra === void 0 ? void 0 : extra.strokeWidth;
- if (typeof size === 'string' || typeof size === 'undefined') {
- height = strokeWidth || (size === 'small' ? 6 : 8);
- } else if (typeof size === 'number') {
- [width, height] = [size, size];
- } else {
- [width = -1, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
- }
- } else if (type === 'circle' || type === 'dashboard') {
- if (typeof size === 'string' || typeof size === 'undefined') {
- [width, height] = size === 'small' ? [60, 60] : [120, 120];
- } else if (typeof size === 'number') {
- [width, height] = [size, size];
- } else if (Array.isArray(size)) {
- width = (_b = (_a = size[0]) !== null && _a !== void 0 ? _a : size[1]) !== null && _b !== void 0 ? _b : 120;
- height = (_d = (_c = size[0]) !== null && _c !== void 0 ? _c : size[1]) !== null && _d !== void 0 ? _d : 120;
- }
- }
- return [width, height];
- };
- ;// ./components/progress/Circle.tsx
- const CIRCLE_MIN_STROKE_WIDTH = 3;
- const getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;
- const Circle_Circle = props => {
- const {
- prefixCls,
- trailColor = null,
- strokeLinecap = 'round',
- gapPosition,
- gapDegree,
- width: originWidth = 120,
- type,
- children,
- success,
- size = originWidth,
- steps
- } = props;
- const [width, height] = utils_getSize(size, 'circle');
- let {
- strokeWidth
- } = props;
- if (strokeWidth === undefined) {
- strokeWidth = Math.max(getMinPercent(width), 6);
- }
- const circleStyle = {
- width,
- height,
- fontSize: width * 0.15 + 6
- };
- const realGapDegree = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- // Support gapDeg = 0 when type = 'dashboard'
- if (gapDegree || gapDegree === 0) {
- return gapDegree;
- }
- if (type === 'dashboard') {
- return 75;
- }
- return undefined;
- }, [gapDegree, type]);
- const percentArray = getPercentage(props);
- const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;
- // using className to style stroke color
- const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';
- const strokeColor = getStrokeColor({
- success,
- strokeColor: props.strokeColor
- });
- const wrapperClassName = classnames_default()(`${prefixCls}-inner`, {
- [`${prefixCls}-circle-gradient`]: isGradient
- });
- const circleContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Circle, {
- steps: steps,
- percent: steps ? percentArray[1] : percentArray,
- strokeWidth: strokeWidth,
- trailWidth: strokeWidth,
- strokeColor: steps ? strokeColor[1] : strokeColor,
- strokeLinecap: strokeLinecap,
- trailColor: trailColor,
- prefixCls: prefixCls,
- gapDegree: realGapDegree,
- gapPosition: gapPos
- });
- const smallCircle = width <= 20;
- const node = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: wrapperClassName,
- style: circleStyle
- }, circleContent, !smallCircle && children);
- if (smallCircle) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- title: children
- }, node);
- }
- return node;
- };
- /* harmony default export */ var progress_Circle = (Circle_Circle);
- // EXTERNAL MODULE: ./components/progress/style/index.ts
- var progress_style = __webpack_require__("./components/progress/style/index.ts");
- ;// ./components/progress/Line.tsx
- var Line_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- /**
- * @example
- * {
- * "0%": "#afc163",
- * "75%": "#009900",
- * "50%": "green", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
- * "25%": "#66FF00",
- * "100%": "#ffffff"
- * }
- */
- const sortGradient = gradients => {
- let tempArr = [];
- Object.keys(gradients).forEach(key => {
- const formattedKey = parseFloat(key.replace(/%/g, ''));
- if (!Number.isNaN(formattedKey)) {
- tempArr.push({
- key: formattedKey,
- value: gradients[key]
- });
- }
- });
- tempArr = tempArr.sort((a, b) => a.key - b.key);
- return tempArr.map(({
- key,
- value
- }) => `${value} ${key}%`).join(', ');
- };
- /**
- * Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
- * butter, there is the bug. And... Besides women, there is the code.
- *
- * @example
- * {
- * "0%": "#afc163",
- * "25%": "#66FF00",
- * "50%": "#00CC00", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
- * "75%": "#009900", // #00CC00 50%, #009900 75%, #ffffff 100%)
- * "100%": "#ffffff"
- * }
- */
- const handleGradient = (strokeColor, directionConfig) => {
- const {
- from = colors_es.presetPrimaryColors.blue,
- to = colors_es.presetPrimaryColors.blue,
- direction = directionConfig === 'rtl' ? 'to left' : 'to right'
- } = strokeColor,
- rest = Line_rest(strokeColor, ["from", "to", "direction"]);
- if (Object.keys(rest).length !== 0) {
- const sortedGradients = sortGradient(rest);
- const background = `linear-gradient(${direction}, ${sortedGradients})`;
- return {
- background,
- [progress_style.LineStrokeColorVar]: background
- };
- }
- const background = `linear-gradient(${direction}, ${from}, ${to})`;
- return {
- background,
- [progress_style.LineStrokeColorVar]: background
- };
- };
- const Line_Line = props => {
- const {
- prefixCls,
- direction: directionConfig,
- percent,
- size,
- strokeWidth,
- strokeColor,
- strokeLinecap = 'round',
- children,
- trailColor = null,
- percentPosition,
- success
- } = props;
- const {
- align: infoAlign,
- type: infoPosition
- } = percentPosition;
- const backgroundProps = strokeColor && typeof strokeColor !== 'string' ? handleGradient(strokeColor, directionConfig) : {
- [progress_style.LineStrokeColorVar]: strokeColor,
- background: strokeColor
- };
- const borderRadius = strokeLinecap === 'square' || strokeLinecap === 'butt' ? 0 : undefined;
- const mergedSize = size !== null && size !== void 0 ? size : [-1, strokeWidth || (size === 'small' ? 6 : 8)];
- const [width, height] = utils_getSize(mergedSize, 'line', {
- strokeWidth
- });
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Progress');
- warning.deprecated(!('strokeWidth' in props), 'strokeWidth', 'size');
- }
- const trailStyle = {
- backgroundColor: trailColor || undefined,
- borderRadius
- };
- const percentStyle = Object.assign(Object.assign({
- width: `${validProgress(percent)}%`,
- height,
- borderRadius
- }, backgroundProps), {
- [progress_style.Percent]: validProgress(percent) / 100
- });
- const successPercent = getSuccessPercent(props);
- const successPercentStyle = {
- width: `${validProgress(successPercent)}%`,
- height,
- borderRadius,
- backgroundColor: success === null || success === void 0 ? void 0 : success.strokeColor
- };
- const outerStyle = {
- width: width < 0 ? '100%' : width
- };
- const lineInner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-inner`,
- style: trailStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-bg`, `${prefixCls}-bg-${infoPosition}`),
- style: percentStyle
- }, infoPosition === 'inner' && children), successPercent !== undefined && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-success-bg`,
- style: successPercentStyle
- })));
- const isOuterStart = infoPosition === 'outer' && infoAlign === 'start';
- const isOuterEnd = infoPosition === 'outer' && infoAlign === 'end';
- return infoPosition === 'outer' && infoAlign === 'center' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-layout-bottom`
- }, lineInner, children)) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-outer`,
- style: outerStyle
- }, isOuterStart && children, lineInner, isOuterEnd && children));
- };
- /* harmony default export */ var progress_Line = (Line_Line);
- ;// ./components/progress/Steps.tsx
- const Steps_Steps = props => {
- const {
- size,
- steps,
- rounding: customRounding = Math.round,
- percent = 0,
- strokeWidth = 8,
- strokeColor,
- trailColor = null,
- prefixCls,
- children
- } = props;
- const current = customRounding(steps * (percent / 100));
- const stepWidth = size === 'small' ? 2 : 14;
- const mergedSize = size !== null && size !== void 0 ? size : [stepWidth, strokeWidth];
- const [width, height] = utils_getSize(mergedSize, 'step', {
- steps,
- strokeWidth
- });
- const unitWidth = width / steps;
- const styledSteps = Array.from({
- length: steps
- });
- for (let i = 0; i < steps; i++) {
- const color = Array.isArray(strokeColor) ? strokeColor[i] : strokeColor;
- styledSteps[i] = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- key: i,
- className: classnames_default()(`${prefixCls}-steps-item`, {
- [`${prefixCls}-steps-item-active`]: i <= current - 1
- }),
- style: {
- backgroundColor: i <= current - 1 ? color : trailColor,
- width: unitWidth,
- height
- }
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-steps-outer`
- }, styledSteps, children);
- };
- /* harmony default export */ var progress_Steps = (Steps_Steps);
- ;// ./components/progress/progress.tsx
- var progress_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const ProgressTypes = ['line', 'circle', 'dashboard'];
- const ProgressStatuses = ['normal', 'exception', 'active', 'success'];
- const progress_Progress = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- steps,
- strokeColor,
- percent = 0,
- size = 'default',
- showInfo = true,
- type = 'line',
- status,
- format,
- style,
- percentPosition = {}
- } = props,
- restProps = progress_rest(props, ["prefixCls", "className", "rootClassName", "steps", "strokeColor", "percent", "size", "showInfo", "type", "status", "format", "style", "percentPosition"]);
- const {
- align: infoAlign = 'end',
- type: infoPosition = 'outer'
- } = percentPosition;
- const strokeColorNotArray = Array.isArray(strokeColor) ? strokeColor[0] : strokeColor;
- const strokeColorNotGradient = typeof strokeColor === 'string' || Array.isArray(strokeColor) ? strokeColor : undefined;
- const strokeColorIsBright = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (strokeColorNotArray) {
- const color = typeof strokeColorNotArray === 'string' ? strokeColorNotArray : Object.values(strokeColorNotArray)[0];
- return new fast_color_es.FastColor(color).isLight();
- }
- return false;
- }, [strokeColor]);
- const percentNumber = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- const successPercent = getSuccessPercent(props);
- return parseInt(successPercent !== undefined ? (_a = successPercent !== null && successPercent !== void 0 ? successPercent : 0) === null || _a === void 0 ? void 0 : _a.toString() : (_b = percent !== null && percent !== void 0 ? percent : 0) === null || _b === void 0 ? void 0 : _b.toString(), 10);
- }, [percent, props.success, props.successPercent]);
- const progressStatus = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!ProgressStatuses.includes(status) && percentNumber >= 100) {
- return 'success';
- }
- return status || 'normal';
- }, [status, percentNumber]);
- const {
- getPrefixCls,
- direction,
- progress: progressStyle
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('progress', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,progress_style["default"])(prefixCls);
- const isLineType = type === 'line';
- const isPureLineType = isLineType && !steps;
- const progressInfo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!showInfo) {
- return null;
- }
- const successPercent = getSuccessPercent(props);
- let text;
- const textFormatter = format || (number => `${number}%`);
- const isBrightInnerColor = isLineType && strokeColorIsBright && infoPosition === 'inner';
- if (infoPosition === 'inner' || format || progressStatus !== 'exception' && progressStatus !== 'success') {
- text = textFormatter(validProgress(percent), validProgress(successPercent));
- } else if (progressStatus === 'exception') {
- text = isLineType ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseCircleFilled, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, null);
- } else if (progressStatus === 'success') {
- text = isLineType ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckCircleFilled, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckOutlined, null);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${prefixCls}-text`, {
- [`${prefixCls}-text-bright`]: isBrightInnerColor,
- [`${prefixCls}-text-${infoAlign}`]: isPureLineType,
- [`${prefixCls}-text-${infoPosition}`]: isPureLineType
- }),
- title: typeof text === 'string' ? text : undefined
- }, text);
- }, [showInfo, percent, percentNumber, progressStatus, type, prefixCls, format]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Progress');
- warning.deprecated(!('successPercent' in props), 'successPercent', 'success.percent');
- warning.deprecated(!('width' in props), 'width', 'size');
- if (type === 'circle' || type === 'dashboard') {
- if (Array.isArray(size)) {
- true ? warning(false, 'usage', 'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.') : 0;
- } else if (typeof size === 'object') {
- true ? warning(false, 'usage', 'Type "circle" and "dashboard" do not accept object as `size`, please use number or preset size instead.') : 0;
- }
- }
- if (props.success && 'progress' in props.success) {
- warning.deprecated(false, 'success.progress', 'success.percent');
- }
- }
- let progress;
- // Render progress shape
- if (type === 'line') {
- progress = steps ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(progress_Steps, Object.assign({}, props, {
- strokeColor: strokeColorNotGradient,
- prefixCls: prefixCls,
- steps: typeof steps === 'object' ? steps.count : steps
- }), progressInfo)) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(progress_Line, Object.assign({}, props, {
- strokeColor: strokeColorNotArray,
- prefixCls: prefixCls,
- direction: direction,
- percentPosition: {
- align: infoAlign,
- type: infoPosition
- }
- }), progressInfo));
- } else if (type === 'circle' || type === 'dashboard') {
- progress = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(progress_Circle, Object.assign({}, props, {
- strokeColor: strokeColorNotArray,
- prefixCls: prefixCls,
- progressStatus: progressStatus
- }), progressInfo);
- }
- const classString = classnames_default()(prefixCls, `${prefixCls}-status-${progressStatus}`, {
- [`${prefixCls}-${type === 'dashboard' && 'circle' || type}`]: type !== 'line',
- [`${prefixCls}-inline-circle`]: type === 'circle' && utils_getSize(size, 'circle')[0] <= 20,
- [`${prefixCls}-line`]: isPureLineType,
- [`${prefixCls}-line-align-${infoAlign}`]: isPureLineType,
- [`${prefixCls}-line-position-${infoPosition}`]: isPureLineType,
- [`${prefixCls}-steps`]: steps,
- [`${prefixCls}-show-info`]: showInfo,
- [`${prefixCls}-${size}`]: typeof size === 'string',
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, progressStyle === null || progressStyle === void 0 ? void 0 : progressStyle.className, className, rootClassName, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({
- ref: ref,
- style: Object.assign(Object.assign({}, progressStyle === null || progressStyle === void 0 ? void 0 : progressStyle.style), style),
- className: classString,
- role: "progressbar",
- "aria-valuenow": percentNumber,
- "aria-valuemin": 0,
- "aria-valuemax": 100
- }, (0,omit["default"])(restProps, ['trailColor', 'strokeWidth', 'width', 'gapDegree', 'gapPosition', 'strokeLinecap', 'success', 'successPercent'])), progress));
- });
- if (true) {
- progress_Progress.displayName = 'Progress';
- }
- /* harmony default export */ var progress = (progress_Progress);
- ;// ./components/progress/index.tsx
- /* harmony default export */ var components_progress = (progress);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
- var unsupportedIterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js
- function _createForOfIteratorHelper(r, e) {
- var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (!t) {
- if (Array.isArray(r) || (t = (0,unsupportedIterableToArray["default"])(r)) || e && r && "number" == typeof r.length) {
- t && (r = t);
- var _n = 0,
- F = function F() {};
- return {
- s: F,
- n: function n() {
- return _n >= r.length ? {
- done: !0
- } : {
- done: !1,
- value: r[_n++]
- };
- },
- e: function e(r) {
- throw r;
- },
- f: F
- };
- }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var o,
- a = !0,
- u = !1;
- return {
- s: function s() {
- t = t.call(r);
- },
- n: function n() {
- var r = t.next();
- return a = r.done, r;
- },
- e: function e(r) {
- u = !0, o = r;
- },
- f: function f() {
- try {
- a || null == t["return"] || t["return"]();
- } finally {
- if (u) throw o;
- }
- }
- };
- }
- ;// ./node_modules/@rc-component/qrcode/es/libs/qrcodegen.js
- var _class, _class2;
- // Copyright (c) Project Nayuki. (MIT License)
- // https://www.nayuki.io/page/qr-code-generator-library
- // Modification with code reorder and prettier
- // --------------------------------------------
- // Appends the given number of low-order bits of the given value
- // to the given buffer. Requires 0 <= len <= 31 and 0 <= val < 2^len.
- function appendBits(val, len, bb) {
- if (len < 0 || len > 31 || val >>> len != 0) throw new RangeError('Value out of range');
- for (var i = len - 1; i >= 0; i-- // Append bit by bit
- ) bb.push(val >>> i & 1);
- }
- // Returns true iff the i'th bit of x is set to 1.
- function getBit(x, i) {
- return (x >>> i & 1) != 0;
- }
- // Throws an exception if the given condition is false.
- function assert(cond) {
- if (!cond) throw new Error('Assertion error');
- }
- /*---- Public helper enumeration ----*/
- /*
- * Describes how a segment's data bits are numbererpreted. Immutable.
- */
- var Mode = /*#__PURE__*/function () {
- function Mode(modeBits, numBitsCharCount) {
- (0,classCallCheck["default"])(this, Mode);
- /*-- Constructor and fields --*/
- // The mode indicator bits, which is a unumber4 value (range 0 to 15).
- (0,defineProperty["default"])(this, "modeBits", void 0);
- // Number of character count bits for three different version ranges.
- (0,defineProperty["default"])(this, "numBitsCharCount", void 0);
- this.modeBits = modeBits;
- this.numBitsCharCount = numBitsCharCount;
- }
- /*-- Method --*/
- // (Package-private) Returns the bit width of the character count field for a segment in
- // this mode in a QR Code at the given version number. The result is in the range [0, 16].
- (0,createClass["default"])(Mode, [{
- key: "numCharCountBits",
- value: function numCharCountBits(ver) {
- return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
- }
- }]);
- return Mode;
- }();
- /*---- Public helper enumeration ----*/
- /*
- * The error correction level in a QR Code symbol. Immutable.
- */
- _class = Mode;
- /*-- Constants --*/
- (0,defineProperty["default"])(Mode, "NUMERIC", new _class(0x1, [10, 12, 14]));
- (0,defineProperty["default"])(Mode, "ALPHANUMERIC", new _class(0x2, [9, 11, 13]));
- (0,defineProperty["default"])(Mode, "BYTE", new _class(0x4, [8, 16, 16]));
- (0,defineProperty["default"])(Mode, "KANJI", new _class(0x8, [8, 10, 12]));
- (0,defineProperty["default"])(Mode, "ECI", new _class(0x7, [0, 0, 0]));
- var Ecc = /*#__PURE__*/(0,createClass["default"])(function Ecc(ordinal, formatBits) {
- (0,classCallCheck["default"])(this, Ecc);
- // The QR Code can tolerate about 30% erroneous codewords
- /*-- Constructor and fields --*/
- // In the range 0 to 3 (unsigned 2-bit numbereger).
- (0,defineProperty["default"])(this, "ordinal", void 0);
- // (Package-private) In the range 0 to 3 (unsigned 2-bit numbereger).
- (0,defineProperty["default"])(this, "formatBits", void 0);
- this.ordinal = ordinal;
- this.formatBits = formatBits;
- });
- /*
- * A segment of character/binary/control data in a QR Code symbol.
- * Instances of this class are immutable.
- * The mid-level way to create a segment is to take the payload data
- * and call a static factory function such as QrSegment.makeNumeric().
- * The low-level way to create a segment is to custom-make the bit buffer
- * and call the QrSegment() constructor with appropriate values.
- * This segment class imposes no length restrictions, but QR Codes have restrictions.
- * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data.
- * Any segment longer than this is meaningless for the purpose of generating QR Codes.
- */
- _class2 = Ecc;
- /*-- Constants --*/
- (0,defineProperty["default"])(Ecc, "LOW", new _class2(0, 1));
- // The QR Code can tolerate about 7% erroneous codewords
- (0,defineProperty["default"])(Ecc, "MEDIUM", new _class2(1, 0));
- // The QR Code can tolerate about 15% erroneous codewords
- (0,defineProperty["default"])(Ecc, "QUARTILE", new _class2(2, 3));
- // The QR Code can tolerate about 25% erroneous codewords
- (0,defineProperty["default"])(Ecc, "HIGH", new _class2(3, 2));
- var QrSegment = /*#__PURE__*/function () {
- // Creates a new QR Code segment with the given attributes and data.
- // The character count (numChars) must agree with the mode and the bit buffer length,
- // but the constranumber isn't checked. The given bit buffer is cloned and stored.
- function QrSegment(mode, numChars, bitData) {
- (0,classCallCheck["default"])(this, QrSegment);
- /*-- Constructor (low level) and fields --*/
- // The mode indicator of this segment.
- (0,defineProperty["default"])(this, "mode", void 0);
- // The length of this segment's unencoded data. Measured in characters for
- // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode.
- // Always zero or positive. Not the same as the data's bit length.
- (0,defineProperty["default"])(this, "numChars", void 0);
- // The data bits of this segment. Accessed through getData().
- (0,defineProperty["default"])(this, "bitData", void 0);
- this.mode = mode;
- this.numChars = numChars;
- this.bitData = bitData;
- if (numChars < 0) throw new RangeError('Invalid argument');
- this.bitData = bitData.slice(); // Make defensive copy
- }
- /*-- Methods --*/
- // Returns a new copy of the data bits of this segment.
- (0,createClass["default"])(QrSegment, [{
- key: "getData",
- value: function getData() {
- return this.bitData.slice(); // Make defensive copy
- }
- // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
- // the given version. The result is infinity if a segment has too many characters to fit its length field.
- }], [{
- key: "makeBytes",
- value: /*-- Static factory functions (mid level) --*/
- // Returns a segment representing the given binary data encoded in
- // byte mode. All input byte arrays are acceptable. Any text string
- // can be converted to UTF-8 bytes and encoded as a byte mode segment.
- function makeBytes(data) {
- var bb = [];
- var _iterator = _createForOfIteratorHelper(data),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var b = _step.value;
- appendBits(b, 8, bb);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return new QrSegment(Mode.BYTE, data.length, bb);
- }
- // Returns a segment representing the given string of decimal digits encoded in numeric mode.
- }, {
- key: "makeNumeric",
- value: function makeNumeric(digits) {
- if (!QrSegment.isNumeric(digits)) throw new RangeError('String contains non-numeric characters');
- var bb = [];
- for (var i = 0; i < digits.length;) {
- // Consume up to 3 digits per iteration
- var n = Math.min(digits.length - i, 3);
- appendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);
- i += n;
- }
- return new QrSegment(Mode.NUMERIC, digits.length, bb);
- }
- // Returns a segment representing the given text string encoded in alphanumeric mode.
- // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
- // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
- }, {
- key: "makeAlphanumeric",
- value: function makeAlphanumeric(text) {
- if (!QrSegment.isAlphanumeric(text)) throw new RangeError('String contains unencodable characters in alphanumeric mode');
- var bb = [];
- var i;
- for (i = 0; i + 2 <= text.length; i += 2) {
- // Process groups of 2
- var temp = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;
- temp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));
- appendBits(temp, 11, bb);
- }
- if (i < text.length)
- // 1 character remaining
- appendBits(QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);
- return new QrSegment(Mode.ALPHANUMERIC, text.length, bb);
- }
- // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
- // The result may use various segment modes and switch modes to optimize the length of the bit stream.
- }, {
- key: "makeSegments",
- value: function makeSegments(text) {
- // Select the most efficient segment encoding automatically
- if (text == '') return [];else if (QrSegment.isNumeric(text)) return [QrSegment.makeNumeric(text)];else if (QrSegment.isAlphanumeric(text)) return [QrSegment.makeAlphanumeric(text)];else return [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];
- }
- // Returns a segment representing an Extended Channel Interpretation
- // (ECI) designator with the given assignment value.
- }, {
- key: "makeEci",
- value: function makeEci(assignVal) {
- var bb = [];
- if (assignVal < 0) throw new RangeError('ECI assignment value out of range');else if (assignVal < 1 << 7) appendBits(assignVal, 8, bb);else if (assignVal < 1 << 14) {
- appendBits(2, 2, bb);
- appendBits(assignVal, 14, bb);
- } else if (assignVal < 1000000) {
- appendBits(6, 3, bb);
- appendBits(assignVal, 21, bb);
- } else throw new RangeError('ECI assignment value out of range');
- return new QrSegment(Mode.ECI, 0, bb);
- }
- // Tests whether the given string can be encoded as a segment in numeric mode.
- // A string is encodable iff each character is in the range 0 to 9.
- }, {
- key: "isNumeric",
- value: function isNumeric(text) {
- return QrSegment.NUMERIC_REGEX.test(text);
- }
- // Tests whether the given string can be encoded as a segment in alphanumeric mode.
- // A string is encodable iff each character is in the following set: 0 to 9, A to Z
- // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
- }, {
- key: "isAlphanumeric",
- value: function isAlphanumeric(text) {
- return QrSegment.ALPHANUMERIC_REGEX.test(text);
- }
- }, {
- key: "getTotalBits",
- value: function getTotalBits(segs, version) {
- var result = 0;
- var _iterator2 = _createForOfIteratorHelper(segs),
- _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- var seg = _step2.value;
- var ccbits = seg.mode.numCharCountBits(version);
- if (seg.numChars >= 1 << ccbits) return Infinity; // The segment's length doesn't fit the field's bit width
- result += 4 + ccbits + seg.bitData.length;
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- return result;
- }
- // Returns a new array of bytes representing the given string encoded in UTF-8.
- }, {
- key: "toUtf8ByteArray",
- value: function toUtf8ByteArray(input) {
- var str = encodeURI(input);
- var result = [];
- for (var i = 0; i < str.length; i++) {
- if (str.charAt(i) != '%') result.push(str.charCodeAt(i));else {
- result.push(parseInt(str.substring(i + 1, i + 3), 16));
- i += 2;
- }
- }
- return result;
- }
- /*-- Constants --*/
- // Describes precisely all strings that are encodable in numeric mode.
- }]);
- return QrSegment;
- }();
- /*
- * A QR Code symbol, which is a type of two-dimension barcode.
- * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
- * Instances of this class represent an immutable square grid of dark and light cells.
- * The class provides static factory functions to create a QR Code from text or binary data.
- * The class covers the QR Code Model 2 specification, supporting all versions (sizes)
- * from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
- *
- * Ways to create a QR Code object:
- * - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().
- * - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().
- * - Low level: Custom-make the array of data codeword bytes (including
- * segment headers and final padding, excluding error correction codewords),
- * supply the appropriate version number, and call the QrCode() constructor.
- * (Note that all ways require supplying the desired error correction level.)
- */
- (0,defineProperty["default"])(QrSegment, "NUMERIC_REGEX", /^[0-9]*$/);
- // Describes precisely all strings that are encodable in alphanumeric mode.
- (0,defineProperty["default"])(QrSegment, "ALPHANUMERIC_REGEX", /^[A-Z0-9 $%*+.\/:-]*$/);
- // The set of all legal characters in alphanumeric mode,
- // where each character value maps to the index in the string.
- (0,defineProperty["default"])(QrSegment, "ALPHANUMERIC_CHARSET", '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:');
- var QrCode = /*#__PURE__*/function () {
- // Creates a new QR Code with the given version number,
- // error correction level, data codeword bytes, and mask number.
- // This is a low-level API that most users should not use directly.
- // A mid-level API is the encodeSegments() function.
- function QrCode(
- // The version number of this QR Code, which is between 1 and 40 (inclusive).
- // This determines the size of this barcode.
- version,
- // The error correction level used in this QR Code.
- errorCorrectionLevel, dataCodewords, oriMsk) {
- (0,classCallCheck["default"])(this, QrCode);
- /*-- Fields --*/
- // The width and height of this QR Code, measured in modules, between
- // 21 and 177 (inclusive). This is equal to version * 4 + 17.
- (0,defineProperty["default"])(this, "size", void 0);
- // The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).
- // Even if a QR Code is created with automatic masking requested (mask = -1),
- // the resulting object still has a mask value between 0 and 7.
- (0,defineProperty["default"])(this, "mask", void 0);
- // The modules of this QR Code (false = light, true = dark).
- // Immutable after constructor finishes. Accessed through getModule().
- (0,defineProperty["default"])(this, "modules", []);
- // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.
- (0,defineProperty["default"])(this, "isFunction", []);
- /*-- Constructor (low level) and fields --*/
- // The version number of this QR Code, which is between 1 and 40 (inclusive).
- // This determines the size of this barcode.
- (0,defineProperty["default"])(this, "version", void 0);
- // The error correction level used in this QR Code.
- (0,defineProperty["default"])(this, "errorCorrectionLevel", void 0);
- var msk = oriMsk;
- this.version = version;
- this.errorCorrectionLevel = errorCorrectionLevel;
- // Check scalar arguments
- if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION) throw new RangeError('Version value out of range');
- if (msk < -1 || msk > 7) throw new RangeError('Mask value out of range');
- this.size = version * 4 + 17;
- // Initialize both grids to be size*size arrays of Boolean false
- var row = [];
- for (var i = 0; i < this.size; i++) row.push(false);
- for (var _i = 0; _i < this.size; _i++) {
- this.modules.push(row.slice()); // Initially all light
- this.isFunction.push(row.slice());
- }
- // Compute ECC, draw modules
- this.drawFunctionPatterns();
- var allCodewords = this.addEccAndInterleave(dataCodewords);
- this.drawCodewords(allCodewords);
- // Do masking
- if (msk == -1) {
- // Automatically choose best mask
- var minPenalty = 1000000000;
- for (var _i2 = 0; _i2 < 8; _i2++) {
- this.applyMask(_i2);
- this.drawFormatBits(_i2);
- var penalty = this.getPenaltyScore();
- if (penalty < minPenalty) {
- msk = _i2;
- minPenalty = penalty;
- }
- this.applyMask(_i2); // Undoes the mask due to XOR
- }
- }
- assert(0 <= msk && msk <= 7);
- this.mask = msk;
- this.applyMask(msk); // Apply the final choice of mask
- this.drawFormatBits(msk); // Overwrite old format bits
- this.isFunction = [];
- }
- /*-- Accessor methods --*/
- // Returns the color of the module (pixel) at the given coordinates, which is false
- // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
- // If the given coordinates are out of bounds, then false (light) is returned.
- (0,createClass["default"])(QrCode, [{
- key: "getModule",
- value: function getModule(x, y) {
- return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];
- }
- // Modified to expose modules for easy access
- }, {
- key: "getModules",
- value: function getModules() {
- return this.modules;
- }
- /*-- Private helper methods for constructor: Drawing function modules --*/
- // Reads this object's version field, and draws and marks all function modules.
- }, {
- key: "drawFunctionPatterns",
- value: function drawFunctionPatterns() {
- // Draw horizontal and vertical timing patterns
- for (var i = 0; i < this.size; i++) {
- this.setFunctionModule(6, i, i % 2 == 0);
- this.setFunctionModule(i, 6, i % 2 == 0);
- }
- // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules)
- this.drawFinderPattern(3, 3);
- this.drawFinderPattern(this.size - 4, 3);
- this.drawFinderPattern(3, this.size - 4);
- // Draw numerous alignment patterns
- var alignPatPos = this.getAlignmentPatternPositions();
- var numAlign = alignPatPos.length;
- for (var _i3 = 0; _i3 < numAlign; _i3++) {
- for (var j = 0; j < numAlign; j++) {
- // Don't draw on the three finder corners
- if (!(_i3 == 0 && j == 0 || _i3 == 0 && j == numAlign - 1 || _i3 == numAlign - 1 && j == 0)) this.drawAlignmentPattern(alignPatPos[_i3], alignPatPos[j]);
- }
- }
- // Draw configuration data
- this.drawFormatBits(0); // Dummy mask value; overwritten later in the constructor
- this.drawVersion();
- }
- // Draws two copies of the format bits (with its own error correction code)
- // based on the given mask and this object's error correction level field.
- }, {
- key: "drawFormatBits",
- value: function drawFormatBits(mask) {
- // Calculate error correction code and pack bits
- var data = this.errorCorrectionLevel.formatBits << 3 | mask; // errCorrLvl is unumber2, mask is unumber3
- var rem = data;
- for (var i = 0; i < 10; i++) rem = rem << 1 ^ (rem >>> 9) * 0x537;
- var bits = (data << 10 | rem) ^ 0x5412; // unumber15
- assert(bits >>> 15 == 0);
- // Draw first copy
- for (var _i4 = 0; _i4 <= 5; _i4++) this.setFunctionModule(8, _i4, getBit(bits, _i4));
- this.setFunctionModule(8, 7, getBit(bits, 6));
- this.setFunctionModule(8, 8, getBit(bits, 7));
- this.setFunctionModule(7, 8, getBit(bits, 8));
- for (var _i5 = 9; _i5 < 15; _i5++) this.setFunctionModule(14 - _i5, 8, getBit(bits, _i5));
- // Draw second copy
- for (var _i6 = 0; _i6 < 8; _i6++) this.setFunctionModule(this.size - 1 - _i6, 8, getBit(bits, _i6));
- for (var _i7 = 8; _i7 < 15; _i7++) this.setFunctionModule(8, this.size - 15 + _i7, getBit(bits, _i7));
- this.setFunctionModule(8, this.size - 8, true); // Always dark
- }
- // Draws two copies of the version bits (with its own error correction code),
- // based on this object's version field, iff 7 <= version <= 40.
- }, {
- key: "drawVersion",
- value: function drawVersion() {
- if (this.version < 7) return;
- // Calculate error correction code and pack bits
- var rem = this.version; // version is unumber6, in the range [7, 40]
- for (var i = 0; i < 12; i++) rem = rem << 1 ^ (rem >>> 11) * 0x1f25;
- var bits = this.version << 12 | rem; // unumber18
- assert(bits >>> 18 == 0);
- // Draw two copies
- for (var _i8 = 0; _i8 < 18; _i8++) {
- var color = getBit(bits, _i8);
- var a = this.size - 11 + _i8 % 3;
- var b = Math.floor(_i8 / 3);
- this.setFunctionModule(a, b, color);
- this.setFunctionModule(b, a, color);
- }
- }
- // Draws a 9*9 finder pattern including the border separator,
- // with the center module at (x, y). Modules can be out of bounds.
- }, {
- key: "drawFinderPattern",
- value: function drawFinderPattern(x, y) {
- for (var dy = -4; dy <= 4; dy++) {
- for (var dx = -4; dx <= 4; dx++) {
- var dist = Math.max(Math.abs(dx), Math.abs(dy)); // Chebyshev/infinity norm
- var xx = x + dx;
- var yy = y + dy;
- if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size) this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
- }
- }
- }
- // Draws a 5*5 alignment pattern, with the center module
- // at (x, y). All modules must be in bounds.
- }, {
- key: "drawAlignmentPattern",
- value: function drawAlignmentPattern(x, y) {
- for (var dy = -2; dy <= 2; dy++) {
- for (var dx = -2; dx <= 2; dx++) this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
- }
- }
- // Sets the color of a module and marks it as a function module.
- // Only used by the constructor. Coordinates must be in bounds.
- }, {
- key: "setFunctionModule",
- value: function setFunctionModule(x, y, isDark) {
- this.modules[y][x] = isDark;
- this.isFunction[y][x] = true;
- }
- /*-- Private helper methods for constructor: Codewords and masking --*/
- // Returns a new byte string representing the given data with the appropriate error correction
- // codewords appended to it, based on this object's version and error correction level.
- }, {
- key: "addEccAndInterleave",
- value: function addEccAndInterleave(data) {
- var ver = this.version;
- var ecl = this.errorCorrectionLevel;
- if (data.length != QrCode.getNumDataCodewords(ver, ecl)) throw new RangeError('Invalid argument');
- // Calculate parameter numbers
- var numBlocks = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
- var blockEccLen = QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];
- var rawCodewords = Math.floor(QrCode.getNumRawDataModules(ver) / 8);
- var numShortBlocks = numBlocks - rawCodewords % numBlocks;
- var shortBlockLen = Math.floor(rawCodewords / numBlocks);
- // Split data numbero blocks and append ECC to each block
- var blocks = [];
- var rsDiv = QrCode.reedSolomonComputeDivisor(blockEccLen);
- for (var i = 0, k = 0; i < numBlocks; i++) {
- var dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));
- k += dat.length;
- var ecc = QrCode.reedSolomonComputeRemainder(dat, rsDiv);
- if (i < numShortBlocks) dat.push(0);
- blocks.push(dat.concat(ecc));
- }
- // Interleave (not concatenate) the bytes from every block numbero a single sequence
- var result = [];
- var _loop = function _loop(_i9) {
- blocks.forEach(function (block, j) {
- // Skip the padding byte in short blocks
- if (_i9 != shortBlockLen - blockEccLen || j >= numShortBlocks) result.push(block[_i9]);
- });
- };
- for (var _i9 = 0; _i9 < blocks[0].length; _i9++) {
- _loop(_i9);
- }
- assert(result.length == rawCodewords);
- return result;
- }
- // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
- // data area of this QR Code. Function modules need to be marked off before this is called.
- }, {
- key: "drawCodewords",
- value: function drawCodewords(data) {
- if (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8)) throw new RangeError('Invalid argument');
- var i = 0; // Bit index numbero the data
- // Do the funny zigzag scan
- for (var right = this.size - 1; right >= 1; right -= 2) {
- // Index of right column in each column pair
- if (right == 6) right = 5;
- for (var vert = 0; vert < this.size; vert++) {
- // Vertical counter
- for (var j = 0; j < 2; j++) {
- var x = right - j; // Actual x coordinate
- var upward = (right + 1 & 2) == 0;
- var y = upward ? this.size - 1 - vert : vert; // Actual y coordinate
- if (!this.isFunction[y][x] && i < data.length * 8) {
- this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));
- i++;
- }
- // If this QR Code has any remainder bits (0 to 7), they were assigned as
- // 0/false/light by the constructor and are left unchanged by this method
- }
- }
- }
- assert(i == data.length * 8);
- }
- // XORs the codeword modules in this QR Code with the given mask pattern.
- // The function modules must be marked and the codeword bits must be drawn
- // before masking. Due to the arithmetic of XOR, calling applyMask() with
- // the same mask value a second time will undo the mask. A final well-formed
- // QR Code needs exactly one (not zero, two, etc.) mask applied.
- }, {
- key: "applyMask",
- value: function applyMask(mask) {
- if (mask < 0 || mask > 7) throw new RangeError('Mask value out of range');
- for (var y = 0; y < this.size; y++) {
- for (var x = 0; x < this.size; x++) {
- var invert = void 0;
- switch (mask) {
- case 0:
- invert = (x + y) % 2 == 0;
- break;
- case 1:
- invert = y % 2 == 0;
- break;
- case 2:
- invert = x % 3 == 0;
- break;
- case 3:
- invert = (x + y) % 3 == 0;
- break;
- case 4:
- invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;
- break;
- case 5:
- invert = x * y % 2 + x * y % 3 == 0;
- break;
- case 6:
- invert = (x * y % 2 + x * y % 3) % 2 == 0;
- break;
- case 7:
- invert = ((x + y) % 2 + x * y % 3) % 2 == 0;
- break;
- default:
- throw new Error('Unreachable');
- }
- if (!this.isFunction[y][x] && invert) this.modules[y][x] = !this.modules[y][x];
- }
- }
- }
- // Calculates and returns the penalty score based on state of this QR Code's current modules.
- // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
- }, {
- key: "getPenaltyScore",
- value: function getPenaltyScore() {
- var result = 0;
- // Adjacent modules in row having same color, and finder-like patterns
- for (var y = 0; y < this.size; y++) {
- var runColor = false;
- var runX = 0;
- var runHistory = [0, 0, 0, 0, 0, 0, 0];
- for (var x = 0; x < this.size; x++) {
- if (this.modules[y][x] == runColor) {
- runX++;
- if (runX == 5) result += QrCode.PENALTY_N1;else if (runX > 5) result++;
- } else {
- this.finderPenaltyAddHistory(runX, runHistory);
- if (!runColor) result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;
- runColor = this.modules[y][x];
- runX = 1;
- }
- }
- result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;
- }
- // Adjacent modules in column having same color, and finder-like patterns
- for (var _x = 0; _x < this.size; _x++) {
- var _runColor = false;
- var runY = 0;
- var _runHistory = [0, 0, 0, 0, 0, 0, 0];
- for (var _y = 0; _y < this.size; _y++) {
- if (this.modules[_y][_x] == _runColor) {
- runY++;
- if (runY == 5) result += QrCode.PENALTY_N1;else if (runY > 5) result++;
- } else {
- this.finderPenaltyAddHistory(runY, _runHistory);
- if (!_runColor) result += this.finderPenaltyCountPatterns(_runHistory) * QrCode.PENALTY_N3;
- _runColor = this.modules[_y][_x];
- runY = 1;
- }
- }
- result += this.finderPenaltyTerminateAndCount(_runColor, runY, _runHistory) * QrCode.PENALTY_N3;
- }
- // 2*2 blocks of modules having same color
- for (var _y2 = 0; _y2 < this.size - 1; _y2++) {
- for (var _x2 = 0; _x2 < this.size - 1; _x2++) {
- var color = this.modules[_y2][_x2];
- if (color == this.modules[_y2][_x2 + 1] && color == this.modules[_y2 + 1][_x2] && color == this.modules[_y2 + 1][_x2 + 1]) result += QrCode.PENALTY_N2;
- }
- }
- // Balance of dark and light modules
- var dark = 0;
- var _iterator3 = _createForOfIteratorHelper(this.modules),
- _step3;
- try {
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
- var row = _step3.value;
- dark = row.reduce(function (sum, color) {
- return sum + (color ? 1 : 0);
- }, dark);
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- var total = this.size * this.size; // Note that size is odd, so dark/total != 1/2
- // Compute the smallest numbereger k >= 0 such that (45-5k)% <= dark/total <= (55+5k)%
- var k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
- assert(0 <= k && k <= 9);
- result += k * QrCode.PENALTY_N4;
- assert(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4
- return result;
- }
- /*-- Private helper functions --*/
- // Returns an ascending list of positions of alignment patterns for this version number.
- // Each position is in the range [0,177), and are used on both the x and y axes.
- // This could be implemented as lookup table of 40 variable-length lists of numberegers.
- }, {
- key: "getAlignmentPatternPositions",
- value: function getAlignmentPatternPositions() {
- if (this.version == 1) return [];else {
- var numAlign = Math.floor(this.version / 7) + 2;
- var step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
- var result = [6];
- for (var pos = this.size - 7; result.length < numAlign; pos -= step) result.splice(1, 0, pos);
- return result;
- }
- }
- // Returns the number of data bits that can be stored in a QR Code of the given version number, after
- // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
- // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
- }, {
- key: "finderPenaltyCountPatterns",
- value:
- // Can only be called immediately after a light run is added, and
- // returns either 0, 1, or 2. A helper function for getPenaltyScore().
- function finderPenaltyCountPatterns(runHistory) {
- var n = runHistory[1];
- assert(n <= this.size * 3);
- var core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;
- return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);
- }
- // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
- }, {
- key: "finderPenaltyTerminateAndCount",
- value: function finderPenaltyTerminateAndCount(currentRunColor, oriCurrentRunLength, runHistory) {
- var currentRunLength = oriCurrentRunLength;
- if (currentRunColor) {
- // Terminate dark run
- this.finderPenaltyAddHistory(currentRunLength, runHistory);
- currentRunLength = 0;
- }
- currentRunLength += this.size; // Add light border to final run
- this.finderPenaltyAddHistory(currentRunLength, runHistory);
- return this.finderPenaltyCountPatterns(runHistory);
- }
- // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
- }, {
- key: "finderPenaltyAddHistory",
- value: function finderPenaltyAddHistory(oriCurrentRunLength, runHistory) {
- var currentRunLength = oriCurrentRunLength;
- if (runHistory[0] == 0) currentRunLength += this.size; // Add light border to initial run
- runHistory.pop();
- runHistory.unshift(currentRunLength);
- }
- /*-- Constants and tables --*/
- // The minimum version number supported in the QR Code Model 2 standard.
- }], [{
- key: "encodeText",
- value: /*-- Static factory functions (high level) --*/
- // Returns a QR Code representing the given Unicode text string at the given error correction level.
- // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
- // Unicode code ponumbers (not UTF-16 code units) if the low error correction level is used. The smallest possible
- // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
- // ecl argument if it can be done without increasing the version.
- function encodeText(text, ecl) {
- var segs = QrSegment.makeSegments(text);
- return QrCode.encodeSegments(segs, ecl);
- }
- // Returns a QR Code representing the given binary data at the given error correction level.
- // This function always encodes using the binary segment mode, not any text mode. The maximum number of
- // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
- // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
- }, {
- key: "encodeBinary",
- value: function encodeBinary(data, ecl) {
- var seg = QrSegment.makeBytes(data);
- return QrCode.encodeSegments([seg], ecl);
- }
- /*-- Static factory functions (mid level) --*/
- // Returns a QR Code representing the given segments with the given encoding parameters.
- // The smallest possible QR Code version within the given range is automatically
- // chosen for the output. Iff boostEcl is true, then the ECC level of the result
- // may be higher than the ecl argument if it can be done without increasing the
- // version. The mask number is either between 0 to 7 (inclusive) to force that
- // mask, or -1 to automatically choose an appropriate mask (which may be slow).
- // This function allows the user to create a custom sequence of segments that switches
- // between modes (such as alphanumeric and byte) to encode text in less space.
- // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
- }, {
- key: "encodeSegments",
- value: function encodeSegments(segs, oriEcl) {
- var minVersion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var maxVersion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 40;
- var mask = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
- var boostEcl = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
- if (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION) || mask < -1 || mask > 7) throw new RangeError('Invalid value');
- // Find the minimal version number to use
- var version;
- var dataUsedBits;
- for (version = minVersion;; version++) {
- var _dataCapacityBits = QrCode.getNumDataCodewords(version, oriEcl) * 8; // Number of data bits available
- var usedBits = QrSegment.getTotalBits(segs, version);
- if (usedBits <= _dataCapacityBits) {
- dataUsedBits = usedBits;
- break; // This version number is found to be suitable
- }
- if (version >= maxVersion)
- // All versions in the range could not fit the given data
- throw new RangeError('Data too long');
- }
- var ecl = oriEcl;
- // Increase the error correction level while the data still fits in the current version number
- for (var _i10 = 0, _arr = [Ecc.MEDIUM, Ecc.QUARTILE, Ecc.HIGH]; _i10 < _arr.length; _i10++) {
- var newEcl = _arr[_i10];
- // From low to high
- if (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8) ecl = newEcl;
- }
- // Concatenate all segments to create the data bit string
- var bb = [];
- var _iterator4 = _createForOfIteratorHelper(segs),
- _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
- var seg = _step4.value;
- appendBits(seg.mode.modeBits, 4, bb);
- appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);
- var _iterator5 = _createForOfIteratorHelper(seg.getData()),
- _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
- var b = _step5.value;
- bb.push(b);
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- assert(bb.length == dataUsedBits);
- // Add terminator and pad up to a byte if applicable
- var dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8;
- assert(bb.length <= dataCapacityBits);
- appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);
- appendBits(0, (8 - bb.length % 8) % 8, bb);
- assert(bb.length % 8 == 0);
- // Pad with alternating bytes until data capacity is reached
- for (var padByte = 0xec; bb.length < dataCapacityBits; padByte ^= 0xec ^ 0x11) appendBits(padByte, 8, bb);
- // Pack bits numbero bytes in big endian
- var dataCodewords = [];
- while (dataCodewords.length * 8 < bb.length) dataCodewords.push(0);
- bb.forEach(function (b, i) {
- return dataCodewords[i >>> 3] |= b << 7 - (i & 7);
- });
- // Create the QR Code object
- return new QrCode(version, ecl, dataCodewords, mask);
- }
- }, {
- key: "getNumRawDataModules",
- value: function getNumRawDataModules(ver) {
- if (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION) throw new RangeError('Version number out of range');
- var result = (16 * ver + 128) * ver + 64;
- if (ver >= 2) {
- var numAlign = Math.floor(ver / 7) + 2;
- result -= (25 * numAlign - 10) * numAlign - 55;
- if (ver >= 7) result -= 36;
- }
- assert(208 <= result && result <= 29648);
- return result;
- }
- // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
- // QR Code of the given version number and error correction level, with remainder bits discarded.
- // This stateless pure function could be implemented as a (40*4)-cell lookup table.
- }, {
- key: "getNumDataCodewords",
- value: function getNumDataCodewords(ver, ecl) {
- return Math.floor(QrCode.getNumRawDataModules(ver) / 8) - QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
- }
- // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
- // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
- }, {
- key: "reedSolomonComputeDivisor",
- value: function reedSolomonComputeDivisor(degree) {
- if (degree < 1 || degree > 255) throw new RangeError('Degree out of range');
- // Polynomial coefficients are stored from highest to lowest power, excluding the leading term which is always 1.
- // For example the polynomial x^3 + 255x^2 + 8x + 93 is stored as the unumber8 array [255, 8, 93].
- var result = [];
- for (var i = 0; i < degree - 1; i++) result.push(0);
- result.push(1); // Start off with the monomial x^0
- // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}),
- // and drop the highest monomial term which is always 1x^degree.
- // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D).
- var root = 1;
- for (var _i11 = 0; _i11 < degree; _i11++) {
- // Multiply the current product by (x - r^i)
- for (var j = 0; j < result.length; j++) {
- result[j] = QrCode.reedSolomonMultiply(result[j], root);
- if (j + 1 < result.length) result[j] ^= result[j + 1];
- }
- root = QrCode.reedSolomonMultiply(root, 0x02);
- }
- return result;
- }
- // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
- }, {
- key: "reedSolomonComputeRemainder",
- value: function reedSolomonComputeRemainder(data, divisor) {
- var result = divisor.map(function () {
- return 0;
- });
- var _iterator6 = _createForOfIteratorHelper(data),
- _step6;
- try {
- var _loop2 = function _loop2() {
- var b = _step6.value;
- // Polynomial division
- var factor = b ^ result.shift();
- result.push(0);
- divisor.forEach(function (coef, i) {
- return result[i] ^= QrCode.reedSolomonMultiply(coef, factor);
- });
- };
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
- _loop2();
- }
- } catch (err) {
- _iterator6.e(err);
- } finally {
- _iterator6.f();
- }
- return result;
- }
- // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
- // are unsigned 8-bit numberegers. This could be implemented as a lookup table of 256*256 entries of unumber8.
- }, {
- key: "reedSolomonMultiply",
- value: function reedSolomonMultiply(x, y) {
- if (x >>> 8 != 0 || y >>> 8 != 0) throw new RangeError('Byte out of range');
- // Russian peasant multiplication
- var z = 0;
- for (var i = 7; i >= 0; i--) {
- z = z << 1 ^ (z >>> 7) * 0x11d;
- z ^= (y >>> i & 1) * x;
- }
- assert(z >>> 8 == 0);
- return z;
- }
- }]);
- return QrCode;
- }();
- (0,defineProperty["default"])(QrCode, "MIN_VERSION", 1);
- // The maximum version number supported in the QR Code Model 2 standard.
- (0,defineProperty["default"])(QrCode, "MAX_VERSION", 40);
- // For use in getPenaltyScore(), when evaluating which mask is best.
- (0,defineProperty["default"])(QrCode, "PENALTY_N1", 3);
- (0,defineProperty["default"])(QrCode, "PENALTY_N2", 3);
- (0,defineProperty["default"])(QrCode, "PENALTY_N3", 40);
- (0,defineProperty["default"])(QrCode, "PENALTY_N4", 10);
- (0,defineProperty["default"])(QrCode, "ECC_CODEWORDS_PER_BLOCK", [
- // Version: (note that index 0 is for padding, and is set to an illegal value)
- //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
- [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
- // Low
- [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
- // Medium
- [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
- // Quartile
- [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30] // High
- ]);
- (0,defineProperty["default"])(QrCode, "NUM_ERROR_CORRECTION_BLOCKS", [
- // Version: (note that index 0 is for padding, and is set to an illegal value)
- //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
- [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
- // Low
- [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
- // Medium
- [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
- // Quartile
- [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81] // High
- ]);
- ;// ./node_modules/@rc-component/qrcode/es/utils.js
- // Part logic is from `qrcode.react`. (ISC License)
- // https://github.com/zpao/qrcode.react
- // ==========================================================
- // =================== ERROR_LEVEL ==========================
- var ERROR_LEVEL_MAP = {
- L: Ecc.LOW,
- M: Ecc.MEDIUM,
- Q: Ecc.QUARTILE,
- H: Ecc.HIGH
- };
- // =================== DEFAULT_VALUE ==========================
- var utils_DEFAULT_SIZE = 128;
- var DEFAULT_LEVEL = 'L';
- var DEFAULT_BACKGROUND_COLOR = '#FFFFFF';
- var DEFAULT_FRONT_COLOR = '#000000';
- var DEFAULT_NEED_MARGIN = false;
- var DEFAULT_MINVERSION = 1;
- var SPEC_MARGIN_SIZE = 4;
- var DEFAULT_MARGIN_SIZE = 0;
- var DEFAULT_IMG_SCALE = 0.1;
- // =================== UTILS ==========================
- /**
- * Generate a path string from modules
- * @param modules
- * @param margin
- * @returns
- */
- function generatePath(modules) {
- var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var ops = [];
- modules.forEach(function (row, y) {
- var start = null;
- row.forEach(function (cell, x) {
- if (!cell && start !== null) {
- ops.push("M".concat(start + margin, " ").concat(y + margin, "h").concat(x - start, "v1H").concat(start + margin, "z"));
- start = null;
- return;
- }
- if (x === row.length - 1) {
- if (!cell) {
- return;
- }
- if (start === null) {
- ops.push("M".concat(x + margin, ",").concat(y + margin, " h1v1H").concat(x + margin, "z"));
- } else {
- ops.push("M".concat(start + margin, ",").concat(y + margin, " h").concat(x + 1 - start, "v1H").concat(start + margin, "z"));
- }
- return;
- }
- if (cell && start === null) {
- start = x;
- }
- });
- });
- return ops.join('');
- }
- /**
- * Excavate modules
- * @param modules
- * @param excavation
- * @returns
- */
- function excavateModules(modules, excavation) {
- return modules.slice().map(function (row, y) {
- if (y < excavation.y || y >= excavation.y + excavation.h) {
- return row;
- }
- return row.map(function (cell, x) {
- if (x < excavation.x || x >= excavation.x + excavation.w) {
- return cell;
- }
- return false;
- });
- });
- }
- /**
- * Get image settings
- * @param cells The modules of the QR code
- * @param size The size of the QR code
- * @param margin
- * @param imageSettings
- * @returns
- */
- function getImageSettings(cells, size, margin, imageSettings) {
- if (imageSettings == null) {
- return null;
- }
- var numCells = cells.length + margin * 2;
- var defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);
- var scale = numCells / size;
- var w = (imageSettings.width || defaultSize) * scale;
- var h = (imageSettings.height || defaultSize) * scale;
- var x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;
- var y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;
- var opacity = imageSettings.opacity == null ? 1 : imageSettings.opacity;
- var excavation = null;
- if (imageSettings.excavate) {
- var floorX = Math.floor(x);
- var floorY = Math.floor(y);
- var ceilW = Math.ceil(w + x - floorX);
- var ceilH = Math.ceil(h + y - floorY);
- excavation = {
- x: floorX,
- y: floorY,
- w: ceilW,
- h: ceilH
- };
- }
- var crossOrigin = imageSettings.crossOrigin;
- return {
- x: x,
- y: y,
- h: h,
- w: w,
- excavation: excavation,
- opacity: opacity,
- crossOrigin: crossOrigin
- };
- }
- /**
- * Get margin size
- * @param needMargin Whether need margin
- * @param marginSize Custom margin size
- * @returns
- */
- function getMarginSize(needMargin, marginSize) {
- if (marginSize != null) {
- return Math.floor(marginSize);
- }
- return needMargin ? SPEC_MARGIN_SIZE : DEFAULT_MARGIN_SIZE;
- }
- /**
- * Check if Path2D is supported
- */
- var isSupportPath2d = function () {
- try {
- new Path2D().addPath(new Path2D());
- } catch (e) {
- return false;
- }
- return true;
- }();
- ;// ./node_modules/@rc-component/qrcode/es/hooks/useQRCode.js
- function useQRCode(_ref) {
- var value = _ref.value,
- level = _ref.level,
- minVersion = _ref.minVersion,
- includeMargin = _ref.includeMargin,
- marginSize = _ref.marginSize,
- imageSettings = _ref.imageSettings,
- size = _ref.size;
- var qrcode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var segments = QrSegment.makeSegments(value);
- return QrCode.encodeSegments(segments, ERROR_LEVEL_MAP[level], minVersion);
- }, [value, level, minVersion]);
- var _useMemo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var cs = qrcode.getModules();
- var mg = getMarginSize(includeMargin, marginSize);
- var ncs = cs.length + mg * 2;
- var cis = getImageSettings(cs, size, mg, imageSettings);
- return {
- cells: cs,
- margin: mg,
- numCells: ncs,
- calculatedImageSettings: cis
- };
- }, [qrcode, size, imageSettings, includeMargin, marginSize]),
- cells = _useMemo.cells,
- margin = _useMemo.margin,
- numCells = _useMemo.numCells,
- calculatedImageSettings = _useMemo.calculatedImageSettings;
- return {
- qrcode: qrcode,
- margin: margin,
- cells: cells,
- numCells: numCells,
- calculatedImageSettings: calculatedImageSettings
- };
- }
- ;// ./node_modules/@rc-component/qrcode/es/QRCodeCanvas.js
- var QRCodeCanvas_excluded = ["value", "size", "level", "bgColor", "fgColor", "includeMargin", "minVersion", "marginSize", "style", "imageSettings"];
- var QRCodeCanvas = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function QRCodeCanvas(props, forwardedRef) {
- var value = props.value,
- _props$size = props.size,
- size = _props$size === void 0 ? utils_DEFAULT_SIZE : _props$size,
- _props$level = props.level,
- level = _props$level === void 0 ? DEFAULT_LEVEL : _props$level,
- _props$bgColor = props.bgColor,
- bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor,
- _props$fgColor = props.fgColor,
- fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor,
- _props$includeMargin = props.includeMargin,
- includeMargin = _props$includeMargin === void 0 ? DEFAULT_NEED_MARGIN : _props$includeMargin,
- _props$minVersion = props.minVersion,
- minVersion = _props$minVersion === void 0 ? DEFAULT_MINVERSION : _props$minVersion,
- marginSize = props.marginSize,
- style = props.style,
- imageSettings = props.imageSettings,
- otherProps = (0,objectWithoutProperties["default"])(props, QRCodeCanvas_excluded);
- var imgSrc = imageSettings === null || imageSettings === void 0 ? void 0 : imageSettings.src;
- var _canvas = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var _image = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var setCanvasRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function (node) {
- _canvas.current = node;
- if (typeof forwardedRef === 'function') {
- forwardedRef(node);
- } else if (forwardedRef) {
- forwardedRef.current = node;
- }
- }, [forwardedRef]);
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- setIsImageLoaded = _useState2[1];
- var _useQRCode = useQRCode({
- value: value,
- level: level,
- minVersion: minVersion,
- includeMargin: includeMargin,
- marginSize: marginSize,
- imageSettings: imageSettings,
- size: size
- }),
- margin = _useQRCode.margin,
- cells = _useQRCode.cells,
- numCells = _useQRCode.numCells,
- calculatedImageSettings = _useQRCode.calculatedImageSettings;
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (_canvas.current != null) {
- var canvas = _canvas.current;
- var ctx = canvas.getContext('2d');
- if (!ctx) {
- return;
- }
- var cellsToDraw = cells;
- var image = _image.current;
- var haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;
- if (haveImageToRender) {
- if (calculatedImageSettings.excavation != null) {
- cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);
- }
- }
- var pixelRatio = window.devicePixelRatio || 1;
- canvas.height = canvas.width = size * pixelRatio;
- var scale = size / numCells * pixelRatio;
- ctx.scale(scale, scale);
- ctx.fillStyle = bgColor;
- ctx.fillRect(0, 0, numCells, numCells);
- ctx.fillStyle = fgColor;
- if (isSupportPath2d) {
- ctx.fill(new Path2D(generatePath(cellsToDraw, margin)));
- } else {
- cells.forEach(function (row, rdx) {
- row.forEach(function (cell, cdx) {
- if (cell) {
- ctx.fillRect(cdx + margin, rdx + margin, 1, 1);
- }
- });
- });
- }
- if (calculatedImageSettings) {
- ctx.globalAlpha = calculatedImageSettings.opacity;
- }
- if (haveImageToRender) {
- ctx.drawImage(image, calculatedImageSettings.x + margin, calculatedImageSettings.y + margin, calculatedImageSettings.w, calculatedImageSettings.h);
- }
- }
- });
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- setIsImageLoaded(false);
- }, [imgSrc]);
- var canvasStyle = (0,objectSpread2["default"])({
- height: size,
- width: size
- }, style);
- var img = null;
- if (imgSrc != null) {
- img = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("img", {
- src: imgSrc,
- key: imgSrc,
- style: {
- display: 'none'
- },
- onLoad: function onLoad() {
- setIsImageLoaded(true);
- },
- ref: _image
- // when crossOrigin is not set, the image will be tainted
- // and the canvas cannot be exported to an image
- ,
- crossOrigin: calculatedImageSettings === null || calculatedImageSettings === void 0 ? void 0 : calculatedImageSettings.crossOrigin
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("canvas", (0,esm_extends["default"])({
- style: canvasStyle,
- height: size,
- width: size,
- ref: setCanvasRef,
- role: "img"
- }, otherProps)), img);
- });
- QRCodeCanvas.displayName = 'QRCodeCanvas';
- ;// ./node_modules/@rc-component/qrcode/es/QRCodeSVG.js
- var QRCodeSVG_excluded = ["value", "size", "level", "bgColor", "fgColor", "includeMargin", "minVersion", "title", "marginSize", "imageSettings"];
- var QRCodeSVG = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(function QRCodeSVG(props, forwardedRef) {
- var value = props.value,
- _props$size = props.size,
- size = _props$size === void 0 ? utils_DEFAULT_SIZE : _props$size,
- _props$level = props.level,
- level = _props$level === void 0 ? DEFAULT_LEVEL : _props$level,
- _props$bgColor = props.bgColor,
- bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor,
- _props$fgColor = props.fgColor,
- fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor,
- _props$includeMargin = props.includeMargin,
- includeMargin = _props$includeMargin === void 0 ? DEFAULT_NEED_MARGIN : _props$includeMargin,
- _props$minVersion = props.minVersion,
- minVersion = _props$minVersion === void 0 ? DEFAULT_MINVERSION : _props$minVersion,
- title = props.title,
- marginSize = props.marginSize,
- imageSettings = props.imageSettings,
- otherProps = (0,objectWithoutProperties["default"])(props, QRCodeSVG_excluded);
- var _useQRCode = useQRCode({
- value: value,
- level: level,
- minVersion: minVersion,
- includeMargin: includeMargin,
- marginSize: marginSize,
- imageSettings: imageSettings,
- size: size
- }),
- margin = _useQRCode.margin,
- cells = _useQRCode.cells,
- numCells = _useQRCode.numCells,
- calculatedImageSettings = _useQRCode.calculatedImageSettings;
- var cellsToDraw = cells;
- var image = null;
- if (imageSettings != null && calculatedImageSettings != null) {
- if (calculatedImageSettings.excavation != null) {
- cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);
- }
- image = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("image", {
- href: imageSettings.src,
- height: calculatedImageSettings.h,
- width: calculatedImageSettings.w,
- x: calculatedImageSettings.x + margin,
- y: calculatedImageSettings.y + margin,
- preserveAspectRatio: "none",
- opacity: calculatedImageSettings.opacity
- // when crossOrigin is not set, the image will be tainted
- // and the canvas cannot be exported to an image
- ,
- crossOrigin: calculatedImageSettings.crossOrigin
- });
- }
- var fgPath = generatePath(cellsToDraw, margin);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", (0,esm_extends["default"])({
- height: size,
- width: size,
- viewBox: "0 0 ".concat(numCells, " ").concat(numCells),
- ref: forwardedRef,
- role: "img"
- }, otherProps), !!title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("title", null, title), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
- fill: bgColor,
- d: "M0,0 h".concat(numCells, "v").concat(numCells, "H0z"),
- shapeRendering: "crispEdges"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("path", {
- fill: fgColor,
- d: fgPath,
- shapeRendering: "crispEdges"
- }), image);
- });
- QRCodeSVG.displayName = 'QRCodeSVG';
- ;// ./node_modules/@rc-component/qrcode/es/index.js
- ;// ./node_modules/@ant-design/icons-svg/es/asn/ReloadOutlined.js
- // This icon file is generated automatically.
- var ReloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z" } }] }, "name": "reload", "theme": "outlined" };
- /* harmony default export */ var asn_ReloadOutlined = (ReloadOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var ReloadOutlined_ReloadOutlined = function ReloadOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_ReloadOutlined
- }));
- };
- /** */
- var ReloadOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ReloadOutlined_ReloadOutlined);
- if (true) {
- ReloadOutlined_RefIcon.displayName = 'ReloadOutlined';
- }
- /* harmony default export */ var icons_ReloadOutlined = (ReloadOutlined_RefIcon);
- ;// ./components/qr-code/QrcodeStatus.tsx
- const defaultSpin = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(spin, null);
- function QRcodeStatus({
- prefixCls,
- locale,
- onRefresh,
- statusRender,
- status
- }) {
- const defaultExpiredNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("p", {
- className: `${prefixCls}-expired`
- }, locale === null || locale === void 0 ? void 0 : locale.expired), onRefresh && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_button, {
- type: "link",
- icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_ReloadOutlined, null),
- onClick: onRefresh
- }, locale === null || locale === void 0 ? void 0 : locale.refresh)));
- const defaultScannedNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("p", {
- className: `${prefixCls}-scanned`
- }, locale === null || locale === void 0 ? void 0 : locale.scanned);
- const defaultNodes = {
- expired: defaultExpiredNode,
- loading: defaultSpin,
- scanned: defaultScannedNode
- };
- const defaultStatusRender = info => defaultNodes[info.status];
- const mergedStatusRender = statusRender !== null && statusRender !== void 0 ? statusRender : defaultStatusRender;
- return mergedStatusRender({
- status,
- locale,
- onRefresh
- });
- }
- // EXTERNAL MODULE: ./components/qr-code/style/index.ts
- var qr_code_style = __webpack_require__("./components/qr-code/style/index.ts");
- ;// ./components/qr-code/index.tsx
- var qr_code_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const QRCode = props => {
- var _a, _b, _c, _d;
- const [, token] = (0,useToken["default"])();
- const {
- value,
- type = 'canvas',
- icon = '',
- size = 160,
- iconSize,
- color = token.colorText,
- errorLevel = 'M',
- status = 'active',
- bordered = true,
- onRefresh,
- style,
- className,
- rootClassName,
- prefixCls: customizePrefixCls,
- bgColor = 'transparent',
- statusRender
- } = props,
- rest = qr_code_rest(props, ["value", "type", "icon", "size", "iconSize", "color", "errorLevel", "status", "bordered", "onRefresh", "style", "className", "rootClassName", "prefixCls", "bgColor", "statusRender"]);
- const {
- getPrefixCls
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('qrcode', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,qr_code_style["default"])(prefixCls);
- const imageSettings = {
- src: icon,
- x: undefined,
- y: undefined,
- height: typeof iconSize === 'number' ? iconSize : (_a = iconSize === null || iconSize === void 0 ? void 0 : iconSize.height) !== null && _a !== void 0 ? _a : 40,
- width: typeof iconSize === 'number' ? iconSize : (_b = iconSize === null || iconSize === void 0 ? void 0 : iconSize.width) !== null && _b !== void 0 ? _b : 40,
- excavate: true,
- crossOrigin: 'anonymous'
- };
- const a11yProps = (0,pickAttrs["default"])(rest, true);
- const restProps = (0,omit["default"])(rest, Object.keys(a11yProps));
- const qrCodeProps = Object.assign({
- value,
- size,
- level: errorLevel,
- bgColor,
- fgColor: color,
- style: {
- width: style === null || style === void 0 ? void 0 : style.width,
- height: style === null || style === void 0 ? void 0 : style.height
- },
- imageSettings: icon ? imageSettings : undefined
- }, a11yProps);
- const [locale] = (0,useLocale["default"])('QRCode');
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('QRCode');
- true ? warning(!!value, 'usage', 'need to receive `value` props') : 0;
- true ? warning(!(icon && errorLevel === 'L'), 'usage', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : 0;
- }
- if (!value) {
- return null;
- }
- const mergedCls = classnames_default()(prefixCls, className, rootClassName, hashId, cssVarCls, {
- [`${prefixCls}-borderless`]: !bordered
- });
- const mergedStyle = Object.assign(Object.assign({
- backgroundColor: bgColor
- }, style), {
- width: (_c = style === null || style === void 0 ? void 0 : style.width) !== null && _c !== void 0 ? _c : size,
- height: (_d = style === null || style === void 0 ? void 0 : style.height) !== null && _d !== void 0 ? _d : size
- });
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({}, restProps, {
- className: mergedCls,
- style: mergedStyle
- }), status !== 'active' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-mask`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(QRcodeStatus, {
- prefixCls: prefixCls,
- locale: locale,
- status: status,
- onRefresh: onRefresh,
- statusRender: statusRender
- }))), type === 'canvas' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(QRCodeSVG, Object.assign({}, qrCodeProps))));
- };
- if (true) {
- QRCode.displayName = 'QRCode';
- }
- /* harmony default export */ var qr_code = (QRCode);
- ;// ./components/radio/index.tsx
- const radio_Radio = radio_radio;
- radio_Radio.Button = radioButton;
- radio_Radio.Group = group;
- radio_Radio.__ANT_RADIO = true;
- /* harmony default export */ var components_radio = (radio_Radio);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/StarFilled.js
- // This icon file is generated automatically.
- var StarFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" } }] }, "name": "star", "theme": "filled" };
- /* harmony default export */ var asn_StarFilled = (StarFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/StarFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var StarFilled_StarFilled = function StarFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_StarFilled
- }));
- };
- /** */
- var StarFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(StarFilled_StarFilled);
- if (true) {
- StarFilled_RefIcon.displayName = 'StarFilled';
- }
- /* harmony default export */ var icons_StarFilled = (StarFilled_RefIcon);
- ;// ./node_modules/rc-rate/es/Star.js
- function Star(props, ref) {
- var disabled = props.disabled,
- prefixCls = props.prefixCls,
- character = props.character,
- characterRender = props.characterRender,
- index = props.index,
- count = props.count,
- value = props.value,
- allowHalf = props.allowHalf,
- focused = props.focused,
- onHover = props.onHover,
- onClick = props.onClick;
- // =========================== Events ===========================
- var onInternalHover = function onInternalHover(e) {
- onHover(e, index);
- };
- var onInternalClick = function onInternalClick(e) {
- onClick(e, index);
- };
- var onInternalKeyDown = function onInternalKeyDown(e) {
- if (e.keyCode === KeyCode["default"].ENTER) {
- onClick(e, index);
- }
- };
- // =========================== Render ===========================
- // >>>>> ClassName
- var starValue = index + 1;
- var classNameList = new Set([prefixCls]);
- // TODO: Current we just refactor from CC to FC. This logic seems can be optimized.
- if (value === 0 && index === 0 && focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- } else if (allowHalf && value + 0.5 >= starValue && value < starValue) {
- classNameList.add("".concat(prefixCls, "-half"));
- classNameList.add("".concat(prefixCls, "-active"));
- if (focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- }
- } else {
- if (starValue <= value) {
- classNameList.add("".concat(prefixCls, "-full"));
- } else {
- classNameList.add("".concat(prefixCls, "-zero"));
- }
- if (starValue === value && focused) {
- classNameList.add("".concat(prefixCls, "-focused"));
- }
- }
- // >>>>> Node
- var characterNode = typeof character === 'function' ? character(props) : character;
- var start = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
- className: classnames_default()(Array.from(classNameList)),
- ref: ref
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- onClick: disabled ? null : onInternalClick,
- onKeyDown: disabled ? null : onInternalKeyDown,
- onMouseMove: disabled ? null : onInternalHover,
- role: "radio",
- "aria-checked": value > index ? 'true' : 'false',
- "aria-posinset": index + 1,
- "aria-setsize": count,
- tabIndex: disabled ? -1 : 0
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-first")
- }, characterNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-second")
- }, characterNode)));
- if (characterRender) {
- start = characterRender(start, props);
- }
- return start;
- }
- /* harmony default export */ var es_Star = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Star));
- ;// ./node_modules/rc-rate/es/useRefs.js
- function useRefs() {
- var nodeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- function getRef(index) {
- return nodeRef.current[index];
- }
- function setRef(index) {
- return function (node) {
- nodeRef.current[index] = node;
- };
- }
- return [getRef, setRef];
- }
- ;// ./node_modules/rc-rate/es/util.js
- function es_util_getScroll(w) {
- var ret = w.pageXOffset;
- var method = 'scrollLeft';
- if (typeof ret !== 'number') {
- var d = w.document;
- // ie6,7,8 standard mode
- ret = d.documentElement[method];
- if (typeof ret !== 'number') {
- // quirks mode
- ret = d.body[method];
- }
- }
- return ret;
- }
- function getClientPosition(elem) {
- var x;
- var y;
- var doc = elem.ownerDocument;
- var body = doc.body;
- var docElem = doc && doc.documentElement;
- var box = elem.getBoundingClientRect();
- x = box.left;
- y = box.top;
- x -= docElem.clientLeft || body.clientLeft || 0;
- y -= docElem.clientTop || body.clientTop || 0;
- return {
- left: x,
- top: y
- };
- }
- function getOffsetLeft(el) {
- var pos = getClientPosition(el);
- var doc = el.ownerDocument;
- // Only IE use `parentWindow`
- var w = doc.defaultView || doc.parentWindow;
- pos.left += es_util_getScroll(w);
- return pos.left;
- }
- ;// ./node_modules/rc-rate/es/Rate.js
- var Rate_excluded = ["prefixCls", "className", "defaultValue", "value", "count", "allowHalf", "allowClear", "keyboard", "character", "characterRender", "disabled", "direction", "tabIndex", "autoFocus", "onHoverChange", "onChange", "onFocus", "onBlur", "onKeyDown", "onMouseLeave"];
- function Rate(props, ref) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-rate' : _props$prefixCls,
- className = props.className,
- defaultValue = props.defaultValue,
- propValue = props.value,
- _props$count = props.count,
- count = _props$count === void 0 ? 5 : _props$count,
- _props$allowHalf = props.allowHalf,
- allowHalf = _props$allowHalf === void 0 ? false : _props$allowHalf,
- _props$allowClear = props.allowClear,
- allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
- _props$keyboard = props.keyboard,
- keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
- _props$character = props.character,
- character = _props$character === void 0 ? '★' : _props$character,
- characterRender = props.characterRender,
- disabled = props.disabled,
- _props$direction = props.direction,
- direction = _props$direction === void 0 ? 'ltr' : _props$direction,
- _props$tabIndex = props.tabIndex,
- tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
- autoFocus = props.autoFocus,
- onHoverChange = props.onHoverChange,
- onChange = props.onChange,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onKeyDown = props.onKeyDown,
- onMouseLeave = props.onMouseLeave,
- restProps = (0,objectWithoutProperties["default"])(props, Rate_excluded);
- var _useRefs = useRefs(),
- _useRefs2 = (0,slicedToArray["default"])(_useRefs, 2),
- getStarRef = _useRefs2[0],
- setStarRef = _useRefs2[1];
- var rateRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- // ============================ Ref =============================
- var triggerFocus = function triggerFocus() {
- if (!disabled) {
- var _rateRef$current;
- (_rateRef$current = rateRef.current) === null || _rateRef$current === void 0 || _rateRef$current.focus();
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useImperativeHandle(ref, function () {
- return {
- focus: triggerFocus,
- blur: function blur() {
- if (!disabled) {
- var _rateRef$current2;
- (_rateRef$current2 = rateRef.current) === null || _rateRef$current2 === void 0 || _rateRef$current2.blur();
- }
- }
- };
- });
- // =========================== Value ============================
- var _useMergedState = (0,useMergedState["default"])(defaultValue || 0, {
- value: propValue
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- value = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var _useMergedState3 = (0,useMergedState["default"])(null),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- cleanedValue = _useMergedState4[0],
- setCleanedValue = _useMergedState4[1];
- var getStarValue = function getStarValue(index, x) {
- var reverse = direction === 'rtl';
- var starValue = index + 1;
- if (allowHalf) {
- var starEle = getStarRef(index);
- var leftDis = getOffsetLeft(starEle);
- var width = starEle.clientWidth;
- if (reverse && x - leftDis > width / 2) {
- starValue -= 0.5;
- } else if (!reverse && x - leftDis < width / 2) {
- starValue -= 0.5;
- }
- }
- return starValue;
- };
- // >>>>> Change
- var changeValue = function changeValue(nextValue) {
- setValue(nextValue);
- onChange === null || onChange === void 0 || onChange(nextValue);
- };
- // =========================== Focus ============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- focused = _React$useState2[0],
- setFocused = _React$useState2[1];
- var onInternalFocus = function onInternalFocus() {
- setFocused(true);
- onFocus === null || onFocus === void 0 || onFocus();
- };
- var onInternalBlur = function onInternalBlur() {
- setFocused(false);
- onBlur === null || onBlur === void 0 || onBlur();
- };
- // =========================== Hover ============================
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- hoverValue = _React$useState4[0],
- setHoverValue = _React$useState4[1];
- var onHover = function onHover(event, index) {
- var nextHoverValue = getStarValue(index, event.pageX);
- if (nextHoverValue !== cleanedValue) {
- setHoverValue(nextHoverValue);
- setCleanedValue(null);
- }
- onHoverChange === null || onHoverChange === void 0 || onHoverChange(nextHoverValue);
- };
- var onMouseLeaveCallback = function onMouseLeaveCallback(event) {
- if (!disabled) {
- setHoverValue(null);
- setCleanedValue(null);
- onHoverChange === null || onHoverChange === void 0 || onHoverChange(undefined);
- }
- if (event) {
- onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave(event);
- }
- };
- // =========================== Click ============================
- var onClick = function onClick(event, index) {
- var newValue = getStarValue(index, event.pageX);
- var isReset = false;
- if (allowClear) {
- isReset = newValue === value;
- }
- onMouseLeaveCallback();
- changeValue(isReset ? 0 : newValue);
- setCleanedValue(isReset ? newValue : null);
- };
- var onInternalKeyDown = function onInternalKeyDown(event) {
- var keyCode = event.keyCode;
- var reverse = direction === 'rtl';
- var step = allowHalf ? 0.5 : 1;
- if (keyboard) {
- if (keyCode === KeyCode["default"].RIGHT && value < count && !reverse) {
- changeValue(value + step);
- event.preventDefault();
- } else if (keyCode === KeyCode["default"].LEFT && value > 0 && !reverse) {
- changeValue(value - step);
- event.preventDefault();
- } else if (keyCode === KeyCode["default"].RIGHT && value > 0 && reverse) {
- changeValue(value - step);
- event.preventDefault();
- } else if (keyCode === KeyCode["default"].LEFT && value < count && reverse) {
- changeValue(value + step);
- event.preventDefault();
- }
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
- };
- // =========================== Effect ===========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
- if (autoFocus && !disabled) {
- triggerFocus();
- }
- }, []);
- // =========================== Render ===========================
- // >>> Star
- var starNodes = new Array(count).fill(0).map(function (item, index) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Star, {
- ref: setStarRef(index),
- index: index,
- count: count,
- disabled: disabled,
- prefixCls: "".concat(prefixCls, "-star"),
- allowHalf: allowHalf,
- value: hoverValue === null ? value : hoverValue,
- onClick: onClick,
- onHover: onHover,
- key: item || index,
- character: character,
- characterRender: characterRender,
- focused: focused
- });
- });
- var classString = classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-rtl"), direction === 'rtl'));
- // >>> Node
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("ul", (0,esm_extends["default"])({
- className: classString,
- onMouseLeave: onMouseLeaveCallback,
- tabIndex: disabled ? -1 : tabIndex,
- onFocus: disabled ? null : onInternalFocus,
- onBlur: disabled ? null : onInternalBlur,
- onKeyDown: disabled ? null : onInternalKeyDown,
- ref: rateRef
- }, (0,pickAttrs["default"])(restProps, {
- aria: true,
- data: true,
- attr: true
- })), starNodes);
- }
- /* harmony default export */ var es_Rate = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Rate));
- ;// ./node_modules/rc-rate/es/index.js
- /* harmony default export */ var rc_rate_es = (es_Rate);
- // EXTERNAL MODULE: ./components/rate/style/index.ts
- var rate_style = __webpack_require__("./components/rate/style/index.ts");
- ;// ./components/rate/index.tsx
- var rate_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const rate_Rate = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls,
- className,
- rootClassName,
- style,
- tooltips,
- character = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_StarFilled, null),
- disabled: customDisabled
- } = props,
- rest = rate_rest(props, ["prefixCls", "className", "rootClassName", "style", "tooltips", "character", "disabled"]);
- const characterRender = (node, {
- index
- }) => {
- if (!tooltips) {
- return node;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- title: tooltips[index]
- }, node);
- };
- const {
- getPrefixCls,
- direction,
- rate
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const ratePrefixCls = getPrefixCls('rate', prefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,rate_style["default"])(ratePrefixCls);
- const mergedStyle = Object.assign(Object.assign({}, rate === null || rate === void 0 ? void 0 : rate.style), style);
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_rate_es, Object.assign({
- ref: ref,
- character: character,
- characterRender: characterRender,
- disabled: mergedDisabled
- }, rest, {
- className: classnames_default()(className, rootClassName, hashId, cssVarCls, rate === null || rate === void 0 ? void 0 : rate.className),
- style: mergedStyle,
- prefixCls: ratePrefixCls,
- direction: direction
- })));
- });
- if (true) {
- rate_Rate.displayName = 'Rate';
- }
- /* harmony default export */ var rate = (rate_Rate);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/WarningFilled.js
- // This icon file is generated automatically.
- var WarningFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "warning", "theme": "filled" };
- /* harmony default export */ var asn_WarningFilled = (WarningFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/WarningFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var WarningFilled_WarningFilled = function WarningFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_WarningFilled
- }));
- };
- /** */
- var WarningFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(WarningFilled_WarningFilled);
- if (true) {
- WarningFilled_RefIcon.displayName = 'WarningFilled';
- }
- /* harmony default export */ var icons_WarningFilled = (WarningFilled_RefIcon);
- ;// ./components/result/noFound.tsx
- const NoFound = () => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- width: "252",
- height: "294"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, "No Found"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- fill: "none",
- fillRule: "evenodd"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- cx: "126.75",
- cy: "128.1",
- r: "126",
- fill: "#E4EBF7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- cx: "31.55",
- cy: "130.8",
- r: "8.3",
- fill: "#FFF"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m37 134.3 10.5 6m.9 6.2-12.7 10.8",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M39.9 159.4a5.7 5.7 0 1 1-11.3-1.2 5.7 5.7 0 0 1 11.3 1.2m17.7-16.2a5.7 5.7 0 1 1-11.4-1.1 5.7 5.7 0 0 1 11.4 1.1M99 27h29.8a4.6 4.6 0 1 0 0-9.2H99a4.6 4.6 0 1 0 0 9.2m11.4 18.3h29.8a4.6 4.6 0 0 0 0-9.2h-29.8a4.6 4.6 0 1 0 0 9.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M112.8 26.9h15.8a4.6 4.6 0 1 0 0 9.1h-15.8a4.6 4.6 0 0 0 0-9.1m71.7 108.8a10 10 0 1 1-19.8-2 10 10 0 0 1 19.8 2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m179.3 141.8 12.6 7.1m1.1 7.6-15.2 13",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M184.7 170a6.8 6.8 0 1 1-13.6-1.3 6.8 6.8 0 0 1 13.6 1.4m18.6-16.8a6.9 6.9 0 1 1-13.7-1.4 6.9 6.9 0 0 1 13.7 1.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "M152 192.3a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.4 0zm73.3-76.2a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0zm-9 35a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.5 0zM177 107.6a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm18.4-15.4a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0zm6.8 88.5a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0z",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m214.4 153.3-2 20.2-10.8 6m-28-4.7-6.3 9.8H156l-4.5 6.5m23.5-66v-15.7m46 7.8-13 8-15.2-8V94.4",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M166.6 66h-4a4.8 4.8 0 0 1-4.7-4.8 4.8 4.8 0 0 1 4.7-4.7h4a4.8 4.8 0 0 1 4.7 4.7 4.8 4.8 0 0 1-4.7 4.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- cx: "204.3",
- cy: "30",
- r: "29.5",
- fill: "#1677ff"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M206 38.4c.5.5.7 1.1.7 2s-.2 1.4-.7 1.9a3 3 0 0 1-2 .7c-.8 0-1.5-.3-2-.8s-.8-1.1-.8-1.9.3-1.4.8-2c.5-.4 1.2-.7 2-.7.7 0 1.4.3 2 .8m4.2-19.5c1.5 1.3 2.2 3 2.2 5.2a7.2 7.2 0 0 1-1.5 4.5l-3 2.7a5 5 0 0 0-1.3 1.7 5.2 5.2 0 0 0-.6 2.4v.5h-4v-.5c0-1.4.1-2.5.6-3.5s1.9-2.5 4.2-4.5l.4-.5a4 4 0 0 0 1-2.6c0-1.2-.4-2-1-2.8-.7-.6-1.6-1-2.9-1-1.5 0-2.6.5-3.3 1.5-.4.5-.6 1-.8 1.9a2 2 0 0 1-2 1.6 2 2 0 0 1-2-2.4c.4-1.6 1-2.8 2.1-3.8a8.5 8.5 0 0 1 6.3-2.3c2.3 0 4.2.6 5.6 2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFB594",
- d: "M52 76.1s21.8 5.4 27.3 16c5.6 10.7-6.3 9.2-15.7 5C52.8 92 39 85 52 76"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m90.5 67.5-.5 2.9c-.7.5-4.7-2.7-4.7-2.7l-1.7.8-1.3-5.7s6.8-4.6 9-5c2.4-.5 9.8 1 10.6 2.3 0 0 1.3.4-2.2.6-3.6.3-5 .5-6.8 3.2l-2.4 3.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M128 111.4a36.7 36.7 0 0 0-8.9-15.5c-3.5-3-9.3-2.2-11.3-4.2-1.3-1.2-3.2-1.2-3.2-1.2L87.7 87c-2.3-.4-2.1-.7-6-1.4-1.6-1.9-3-1.1-3-1.1l-7-1.4c-1-1.5-2.5-1-2.5-1l-2.4-.9C65 91.2 59 95 59 95c1.8 1.1 15.7 8.3 15.7 8.3l5.1 37.1s-3.3 5.7 1.4 9.1c0 0 19.9-3.7 34.9-.3 0 0 3-2.6 1-8.8.5-3 1.4-8.3 1.7-11.6.4.7 2 1.9 3.1 3.4 0 0 9.4-7.3 11-14a17 17 0 0 1-2.2-2.4c-.5-.8-.3-2-.7-2.8-.7-1-1.8-1.3-2-1.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M101 290s4.4 2 7.4 1c2.9-1 4.6.7 7.1 1.2 2.6.5 6.9 1.1 11.7-1.3 0-5.5-6.9-4-12-6.7-2.5-1.4-3.7-4.7-3.5-8.8h-9.5s-1.2 10.6-1 14.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M101 289.8s2.5 1.3 6.8.7c3-.5 3.7.5 7.4 1 3.8.6 10.8 0 11.9-.9.4 1.1-.4 2-.4 2s-1.5.7-4.8.9c-2 .1-5.8.3-7.6-.5-1.8-1.4-5.2-1.9-5.7-.2-4 1-7.4-.3-7.4-.3l-.1-2.7z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M108.3 276h3.1s0 6.7 4.6 8.6c-4.7.6-8.6-2.3-7.7-8.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M57.5 272.4s-2 7.4-4.4 12.3c-1.8 3.7-4.3 7.5 5.4 7.5 6.7 0 9-.5 7.4-6.6-1.5-6.1.3-13.2.3-13.2h-8.7z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M51.5 289.8s2 1.2 6.6 1.2c6 0 8.3-1.7 8.3-1.7s.6 1.1-.7 2.2c-1 .8-3.6 1.6-7.4 1.5-4.1 0-5.8-.5-6.7-1.1-.8-.6-.7-1.6-.1-2.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M58.4 274.3s0 1.5-.3 3c-.3 1.4-1 3-1.1 4 0 1.2 4.5 1.7 5.1.1.6-1.5 1.3-6.4 2-7.2.6-.9-5-2.2-5.7.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#7BB2F9",
- d: "m99.7 278.5 13.3.1s1.3-54.5 1.9-64.4c.5-9.9 3.8-43.4 1-63.1l-12.6-.7-22.8.8-1.2 10c0 .5-.7.8-.7 1.4-.1.5.4 1.3.3 2-2.4 14-6.4 33-8.8 46.6 0 .7-1.2 1-1.4 2.7 0 .3.2 1.5 0 1.8-6.8 18.7-10.9 47.8-14.2 61.9h14.6s2.2-8.6 4-17c2.9-12.9 23.2-85 23.2-85l3-.5 1 46.3s-.2 1.2.4 2c.5.8-.6 1.1-.4 2.3l.4 1.8-1 11.8c-.4 4.8 0 39.2 0 39.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M76 221.6c1.2.1 4.1-2 7-5m23.4 8.5s2.7-1 6-3.8",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M107.3 222.1s2.7-1.1 6-3.9",
- strokeLinecap: "round",
- strokeLinejoin: "round"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M74.7 224.8s2.7-.6 6.5-3.4m4.8-69.8c-.2 3.1.3 8.6-4.3 9.2m22-11s0 14-1.4 15.1a15 15 0 0 1-3 2m.5-16.5s0 13-1.2 24.4m-5 1.1s7.3-1.7 9.5-1.7M74.3 206a212 212 0 0 1-1 4.5s-1.4 1.9-1 3.8c.5 2-1 2-5 15.4A353 353 0 0 0 61 257l-.2 1.2m14.9-60.5a321 321 0 0 1-.9 4.8m7.8-50.4-1.2 10.5s-1.1.1-.5 2.2c.1 1.4-2.7 15.8-5.2 30.5m-19.6 79h13.3",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M116.2 148.2s-17-3-35.9.2c.2 2.5 0 4.2 0 4.2s14.7-2.8 35.7-.3c.3-2.4.2-4 .2-4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M106.3 151.2v-5a.8.8 0 0 0-.8-.8h-7.8a.8.8 0 0 0-.8.8v5a.8.8 0 0 0 .8.8h7.8a.8.8 0 0 0 .8-.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M105.2 150.2v-3a.6.6 0 0 0-.6-.7 94.3 94.3 0 0 0-5.9 0 .7.7 0 0 0-.6.6v3.1a.6.6 0 0 0 .6.7 121.1 121.1 0 0 1 5.8 0c.4 0 .7-.3.7-.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M100.3 275.4h12.3m-11.2-4.9.1 6.5m0-12.5a915.8 915.8 0 0 0 0 4.4m-.5-94 .9 44.7s.7 1.6-.2 2.7c-1 1.1 2.4.7.9 2.2-1.6 1.6.9 1.2 0 3.4-.6 1.5-1 21.1-1.1 35.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M46.9 83.4s-.5 6 7.2 5.6c11.2-.7 9.2-9.4 31.5-21.7-.7-2.7-2.4-4.7-2.4-4.7s-11 3-22.6 8c-6.8 3-13.4 6.4-13.7 12.8m57.6 7.7.9-5.4-8.9-11.4-5 5.3-1.8 7.9a.3.3 0 0 0 .1.3c1 .8 6.5 5 14.4 3.5a.3.3 0 0 0 .3-.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M94 79.4s-4.6-2.9-2.5-6.9c1.6-3 4.5 1.2 4.5 1.2s.5-3.7 3.1-3.7c.6-1 1.6-4.1 1.6-4.1l13.5 3c0 5.3-2.3 19.5-7.8 20-8.9.6-12.5-9.5-12.5-9.5"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#520038",
- d: "M113.9 73.4c2.6-2 3.4-9.7 3.4-9.7s-2.4-.5-6.6-2c-4.7-2.1-12.8-4.8-17.5 1-9.6 3.2-2 19.8-2 19.8l2.7-3s-4-3.3-2-6.3c2-3.5 3.8 1 3.8 1s.7-2.3 3.6-3.3c.4-.7 1-2.6 1.4-3.8a1 1 0 0 1 1.3-.7l11.4 2.6c.5.2.8.7.8 1.2l-.3 3.2z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#552950",
- d: "M105 76c-.1.7-.6 1.1-1 1-.6 0-.9-.6-.8-1.2.1-.6.6-1 1-1 .6 0 .9.7.8 1.3m7.1 1.6c0 .6-.5 1-1 1-.5-.1-.8-.7-.7-1.3 0-.6.5-1 1-1 .5.1.8.7.7 1.3"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "m110.1 74.8-.9 1.7-.3 4.3h-2.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#5C2552",
- d: "M110.8 74.5s1.8-.7 2.6.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M92.4 74.3s.5-1.1 1.1-.7c.6.4 1.3 1.4.6 2-.8.5.1 1.6.1 1.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#5C2552",
- d: "M103.3 73s1.8 1 4.1.9",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M103.7 81.8s2.2 1.2 4.4 1.2m-3.5 1.3s1 .4 1.6.3m-11.5-3.4s2.3 7.4 10.4 7.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M81.5 89.4s.4 5.6-5 12.8M69 82.7s-.7 9.2-8.2 14.2m68.6 26s-5.3 7.4-9.4 10.7m-.7-26.3s.5 4.4-2.1 32",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F2D7AD",
- d: "M150 151.2h-49.8a1 1 0 0 1-1-1v-31.7c0-.5.4-1 1-1H150c.6 0 1 .5 1 1v31.7a1 1 0 0 1-1 1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F4D19D",
- d: "M150.3 151.2h-19.9v-33.7h20.8v32.8a1 1 0 0 1-1 1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F2D7AD",
- d: "M123.6 127.9H92.9a.5.5 0 0 1-.4-.8l6.4-9.1c.2-.3.5-.5.8-.5h31.1l-7.2 10.4z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CC9B6E",
- d: "M123.7 128.4H99.2v-.5h24.2l7.2-10.2.4.3z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F4D19D",
- d: "M158.3 127.9h-18.7a2 2 0 0 1-1.6-.8l-7.2-9.6h20c.5 0 1 .3 1.2.6l6.7 9a.5.5 0 0 1-.4.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CC9B6E",
- d: "M157.8 128.5h-19.3l-7.9-10.5.4-.3 7.7 10.3h19.1zm-27.2 22.2v-8.2h.4v8.2zm-.1-10.9v-21.4h.4l.1 21.4zm-18.6 1.1-.5-.1 1.5-5.2.5.2zm-3.5.2-2.6-3 2.6-3.4.4.3-2.4 3.1 2.4 2.6zm8.2 0-.4-.4 2.4-2.6-2.4-3 .4-.4 2.7 3.4z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m154.3 131.9-3.1-2v3.5l-1 .1a85 85 0 0 1-4.8.3c-1.9 0-2.7 2.2 2.2 2.6l-2.6-.6s-2.2 1.3.5 2.3c0 0-1.6 1.2.6 2.6-.6 3.5 5.2 4 7 3.6a6.1 6.1 0 0 0 4.6-5.2 8 8 0 0 0-3.4-7.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M153.7 133.6s-6.5.4-8.4.3c-1.8 0-1.9 2.2 2.4 2.3 3.7.2 5.4 0 5.4 0",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M145.2 135.9c-1.9 1.3.5 2.3.5 2.3s3.5 1 6.8.6m-.6 2.9s-6.3.1-6.7-2.1c-.3-1.4.4-1.4.4-1.4m.5 2.7s-1 3.1 5.5 3.5m-.4-14.5v3.5M52.8 89.3a18 18 0 0 0 13.6-7.8",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#5BA02E",
- d: "M168.6 248.3a6.6 6.6 0 0 1-6.7-6.6v-66.5a6.6 6.6 0 1 1 13.3 0v66.5a6.6 6.6 0 0 1-6.6 6.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#92C110",
- d: "M176.5 247.7a6.6 6.6 0 0 1-6.6-6.7v-33.2a6.6 6.6 0 1 1 13.3 0V241a6.6 6.6 0 0 1-6.7 6.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F2D7AD",
- d: "M186.4 293.6H159a3.2 3.2 0 0 1-3.2-3.2v-46.1a3.2 3.2 0 0 1 3.2-3.2h27.5a3.2 3.2 0 0 1 3.2 3.2v46.1a3.2 3.2 0 0 1-3.2 3.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M89 89.5s7.8 5.4 16.6 2.8",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }))));
- /* harmony default export */ var noFound = (NoFound);
- ;// ./components/result/serverError.tsx
- const ServerError = () => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- width: "254",
- height: "294"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, "Server Error"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- fill: "none",
- fillRule: "evenodd"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#E4EBF7",
- d: "M0 128.1v-2C0 56.5 56.3.2 125.7.2h2.1C197.2.3 253.5 56.6 253.5 126v2.1c0 69.5-56.3 125.7-125.7 125.7h-2.1A125.7 125.7 0 0 1 0 128.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M40 132.1a8.3 8.3 0 1 1-16.6-1.7 8.3 8.3 0 0 1 16.6 1.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m37.2 135.6 10.5 6m1 6.3-12.8 10.8",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M40.1 160.8a5.7 5.7 0 1 1-11.3-1.1 5.7 5.7 0 0 1 11.3 1.1M58 144.6a5.7 5.7 0 1 1-11.4-1.2 5.7 5.7 0 0 1 11.4 1.2M99.7 27.4h30a4.6 4.6 0 1 0 0-9.2h-30a4.6 4.6 0 0 0 0 9.2M111 46h30a4.6 4.6 0 1 0 0-9.3h-30a4.6 4.6 0 1 0 0 9.3m2.5-18.6h16a4.6 4.6 0 1 0 0 9.3h-16a4.6 4.6 0 0 0 0-9.3m36.7 42.7h-4a4.8 4.8 0 0 1-4.8-4.8 4.8 4.8 0 0 1 4.8-4.8h4a4.8 4.8 0 0 1 4.7 4.8 4.8 4.8 0 0 1-4.7 4.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("circle", {
- cx: "201.35",
- cy: "30.2",
- r: "29.7",
- fill: "#FF603B"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "m203.6 19.4-.7 15a1.5 1.5 0 0 1-3 0l-.7-15a2.2 2.2 0 1 1 4.4 0m-.3 19.4c.5.5.8 1.1.8 1.9s-.3 1.4-.8 1.9a3 3 0 0 1-2 .7 2.5 2.5 0 0 1-1.8-.7c-.6-.6-.8-1.2-.8-2 0-.7.2-1.3.8-1.8.5-.5 1.1-.7 1.8-.7.8 0 1.5.2 2 .7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFB594",
- d: "M119.3 133.3c4.4-.6 3.6-1.2 4-4.8.8-5.2-3-17-8.2-25.1-1-10.7-12.6-11.3-12.6-11.3s4.3 5 4.2 16.2c1.4 5.3.8 14.5.8 14.5s5.3 11.4 11.8 10.5"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M101 91.6s1.4-.6 3.2.6c8 1.4 10.3 6.7 11.3 11.4 1.8 1.2 1.8 2.3 1.8 3.5l1.5 3s-7.2 1.7-11 6.7c-1.3-6.4-6.9-25.2-6.9-25.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFB594",
- d: "m94 90.5 1-5.8-9.2-11.9-5.2 5.6-2.6 9.9s8.4 5 16 2.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M83 78.2s-4.6-2.9-2.5-6.9c1.6-3 4.5 1.2 4.5 1.2s.5-3.7 3.2-3.7c.5-1 1.5-4.2 1.5-4.2l13.6 3.2c0 5.2-2.3 19.5-7.9 20-8.9.6-12.5-9.6-12.5-9.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#520038",
- d: "M103 72.2c2.6-2 3.5-9.7 3.5-9.7s-2.5-.5-6.7-2c-4.7-2.2-12.9-4.9-17.6.9-9.5 4.4-2 20-2 20l2.7-3.1s-4-3.3-2.1-6.3c2.2-3.5 4 1 4 1s.6-2.3 3.5-3.3c.4-.7 1-2.7 1.5-3.8A1 1 0 0 1 91 65l11.5 2.7c.5.1.8.6.8 1.2l-.3 3.2z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#552950",
- d: "M101.2 76.5c0 .6-.6 1-1 1-.5-.1-.9-.7-.8-1.3.1-.6.6-1 1.1-1 .5.1.8.7.7 1.3m-7-1.4c0 .6-.5 1-1 1-.5-.1-.8-.7-.7-1.3 0-.6.6-1 1-1 .5.1.9.7.8 1.3"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "m99.2 73.6-.9 1.7-.3 4.3h-2.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#5C2552",
- d: "M100 73.3s1.7-.7 2.4.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M81.4 73s.4-1 1-.6c.7.4 1.4 1.4.6 2s.2 1.6.2 1.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#5C2552",
- d: "M92.3 71.7s1.9 1.1 4.2 1",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M92.7 80.6s2.3 1.2 4.4 1.2m-3.4 1.4s1 .4 1.5.3M83.7 80s1.8 6.6 9.2 8",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M95.5 91.7s-1 2.8-8.2 2c-7.3-.6-10.3-5-10.3-5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M78.1 87.5s6.6 5 16.5 2.5c0 0 9.6 1 11.5 5.3 5.4 11.8.6 36.8 0 40 3.5 4-.4 8.4-.4 8.4-15.7-3.5-35.8-.6-35.8-.6-4.9-3.5-1.3-9-1.3-9l-6.2-23.8c-2.5-15.2.8-19.8 3.5-20.7 3-1 8-1.3 8-1.3.6 0 1.1 0 1.4-.2 2.4-1.3 2.8-.6 2.8-.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M65.8 89.8s-6.8.5-7.6 8.2c-.4 8.8 3 11 3 11s6.1 22 16.9 22.9c8.4-2.2 4.7-6.7 4.6-11.4-.2-11.3-7-17-7-17s-4.3-13.7-9.9-13.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M71.7 124.2s.9 11.3 9.8 6.5c4.8-2.5 7.6-13.8 9.8-22.6A201 201 0 0 0 94 96l-5-1.7s-2.4 5.6-7.7 12.3c-4.4 5.5-9.2 11.1-9.5 17.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M108.5 105.2s1.7 2.7-2.4 30.5c2.4 2.2 1 6-.2 7.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M123.3 131.5s-.5 2.8-11.8 2c-15.2-1-25.3-3.2-25.3-3.2l.9-5.8s.7.2 9.7-.1c11.9-.4 18.7-6 25-1 4 3.2 1.5 8.1 1.5 8.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M70.2 91s-5.6-4.8-11 2.7c-3.3 7.2.5 15.2 2.6 19.5-.3 3.8 2.4 4.3 2.4 4.3s0 1 1.5 2.7c4-7 6.7-9.1 13.7-12.5-.3-.7-1.9-3.3-1.8-3.8.2-1.7-1.3-2.6-1.3-2.6s-.3-.2-1.2-2.8c-.8-2.3-2-5.1-4.9-7.5"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M90.2 288s4.9 2.3 8.3 1.2c3.2-1 5.2.7 8 1.3a20 20 0 0 0 13.3-1.4c-.2-6.2-7.8-4.5-13.6-7.6-2.9-1.6-4.2-5.3-4-10H91.5s-1.5 12-1.3 16.5"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M90.2 287.8s2.8 1.5 7.6.8c3.5-.5 3.3.6 7.5 1.3 4.2.6 13-.2 14.3-1.2.5 1.3-.4 2.4-.4 2.4s-1.7.6-5.4.9c-2.3.1-8.1.3-10.2-.6-2-1.6-4.9-1.5-6-.3-4.5 1.1-7.2-.3-7.2-.3l-.2-3z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M98.4 272.3h3.5s0 7.5 5.2 9.6c-5.3.7-9.7-2.6-8.7-9.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M44.4 272s-2.2 7.8-4.7 13c-1.9 3.8-4.4 7.8 5.8 7.8 7 0 9.3-.5 7.7-7-1.6-6.3.3-13.8.3-13.8h-9z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M38 290.3s2.3 1.2 7 1.2c6.4 0 8.7-1.7 8.7-1.7s.6 1.1-.7 2.2c-1 1-3.8 1.7-7.7 1.7-4.4 0-6.1-.6-7-1.3-1-.5-.8-1.6-.2-2.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M45.3 274s0 1.6-.3 3.1-1.1 3.3-1.2 4.4c0 1.2 4.8 1.6 5.4 0 .7-1.6 1.4-6.8 2-7.6.7-.9-5.1-2.2-5.9.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#7BB2F9",
- d: "M89.5 277.6h13.9s1.3-56.6 1.9-66.8c.6-10.3 4-45.1 1-65.6l-13-.7-23.7.8-1.3 10.4c0 .5-.7.9-.8 1.4 0 .6.5 1.4.4 2L59.6 206c-.1.7-1.3 1-1.5 2.8 0 .3.2 1.6.1 1.8-7.1 19.5-12.2 52.6-15.6 67.2h15.1L62 259c3-13.3 24-88.3 24-88.3l3.2-1-.2 48.6s-.2 1.3.4 2.1c.5.8-.6 1.2-.4 2.4l.4 1.8-1 12.4c-.4 4.9 1.2 40.7 1.2 40.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M64.6 218.9c1.2 0 4.2-2.1 7.2-5.1m24.2 8.7s3-1.1 6.4-4",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M97 219.4s2.9-1.2 6.3-4",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M63.2 222.1s2.7-.6 6.7-3.5m5-72.4c-.3 3.2.3 8.8-4.5 9.4m22.8-11.3s.1 14.6-1.4 15.7c-2.3 1.7-3 2-3 2m.4-17s.3 13-1 25m-4.7.7s6.8-1 9.1-1M46 270l-.9 4.6m1.8-11.3-.8 4.1m16.6-64.9c-.3 1.6 0 2-.4 3.4 0 0-2.8 2-2.3 4s-.3 3.4-4.5 17.2c-1.8 5.8-4.3 19-6.2 28.3l-1.1 5.8m16-67-1 4.9m8.1-52.3-1.2 10.9s-1.2.1-.5 2.3c0 1.4-2.8 16.4-5.4 31.6m-20 82.1h13.9",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M106.2 142.1c-3-.5-18.8-2.7-36.2.2a.6.6 0 0 0-.6.7v3a.6.6 0 0 0 .8.6c3.3-.5 17-2.4 35.6-.3.4 0 .7-.2.7-.5.2-1.4.2-2.5.2-3a.6.6 0 0 0-.5-.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M96.4 145.3v-5.1a.8.8 0 0 0-.8-.9 114.1 114.1 0 0 0-8.1 0 .8.8 0 0 0-.9.8v5.1c0 .5.4.9.9.9h8a.8.8 0 0 0 .9-.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M95.2 144.3v-3.2a.7.7 0 0 0-.6-.7h-6.1a.7.7 0 0 0-.6.7v3.2c0 .4.3.7.6.7h6c.4 0 .7-.3.7-.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M90.1 273.5h12.8m-11.7-3.7v6.3m-.3-12.6v4.5m-.5-97.6 1 46.4s.7 1.6-.3 2.8c-.9 1.1 2.6.7 1 2.3-1.7 1.6.9 1.2 0 3.5-.6 1.6-1 22-1.2 36.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M73.7 98.7 76 103s2 .8 1.8 2.7l.8 2.2m-14.3 8.7c.2-1 2.2-7.1 12.6-10.5m.7-16s7.7 6 16.5 2.7",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M92 87s5.5-.9 7.5-4.6c1.3-.3.8 2.2-.3 3.7l-1 1.5s.2.3.2.9c0 .6-.2.6-.3 1v1l-.4 1c-.1.2 0 .6-.2.9-.2.4-1.6 1.8-2.6 2.8-3.8 3.6-5 1.7-6-.4-1-1.8-.7-5.1-.9-6.9-.3-2.9-2.6-3-2-4.4.4-.7 3 .7 3.4 1.8.7 2 2.9 1.8 2.6 1.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M99.8 82.4c-.5.1-.3.3-1 1.3-.6 1-4.8 2.9-6.4 3.2-2.5.5-2.2-1.6-4.2-2.9-1.7-1-3.6-.6-1.4 1.4 1 1 1 1.1 1.4 3.2.3 1.5-.7 3.7.7 5.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E59788",
- d: "M79.5 108.7c-2 2.9-4.2 6.1-5.5 8.7",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M87.7 124.8s-2-2-5.1-2.8c-3-.7-3.6-.1-5.5.1-2 .3-4-.9-3.7.7.3 1.7 5 1 5.2 2.1.2 1.1-6.3 2.8-8.3 2.2-.8.8.5 1.9 2 2.2.3 1.5 2.3 1.5 2.3 1.5s.7 1 2.6 1.1c2.5 1.3 9-.7 11-1.5 2-.9-.5-5.6-.5-5.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E59788",
- d: "M73.4 122.8s.7 1.2 3.2 1.4c2.3.3 2.6.6 2.6.6s-2.6 3-9.1 2.3m2.3 2.2s3.8 0 5-.7m-2.4 2.2s2 0 3.3-.6m-1 1.7s1.7 0 2.8-.5m-6.8-9s-.6-1.1 1.3-.5c1.7.5 2.8 0 5.1.1 1.4.1 3-.2 4 .2 1.6.8 3.6 2.2 3.6 2.2s10.6 1.2 19-1.1M79 108s-8.4 2.8-13.2 12.1",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M109.3 112.5s3.4-3.6 7.6-4.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E59788",
- d: "M107.4 123s9.7-2.7 11.4-.9",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#BFCDDD",
- d: "m194.6 83.7 4-4M187.2 91l3.7-3.6m.9-3-4.5-4.7m11.2 11.5-4.2-4.3m-65 76.3 3.7-3.7M122.3 170l3.5-3.5m.8-2.9-4.3-4.2M133 170l-4-4",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A3B4C6",
- d: "M190.2 211.8h-1.6a4 4 0 0 1-4-4v-32.1a4 4 0 0 1 4-4h1.6a4 4 0 0 1 4 4v32a4 4 0 0 1-4 4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A3B4C6",
- d: "M237.8 213a4.8 4.8 0 0 1-4.8 4.8h-86.6a4.8 4.8 0 0 1 0-9.6H233a4.8 4.8 0 0 1 4.8 4.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A3B4C6",
- d: "M154.1 190.1h70.5v-84.6h-70.5z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#BFCDDD",
- d: "M225 190.1h-71.2a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.2v19a3.2 3.2 0 0 1-3.2 3.2m0-59.3h-71.1a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.3v19a3.2 3.2 0 0 1-3.2 3.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M159.6 120.5a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8v-3.2c0-.4.3-.8.8-.8h22.4c.5 0 .8.4.8.8v3.2c0 .5-.3.8-.8.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#BFCDDD",
- d: "M225 160.5h-71.2a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.2v19a3.2 3.2 0 0 1-3.2 3.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#7C90A5",
- d: "M173.5 130.8h49.3m-57.8 0h6m-15 0h6.7m11.1 29.8h49.3m-57.7 0h6m-15.8 0h6.7",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M159.6 151a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8V147c0-.4.3-.8.8-.8h22.4c.5 0 .8.4.8.8v3.2c0 .5-.3.8-.8.8m-63 29a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.5 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8V176c0-.5.3-.8.8-.8h22.4c.5 0 .8.3.8.8v3.2c0 .4-.3.8-.8.8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#BFCDDD",
- d: "M203 221.1h-27.3a2.4 2.4 0 0 1-2.4-2.4v-11.4a2.4 2.4 0 0 1 2.4-2.5H203a2.4 2.4 0 0 1 2.4 2.5v11.4a2.4 2.4 0 0 1-2.4 2.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#A3B4C6",
- d: "M177.3 207.2v11.5m23.8-11.5v11.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#5BA02E",
- d: "M162.9 267.9a9.4 9.4 0 0 1-9.4-9.4v-14.8a9.4 9.4 0 0 1 18.8 0v14.8a9.4 9.4 0 0 1-9.4 9.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#92C110",
- d: "M171.2 267.8a9.4 9.4 0 0 1-9.4-9.4V255a9.4 9.4 0 0 1 18.8 0v3.4a9.4 9.4 0 0 1-9.4 9.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F2D7AD",
- d: "M181.3 293.7h-27.7a3.2 3.2 0 0 1-3.2-3.2v-20.7a3.2 3.2 0 0 1 3.2-3.2h27.7a3.2 3.2 0 0 1 3.2 3.2v20.7a3.2 3.2 0 0 1-3.2 3.2"
- }))));
- /* harmony default export */ var serverError = (ServerError);
- // EXTERNAL MODULE: ./components/result/style/index.ts
- var result_style = __webpack_require__("./components/result/style/index.ts");
- ;// ./components/result/unauthorized.tsx
- const Unauthorized = () => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("svg", {
- width: "251",
- height: "294"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("title", null, "Unauthorized"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("g", {
- fill: "none",
- fillRule: "evenodd"
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#E4EBF7",
- d: "M0 129v-2C0 58.3 55.6 2.7 124.2 2.7h2c68.6 0 124.2 55.6 124.2 124.1v2.1c0 68.6-55.6 124.2-124.1 124.2h-2.1A124.2 124.2 0 0 1 0 129"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M41.4 133a8.2 8.2 0 1 1-16.4-1.7 8.2 8.2 0 0 1 16.4 1.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m38.7 136.4 10.4 5.9m.9 6.2-12.6 10.7",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M41.5 161.3a5.6 5.6 0 1 1-11.2-1.2 5.6 5.6 0 0 1 11.2 1.2m17.7-16a5.7 5.7 0 1 1-11.3-1.2 5.7 5.7 0 0 1 11.3 1.2m41.2-115.8H130a4.6 4.6 0 1 0 0-9.1h-29.6a4.6 4.6 0 0 0 0 9.1m11.3 18.3h29.7a4.6 4.6 0 1 0 0-9.2h-29.7a4.6 4.6 0 1 0 0 9.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M114 29.5h15.8a4.6 4.6 0 1 0 0 9.1H114a4.6 4.6 0 0 0 0-9.1m71.3 108.2a10 10 0 1 1-19.8-2 10 10 0 0 1 19.8 2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m180.2 143.8 12.5 7.1m1.1 7.5-15.1 13",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M185.6 172a6.8 6.8 0 1 1-13.6-1.4 6.8 6.8 0 0 1 13.5 1.3m18.6-16.6a6.8 6.8 0 1 1-13.6-1.4 6.8 6.8 0 0 1 13.6 1.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "M153 194a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm73-75.8a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.4 0zm-9 34.9a2.2 2.2 0 1 1-4.3 0 2.2 2.2 0 0 1 4.4 0zm-39.2-43.3a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm18.3-15.3a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm6.7 88a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0z",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#FFF",
- d: "m215.1 155.3-1.9 20-10.8 6m-27.8-4.7-6.3 9.8H157l-4.5 6.4m23.4-65.5v-15.7m45.6 7.8-12.8 7.9-15.2-7.9V96.7",
- strokeWidth: "2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A26EF4",
- d: "M180.7 29.3a29.3 29.3 0 1 1 58.6 0 29.3 29.3 0 0 1-58.6 0"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "m221.4 41.7-21.5-.1a1.7 1.7 0 0 1-1.7-1.8V27.6a1.7 1.7 0 0 1 1.8-1.7h21.5c1 0 1.8.9 1.8 1.8l-.1 12.3a1.7 1.7 0 0 1-1.7 1.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M215.1 29.2c0 2.6-2 4.6-4.5 4.6a4.6 4.6 0 0 1-4.5-4.7v-6.9c0-2.6 2-4.6 4.6-4.6 2.5 0 4.5 2 4.4 4.7v6.9zm-4.5-14a6.9 6.9 0 0 0-7 6.8v7.3a6.9 6.9 0 0 0 13.8.1V22a6.9 6.9 0 0 0-6.8-6.9zm-43 53.2h-4a4.7 4.7 0 0 1-4.7-4.8 4.7 4.7 0 0 1 4.7-4.7h4a4.7 4.7 0 0 1 4.7 4.8 4.7 4.7 0 0 1-4.7 4.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#5BA02E",
- d: "M168.2 248.8a6.6 6.6 0 0 1-6.6-6.6v-66a6.6 6.6 0 0 1 13.2 0v66a6.6 6.6 0 0 1-6.6 6.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#92C110",
- d: "M176.1 248.2a6.6 6.6 0 0 1-6.6-6.6v-33a6.6 6.6 0 1 1 13.3 0v33a6.6 6.6 0 0 1-6.7 6.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#F2D7AD",
- d: "M186 293.9h-27.4a3.2 3.2 0 0 1-3.2-3.2v-45.9a3.2 3.2 0 0 1 3.2-3.1H186a3.2 3.2 0 0 1 3.2 3.1v46a3.2 3.2 0 0 1-3.2 3"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M82 147.7s6.3-1 17.5-1.3c11.8-.4 17.6 1 17.6 1s3.7-3.8 1-8.3c1.3-12.1 6-32.9.3-48.3-1.1-1.4-3.7-1.5-7.5-.6-1.4.3-7.2-.2-8-.1l-15.3-.4-8-.5c-1.6-.1-4.3-1.7-5.5-.3-.4.4-2.4 5.6-2 16l8.7 35.7s-3.2 3.6 1.2 7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m75.8 73.3-1-6.4 12-6.5s7.4-.1 8 1.2c.8 1.3-5.5 1-5.5 1s-1.9 1.4-2.6 2.5c-1.7 2.4-1 6.5-8.4 6-1.7.3-2.5 2.2-2.5 2.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFB594",
- d: "M52.4 77.7S66.7 87 77.4 92c1 .5-2 16.2-11.9 11.8-7.4-3.3-20.1-8.4-21.5-14.5-.7-3.2 2.6-7.6 8.4-11.7M142 80s-6.7 3-13.9 6.9c-3.9 2.1-10.1 4.7-12.3 8-6.2 9.3 3.5 11.2 13 7.5 6.6-2.7 29-12.1 13.2-22.4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m76.2 66.4 3 3.8S76.4 73 73 76c-7 6.2-12.8 14.3-16 16.4-4 2.7-9.7 3.3-12.2 0-3.5-5.1.5-14.7 31.5-26"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M64.7 85.1s-2.4 8.4-9 14.5c.7.5 18.6 10.5 22.2 10 5.2-.6 6.4-19 1.2-20.5-.8-.2-6-1.3-8.9-2.2-.9-.2-1.6-1.7-3.5-1l-2-.8zm63.7.7s5.3 2 7.3 13.8c-.6.2-17.6 12.3-21.8 7.8-6.6-7-.8-17.4 4.2-18.6 4.7-1.2 5-1.4 10.3-3"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M78.2 94.7s.9 7.4-5 13",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M87.4 94.7s3.1 2.6 10.3 2.6c7.1 0 9-3.5 9-3.5",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".9"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m117.2 68.6-6.8-6.1s-5.4-4.4-9.2-1c-3.9 3.5 4.4 2.2 5.6 4.2 1.2 2.1.9 1.2-2 .5-5.7-1.4-2.1.9 3 5.3 2 1.9 7 1 7 1l2.4-3.9z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFB594",
- d: "m105.3 91.3-.3-11H89l-.5 10.5c0 .4.2.8.6 1 2 1.3 9.3 5 15.8.4.2-.2.4-.5.4-.9"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#5C2552",
- d: "M107.6 74.2c.8-1.1 1-9 1-11.9a1 1 0 0 0-1-1l-4.6-.4c-7.7-1-17 .6-18.3 6.3-5.4 5.9-.4 13.3-.4 13.3s2 3.5 4.3 6.8c.8 1 .4-3.8 3-6a47.9 47.9 0 0 1 16-7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "M88.4 83.2s2.7 6.2 11.6 6.5c7.8.3 9-7 7.5-17.5l-1-5.5c-6-2.9-15.4.6-15.4.6s-.6 2-.2 5.5c-2.3 2-1.8 5.6-1.8 5.6s-1-2-2-2.3c-.9-.3-2 0-2.3 2-1 4.6 3.6 5.1 3.6 5.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "m100.8 77.1 1.7-1-1-4.3.7-1.4",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#552950",
- d: "M105.5 74c0 .8-.4 1.4-1 1.4-.4 0-.8-.7-.8-1.4s.5-1.2 1-1.2.9.6.8 1.3m-8 .2c0 .8-.4 1.3-.9 1.3s-.9-.6-.9-1.3c0-.7.5-1.3 1-1.3s1 .6.9 1.3"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M91.1 86.8s5.3 5 12.7 2.3",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#DB836E",
- d: "M99.8 81.9s-3.6.2-1.5-2.8c1.6-1.5 5-.4 5-.4s1 3.9-3.5 3.2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#5C2552",
- d: "M102.9 70.6s2.5.8 3.4.7m-12.4.7s2.5-1.2 4.8-1.1",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.5"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M86.3 77.4s1 .9 1.5 2c-.4.6-1 1.2-.3 1.9m11.8 2.4s2 .2 2.5-.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "m87.8 115.8 15.7-3m-3.3 3 10-2m-43.7-27s-1.6 8.8-6.7 14M128.3 88s3 4 4 11.7",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M64 84.8s-6 10-13.5 10",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFC6A0",
- d: "m112.4 66-.2 5.2 12 9.2c4.5 3.6 8.9 7.5 11 8.7 4.8 2.8 8.9 3.3 11 1.8 4.1-2.9 4.4-9.9-8.1-15.3-4.3-1.8-16.1-6.3-25.7-9.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#DB836E",
- d: "M130.5 85.5s4.6 5.7 11.7 6.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: ".8"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#E4EBF7",
- d: "M121.7 105.7s-.4 8.6-1.3 13.6",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M115.8 161.5s-3.6-1.5-2.7-7.1",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M101.5 290.2s4.3 2.1 7.4 1c2.9-.9 4.6.7 7.2 1.3 2.5.5 6.9 1 11.7-1.3 0-5.6-7-4-12-6.8-2.6-1.4-3.8-4.7-3.6-8.8h-9.5s-1.4 10.6-1.2 14.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M101.5 290s2.4 1.4 6.8.7c3-.4 3.7.5 7.5 1 3.7.6 10.8 0 11.9-.8.4 1-.4 2-.4 2s-1.5.7-4.8.9c-2 .1-5.8.3-7.7-.5-1.8-1.4-5.2-2-5.7-.3-4 1-7.4-.3-7.4-.3l-.2-2.6z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M108.8 276.2h3.1s0 6.7 4.6 8.6c-4.7.6-8.6-2.3-7.7-8.6"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#CBD1D1",
- d: "M57.6 272.5s-2 7.5-4.5 12.4c-1.8 3.7-4.2 7.6 5.5 7.6 6.7 0 9-.5 7.5-6.7-1.5-6.1.3-13.3.3-13.3h-8.8z"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#2B0849",
- d: "M51.5 290s2.2 1.2 6.7 1.2c6.1 0 8.3-1.6 8.3-1.6s.6 1-.6 2.1c-1 .9-3.6 1.6-7.4 1.6-4.2 0-6-.6-6.8-1.2-.9-.5-.7-1.6-.2-2"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#A4AABA",
- d: "M58.5 274.4s0 1.6-.3 3-1 3.1-1.1 4.2c0 1.1 4.5 1.5 5.2 0 .6-1.6 1.3-6.5 1.9-7.3.6-.8-5-2.1-5.7.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#7BB2F9",
- d: "m100.9 277 13.3.1s1.3-54.2 1.8-64c.6-9.9 3.8-43.2 1-62.8l-12.4-.7-22.8.8-1.2 10c0 .4-.6.8-.7 1.3 0 .6.4 1.3.3 2-2.3 14-6.3 32.9-8.7 46.4-.1.6-1.2 1-1.4 2.6 0 .3.2 1.6 0 1.8-6.8 18.7-10.8 47.6-14.1 61.6h14.5s2.2-8.6 4-17a3984 3984 0 0 1 23-84.5l3-.5 1 46.1s-.2 1.2.4 2c.5.8-.6 1.1-.4 2.3l.4 1.7-1 11.9c-.4 4.6 0 39 0 39"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M77.4 220.4c1.2.1 4-2 7-4.9m23.1 8.4s2.8-1 6.1-3.8",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M108.5 221s2.7-1.2 6-4",
- strokeLinecap: "round",
- strokeLinejoin: "round"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M76.1 223.6s2.6-.6 6.5-3.4m4.7-69.4c-.2 3.1.3 8.5-4.3 9m21.8-10.7s.1 14-1.3 15c-2.2 1.6-3 1.9-3 1.9m.5-16.4s0 12.8-1.2 24.3m-4.9 1s7.2-1.6 9.4-1.6m-28.6 31.5-1 4.5s-1.5 1.8-1 3.7c.4 2-1 2-5 15.3-1.7 5.6-4.4 18.5-6.3 27.5l-4 18.4M77 196.7a313.3 313.3 0 0 1-.8 4.8m7.7-50-1.2 10.3s-1 .2-.5 2.3c.1 1.3-2.6 15.6-5.1 30.2M57.6 273h13.2",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M117.4 147.4s-17-3-35.7.2v4.2s14.6-2.9 35.5-.4l.2-4"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#FFF",
- d: "M107.5 150.4v-5a.8.8 0 0 0-.8-.7H99a.8.8 0 0 0-.7.8v4.8c0 .5.3.9.8.8a140.8 140.8 0 0 1 7.7 0 .8.8 0 0 0 .8-.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- fill: "#192064",
- d: "M106.4 149.4v-3a.6.6 0 0 0-.6-.7 94.1 94.1 0 0 0-5.8 0 .6.6 0 0 0-.7.7v3c0 .4.3.7.7.7h5.7c.4 0 .7-.3.7-.7"
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("path", {
- stroke: "#648BD8",
- d: "M101.5 274h12.3m-11.1-5v6.5m0-12.4v4.3m-.5-93.4.9 44.4s.7 1.6-.2 2.7c-1 1.1 2.4.7.9 2.2-1.6 1.6.9 1.1 0 3.4-.6 1.5-1 21-1.1 35",
- strokeLinecap: "round",
- strokeLinejoin: "round",
- strokeWidth: "1.1"
- }))));
- /* harmony default export */ var unauthorized = (Unauthorized);
- ;// ./components/result/index.tsx
- const IconMap = {
- success: icons_CheckCircleFilled,
- error: icons_CloseCircleFilled,
- info: icons_ExclamationCircleFilled,
- warning: icons_WarningFilled
- };
- const ExceptionMap = {
- '404': noFound,
- '500': serverError,
- '403': unauthorized
- };
- // ExceptionImageMap keys
- const ExceptionStatus = Object.keys(ExceptionMap);
- const result_Icon = ({
- prefixCls,
- icon,
- status
- }) => {
- const className = classnames_default()(`${prefixCls}-icon`);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Result');
- true ? warning(!(typeof icon === 'string' && icon.length > 2), 'breaking', `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`) : 0;
- }
- if (ExceptionStatus.includes(`${status}`)) {
- const SVGComponent = ExceptionMap[status];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${className} ${prefixCls}-image`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(SVGComponent, null));
- }
- const iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(IconMap[status]);
- if (icon === null || icon === false) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className
- }, icon || iconNode);
- };
- const Extra = ({
- prefixCls,
- extra
- }) => {
- if (!extra) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-extra`
- }, extra);
- };
- const Result = ({
- prefixCls: customizePrefixCls,
- className: customizeClassName,
- rootClassName,
- subTitle,
- title,
- style,
- children,
- status = 'info',
- icon,
- extra
- }) => {
- const {
- getPrefixCls,
- direction,
- result
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('result', customizePrefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,result_style["default"])(prefixCls);
- const className = classnames_default()(prefixCls, `${prefixCls}-${status}`, customizeClassName, result === null || result === void 0 ? void 0 : result.className, rootClassName, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.style), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className,
- style: mergedStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(result_Icon, {
- prefixCls: prefixCls,
- status: status,
- icon: icon
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-title`
- }, title), subTitle && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-subtitle`
- }, subTitle), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Extra, {
- prefixCls: prefixCls,
- extra: extra
- }), children && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-content`
- }, children)));
- };
- Result.PRESENTED_IMAGE_403 = ExceptionMap['403'];
- Result.PRESENTED_IMAGE_404 = ExceptionMap['404'];
- Result.PRESENTED_IMAGE_500 = ExceptionMap['500'];
- if (true) {
- Result.displayName = 'Result';
- }
- /* harmony default export */ var result = (Result);
- ;// ./components/row/index.tsx
- /* harmony default export */ var components_row = (row);
- ;// ./components/statistic/Number.tsx
- const StatisticNumber = props => {
- const {
- value,
- formatter,
- precision,
- decimalSeparator,
- groupSeparator = '',
- prefixCls
- } = props;
- let valueNode;
- if (typeof formatter === 'function') {
- // Customize formatter
- valueNode = formatter(value);
- } else {
- // Internal formatter
- const val = String(value);
- const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
- // Process if illegal number
- if (!cells || val === '-') {
- valueNode = val;
- } else {
- const negative = cells[1];
- let int = cells[2] || '0';
- let decimal = cells[4] || '';
- int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
- if (typeof precision === 'number') {
- decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
- }
- if (decimal) {
- decimal = `${decimalSeparator}${decimal}`;
- }
- valueNode = [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: "int",
- className: `${prefixCls}-content-value-int`
- }, negative, int), decimal && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: "decimal",
- className: `${prefixCls}-content-value-decimal`
- }, decimal))];
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-content-value`
- }, valueNode);
- };
- /* harmony default export */ var statistic_Number = (StatisticNumber);
- // EXTERNAL MODULE: ./components/statistic/style/index.ts
- var statistic_style = __webpack_require__("./components/statistic/style/index.ts");
- ;// ./components/statistic/Statistic.tsx
- var Statistic_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Statistic = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- valueStyle,
- value = 0,
- title,
- valueRender,
- prefix,
- suffix,
- loading = false,
- /* --- FormatConfig starts --- */
- formatter,
- precision,
- decimalSeparator = '.',
- groupSeparator = ',',
- /* --- FormatConfig starts --- */
- onMouseEnter,
- onMouseLeave
- } = props,
- rest = Statistic_rest(props, ["prefixCls", "className", "rootClassName", "style", "valueStyle", "value", "title", "valueRender", "prefix", "suffix", "loading", "formatter", "precision", "decimalSeparator", "groupSeparator", "onMouseEnter", "onMouseLeave"]);
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('statistic');
- const prefixCls = getPrefixCls('statistic', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,statistic_style["default"])(prefixCls);
- const valueNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(statistic_Number, {
- decimalSeparator: decimalSeparator,
- groupSeparator: groupSeparator,
- prefixCls: prefixCls,
- formatter: formatter,
- precision: precision,
- value: value
- });
- const cls = classnames_default()(prefixCls, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, contextClassName, className, rootClassName, hashId, cssVarCls);
- const internalRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- nativeElement: internalRef.current
- }));
- const restProps = (0,pickAttrs["default"])(rest, {
- aria: true,
- data: true
- });
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", Object.assign({}, restProps, {
- ref: internalRef,
- className: cls,
- style: Object.assign(Object.assign({}, contextStyle), style),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave
- }), title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-title`
- }, title), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(skeleton, {
- paragraph: false,
- loading: loading,
- className: `${prefixCls}-skeleton`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: valueStyle,
- className: `${prefixCls}-content`
- }, prefix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-content-prefix`
- }, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-content-suffix`
- }, suffix)))));
- });
- if (true) {
- Statistic.displayName = 'Statistic';
- }
- /* harmony default export */ var statistic_Statistic = (Statistic);
- ;// ./components/statistic/utils.ts
- // Countdown
- const timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365],
- // years
- ['M', 1000 * 60 * 60 * 24 * 30],
- // months
- ['D', 1000 * 60 * 60 * 24],
- // days
- ['H', 1000 * 60 * 60],
- // hours
- ['m', 1000 * 60],
- // minutes
- ['s', 1000],
- // seconds
- ['S', 1] // million seconds
- ];
- function formatTimeStr(duration, format) {
- let leftDuration = duration;
- const escapeRegex = /\[[^\]]*]/g;
- const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
- const templateText = format.replace(escapeRegex, '[]');
- const replacedText = timeUnits.reduce((current, [name, unit]) => {
- if (current.includes(name)) {
- const value = Math.floor(leftDuration / unit);
- leftDuration -= value * unit;
- return current.replace(new RegExp(`${name}+`, 'g'), match => {
- const len = match.length;
- return value.toString().padStart(len, '0');
- });
- }
- return current;
- }, templateText);
- let index = 0;
- return replacedText.replace(escapeRegex, () => {
- const match = keepList[index];
- index += 1;
- return match;
- });
- }
- function formatCounter(value, config, down) {
- const {
- format = ''
- } = config;
- const target = new Date(value).getTime();
- const current = Date.now();
- const diff = down ? Math.max(target - current, 0) : Math.max(current - target, 0);
- return formatTimeStr(diff, format);
- }
- ;// ./components/statistic/Timer.tsx
- var Timer_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getTime(value) {
- return new Date(value).getTime();
- }
- const StatisticTimer = props => {
- const {
- value,
- format = 'HH:mm:ss',
- onChange,
- onFinish,
- type
- } = props,
- rest = Timer_rest(props, ["value", "format", "onChange", "onFinish", "type"]);
- const down = type === 'countdown';
- // We reuse state here to do same as `forceUpdate`
- const [showTime, setShowTime] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- // ======================== Update ========================
- const update = (0,rc_util_es.useEvent)(() => {
- const now = Date.now();
- const timestamp = getTime(value);
- setShowTime({});
- const timeDiff = !down ? now - timestamp : timestamp - now;
- onChange === null || onChange === void 0 ? void 0 : onChange(timeDiff);
- // Only countdown will trigger `onFinish`
- if (down && timestamp < now) {
- onFinish === null || onFinish === void 0 ? void 0 : onFinish();
- return false;
- }
- return true;
- });
- // Effect trigger
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- let rafId;
- const clear = () => raf["default"].cancel(rafId);
- const rafUpdate = () => {
- rafId = (0,raf["default"])(() => {
- if (update()) {
- rafUpdate();
- }
- });
- };
- rafUpdate();
- return clear;
- }, [value, down]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setShowTime({});
- }, []);
- // ======================== Format ========================
- const formatter = (formatValue, config) => showTime ? formatCounter(formatValue, Object.assign(Object.assign({}, config), {
- format
- }), down) : '-';
- const valueRender = node => (0,reactNode.cloneElement)(node, {
- title: undefined
- });
- // ======================== Render ========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(statistic_Statistic, Object.assign({}, rest, {
- value: value,
- valueRender: valueRender,
- formatter: formatter
- }));
- };
- /* harmony default export */ var Timer = (StatisticTimer);
- ;// ./components/statistic/Countdown.tsx
- const Countdown = props => {
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Countdown');
- warning.deprecated(false, '<Statistic.Countdown />', '<Statistic.Timer type="countdown" />');
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Timer, Object.assign({}, props, {
- type: "countdown"
- }));
- };
- /* harmony default export */ var statistic_Countdown = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(Countdown));
- ;// ./components/statistic/index.tsx
- statistic_Statistic.Timer = Timer;
- statistic_Statistic.Countdown = statistic_Countdown;
- /* harmony default export */ var statistic = (statistic_Statistic);
- ;// ./node_modules/rc-steps/es/Step.js
- var Step_excluded = ["className", "prefixCls", "style", "active", "status", "iconPrefix", "icon", "wrapperStyle", "stepNumber", "disabled", "description", "title", "subTitle", "progressDot", "stepIcon", "tailContent", "icons", "stepIndex", "onStepClick", "onClick", "render"];
- /* eslint react/prop-types: 0 */
- function Step_isString(str) {
- return typeof str === 'string';
- }
- function Step(props) {
- var _classNames2;
- var className = props.className,
- prefixCls = props.prefixCls,
- style = props.style,
- active = props.active,
- status = props.status,
- iconPrefix = props.iconPrefix,
- icon = props.icon,
- wrapperStyle = props.wrapperStyle,
- stepNumber = props.stepNumber,
- disabled = props.disabled,
- description = props.description,
- title = props.title,
- subTitle = props.subTitle,
- progressDot = props.progressDot,
- stepIcon = props.stepIcon,
- tailContent = props.tailContent,
- icons = props.icons,
- stepIndex = props.stepIndex,
- onStepClick = props.onStepClick,
- onClick = props.onClick,
- render = props.render,
- restProps = (0,objectWithoutProperties["default"])(props, Step_excluded);
- // ========================= Click ==========================
- var clickable = !!onStepClick && !disabled;
- var accessibilityProps = {};
- if (clickable) {
- accessibilityProps.role = 'button';
- accessibilityProps.tabIndex = 0;
- accessibilityProps.onClick = function (e) {
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
- onStepClick(stepIndex);
- };
- accessibilityProps.onKeyDown = function (e) {
- var which = e.which;
- if (which === KeyCode["default"].ENTER || which === KeyCode["default"].SPACE) {
- onStepClick(stepIndex);
- }
- };
- }
- // ========================= Render =========================
- var renderIconNode = function renderIconNode() {
- var _classNames;
- var iconNode;
- var iconClassName = classnames_default()("".concat(prefixCls, "-icon"), "".concat(iconPrefix, "icon"), (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(iconPrefix, "icon-").concat(icon), icon && Step_isString(icon)), (0,defineProperty["default"])(_classNames, "".concat(iconPrefix, "icon-check"), !icon && status === 'finish' && (icons && !icons.finish || !icons)), (0,defineProperty["default"])(_classNames, "".concat(iconPrefix, "icon-cross"), !icon && status === 'error' && (icons && !icons.error || !icons)), _classNames));
- var iconDot = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon-dot")
- });
- // `progressDot` enjoy the highest priority
- if (progressDot) {
- if (typeof progressDot === 'function') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, progressDot(iconDot, {
- index: stepNumber - 1,
- status: status,
- title: title,
- description: description
- }));
- } else {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, iconDot);
- }
- } else if (icon && !Step_isString(icon)) {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, icon);
- } else if (icons && icons.finish && status === 'finish') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, icons.finish);
- } else if (icons && icons.error && status === 'error') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, icons.error);
- } else if (icon || status === 'finish' || status === 'error') {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: iconClassName
- });
- } else {
- iconNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-icon")
- }, stepNumber);
- }
- if (stepIcon) {
- iconNode = stepIcon({
- index: stepNumber - 1,
- status: status,
- title: title,
- description: description,
- node: iconNode
- });
- }
- return iconNode;
- };
- var mergedStatus = status || 'wait';
- var classString = classnames_default()("".concat(prefixCls, "-item"), "".concat(prefixCls, "-item-").concat(mergedStatus), className, (_classNames2 = {}, (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-item-custom"), icon), (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-item-active"), active), (0,defineProperty["default"])(_classNames2, "".concat(prefixCls, "-item-disabled"), disabled === true), _classNames2));
- var stepItemStyle = (0,objectSpread2["default"])({}, style);
- var stepNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({}, restProps, {
- className: classString,
- style: stepItemStyle
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- onClick: onClick
- }, accessibilityProps, {
- className: "".concat(prefixCls, "-item-container")
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-tail")
- }, tailContent), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-icon")
- }, renderIconNode()), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-content")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-title")
- }, title, subTitle && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- title: typeof subTitle === 'string' ? subTitle : undefined,
- className: "".concat(prefixCls, "-item-subtitle")
- }, subTitle)), description && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-item-description")
- }, description))));
- if (render) {
- stepNode = render(stepNode) || null;
- }
- return stepNode;
- }
- /* harmony default export */ var es_Step = (Step);
- ;// ./node_modules/rc-steps/es/Steps.js
- var Steps_excluded = ["prefixCls", "style", "className", "children", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "stepIcon", "initial", "icons", "onChange", "itemRender", "items"];
- /* eslint react/no-did-mount-set-state: 0, react/prop-types: 0 */
- function es_Steps_Steps(props) {
- var _classNames;
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-steps' : _props$prefixCls,
- _props$style = props.style,
- style = _props$style === void 0 ? {} : _props$style,
- className = props.className,
- children = props.children,
- _props$direction = props.direction,
- direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
- _props$type = props.type,
- type = _props$type === void 0 ? 'default' : _props$type,
- _props$labelPlacement = props.labelPlacement,
- labelPlacement = _props$labelPlacement === void 0 ? 'horizontal' : _props$labelPlacement,
- _props$iconPrefix = props.iconPrefix,
- iconPrefix = _props$iconPrefix === void 0 ? 'rc' : _props$iconPrefix,
- _props$status = props.status,
- status = _props$status === void 0 ? 'process' : _props$status,
- size = props.size,
- _props$current = props.current,
- current = _props$current === void 0 ? 0 : _props$current,
- _props$progressDot = props.progressDot,
- progressDot = _props$progressDot === void 0 ? false : _props$progressDot,
- stepIcon = props.stepIcon,
- _props$initial = props.initial,
- initial = _props$initial === void 0 ? 0 : _props$initial,
- icons = props.icons,
- onChange = props.onChange,
- itemRender = props.itemRender,
- _props$items = props.items,
- items = _props$items === void 0 ? [] : _props$items,
- restProps = (0,objectWithoutProperties["default"])(props, Steps_excluded);
- var isNav = type === 'navigation';
- var isInline = type === 'inline';
- // inline type requires fixed progressDot direction size.
- var mergedProgressDot = isInline || progressDot;
- var mergedDirection = isInline ? 'horizontal' : direction;
- var mergedSize = isInline ? undefined : size;
- var adjustedLabelPlacement = mergedProgressDot ? 'vertical' : labelPlacement;
- var classString = classnames_default()(prefixCls, "".concat(prefixCls, "-").concat(mergedDirection), className, (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-").concat(mergedSize), mergedSize), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-label-").concat(adjustedLabelPlacement), mergedDirection === 'horizontal'), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-dot"), !!mergedProgressDot), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-navigation"), isNav), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-inline"), isInline), _classNames));
- var onStepClick = function onStepClick(next) {
- if (onChange && current !== next) {
- onChange(next);
- }
- };
- var renderStep = function renderStep(item, index) {
- var mergedItem = (0,objectSpread2["default"])({}, item);
- var stepNumber = initial + index;
- // fix tail color
- if (status === 'error' && index === current - 1) {
- mergedItem.className = "".concat(prefixCls, "-next-error");
- }
- if (!mergedItem.status) {
- if (stepNumber === current) {
- mergedItem.status = status;
- } else if (stepNumber < current) {
- mergedItem.status = 'finish';
- } else {
- mergedItem.status = 'wait';
- }
- }
- if (isInline) {
- mergedItem.icon = undefined;
- mergedItem.subTitle = undefined;
- }
- if (!mergedItem.render && itemRender) {
- mergedItem.render = function (stepItem) {
- return itemRender(mergedItem, stepItem);
- };
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Step, (0,esm_extends["default"])({}, mergedItem, {
- active: stepNumber === current,
- stepNumber: stepNumber + 1,
- stepIndex: stepNumber,
- key: stepNumber,
- prefixCls: prefixCls,
- iconPrefix: iconPrefix,
- wrapperStyle: style,
- progressDot: mergedProgressDot,
- stepIcon: stepIcon,
- icons: icons,
- onStepClick: onChange && onStepClick
- }));
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- className: classString,
- style: style
- }, restProps), items.filter(function (item) {
- return item;
- }).map(renderStep));
- }
- es_Steps_Steps.Step = es_Step;
- /* harmony default export */ var rc_steps_es_Steps = (es_Steps_Steps);
- ;// ./node_modules/rc-steps/es/index.js
- /* harmony default export */ var rc_steps_es = (rc_steps_es_Steps);
- // EXTERNAL MODULE: ./components/steps/style/index.ts + 10 modules
- var steps_style = __webpack_require__("./components/steps/style/index.ts");
- ;// ./components/steps/useLegacyItems.ts
- function useLegacyItems_filter(items) {
- return items.filter(item => item);
- }
- function useLegacyItems_useLegacyItems(items, children) {
- if (false) // removed by dead control flow
- {}
- if (items) {
- return items;
- }
- const childrenItems = (0,toArray["default"])(children).map(node => {
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node)) {
- const {
- props
- } = node;
- const item = Object.assign({}, props);
- return item;
- }
- return null;
- });
- return useLegacyItems_filter(childrenItems);
- }
- /* harmony default export */ var steps_useLegacyItems = (useLegacyItems_useLegacyItems);
- ;// ./components/steps/index.tsx
- var steps_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const steps_Steps = props => {
- const {
- percent,
- size: customizeSize,
- className,
- rootClassName,
- direction,
- items,
- responsive = true,
- current = 0,
- children,
- style
- } = props,
- restProps = steps_rest(props, ["percent", "size", "className", "rootClassName", "direction", "items", "responsive", "current", "children", "style"]);
- const {
- xs
- } = hooks_useBreakpoint(responsive);
- const {
- getPrefixCls,
- direction: rtlDirection,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('steps');
- const realDirectionValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => responsive && xs ? 'vertical' : direction, [xs, direction]);
- const size = (0,useSize["default"])(customizeSize);
- const prefixCls = getPrefixCls('steps', props.prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,steps_style["default"])(prefixCls);
- const isInline = props.type === 'inline';
- const iconPrefix = getPrefixCls('', props.iconPrefix);
- const mergedItems = steps_useLegacyItems(items, children);
- const mergedPercent = isInline ? undefined : percent;
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- const stepsClassName = classnames_default()(contextClassName, {
- [`${prefixCls}-rtl`]: rtlDirection === 'rtl',
- [`${prefixCls}-with-progress`]: mergedPercent !== undefined
- }, className, rootClassName, hashId, cssVarCls);
- const icons = {
- finish: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckOutlined, {
- className: `${prefixCls}-finish-icon`
- }),
- error: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CloseOutlined, {
- className: `${prefixCls}-error-icon`
- })
- };
- const stepIconRender = ({
- node,
- status
- }) => {
- if (status === 'process' && mergedPercent !== undefined) {
- // currently it's hard-coded, since we can't easily read the actually width of icon
- const progressWidth = size === 'small' ? 32 : 40;
- // iconWithProgress
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-progress-icon`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_progress, {
- type: "circle",
- percent: mergedPercent,
- size: progressWidth,
- strokeWidth: 4,
- format: () => null
- }), node);
- }
- return node;
- };
- const itemRender = (item, stepItem) => item.description ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- title: item.description
- }, stepItem) : stepItem;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_steps_es, Object.assign({
- icons: icons
- }, restProps, {
- style: mergedStyle,
- current: current,
- size: size,
- items: mergedItems,
- itemRender: isInline ? itemRender : undefined,
- stepIcon: stepIconRender,
- direction: realDirectionValue,
- prefixCls: prefixCls,
- iconPrefix: iconPrefix,
- className: stepsClassName
- })));
- };
- steps_Steps.Step = rc_steps_es.Step;
- if (true) {
- steps_Steps.displayName = 'Steps';
- }
- /* harmony default export */ var steps = (steps_Steps);
- ;// ./node_modules/rc-switch/es/index.js
- var rc_switch_es_excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
- var Switch = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (_ref, ref) {
- var _classNames;
- var _ref$prefixCls = _ref.prefixCls,
- prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,
- className = _ref.className,
- checked = _ref.checked,
- defaultChecked = _ref.defaultChecked,
- disabled = _ref.disabled,
- loadingIcon = _ref.loadingIcon,
- checkedChildren = _ref.checkedChildren,
- unCheckedChildren = _ref.unCheckedChildren,
- onClick = _ref.onClick,
- onChange = _ref.onChange,
- onKeyDown = _ref.onKeyDown,
- restProps = (0,objectWithoutProperties["default"])(_ref, rc_switch_es_excluded);
- var _useMergedState = (0,useMergedState["default"])(false, {
- value: checked,
- defaultValue: defaultChecked
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- innerChecked = _useMergedState2[0],
- setInnerChecked = _useMergedState2[1];
- function triggerChange(newChecked, event) {
- var mergedChecked = innerChecked;
- if (!disabled) {
- mergedChecked = newChecked;
- setInnerChecked(mergedChecked);
- onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);
- }
- return mergedChecked;
- }
- function onInternalKeyDown(e) {
- if (e.which === KeyCode["default"].LEFT) {
- triggerChange(false, e);
- } else if (e.which === KeyCode["default"].RIGHT) {
- triggerChange(true, e);
- }
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
- }
- function onInternalClick(e) {
- var ret = triggerChange(!innerChecked, e);
- // [Legacy] trigger onClick with value
- onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
- }
- var switchClassName = classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0,defineProperty["default"])(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", (0,esm_extends["default"])({}, restProps, {
- type: "button",
- role: "switch",
- "aria-checked": innerChecked,
- disabled: disabled,
- className: switchClassName,
- ref: ref,
- onKeyDown: onInternalKeyDown,
- onClick: onInternalClick
- }), loadingIcon, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-inner")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-inner-checked")
- }, checkedChildren), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-inner-unchecked")
- }, unCheckedChildren)));
- });
- Switch.displayName = 'Switch';
- /* harmony default export */ var rc_switch_es = (Switch);
- // EXTERNAL MODULE: ./components/switch/style/index.ts
- var switch_style = __webpack_require__("./components/switch/style/index.ts");
- ;// ./components/switch/index.tsx
- var switch_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalSwitch = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- size: customizeSize,
- disabled: customDisabled,
- loading,
- className,
- rootClassName,
- style,
- checked: checkedProp,
- value,
- defaultChecked: defaultCheckedProp,
- defaultValue,
- onChange
- } = props,
- restProps = switch_rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]);
- const [checked, setChecked] = (0,useMergedState["default"])(false, {
- value: checkedProp !== null && checkedProp !== void 0 ? checkedProp : value,
- defaultValue: defaultCheckedProp !== null && defaultCheckedProp !== void 0 ? defaultCheckedProp : defaultValue
- });
- const {
- getPrefixCls,
- direction,
- switch: SWITCH
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
- const prefixCls = getPrefixCls('switch', customizePrefixCls);
- const loadingIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-handle`
- }, loading && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, {
- className: `${prefixCls}-loading-icon`
- }));
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,switch_style["default"])(prefixCls);
- const mergedSize = (0,useSize["default"])(customizeSize);
- const classes = classnames_default()(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
- [`${prefixCls}-small`]: mergedSize === 'small',
- [`${prefixCls}-loading`]: loading,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
- const changeHandler = (...args) => {
- setChecked(args[0]);
- onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, args);
- };
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(wave, {
- component: "Switch",
- disabled: mergedDisabled
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_switch_es, Object.assign({}, restProps, {
- checked: checked,
- onChange: changeHandler,
- prefixCls: prefixCls,
- className: classes,
- style: mergedStyle,
- disabled: mergedDisabled,
- ref: ref,
- loadingIcon: loadingIcon
- }))));
- });
- const switch_Switch = InternalSwitch;
- switch_Switch.__ANT_SWITCH = true;
- if (true) {
- switch_Switch.displayName = 'Switch';
- }
- /* harmony default export */ var components_switch = (switch_Switch);
- ;// ./node_modules/rc-table/es/constant.js
- var EXPAND_COLUMN = {};
- var INTERNAL_HOOKS = 'rc-table-internal-hook';
- ;// ./node_modules/@rc-component/context/es/context.js
- function createContext(defaultValue) {
- var Context = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(undefined);
- var Provider = function Provider(_ref) {
- var value = _ref.value,
- children = _ref.children;
- var valueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(value);
- valueRef.current = value;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- return {
- getValue: function getValue() {
- return valueRef.current;
- },
- listeners: new Set()
- };
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 1),
- context = _React$useState2[0];
- (0,useLayoutEffect["default"])(function () {
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.unstable_batchedUpdates)(function () {
- context.listeners.forEach(function (listener) {
- listener(value);
- });
- });
- }, [value]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Context.Provider, {
- value: context
- }, children);
- };
- return {
- Context: Context,
- Provider: Provider,
- defaultValue: defaultValue
- };
- }
- /** e.g. useSelect(userContext) => user */
- /** e.g. useSelect(userContext, user => user.name) => user.name */
- /** e.g. useSelect(userContext, ['name', 'age']) => user { name, age } */
- /** e.g. useSelect(userContext, 'name') => user.name */
- function useContext(holder, selector) {
- var eventSelector = (0,useEvent["default"])(typeof selector === 'function' ? selector : function (ctx) {
- if (selector === undefined) {
- return ctx;
- }
- if (!Array.isArray(selector)) {
- return ctx[selector];
- }
- var obj = {};
- selector.forEach(function (key) {
- obj[key] = ctx[key];
- });
- return obj;
- });
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(holder === null || holder === void 0 ? void 0 : holder.Context);
- var _ref2 = context || {},
- listeners = _ref2.listeners,
- getValue = _ref2.getValue;
- var valueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- valueRef.current = eventSelector(context ? getValue() : holder === null || holder === void 0 ? void 0 : holder.defaultValue);
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState({}),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- forceUpdate = _React$useState4[1];
- (0,useLayoutEffect["default"])(function () {
- if (!context) {
- return;
- }
- function trigger(nextValue) {
- var nextSelectorValue = eventSelector(nextValue);
- if (!(0,isEqual["default"])(valueRef.current, nextSelectorValue, true)) {
- forceUpdate({});
- }
- }
- listeners.add(trigger);
- return function () {
- listeners.delete(trigger);
- };
- }, [context]);
- return valueRef.current;
- }
- ;// ./node_modules/@rc-component/context/es/Immutable.js
- /**
- * Create Immutable pair for `makeImmutable` and `responseImmutable`.
- */
- function createImmutable() {
- var ImmutableContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /**
- * Get render update mark by `makeImmutable` root.
- * Do not deps on the return value as render times
- * but only use for `useMemo` or `useCallback` deps.
- */
- function useImmutableMark() {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(ImmutableContext);
- }
- /**
- * Wrapped Component will be marked as Immutable.
- * When Component parent trigger render,
- * it will notice children component (use with `responseImmutable`) node that parent has updated.
- * @param Component Passed Component
- * @param triggerRender Customize trigger `responseImmutable` children re-render logic. Default will always trigger re-render when this component re-render.
- */
- function makeImmutable(Component, shouldTriggerRender) {
- var refAble = (0,es_ref.supportRef)(Component);
- var ImmutableComponent = function ImmutableComponent(props, ref) {
- var refProps = refAble ? {
- ref: ref
- } : {};
- var renderTimesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(0);
- var prevProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(props);
- // If parent has the context, we do not wrap it
- var mark = useImmutableMark();
- if (mark !== null) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, props, refProps));
- }
- if (
- // Always trigger re-render if not provide `notTriggerRender`
- !shouldTriggerRender || shouldTriggerRender(prevProps.current, props)) {
- renderTimesRef.current += 1;
- }
- prevProps.current = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(ImmutableContext.Provider, {
- value: renderTimesRef.current
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, props, refProps)));
- };
- if (true) {
- ImmutableComponent.displayName = "ImmutableRoot(".concat(Component.displayName || Component.name, ")");
- }
- return refAble ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ImmutableComponent) : ImmutableComponent;
- }
- /**
- * Wrapped Component with `React.memo`.
- * But will rerender when parent with `makeImmutable` rerender.
- */
- function responseImmutable(Component, propsAreEqual) {
- var refAble = (0,es_ref.supportRef)(Component);
- var ImmutableComponent = function ImmutableComponent(props, ref) {
- var refProps = refAble ? {
- ref: ref
- } : {};
- useImmutableMark();
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, props, refProps));
- };
- if (true) {
- ImmutableComponent.displayName = "ImmutableResponse(".concat(Component.displayName || Component.name, ")");
- }
- return refAble ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(ImmutableComponent), propsAreEqual) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(ImmutableComponent, propsAreEqual);
- }
- return {
- makeImmutable: makeImmutable,
- responseImmutable: responseImmutable,
- useImmutableMark: useImmutableMark
- };
- }
- ;// ./node_modules/@rc-component/context/es/index.js
- // For legacy usage, we export it directly
- var _createImmutable = createImmutable(),
- makeImmutable = _createImmutable.makeImmutable,
- responseImmutable = _createImmutable.responseImmutable,
- useImmutableMark = _createImmutable.useImmutableMark;
- ;// ./node_modules/rc-table/es/context/TableContext.js
- var TableContext_createImmutable = createImmutable(),
- TableContext_makeImmutable = TableContext_createImmutable.makeImmutable,
- TableContext_responseImmutable = TableContext_createImmutable.responseImmutable,
- TableContext_useImmutableMark = TableContext_createImmutable.useImmutableMark;
- var TableContext = createContext();
- /* harmony default export */ var context_TableContext = (TableContext);
- ;// ./node_modules/rc-table/es/hooks/useRenderTimes.js
- /* istanbul ignore file */
- function useRenderTimes(props, debug) {
- // Render times
- var timesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(0);
- timesRef.current += 1;
- // Props changed
- var propsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(props);
- var keys = [];
- Object.keys(props || {}).map(function (key) {
- var _propsRef$current;
- if ((props === null || props === void 0 ? void 0 : props[key]) !== ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current[key])) {
- keys.push(key);
- }
- });
- propsRef.current = props;
- // Cache keys since React rerender may cause it lost
- var keysRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- if (keys.length) {
- keysRef.current = keys;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useDebugValue(timesRef.current);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useDebugValue(keysRef.current.join(', '));
- if (debug) {
- console.log("".concat(debug, ":"), timesRef.current, keysRef.current);
- }
- return timesRef.current;
- }
- /* harmony default export */ var hooks_useRenderTimes = ( true ? useRenderTimes : 0);
- var RenderBlock = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(function () {
- var times = useRenderTimes();
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("h1", null, "Render Times: ", times);
- });
- if (true) {
- RenderBlock.displayName = 'RenderBlock';
- }
- ;// ./node_modules/rc-table/es/context/PerfContext.js
- // TODO: Remove when use `responsiveImmutable`
- var PerfContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- renderWithProps: false
- });
- /* harmony default export */ var context_PerfContext = (PerfContext);
- ;// ./node_modules/rc-table/es/utils/valueUtil.js
- var INTERNAL_KEY_PREFIX = 'RC_TABLE_KEY';
- function valueUtil_toArray(arr) {
- if (arr === undefined || arr === null) {
- return [];
- }
- return Array.isArray(arr) ? arr : [arr];
- }
- function getColumnsKey(columns) {
- var columnKeys = [];
- var keys = {};
- columns.forEach(function (column) {
- var _ref = column || {},
- key = _ref.key,
- dataIndex = _ref.dataIndex;
- var mergedKey = key || valueUtil_toArray(dataIndex).join('-') || INTERNAL_KEY_PREFIX;
- while (keys[mergedKey]) {
- mergedKey = "".concat(mergedKey, "_next");
- }
- keys[mergedKey] = true;
- columnKeys.push(mergedKey);
- });
- return columnKeys;
- }
- function validateValue(val) {
- return val !== null && val !== undefined;
- }
- function validNumberValue(value) {
- return typeof value === 'number' && !Number.isNaN(value);
- }
- ;// ./node_modules/rc-table/es/Cell/useCellRender.js
- function isRenderCell(data) {
- return data && (0,esm_typeof["default"])(data) === 'object' && !Array.isArray(data) && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(data);
- }
- function useCellRender_useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate) {
- // TODO: Remove this after next major version
- var perfRecord = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(context_PerfContext);
- var mark = TableContext_useImmutableMark();
- // ======================== Render ========================
- var retData = (0,useMemo["default"])(function () {
- if (validateValue(children)) {
- return [children];
- }
- var path = dataIndex === null || dataIndex === undefined || dataIndex === '' ? [] : Array.isArray(dataIndex) ? dataIndex : [dataIndex];
- var value = (0,get["default"])(record, path);
- // Customize render node
- var returnChildNode = value;
- var returnCellProps = undefined;
- if (render) {
- var renderData = render(value, record, renderIndex);
- if (isRenderCell(renderData)) {
- if (true) {
- (0,warning["default"])(false, '`columns.render` return cell props is deprecated with perf issue, please use `onCell` instead.');
- }
- returnChildNode = renderData.children;
- returnCellProps = renderData.props;
- perfRecord.renderWithProps = true;
- } else {
- returnChildNode = renderData;
- }
- }
- return [returnChildNode, returnCellProps];
- }, [
- // Force update deps
- mark,
- // Normal deps
- record, children, dataIndex, render, renderIndex], function (prev, next) {
- if (shouldCellUpdate) {
- var _prev = (0,slicedToArray["default"])(prev, 2),
- prevRecord = _prev[1];
- var _next = (0,slicedToArray["default"])(next, 2),
- nextRecord = _next[1];
- return shouldCellUpdate(nextRecord, prevRecord);
- }
- // Legacy mode should always update
- if (perfRecord.renderWithProps) {
- return true;
- }
- return !(0,isEqual["default"])(prev, next, true);
- });
- return retData;
- }
- ;// ./node_modules/rc-table/es/Cell/useHoverState.js
- /** Check if cell is in hover range */
- function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
- var cellEndRow = cellStartRow + cellRowSpan - 1;
- return cellStartRow <= endRow && cellEndRow >= startRow;
- }
- function useHoverState(rowIndex, rowSpan) {
- return useContext(context_TableContext, function (ctx) {
- var hovering = inHoverRange(rowIndex, rowSpan || 1, ctx.hoverStartRow, ctx.hoverEndRow);
- return [hovering, ctx.onHover];
- });
- }
- ;// ./node_modules/rc-table/es/Cell/index.js
- var getTitleFromCellRenderChildren = function getTitleFromCellRenderChildren(_ref) {
- var ellipsis = _ref.ellipsis,
- rowType = _ref.rowType,
- children = _ref.children;
- var title;
- var ellipsisConfig = ellipsis === true ? {
- showTitle: true
- } : ellipsis;
- if (ellipsisConfig && (ellipsisConfig.showTitle || rowType === 'header')) {
- if (typeof children === 'string' || typeof children === 'number') {
- title = children.toString();
- } else if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(children) && typeof children.props.children === 'string') {
- title = children.props.children;
- }
- }
- return title;
- };
- function Cell_Cell(props) {
- var _ref2, _ref3, _legacyCellProps$colS, _ref4, _ref5, _legacyCellProps$rowS, _additionalProps$titl, _classNames;
- if (true) {
- hooks_useRenderTimes(props);
- }
- var Component = props.component,
- children = props.children,
- ellipsis = props.ellipsis,
- scope = props.scope,
- prefixCls = props.prefixCls,
- className = props.className,
- align = props.align,
- record = props.record,
- render = props.render,
- dataIndex = props.dataIndex,
- renderIndex = props.renderIndex,
- shouldCellUpdate = props.shouldCellUpdate,
- index = props.index,
- rowType = props.rowType,
- colSpan = props.colSpan,
- rowSpan = props.rowSpan,
- fixLeft = props.fixLeft,
- fixRight = props.fixRight,
- firstFixLeft = props.firstFixLeft,
- lastFixLeft = props.lastFixLeft,
- firstFixRight = props.firstFixRight,
- lastFixRight = props.lastFixRight,
- appendNode = props.appendNode,
- _props$additionalProp = props.additionalProps,
- additionalProps = _props$additionalProp === void 0 ? {} : _props$additionalProp,
- isSticky = props.isSticky;
- var cellPrefixCls = "".concat(prefixCls, "-cell");
- var _useContext = useContext(context_TableContext, ['supportSticky', 'allColumnsFixedLeft', 'rowHoverable']),
- supportSticky = _useContext.supportSticky,
- allColumnsFixedLeft = _useContext.allColumnsFixedLeft,
- rowHoverable = _useContext.rowHoverable;
- // ====================== Value =======================
- var _useCellRender = useCellRender_useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate),
- _useCellRender2 = (0,slicedToArray["default"])(_useCellRender, 2),
- childNode = _useCellRender2[0],
- legacyCellProps = _useCellRender2[1];
- // ====================== Fixed =======================
- var fixedStyle = {};
- var isFixLeft = typeof fixLeft === 'number' && supportSticky;
- var isFixRight = typeof fixRight === 'number' && supportSticky;
- if (isFixLeft) {
- fixedStyle.position = 'sticky';
- fixedStyle.left = fixLeft;
- }
- if (isFixRight) {
- fixedStyle.position = 'sticky';
- fixedStyle.right = fixRight;
- }
- // ================ RowSpan & ColSpan =================
- var mergedColSpan = (_ref2 = (_ref3 = (_legacyCellProps$colS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.colSpan) !== null && _legacyCellProps$colS !== void 0 ? _legacyCellProps$colS : additionalProps.colSpan) !== null && _ref3 !== void 0 ? _ref3 : colSpan) !== null && _ref2 !== void 0 ? _ref2 : 1;
- var mergedRowSpan = (_ref4 = (_ref5 = (_legacyCellProps$rowS = legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.rowSpan) !== null && _legacyCellProps$rowS !== void 0 ? _legacyCellProps$rowS : additionalProps.rowSpan) !== null && _ref5 !== void 0 ? _ref5 : rowSpan) !== null && _ref4 !== void 0 ? _ref4 : 1;
- // ====================== Hover =======================
- var _useHoverState = useHoverState(index, mergedRowSpan),
- _useHoverState2 = (0,slicedToArray["default"])(_useHoverState, 2),
- hovering = _useHoverState2[0],
- onHover = _useHoverState2[1];
- var onMouseEnter = (0,rc_util_es.useEvent)(function (event) {
- var _additionalProps$onMo;
- if (record) {
- onHover(index, index + mergedRowSpan - 1);
- }
- additionalProps === null || additionalProps === void 0 || (_additionalProps$onMo = additionalProps.onMouseEnter) === null || _additionalProps$onMo === void 0 || _additionalProps$onMo.call(additionalProps, event);
- });
- var onMouseLeave = (0,rc_util_es.useEvent)(function (event) {
- var _additionalProps$onMo2;
- if (record) {
- onHover(-1, -1);
- }
- additionalProps === null || additionalProps === void 0 || (_additionalProps$onMo2 = additionalProps.onMouseLeave) === null || _additionalProps$onMo2 === void 0 || _additionalProps$onMo2.call(additionalProps, event);
- });
- // ====================== Render ======================
- if (mergedColSpan === 0 || mergedRowSpan === 0) {
- return null;
- }
- // >>>>> Title
- var title = (_additionalProps$titl = additionalProps.title) !== null && _additionalProps$titl !== void 0 ? _additionalProps$titl : getTitleFromCellRenderChildren({
- rowType: rowType,
- ellipsis: ellipsis,
- children: childNode
- });
- // >>>>> ClassName
- var mergedClassName = classnames_default()(cellPrefixCls, className, (_classNames = {}, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])(_classNames, "".concat(cellPrefixCls, "-fix-left"), isFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-first"), firstFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-last"), lastFixLeft && supportSticky), "".concat(cellPrefixCls, "-fix-left-all"), lastFixLeft && allColumnsFixedLeft && supportSticky), "".concat(cellPrefixCls, "-fix-right"), isFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-first"), firstFixRight && supportSticky), "".concat(cellPrefixCls, "-fix-right-last"), lastFixRight && supportSticky), "".concat(cellPrefixCls, "-ellipsis"), ellipsis), "".concat(cellPrefixCls, "-with-append"), appendNode), "".concat(cellPrefixCls, "-fix-sticky"), (isFixLeft || isFixRight) && isSticky && supportSticky), (0,defineProperty["default"])(_classNames, "".concat(cellPrefixCls, "-row-hover"), !legacyCellProps && hovering)), additionalProps.className, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.className);
- // >>>>> Style
- var alignStyle = {};
- if (align) {
- alignStyle.textAlign = align;
- }
- // The order is important since user can overwrite style.
- // For example ant-design/ant-design#51763
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, legacyCellProps === null || legacyCellProps === void 0 ? void 0 : legacyCellProps.style), fixedStyle), alignStyle), additionalProps.style);
- // >>>>> Children Node
- var mergedChildNode = childNode;
- // Not crash if final `childNode` is not validate ReactNode
- if ((0,esm_typeof["default"])(mergedChildNode) === 'object' && !Array.isArray(mergedChildNode) && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(mergedChildNode)) {
- mergedChildNode = null;
- }
- if (ellipsis && (lastFixLeft || firstFixRight)) {
- mergedChildNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(cellPrefixCls, "-content")
- }, mergedChildNode);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, (0,esm_extends["default"])({}, legacyCellProps, additionalProps, {
- className: mergedClassName,
- style: mergedStyle
- // A11y
- ,
- title: title,
- scope: scope
- // Hover
- ,
- onMouseEnter: rowHoverable ? onMouseEnter : undefined,
- onMouseLeave: rowHoverable ? onMouseLeave : undefined
- //Span
- ,
- colSpan: mergedColSpan !== 1 ? mergedColSpan : null,
- rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null
- }), appendNode, mergedChildNode);
- }
- /* harmony default export */ var es_Cell = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(Cell_Cell));
- ;// ./node_modules/rc-table/es/utils/fixUtil.js
- function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) {
- var startColumn = columns[colStart] || {};
- var endColumn = columns[colEnd] || {};
- var fixLeft;
- var fixRight;
- if (startColumn.fixed === 'left') {
- fixLeft = stickyOffsets.left[direction === 'rtl' ? colEnd : colStart];
- } else if (endColumn.fixed === 'right') {
- fixRight = stickyOffsets.right[direction === 'rtl' ? colStart : colEnd];
- }
- var lastFixLeft = false;
- var firstFixRight = false;
- var lastFixRight = false;
- var firstFixLeft = false;
- var nextColumn = columns[colEnd + 1];
- var prevColumn = columns[colStart - 1];
- // need show shadow only when canLastFix is true
- var canLastFix = nextColumn && !nextColumn.fixed || prevColumn && !prevColumn.fixed || columns.every(function (col) {
- return col.fixed === 'left';
- });
- if (direction === 'rtl') {
- if (fixLeft !== undefined) {
- var prevFixLeft = prevColumn && prevColumn.fixed === 'left';
- firstFixLeft = !prevFixLeft && canLastFix;
- } else if (fixRight !== undefined) {
- var nextFixRight = nextColumn && nextColumn.fixed === 'right';
- lastFixRight = !nextFixRight && canLastFix;
- }
- } else if (fixLeft !== undefined) {
- var nextFixLeft = nextColumn && nextColumn.fixed === 'left';
- lastFixLeft = !nextFixLeft && canLastFix;
- } else if (fixRight !== undefined) {
- var prevFixRight = prevColumn && prevColumn.fixed === 'right';
- firstFixRight = !prevFixRight && canLastFix;
- }
- return {
- fixLeft: fixLeft,
- fixRight: fixRight,
- lastFixLeft: lastFixLeft,
- firstFixRight: firstFixRight,
- lastFixRight: lastFixRight,
- firstFixLeft: firstFixLeft,
- isSticky: stickyOffsets.isSticky
- };
- }
- ;// ./node_modules/rc-table/es/Footer/SummaryContext.js
- var SummaryContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- /* harmony default export */ var Footer_SummaryContext = (SummaryContext);
- ;// ./node_modules/rc-table/es/Footer/Cell.js
- function SummaryCell(_ref) {
- var className = _ref.className,
- index = _ref.index,
- children = _ref.children,
- _ref$colSpan = _ref.colSpan,
- colSpan = _ref$colSpan === void 0 ? 1 : _ref$colSpan,
- rowSpan = _ref.rowSpan,
- align = _ref.align;
- var _useContext = useContext(context_TableContext, ['prefixCls', 'direction']),
- prefixCls = _useContext.prefixCls,
- direction = _useContext.direction;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(Footer_SummaryContext),
- scrollColumnIndex = _React$useContext.scrollColumnIndex,
- stickyOffsets = _React$useContext.stickyOffsets,
- flattenColumns = _React$useContext.flattenColumns;
- var lastIndex = index + colSpan - 1;
- var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;
- var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, (0,esm_extends["default"])({
- className: className,
- index: index,
- component: "td",
- prefixCls: prefixCls,
- record: null,
- dataIndex: null,
- align: align,
- colSpan: mergedColSpan,
- rowSpan: rowSpan,
- render: function render() {
- return children;
- }
- }, fixedInfo));
- }
- ;// ./node_modules/rc-table/es/Footer/Row.js
- var Row_excluded = ["children"];
- function FooterRow(_ref) {
- var children = _ref.children,
- props = (0,objectWithoutProperties["default"])(_ref, Row_excluded);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", props, children);
- }
- ;// ./node_modules/rc-table/es/Footer/Summary.js
- /**
- * Syntactic sugar. Do not support HOC.
- */
- function Summary(_ref) {
- var children = _ref.children;
- return children;
- }
- Summary.Row = FooterRow;
- Summary.Cell = SummaryCell;
- /* harmony default export */ var Footer_Summary = (Summary);
- ;// ./node_modules/rc-table/es/Footer/index.js
- function es_Footer_Footer(props) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var children = props.children,
- stickyOffsets = props.stickyOffsets,
- flattenColumns = props.flattenColumns;
- var prefixCls = useContext(context_TableContext, 'prefixCls');
- var lastColumnIndex = flattenColumns.length - 1;
- var scrollColumn = flattenColumns[lastColumnIndex];
- var summaryContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- stickyOffsets: stickyOffsets,
- flattenColumns: flattenColumns,
- scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null
- };
- }, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Footer_SummaryContext.Provider, {
- value: summaryContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tfoot", {
- className: "".concat(prefixCls, "-summary")
- }, children));
- }
- /* harmony default export */ var es_Footer = (TableContext_responseImmutable(es_Footer_Footer));
- var FooterComponents = Footer_Summary;
- ;// ./node_modules/rc-table/es/sugar/Column.js
- /* istanbul ignore next */
- /**
- * This is a syntactic sugar for `columns` prop.
- * So HOC will not work on this.
- */
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- function Column_Column(_) {
- return null;
- }
- /* harmony default export */ var sugar_Column = (Column_Column);
- ;// ./node_modules/rc-table/es/sugar/ColumnGroup.js
- /* istanbul ignore next */
- /**
- * This is a syntactic sugar for `columns` prop.
- * So HOC will not work on this.
- */
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- function ColumnGroup(_) {
- return null;
- }
- /* harmony default export */ var sugar_ColumnGroup = (ColumnGroup);
- ;// ./node_modules/rc-table/es/hooks/useFlattenRecords.js
- // recursion (flat tree structure)
- function fillRecords(list, record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
- var key = getRowKey(record, index);
- list.push({
- record: record,
- indent: indent,
- index: index,
- rowKey: key
- });
- var expanded = expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.has(key);
- if (record && Array.isArray(record[childrenColumnName]) && expanded) {
- // expanded state, flat record
- for (var i = 0; i < record[childrenColumnName].length; i += 1) {
- fillRecords(list, record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
- }
- }
- }
- /**
- * flat tree data on expanded state
- *
- * @export
- * @template T
- * @param {*} data : table data
- * @param {string} childrenColumnName : 指定树形结构的列名
- * @param {Set<Key>} expandedKeys : 展开的行对应的keys
- * @param {GetRowKey<T>} getRowKey : 获取当前rowKey的方法
- * @returns flattened data
- */
- function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
- var arr = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (expandedKeys !== null && expandedKeys !== void 0 && expandedKeys.size) {
- var list = [];
- // collect flattened record
- for (var i = 0; i < (data === null || data === void 0 ? void 0 : data.length); i += 1) {
- var record = data[i];
- // using array.push or spread operator may cause "Maximum call stack size exceeded" exception if array size is big enough.
- fillRecords(list, record, 0, childrenColumnName, expandedKeys, getRowKey, i);
- }
- return list;
- }
- return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
- return {
- record: item,
- indent: 0,
- index: index,
- rowKey: getRowKey(item, index)
- };
- });
- }, [data, childrenColumnName, expandedKeys, getRowKey]);
- return arr;
- }
- ;// ./node_modules/rc-table/es/hooks/useRowInfo.js
- function useRowInfo(record, rowKey, recordIndex, indent) {
- var context = useContext(context_TableContext, ['prefixCls', 'fixedInfoList', 'flattenColumns', 'expandableType', 'expandRowByClick', 'onTriggerExpand', 'rowClassName', 'expandedRowClassName', 'indentSize', 'expandIcon', 'expandedRowRender', 'expandIconColumnIndex', 'expandedKeys', 'childrenColumnName', 'rowExpandable', 'onRow']);
- var flattenColumns = context.flattenColumns,
- expandableType = context.expandableType,
- expandedKeys = context.expandedKeys,
- childrenColumnName = context.childrenColumnName,
- onTriggerExpand = context.onTriggerExpand,
- rowExpandable = context.rowExpandable,
- onRow = context.onRow,
- expandRowByClick = context.expandRowByClick,
- rowClassName = context.rowClassName;
- // ======================= Expandable =======================
- // Only when row is not expandable and `children` exist in record
- var nestExpandable = expandableType === 'nest';
- var rowSupportExpand = expandableType === 'row' && (!rowExpandable || rowExpandable(record));
- var mergedExpandable = rowSupportExpand || nestExpandable;
- var expanded = expandedKeys && expandedKeys.has(rowKey);
- var hasNestChildren = childrenColumnName && record && record[childrenColumnName];
- var onInternalTriggerExpand = (0,rc_util_es.useEvent)(onTriggerExpand);
- // ========================= onRow ==========================
- var rowProps = onRow === null || onRow === void 0 ? void 0 : onRow(record, recordIndex);
- var onRowClick = rowProps === null || rowProps === void 0 ? void 0 : rowProps.onClick;
- var onClick = function onClick(event) {
- if (expandRowByClick && mergedExpandable) {
- onTriggerExpand(record, event);
- }
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- onRowClick === null || onRowClick === void 0 || onRowClick.apply(void 0, [event].concat(args));
- };
- // ====================== RowClassName ======================
- var computeRowClassName;
- if (typeof rowClassName === 'string') {
- computeRowClassName = rowClassName;
- } else if (typeof rowClassName === 'function') {
- computeRowClassName = rowClassName(record, recordIndex, indent);
- }
- // ========================= Column =========================
- var columnsKey = getColumnsKey(flattenColumns);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, context), {}, {
- columnsKey: columnsKey,
- nestExpandable: nestExpandable,
- expanded: expanded,
- hasNestChildren: hasNestChildren,
- record: record,
- onTriggerExpand: onInternalTriggerExpand,
- rowSupportExpand: rowSupportExpand,
- expandable: mergedExpandable,
- rowProps: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, rowProps), {}, {
- className: classnames_default()(computeRowClassName, rowProps === null || rowProps === void 0 ? void 0 : rowProps.className),
- onClick: onClick
- })
- });
- }
- ;// ./node_modules/rc-table/es/Body/ExpandedRow.js
- function ExpandedRow(props) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var prefixCls = props.prefixCls,
- children = props.children,
- Component = props.component,
- cellComponent = props.cellComponent,
- className = props.className,
- expanded = props.expanded,
- colSpan = props.colSpan,
- isEmpty = props.isEmpty,
- _props$stickyOffset = props.stickyOffset,
- stickyOffset = _props$stickyOffset === void 0 ? 0 : _props$stickyOffset;
- var _useContext = useContext(context_TableContext, ['scrollbarSize', 'fixHeader', 'fixColumn', 'componentWidth', 'horizonScroll']),
- scrollbarSize = _useContext.scrollbarSize,
- fixHeader = _useContext.fixHeader,
- fixColumn = _useContext.fixColumn,
- componentWidth = _useContext.componentWidth,
- horizonScroll = _useContext.horizonScroll;
- // Cache render node
- var contentNode = children;
- if (isEmpty ? horizonScroll && componentWidth : fixColumn) {
- contentNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- width: componentWidth - stickyOffset - (fixHeader && !isEmpty ? scrollbarSize : 0),
- position: 'sticky',
- left: stickyOffset,
- overflow: 'hidden'
- },
- className: "".concat(prefixCls, "-expanded-row-fixed")
- }, contentNode);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, {
- className: className,
- style: {
- display: expanded ? null : 'none'
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, {
- component: cellComponent,
- prefixCls: prefixCls,
- colSpan: colSpan
- }, contentNode));
- }
- /* harmony default export */ var Body_ExpandedRow = (ExpandedRow);
- ;// ./node_modules/rc-table/es/utils/expandUtil.js
- function renderExpandIcon(_ref) {
- var prefixCls = _ref.prefixCls,
- record = _ref.record,
- onExpand = _ref.onExpand,
- expanded = _ref.expanded,
- expandable = _ref.expandable;
- var expandClassName = "".concat(prefixCls, "-row-expand-icon");
- if (!expandable) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(expandClassName, "".concat(prefixCls, "-row-spaced"))
- });
- }
- var onClick = function onClick(event) {
- onExpand(record, event);
- event.stopPropagation();
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(expandClassName, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-row-expanded"), expanded), "".concat(prefixCls, "-row-collapsed"), !expanded)),
- onClick: onClick
- });
- }
- function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
- var keys = [];
- function dig(list) {
- (list || []).forEach(function (item, index) {
- keys.push(getRowKey(item, index));
- dig(item[childrenColumnName]);
- });
- }
- dig(data);
- return keys;
- }
- function computedExpandedClassName(cls, record, index, indent) {
- if (typeof cls === 'string') {
- return cls;
- }
- if (typeof cls === 'function') {
- return cls(record, index, indent);
- }
- return '';
- }
- ;// ./node_modules/rc-table/es/Body/BodyRow.js
- // ==================================================================================
- // == getCellProps ==
- // ==================================================================================
- function getCellProps(rowInfo, column, colIndex, indent, index) {
- var _column$onCell;
- var rowKeys = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
- var expandedRowOffset = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
- var record = rowInfo.record,
- prefixCls = rowInfo.prefixCls,
- columnsKey = rowInfo.columnsKey,
- fixedInfoList = rowInfo.fixedInfoList,
- expandIconColumnIndex = rowInfo.expandIconColumnIndex,
- nestExpandable = rowInfo.nestExpandable,
- indentSize = rowInfo.indentSize,
- expandIcon = rowInfo.expandIcon,
- expanded = rowInfo.expanded,
- hasNestChildren = rowInfo.hasNestChildren,
- onTriggerExpand = rowInfo.onTriggerExpand,
- expandable = rowInfo.expandable,
- expandedKeys = rowInfo.expandedKeys;
- var key = columnsKey[colIndex];
- var fixedInfo = fixedInfoList[colIndex];
- // ============= Used for nest expandable =============
- var appendCellNode;
- if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {
- appendCellNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: {
- paddingLeft: "".concat(indentSize * indent, "px")
- },
- className: "".concat(prefixCls, "-row-indent indent-level-").concat(indent)
- }), expandIcon({
- prefixCls: prefixCls,
- expanded: expanded,
- expandable: hasNestChildren,
- record: record,
- onExpand: onTriggerExpand
- }));
- }
- var additionalCellProps = ((_column$onCell = column.onCell) === null || _column$onCell === void 0 ? void 0 : _column$onCell.call(column, record, index)) || {};
- // Expandable row has offset
- if (expandedRowOffset) {
- var _additionalCellProps$ = additionalCellProps.rowSpan,
- rowSpan = _additionalCellProps$ === void 0 ? 1 : _additionalCellProps$;
- // For expandable row with rowSpan,
- // We should increase the rowSpan if the row is expanded
- if (expandable && rowSpan && colIndex < expandedRowOffset) {
- var currentRowSpan = rowSpan;
- for (var i = index; i < index + rowSpan; i += 1) {
- var rowKey = rowKeys[i];
- if (expandedKeys.has(rowKey)) {
- currentRowSpan += 1;
- }
- }
- additionalCellProps.rowSpan = currentRowSpan;
- }
- }
- return {
- key: key,
- fixedInfo: fixedInfo,
- appendCellNode: appendCellNode,
- additionalCellProps: additionalCellProps
- };
- }
- // ==================================================================================
- // == getCellProps ==
- // ==================================================================================
- function BodyRow(props) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var className = props.className,
- style = props.style,
- record = props.record,
- index = props.index,
- renderIndex = props.renderIndex,
- rowKey = props.rowKey,
- rowKeys = props.rowKeys,
- _props$indent = props.indent,
- indent = _props$indent === void 0 ? 0 : _props$indent,
- RowComponent = props.rowComponent,
- cellComponent = props.cellComponent,
- scopeCellComponent = props.scopeCellComponent,
- expandedRowInfo = props.expandedRowInfo;
- var rowInfo = useRowInfo(record, rowKey, index, indent);
- var prefixCls = rowInfo.prefixCls,
- flattenColumns = rowInfo.flattenColumns,
- expandedRowClassName = rowInfo.expandedRowClassName,
- expandedRowRender = rowInfo.expandedRowRender,
- rowProps = rowInfo.rowProps,
- expanded = rowInfo.expanded,
- rowSupportExpand = rowInfo.rowSupportExpand;
- // Force render expand row if expanded before
- var expandedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- expandedRef.current || (expandedRef.current = expanded);
- if (true) {
- hooks_useRenderTimes(props);
- }
- // 若没有 expandedRowRender 参数, 将使用 baseRowNode 渲染 Children
- // 此时如果 level > 1 则说明是 expandedRow, 一样需要附加 computedExpandedRowClassName
- var expandedClsName = computedExpandedClassName(expandedRowClassName, record, index, indent);
- // ======================== Base tr row ========================
- var baseRowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RowComponent, (0,esm_extends["default"])({}, rowProps, {
- "data-row-key": rowKey,
- className: classnames_default()(className, "".concat(prefixCls, "-row"), "".concat(prefixCls, "-row-level-").concat(indent), rowProps === null || rowProps === void 0 ? void 0 : rowProps.className, (0,defineProperty["default"])({}, expandedClsName, indent >= 1)),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), rowProps === null || rowProps === void 0 ? void 0 : rowProps.style)
- }), flattenColumns.map(function (column, colIndex) {
- var render = column.render,
- dataIndex = column.dataIndex,
- columnClassName = column.className;
- var _getCellProps = getCellProps(rowInfo, column, colIndex, indent, index, rowKeys, expandedRowInfo === null || expandedRowInfo === void 0 ? void 0 : expandedRowInfo.offset),
- key = _getCellProps.key,
- fixedInfo = _getCellProps.fixedInfo,
- appendCellNode = _getCellProps.appendCellNode,
- additionalCellProps = _getCellProps.additionalCellProps;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, (0,esm_extends["default"])({
- className: columnClassName,
- ellipsis: column.ellipsis,
- align: column.align,
- scope: column.rowScope,
- component: column.rowScope ? scopeCellComponent : cellComponent,
- prefixCls: prefixCls,
- key: key,
- record: record,
- index: index,
- renderIndex: renderIndex,
- dataIndex: dataIndex,
- render: render,
- shouldCellUpdate: column.shouldCellUpdate
- }, fixedInfo, {
- appendNode: appendCellNode,
- additionalProps: additionalCellProps
- }));
- }));
- // ======================== Expand Row =========================
- var expandRowNode;
- if (rowSupportExpand && (expandedRef.current || expanded)) {
- var expandContent = expandedRowRender(record, index, indent + 1, expanded);
- expandRowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Body_ExpandedRow, {
- expanded: expanded,
- className: classnames_default()("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), expandedClsName),
- prefixCls: prefixCls,
- component: RowComponent,
- cellComponent: cellComponent,
- colSpan: expandedRowInfo ? expandedRowInfo.colSpan : flattenColumns.length,
- stickyOffset: expandedRowInfo === null || expandedRowInfo === void 0 ? void 0 : expandedRowInfo.sticky,
- isEmpty: false
- }, expandContent);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, baseRowNode, expandRowNode);
- }
- if (true) {
- BodyRow.displayName = 'BodyRow';
- }
- /* harmony default export */ var Body_BodyRow = (TableContext_responseImmutable(BodyRow));
- ;// ./node_modules/rc-table/es/Body/MeasureCell.js
- function MeasureCell(_ref) {
- var columnKey = _ref.columnKey,
- onColumnResize = _ref.onColumnResize,
- column = _ref.column;
- var cellRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- (0,useLayoutEffect["default"])(function () {
- if (cellRef.current) {
- onColumnResize(columnKey, cellRef.current.offsetWidth);
- }
- }, []);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- data: columnKey
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("td", {
- ref: cellRef,
- style: {
- paddingTop: 0,
- paddingBottom: 0,
- borderTop: 0,
- borderBottom: 0,
- height: 0
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- height: 0,
- overflow: 'hidden',
- fontWeight: 'bold'
- }
- }, (column === null || column === void 0 ? void 0 : column.title) || '\xa0')));
- }
- ;// ./node_modules/rc-table/es/Body/MeasureRow.js
- function MeasureRow(_ref) {
- var prefixCls = _ref.prefixCls,
- columnsKey = _ref.columnsKey,
- onColumnResize = _ref.onColumnResize,
- columns = _ref.columns;
- var ref = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var _useContext = useContext(context_TableContext, ['measureRowRender']),
- measureRowRender = _useContext.measureRowRender;
- var measureRow = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("tr", {
- "aria-hidden": "true",
- className: "".concat(prefixCls, "-measure-row"),
- style: {
- height: 0
- },
- ref: ref
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es.Collection, {
- onBatchResize: function onBatchResize(infoList) {
- if (isVisible(ref.current)) {
- infoList.forEach(function (_ref2) {
- var columnKey = _ref2.data,
- size = _ref2.size;
- onColumnResize(columnKey, size.offsetWidth);
- });
- }
- }
- }, columnsKey.map(function (columnKey) {
- var column = columns.find(function (col) {
- return col.key === columnKey;
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureCell, {
- key: columnKey,
- columnKey: columnKey,
- onColumnResize: onColumnResize,
- column: column
- });
- })));
- return measureRowRender ? measureRowRender(measureRow) : measureRow;
- }
- ;// ./node_modules/rc-table/es/Body/index.js
- function Body(props) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var data = props.data,
- measureColumnWidth = props.measureColumnWidth;
- var _useContext = useContext(context_TableContext, ['prefixCls', 'getComponent', 'onColumnResize', 'flattenColumns', 'getRowKey', 'expandedKeys', 'childrenColumnName', 'emptyNode', 'expandedRowOffset', 'fixedInfoList', 'colWidths']),
- prefixCls = _useContext.prefixCls,
- getComponent = _useContext.getComponent,
- onColumnResize = _useContext.onColumnResize,
- flattenColumns = _useContext.flattenColumns,
- getRowKey = _useContext.getRowKey,
- expandedKeys = _useContext.expandedKeys,
- childrenColumnName = _useContext.childrenColumnName,
- emptyNode = _useContext.emptyNode,
- _useContext$expandedR = _useContext.expandedRowOffset,
- expandedRowOffset = _useContext$expandedR === void 0 ? 0 : _useContext$expandedR,
- colWidths = _useContext.colWidths;
- var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
- var rowKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return flattenData.map(function (item) {
- return item.rowKey;
- });
- }, [flattenData]);
- // =================== Performance ====================
- var perfRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- renderWithProps: false
- });
- // ===================== Expanded =====================
- // `expandedRowOffset` data is same for all the rows.
- // Let's calc on Body side to save performance.
- var expandedRowInfo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var expandedColSpan = flattenColumns.length - expandedRowOffset;
- var expandedStickyStart = 0;
- for (var i = 0; i < expandedRowOffset; i += 1) {
- expandedStickyStart += colWidths[i] || 0;
- }
- return {
- offset: expandedRowOffset,
- colSpan: expandedColSpan,
- sticky: expandedStickyStart
- };
- }, [flattenColumns.length, expandedRowOffset, colWidths]);
- // ====================== Render ======================
- var WrapperComponent = getComponent(['body', 'wrapper'], 'tbody');
- var trComponent = getComponent(['body', 'row'], 'tr');
- var tdComponent = getComponent(['body', 'cell'], 'td');
- var thComponent = getComponent(['body', 'cell'], 'th');
- var rows;
- if (data.length) {
- rows = flattenData.map(function (item, idx) {
- var record = item.record,
- indent = item.indent,
- renderIndex = item.index,
- rowKey = item.rowKey;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Body_BodyRow, {
- key: rowKey,
- rowKey: rowKey,
- rowKeys: rowKeys,
- record: record,
- index: idx,
- renderIndex: renderIndex,
- rowComponent: trComponent,
- cellComponent: tdComponent,
- scopeCellComponent: thComponent,
- indent: indent
- // Expanded row info
- ,
- expandedRowInfo: expandedRowInfo
- });
- });
- } else {
- rows = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Body_ExpandedRow, {
- expanded: true,
- className: "".concat(prefixCls, "-placeholder"),
- prefixCls: prefixCls,
- component: trComponent,
- cellComponent: tdComponent,
- colSpan: flattenColumns.length,
- isEmpty: true
- }, emptyNode);
- }
- var columnsKey = getColumnsKey(flattenColumns);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_PerfContext.Provider, {
- value: perfRef.current
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(WrapperComponent, {
- className: "".concat(prefixCls, "-tbody")
- }, measureColumnWidth && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureRow, {
- prefixCls: prefixCls,
- columnsKey: columnsKey,
- onColumnResize: onColumnResize,
- columns: flattenColumns
- }), rows));
- }
- if (true) {
- Body.displayName = 'Body';
- }
- /* harmony default export */ var es_Body = (TableContext_responseImmutable(Body));
- ;// ./node_modules/rc-table/es/utils/legacyUtil.js
- var utils_legacyUtil_excluded = ["expandable"];
- var INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';
- function getExpandableProps(props) {
- var expandable = props.expandable,
- legacyExpandableConfig = (0,objectWithoutProperties["default"])(props, utils_legacyUtil_excluded);
- var config;
- if ('expandable' in props) {
- config = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, legacyExpandableConfig), expandable);
- } else {
- if ( true && ['indentSize', 'expandedRowKeys', 'defaultExpandedRowKeys', 'defaultExpandAllRows', 'expandedRowRender', 'expandRowByClick', 'expandIcon', 'onExpand', 'onExpandedRowsChange', 'expandedRowClassName', 'expandIconColumnIndex', 'showExpandColumn', 'title'].some(function (prop) {
- return prop in props;
- })) {
- (0,warning["default"])(false, 'expanded related props have been moved into `expandable`.');
- }
- config = legacyExpandableConfig;
- }
- if (config.showExpandColumn === false) {
- config.expandIconColumnIndex = -1;
- }
- return config;
- }
- ;// ./node_modules/rc-table/es/ColGroup.js
- var ColGroup_excluded = ["columnType"];
- function ColGroup(_ref) {
- var colWidths = _ref.colWidths,
- columns = _ref.columns,
- columCount = _ref.columCount;
- var _useContext = useContext(context_TableContext, ['tableLayout']),
- tableLayout = _useContext.tableLayout;
- var cols = [];
- var len = columCount || columns.length;
- // Only insert col with width & additional props
- // Skip if rest col do not have any useful info
- var mustInsert = false;
- for (var i = len - 1; i >= 0; i -= 1) {
- var width = colWidths[i];
- var column = columns && columns[i];
- var additionalProps = void 0;
- var minWidth = void 0;
- if (column) {
- additionalProps = column[INTERNAL_COL_DEFINE];
- // fixed will cause layout problems
- if (tableLayout === 'auto') {
- minWidth = column.minWidth;
- }
- }
- if (width || minWidth || additionalProps || mustInsert) {
- var _ref2 = additionalProps || {},
- columnType = _ref2.columnType,
- restAdditionalProps = (0,objectWithoutProperties["default"])(_ref2, ColGroup_excluded);
- cols.unshift( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("col", (0,esm_extends["default"])({
- key: i,
- style: {
- width: width,
- minWidth: minWidth
- }
- }, restAdditionalProps)));
- mustInsert = true;
- }
- }
- return cols.length > 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("colgroup", null, cols) : null;
- }
- /* harmony default export */ var es_ColGroup = (ColGroup);
- ;// ./node_modules/rc-table/es/FixedHolder/index.js
- var FixedHolder_excluded = ["className", "noData", "columns", "flattenColumns", "colWidths", "colGroup", "columCount", "stickyOffsets", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName", "scrollX", "tableLayout", "onScroll", "children"];
- function useColumnWidth(colWidths, columCount) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var cloneColumns = [];
- for (var i = 0; i < columCount; i += 1) {
- var val = colWidths[i];
- if (val !== undefined) {
- cloneColumns[i] = val;
- } else {
- return null;
- }
- }
- return cloneColumns;
- }, [colWidths.join('_'), columCount]);
- }
- var FixedHolder = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var className = props.className,
- noData = props.noData,
- columns = props.columns,
- flattenColumns = props.flattenColumns,
- colWidths = props.colWidths,
- colGroup = props.colGroup,
- columCount = props.columCount,
- stickyOffsets = props.stickyOffsets,
- direction = props.direction,
- fixHeader = props.fixHeader,
- stickyTopOffset = props.stickyTopOffset,
- stickyBottomOffset = props.stickyBottomOffset,
- stickyClassName = props.stickyClassName,
- scrollX = props.scrollX,
- _props$tableLayout = props.tableLayout,
- tableLayout = _props$tableLayout === void 0 ? 'fixed' : _props$tableLayout,
- onScroll = props.onScroll,
- children = props.children,
- restProps = (0,objectWithoutProperties["default"])(props, FixedHolder_excluded);
- var _useContext = useContext(context_TableContext, ['prefixCls', 'scrollbarSize', 'isSticky', 'getComponent']),
- prefixCls = _useContext.prefixCls,
- scrollbarSize = _useContext.scrollbarSize,
- isSticky = _useContext.isSticky,
- getComponent = _useContext.getComponent;
- var TableComponent = getComponent(['header', 'table'], 'table');
- var combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize;
- // Pass wheel to scroll event
- var scrollRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var setScrollRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (element) {
- (0,es_ref.fillRef)(ref, element);
- (0,es_ref.fillRef)(scrollRef, element);
- }, []);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- function onWheel(e) {
- var _ref = e,
- currentTarget = _ref.currentTarget,
- deltaX = _ref.deltaX;
- if (deltaX) {
- onScroll({
- currentTarget: currentTarget,
- scrollLeft: currentTarget.scrollLeft + deltaX
- });
- e.preventDefault();
- }
- }
- var scrollEle = scrollRef.current;
- scrollEle === null || scrollEle === void 0 || scrollEle.addEventListener('wheel', onWheel, {
- passive: false
- });
- return function () {
- scrollEle === null || scrollEle === void 0 || scrollEle.removeEventListener('wheel', onWheel);
- };
- }, []);
- // Add scrollbar column
- var lastColumn = flattenColumns[flattenColumns.length - 1];
- var ScrollBarColumn = {
- fixed: lastColumn ? lastColumn.fixed : null,
- scrollbar: true,
- onHeaderCell: function onHeaderCell() {
- return {
- className: "".concat(prefixCls, "-cell-scrollbar")
- };
- }
- };
- var columnsWithScrollbar = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return combinationScrollBarSize ? [].concat((0,toConsumableArray["default"])(columns), [ScrollBarColumn]) : columns;
- }, [combinationScrollBarSize, columns]);
- var flattenColumnsWithScrollbar = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return combinationScrollBarSize ? [].concat((0,toConsumableArray["default"])(flattenColumns), [ScrollBarColumn]) : flattenColumns;
- }, [combinationScrollBarSize, flattenColumns]);
- // Calculate the sticky offsets
- var headerStickyOffsets = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var right = stickyOffsets.right,
- left = stickyOffsets.left;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, stickyOffsets), {}, {
- left: direction === 'rtl' ? [].concat((0,toConsumableArray["default"])(left.map(function (width) {
- return width + combinationScrollBarSize;
- })), [0]) : left,
- right: direction === 'rtl' ? right : [].concat((0,toConsumableArray["default"])(right.map(function (width) {
- return width + combinationScrollBarSize;
- })), [0]),
- isSticky: isSticky
- });
- }, [combinationScrollBarSize, stickyOffsets, isSticky]);
- var mergedColumnWidth = useColumnWidth(colWidths, columCount);
- var colGroupNode = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- // use original ColGroup if no data or no calculated column width, otherwise use calculated column width
- // Return original colGroup if no data, or mergedColumnWidth is empty, or all widths are falsy
- if (noData || !mergedColumnWidth || mergedColumnWidth.length === 0 || mergedColumnWidth.every(function (width) {
- return !width;
- })) {
- return colGroup;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ColGroup, {
- colWidths: [].concat((0,toConsumableArray["default"])(mergedColumnWidth), [combinationScrollBarSize]),
- columCount: columCount + 1,
- columns: flattenColumnsWithScrollbar
- });
- }, [noData, mergedColumnWidth, colGroup, combinationScrollBarSize, columCount, flattenColumnsWithScrollbar]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: (0,objectSpread2["default"])({
- overflow: 'hidden'
- }, isSticky ? {
- top: stickyTopOffset,
- bottom: stickyBottomOffset
- } : {}),
- ref: setScrollRef,
- className: classnames_default()(className, (0,defineProperty["default"])({}, stickyClassName, !!stickyClassName))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TableComponent, {
- style: {
- tableLayout: tableLayout,
- minWidth: '100%',
- // https://github.com/ant-design/ant-design/issues/54894
- width: scrollX
- }
- }, colGroupNode, children((0,objectSpread2["default"])((0,objectSpread2["default"])({}, restProps), {}, {
- stickyOffsets: headerStickyOffsets,
- columns: columnsWithScrollbar,
- flattenColumns: flattenColumnsWithScrollbar
- }))));
- });
- if (true) {
- FixedHolder.displayName = 'FixedHolder';
- }
- /** Return a table in div as fixed element which contains sticky info */
- // export default responseImmutable(FixedHolder);
- /* harmony default export */ var es_FixedHolder = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(FixedHolder));
- ;// ./node_modules/rc-table/es/Header/HeaderRow.js
- var HeaderRow = function HeaderRow(props) {
- var cells = props.cells,
- stickyOffsets = props.stickyOffsets,
- flattenColumns = props.flattenColumns,
- RowComponent = props.rowComponent,
- CellComponent = props.cellComponent,
- onHeaderRow = props.onHeaderRow,
- index = props.index;
- var _useContext = useContext(context_TableContext, ['prefixCls', 'direction']),
- prefixCls = _useContext.prefixCls,
- direction = _useContext.direction;
- var rowProps;
- if (onHeaderRow) {
- rowProps = onHeaderRow(cells.map(function (cell) {
- return cell.column;
- }), index);
- }
- var columnsKey = getColumnsKey(cells.map(function (cell) {
- return cell.column;
- }));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RowComponent, rowProps, cells.map(function (cell, cellIndex) {
- var column = cell.column;
- var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction);
- var additionalProps;
- if (column && column.onHeaderCell) {
- additionalProps = cell.column.onHeaderCell(column);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, (0,esm_extends["default"])({}, cell, {
- scope: column.title ? cell.colSpan > 1 ? 'colgroup' : 'col' : null,
- ellipsis: column.ellipsis,
- align: column.align,
- component: CellComponent,
- prefixCls: prefixCls,
- key: columnsKey[cellIndex]
- }, fixedInfo, {
- additionalProps: additionalProps,
- rowType: "header"
- }));
- }));
- };
- if (true) {
- HeaderRow.displayName = 'HeaderRow';
- }
- /* harmony default export */ var Header_HeaderRow = (HeaderRow);
- ;// ./node_modules/rc-table/es/Header/Header.js
- function parseHeaderRows(rootColumns) {
- var rows = [];
- function fillRowCells(columns, colIndex) {
- var rowIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- // Init rows
- rows[rowIndex] = rows[rowIndex] || [];
- var currentColIndex = colIndex;
- var colSpans = columns.filter(Boolean).map(function (column) {
- var cell = {
- key: column.key,
- className: column.className || '',
- children: column.title,
- column: column,
- colStart: currentColIndex
- };
- var colSpan = 1;
- var subColumns = column.children;
- if (subColumns && subColumns.length > 0) {
- colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce(function (total, count) {
- return total + count;
- }, 0);
- cell.hasSubColumns = true;
- }
- if ('colSpan' in column) {
- colSpan = column.colSpan;
- }
- if ('rowSpan' in column) {
- cell.rowSpan = column.rowSpan;
- }
- cell.colSpan = colSpan;
- cell.colEnd = cell.colStart + colSpan - 1;
- rows[rowIndex].push(cell);
- currentColIndex += colSpan;
- return colSpan;
- });
- return colSpans;
- }
- // Generate `rows` cell data
- fillRowCells(rootColumns, 0);
- // Handle `rowSpan`
- var rowCount = rows.length;
- var _loop = function _loop(rowIndex) {
- rows[rowIndex].forEach(function (cell) {
- if (!('rowSpan' in cell) && !cell.hasSubColumns) {
- // eslint-disable-next-line no-param-reassign
- cell.rowSpan = rowCount - rowIndex;
- }
- });
- };
- for (var rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
- _loop(rowIndex);
- }
- return rows;
- }
- var Header_Header = function Header(props) {
- if (true) {
- hooks_useRenderTimes(props);
- }
- var stickyOffsets = props.stickyOffsets,
- columns = props.columns,
- flattenColumns = props.flattenColumns,
- onHeaderRow = props.onHeaderRow;
- var _useContext = useContext(context_TableContext, ['prefixCls', 'getComponent']),
- prefixCls = _useContext.prefixCls,
- getComponent = _useContext.getComponent;
- var rows = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return parseHeaderRows(columns);
- }, [columns]);
- var WrapperComponent = getComponent(['header', 'wrapper'], 'thead');
- var trComponent = getComponent(['header', 'row'], 'tr');
- var thComponent = getComponent(['header', 'cell'], 'th');
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(WrapperComponent, {
- className: "".concat(prefixCls, "-thead")
- }, rows.map(function (row, rowIndex) {
- var rowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Header_HeaderRow, {
- key: rowIndex,
- flattenColumns: flattenColumns,
- cells: row,
- stickyOffsets: stickyOffsets,
- rowComponent: trComponent,
- cellComponent: thComponent,
- onHeaderRow: onHeaderRow,
- index: rowIndex
- });
- return rowNode;
- }));
- };
- /* harmony default export */ var es_Header_Header = (TableContext_responseImmutable(Header_Header));
- ;// ./node_modules/rc-table/es/hooks/useColumns/useWidthColumns.js
- function parseColWidth(totalWidth) {
- var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- if (typeof width === 'number') {
- return width;
- }
- if (width.endsWith('%')) {
- return totalWidth * parseFloat(width) / 100;
- }
- return null;
- }
- /**
- * Fill all column with width
- */
- function useWidthColumns(flattenColumns, scrollWidth, clientWidth) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // Fill width if needed
- if (scrollWidth && scrollWidth > 0) {
- var totalWidth = 0;
- var missWidthCount = 0;
- // collect not given width column
- flattenColumns.forEach(function (col) {
- var colWidth = parseColWidth(scrollWidth, col.width);
- if (colWidth) {
- totalWidth += colWidth;
- } else {
- missWidthCount += 1;
- }
- });
- // Fill width
- var maxFitWidth = Math.max(scrollWidth, clientWidth);
- var restWidth = Math.max(maxFitWidth - totalWidth, missWidthCount);
- var restCount = missWidthCount;
- var avgWidth = restWidth / missWidthCount;
- var realTotal = 0;
- var filledColumns = flattenColumns.map(function (col) {
- var clone = (0,objectSpread2["default"])({}, col);
- var colWidth = parseColWidth(scrollWidth, clone.width);
- if (colWidth) {
- clone.width = colWidth;
- } else {
- var colAvgWidth = Math.floor(avgWidth);
- clone.width = restCount === 1 ? restWidth : colAvgWidth;
- restWidth -= colAvgWidth;
- restCount -= 1;
- }
- realTotal += clone.width;
- return clone;
- });
- // If realTotal is less than clientWidth,
- // We need extend column width
- if (realTotal < maxFitWidth) {
- var scale = maxFitWidth / realTotal;
- restWidth = maxFitWidth;
- filledColumns.forEach(function (col, index) {
- var colWidth = Math.floor(col.width * scale);
- col.width = index === filledColumns.length - 1 ? restWidth : colWidth;
- restWidth -= colWidth;
- });
- }
- return [filledColumns, Math.max(realTotal, maxFitWidth)];
- }
- return [flattenColumns, scrollWidth];
- }, [flattenColumns, scrollWidth, clientWidth]);
- }
- ;// ./node_modules/rc-table/es/hooks/useColumns/index.js
- var useColumns_excluded = ["children"],
- useColumns_excluded2 = ["fixed"];
- function convertChildrenToColumns(children) {
- return (0,toArray["default"])(children).filter(function (node) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node);
- }).map(function (_ref) {
- var key = _ref.key,
- props = _ref.props;
- var nodeChildren = props.children,
- restProps = (0,objectWithoutProperties["default"])(props, useColumns_excluded);
- var column = (0,objectSpread2["default"])({
- key: key
- }, restProps);
- if (nodeChildren) {
- column.children = convertChildrenToColumns(nodeChildren);
- }
- return column;
- });
- }
- function filterHiddenColumns(columns) {
- return columns.filter(function (column) {
- return column && (0,esm_typeof["default"])(column) === 'object' && !column.hidden;
- }).map(function (column) {
- var subColumns = column.children;
- if (subColumns && subColumns.length > 0) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, column), {}, {
- children: filterHiddenColumns(subColumns)
- });
- }
- return column;
- });
- }
- function flatColumns(columns) {
- var parentKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key';
- return columns.filter(function (column) {
- return column && (0,esm_typeof["default"])(column) === 'object';
- }).reduce(function (list, column, index) {
- var fixed = column.fixed;
- // Convert `fixed='true'` to `fixed='left'` instead
- var parsedFixed = fixed === true ? 'left' : fixed;
- var mergedKey = "".concat(parentKey, "-").concat(index);
- var subColumns = column.children;
- if (subColumns && subColumns.length > 0) {
- return [].concat((0,toConsumableArray["default"])(list), (0,toConsumableArray["default"])(flatColumns(subColumns, mergedKey).map(function (subColum) {
- var _subColum$fixed;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, subColum), {}, {
- fixed: (_subColum$fixed = subColum.fixed) !== null && _subColum$fixed !== void 0 ? _subColum$fixed : parsedFixed
- });
- })));
- }
- return [].concat((0,toConsumableArray["default"])(list), [(0,objectSpread2["default"])((0,objectSpread2["default"])({
- key: mergedKey
- }, column), {}, {
- fixed: parsedFixed
- })]);
- }, []);
- }
- function revertForRtl(columns) {
- return columns.map(function (column) {
- var fixed = column.fixed,
- restProps = (0,objectWithoutProperties["default"])(column, useColumns_excluded2);
- // Convert `fixed='left'` to `fixed='right'` instead
- var parsedFixed = fixed;
- if (fixed === 'left') {
- parsedFixed = 'right';
- } else if (fixed === 'right') {
- parsedFixed = 'left';
- }
- return (0,objectSpread2["default"])({
- fixed: parsedFixed
- }, restProps);
- });
- }
- /**
- * Parse `columns` & `children` into `columns`.
- */
- function useColumns(_ref2, transformColumns) {
- var prefixCls = _ref2.prefixCls,
- columns = _ref2.columns,
- children = _ref2.children,
- expandable = _ref2.expandable,
- expandedKeys = _ref2.expandedKeys,
- columnTitle = _ref2.columnTitle,
- getRowKey = _ref2.getRowKey,
- onTriggerExpand = _ref2.onTriggerExpand,
- expandIcon = _ref2.expandIcon,
- rowExpandable = _ref2.rowExpandable,
- expandIconColumnIndex = _ref2.expandIconColumnIndex,
- _ref2$expandedRowOffs = _ref2.expandedRowOffset,
- expandedRowOffset = _ref2$expandedRowOffs === void 0 ? 0 : _ref2$expandedRowOffs,
- direction = _ref2.direction,
- expandRowByClick = _ref2.expandRowByClick,
- columnWidth = _ref2.columnWidth,
- fixed = _ref2.fixed,
- scrollWidth = _ref2.scrollWidth,
- clientWidth = _ref2.clientWidth;
- var baseColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var newColumns = columns || convertChildrenToColumns(children) || [];
- return filterHiddenColumns(newColumns.slice());
- }, [columns, children]);
- // ========================== Expand ==========================
- var withExpandColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (expandable) {
- var cloneColumns = baseColumns.slice();
- // >>> Warning if use `expandIconColumnIndex`
- if ( true && expandIconColumnIndex >= 0) {
- (0,warning["default"])(false, '`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead.');
- }
- // >>> Insert expand column if not exist
- if (!cloneColumns.includes(EXPAND_COLUMN)) {
- var expandColIndex = expandIconColumnIndex || 0;
- var insertIndex = expandColIndex === 0 && fixed === 'right' ? baseColumns.length : expandColIndex;
- if (insertIndex >= 0) {
- cloneColumns.splice(insertIndex, 0, EXPAND_COLUMN);
- }
- }
- // >>> Deduplicate additional expand column
- if ( true && cloneColumns.filter(function (c) {
- return c === EXPAND_COLUMN;
- }).length > 1) {
- (0,warning["default"])(false, 'There exist more than one `EXPAND_COLUMN` in `columns`.');
- }
- var expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
- cloneColumns = cloneColumns.filter(function (column, index) {
- return column !== EXPAND_COLUMN || index === expandColumnIndex;
- });
- // >>> Check if expand column need to fixed
- var prevColumn = baseColumns[expandColumnIndex];
- var fixedColumn;
- if (fixed) {
- fixedColumn = fixed;
- } else {
- fixedColumn = prevColumn ? prevColumn.fixed : null;
- }
- // >>> Create expandable column
- var expandColumn = (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, INTERNAL_COL_DEFINE, {
- className: "".concat(prefixCls, "-expand-icon-col"),
- columnType: 'EXPAND_COLUMN'
- }), "title", columnTitle), "fixed", fixedColumn), "className", "".concat(prefixCls, "-row-expand-icon-cell")), "width", columnWidth), "render", function render(_, record, index) {
- var rowKey = getRowKey(record, index);
- var expanded = expandedKeys.has(rowKey);
- var recordExpandable = rowExpandable ? rowExpandable(record) : true;
- var icon = expandIcon({
- prefixCls: prefixCls,
- expanded: expanded,
- expandable: recordExpandable,
- record: record,
- onExpand: onTriggerExpand
- });
- if (expandRowByClick) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- onClick: function onClick(e) {
- return e.stopPropagation();
- }
- }, icon);
- }
- return icon;
- });
- return cloneColumns.map(function (col, index) {
- var column = col === EXPAND_COLUMN ? expandColumn : col;
- if (index < expandedRowOffset) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, column), {}, {
- fixed: column.fixed || 'left'
- });
- }
- return column;
- });
- }
- if ( true && baseColumns.includes(EXPAND_COLUMN)) {
- (0,warning["default"])(false, '`expandable` is not config but there exist `EXPAND_COLUMN` in `columns`.');
- }
- return baseColumns.filter(function (col) {
- return col !== EXPAND_COLUMN;
- });
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction, expandedRowOffset]);
- // ========================= Transform ========================
- var mergedColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var finalColumns = withExpandColumns;
- if (transformColumns) {
- finalColumns = transformColumns(finalColumns);
- }
- // Always provides at least one column for table display
- if (!finalColumns.length) {
- finalColumns = [{
- render: function render() {
- return null;
- }
- }];
- }
- return finalColumns;
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [transformColumns, withExpandColumns, direction]);
- // ========================== Flatten =========================
- var flattenColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (direction === 'rtl') {
- return revertForRtl(flatColumns(mergedColumns));
- }
- return flatColumns(mergedColumns);
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [mergedColumns, direction, scrollWidth]);
- // ========================= Gap Fixed ========================
- var hasGapFixed = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // Fixed: left, since old browser not support `findLastIndex`, we should use reverse loop
- var lastLeftIndex = -1;
- for (var i = flattenColumns.length - 1; i >= 0; i -= 1) {
- var colFixed = flattenColumns[i].fixed;
- if (colFixed === 'left' || colFixed === true) {
- lastLeftIndex = i;
- break;
- }
- }
- if (lastLeftIndex >= 0) {
- for (var _i = 0; _i <= lastLeftIndex; _i += 1) {
- var _colFixed = flattenColumns[_i].fixed;
- if (_colFixed !== 'left' && _colFixed !== true) {
- return true;
- }
- }
- }
- // Fixed: right
- var firstRightIndex = flattenColumns.findIndex(function (_ref3) {
- var colFixed = _ref3.fixed;
- return colFixed === 'right';
- });
- if (firstRightIndex >= 0) {
- for (var _i2 = firstRightIndex; _i2 < flattenColumns.length; _i2 += 1) {
- var _colFixed2 = flattenColumns[_i2].fixed;
- if (_colFixed2 !== 'right') {
- return true;
- }
- }
- }
- return false;
- }, [flattenColumns]);
- // ========================= FillWidth ========================
- var _useWidthColumns = useWidthColumns(flattenColumns, scrollWidth, clientWidth),
- _useWidthColumns2 = (0,slicedToArray["default"])(_useWidthColumns, 2),
- filledColumns = _useWidthColumns2[0],
- realScrollWidth = _useWidthColumns2[1];
- return [mergedColumns, filledColumns, realScrollWidth, hasGapFixed];
- }
- /* harmony default export */ var hooks_useColumns = (useColumns);
- ;// ./node_modules/rc-table/es/hooks/useExpand.js
- function useExpand(props, mergedData, getRowKey) {
- var expandableConfig = getExpandableProps(props);
- var expandIcon = expandableConfig.expandIcon,
- expandedRowKeys = expandableConfig.expandedRowKeys,
- defaultExpandedRowKeys = expandableConfig.defaultExpandedRowKeys,
- defaultExpandAllRows = expandableConfig.defaultExpandAllRows,
- expandedRowRender = expandableConfig.expandedRowRender,
- onExpand = expandableConfig.onExpand,
- onExpandedRowsChange = expandableConfig.onExpandedRowsChange,
- childrenColumnName = expandableConfig.childrenColumnName;
- var mergedExpandIcon = expandIcon || renderExpandIcon;
- var mergedChildrenColumnName = childrenColumnName || 'children';
- var expandableType = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (expandedRowRender) {
- return 'row';
- }
- /* eslint-disable no-underscore-dangle */
- /**
- * Fix https://github.com/ant-design/ant-design/issues/21154
- * This is a workaround to not to break current behavior.
- * We can remove follow code after final release.
- *
- * To other developer:
- * Do not use `__PARENT_RENDER_ICON__` in prod since we will remove this when refactor
- */
- if (props.expandable && props.internalHooks === INTERNAL_HOOKS && props.expandable.__PARENT_RENDER_ICON__ || mergedData.some(function (record) {
- return record && (0,esm_typeof["default"])(record) === 'object' && record[mergedChildrenColumnName];
- })) {
- return 'nest';
- }
- /* eslint-enable */
- return false;
- }, [!!expandedRowRender, mergedData]);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- if (defaultExpandedRowKeys) {
- return defaultExpandedRowKeys;
- }
- if (defaultExpandAllRows) {
- return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);
- }
- return [];
- }),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- innerExpandedKeys = _React$useState2[0],
- setInnerExpandedKeys = _React$useState2[1];
- var mergedExpandedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return new Set(expandedRowKeys || innerExpandedKeys || []);
- }, [expandedRowKeys, innerExpandedKeys]);
- var onTriggerExpand = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (record) {
- var key = getRowKey(record, mergedData.indexOf(record));
- var newExpandedKeys;
- var hasKey = mergedExpandedKeys.has(key);
- if (hasKey) {
- mergedExpandedKeys.delete(key);
- newExpandedKeys = (0,toConsumableArray["default"])(mergedExpandedKeys);
- } else {
- newExpandedKeys = [].concat((0,toConsumableArray["default"])(mergedExpandedKeys), [key]);
- }
- setInnerExpandedKeys(newExpandedKeys);
- if (onExpand) {
- onExpand(!hasKey, record);
- }
- if (onExpandedRowsChange) {
- onExpandedRowsChange(newExpandedKeys);
- }
- }, [getRowKey, mergedExpandedKeys, mergedData, onExpand, onExpandedRowsChange]);
- // Warning if use `expandedRowRender` and nest children in the same time
- if ( true && expandedRowRender && mergedData.some(function (record) {
- return Array.isArray(record === null || record === void 0 ? void 0 : record[mergedChildrenColumnName]);
- })) {
- (0,warning["default"])(false, '`expandedRowRender` should not use with nested Table');
- }
- return [expandableConfig, expandableType, mergedExpandedKeys, mergedExpandIcon, mergedChildrenColumnName, onTriggerExpand];
- }
- ;// ./node_modules/rc-table/es/hooks/useFixedInfo.js
- function useFixedInfo(flattenColumns, stickyOffsets, direction) {
- var fixedInfoList = flattenColumns.map(function (_, colIndex) {
- return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction);
- });
- return (0,useMemo["default"])(function () {
- return fixedInfoList;
- }, [fixedInfoList], function (prev, next) {
- return !(0,isEqual["default"])(prev, next);
- });
- }
- ;// ./node_modules/rc-table/es/hooks/useFrame.js
- /**
- * Execute code before next frame but async
- */
- function useLayoutState(defaultState) {
- var stateRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(defaultState);
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({}),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- forceUpdate = _useState2[1];
- var lastPromiseRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var updateBatchRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)([]);
- function setFrameState(updater) {
- updateBatchRef.current.push(updater);
- var promise = Promise.resolve();
- lastPromiseRef.current = promise;
- promise.then(function () {
- if (lastPromiseRef.current === promise) {
- var prevBatch = updateBatchRef.current;
- var prevState = stateRef.current;
- updateBatchRef.current = [];
- prevBatch.forEach(function (batchUpdater) {
- stateRef.current = batchUpdater(stateRef.current);
- });
- lastPromiseRef.current = null;
- if (prevState !== stateRef.current) {
- forceUpdate({});
- }
- }
- });
- }
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return function () {
- lastPromiseRef.current = null;
- };
- }, []);
- return [stateRef.current, setFrameState];
- }
- /** Lock frame, when frame pass reset the lock. */
- function useTimeoutLock(defaultState) {
- var frameRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(defaultState || null);
- var timeoutRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- function cleanUp() {
- window.clearTimeout(timeoutRef.current);
- }
- function setState(newState) {
- frameRef.current = newState;
- cleanUp();
- timeoutRef.current = window.setTimeout(function () {
- frameRef.current = null;
- timeoutRef.current = undefined;
- }, 100);
- }
- function getState() {
- return frameRef.current;
- }
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return cleanUp;
- }, []);
- return [setState, getState];
- }
- ;// ./node_modules/rc-table/es/hooks/useHover.js
- function useHover() {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(-1),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- startRow = _React$useState2[0],
- setStartRow = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(-1),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- endRow = _React$useState4[0],
- setEndRow = _React$useState4[1];
- var onHover = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (start, end) {
- setStartRow(start);
- setEndRow(end);
- }, []);
- return [startRow, endRow, onHover];
- }
- ;// ./node_modules/rc-table/es/hooks/useSticky.js
- // fix ssr render
- var defaultContainer = (0,canUseDom["default"])() ? window : null;
- /** Sticky header hooks */
- function useSticky(sticky, prefixCls) {
- var _ref = (0,esm_typeof["default"])(sticky) === 'object' ? sticky : {},
- _ref$offsetHeader = _ref.offsetHeader,
- offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,
- _ref$offsetSummary = _ref.offsetSummary,
- offsetSummary = _ref$offsetSummary === void 0 ? 0 : _ref$offsetSummary,
- _ref$offsetScroll = _ref.offsetScroll,
- offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,
- _ref$getContainer = _ref.getContainer,
- getContainer = _ref$getContainer === void 0 ? function () {
- return defaultContainer;
- } : _ref$getContainer;
- var container = getContainer() || defaultContainer;
- var isSticky = !!sticky;
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- isSticky: isSticky,
- stickyClassName: isSticky ? "".concat(prefixCls, "-sticky-holder") : '',
- offsetHeader: offsetHeader,
- offsetSummary: offsetSummary,
- offsetScroll: offsetScroll,
- container: container
- };
- }, [isSticky, offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
- }
- ;// ./node_modules/rc-table/es/hooks/useStickyOffsets.js
- /**
- * Get sticky column offset width
- */
- function useStickyOffsets(colWidths, flattenColumns, direction) {
- var stickyOffsets = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- var columnCount = flattenColumns.length;
- var getOffsets = function getOffsets(startIndex, endIndex, offset) {
- var offsets = [];
- var total = 0;
- for (var i = startIndex; i !== endIndex; i += offset) {
- offsets.push(total);
- if (flattenColumns[i].fixed) {
- total += colWidths[i] || 0;
- }
- }
- return offsets;
- };
- var startOffsets = getOffsets(0, columnCount, 1);
- var endOffsets = getOffsets(columnCount - 1, -1, -1).reverse();
- return direction === 'rtl' ? {
- left: endOffsets,
- right: startOffsets
- } : {
- left: startOffsets,
- right: endOffsets
- };
- }, [colWidths, flattenColumns, direction]);
- return stickyOffsets;
- }
- /* harmony default export */ var hooks_useStickyOffsets = (useStickyOffsets);
- ;// ./node_modules/rc-table/es/Panel/index.js
- function es_Panel_Panel(_ref) {
- var className = _ref.className,
- children = _ref.children;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className
- }, children);
- }
- /* harmony default export */ var es_Panel = (es_Panel_Panel);
- ;// ./node_modules/rc-table/es/utils/offsetUtil.js
- // Copy from `rc-util/Dom/css.js`
- function offsetUtil_getOffset(node) {
- var element = (0,findDOMNode.getDOM)(node);
- var box = element.getBoundingClientRect();
- var docElem = document.documentElement;
- // < ie8 not support win.pageXOffset, use docElem.scrollLeft instead
- return {
- left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
- top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
- };
- }
- ;// ./node_modules/rc-table/es/stickyScrollBar.js
- var StickyScrollBar = function StickyScrollBar(_ref, ref) {
- var _scrollBodyRef$curren, _scrollBodyRef$curren2;
- var scrollBodyRef = _ref.scrollBodyRef,
- onScroll = _ref.onScroll,
- offsetScroll = _ref.offsetScroll,
- container = _ref.container,
- direction = _ref.direction;
- var prefixCls = useContext(context_TableContext, 'prefixCls');
- var bodyScrollWidth = ((_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 ? void 0 : _scrollBodyRef$curren.scrollWidth) || 0;
- var bodyWidth = ((_scrollBodyRef$curren2 = scrollBodyRef.current) === null || _scrollBodyRef$curren2 === void 0 ? void 0 : _scrollBodyRef$curren2.clientWidth) || 0;
- var scrollBarWidth = bodyScrollWidth && bodyWidth * (bodyWidth / bodyScrollWidth);
- var scrollBarRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _useLayoutState = useLayoutState({
- scrollLeft: 0,
- isHiddenScrollBar: true
- }),
- _useLayoutState2 = (0,slicedToArray["default"])(_useLayoutState, 2),
- scrollState = _useLayoutState2[0],
- setScrollState = _useLayoutState2[1];
- var refState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- delta: 0,
- x: 0
- });
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- isActive = _React$useState2[0],
- setActive = _React$useState2[1];
- var rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- raf["default"].cancel(rafRef.current);
- };
- }, []);
- var onMouseUp = function onMouseUp() {
- setActive(false);
- };
- var onMouseDown = function onMouseDown(event) {
- event.persist();
- refState.current.delta = event.pageX - scrollState.scrollLeft;
- refState.current.x = 0;
- setActive(true);
- event.preventDefault();
- };
- var onMouseMove = function onMouseMove(event) {
- var _window;
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
- var _ref2 = event || ((_window = window) === null || _window === void 0 ? void 0 : _window.event),
- buttons = _ref2.buttons;
- if (!isActive || buttons === 0) {
- // If out body mouse up, we can set isActive false when mouse move
- if (isActive) {
- setActive(false);
- }
- return;
- }
- var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;
- var isRTL = direction === 'rtl';
- // Limit scroll range
- left = Math.max(isRTL ? scrollBarWidth - bodyWidth : 0, Math.min(isRTL ? 0 : bodyWidth - scrollBarWidth, left));
- // Calculate the scroll position and update
- var shouldScroll = !isRTL || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth;
- if (shouldScroll) {
- onScroll({
- scrollLeft: left / bodyWidth * (bodyScrollWidth + 2)
- });
- refState.current.x = event.pageX;
- }
- };
- var checkScrollBarVisible = function checkScrollBarVisible() {
- raf["default"].cancel(rafRef.current);
- rafRef.current = (0,raf["default"])(function () {
- if (!scrollBodyRef.current) {
- return;
- }
- var tableOffsetTop = offsetUtil_getOffset(scrollBodyRef.current).top;
- var tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;
- var currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : offsetUtil_getOffset(container).top + container.clientHeight;
- setScrollState(function (state) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, state), {}, {
- isHiddenScrollBar: tableBottomOffset - getScrollBarSize() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll
- });
- });
- });
- };
- var setScrollLeft = function setScrollLeft(left) {
- setScrollState(function (state) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, state), {}, {
- scrollLeft: bodyScrollWidth ? left / bodyScrollWidth * bodyWidth : 0
- });
- });
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- setScrollLeft: setScrollLeft,
- checkScrollBarVisible: checkScrollBarVisible
- };
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- var onMouseUpListener = addEventListenerWrap(document.body, 'mouseup', onMouseUp, false);
- var onMouseMoveListener = addEventListenerWrap(document.body, 'mousemove', onMouseMove, false);
- checkScrollBarVisible();
- return function () {
- onMouseUpListener.remove();
- onMouseMoveListener.remove();
- };
- }, [scrollBarWidth, isActive]);
- // Loop for scroll event check
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!scrollBodyRef.current) return;
- var scrollParents = [];
- var parent = (0,findDOMNode.getDOM)(scrollBodyRef.current);
- while (parent) {
- scrollParents.push(parent);
- parent = parent.parentElement;
- }
- scrollParents.forEach(function (p) {
- return p.addEventListener('scroll', checkScrollBarVisible, false);
- });
- window.addEventListener('resize', checkScrollBarVisible, false);
- window.addEventListener('scroll', checkScrollBarVisible, false);
- container.addEventListener('scroll', checkScrollBarVisible, false);
- return function () {
- scrollParents.forEach(function (p) {
- return p.removeEventListener('scroll', checkScrollBarVisible);
- });
- window.removeEventListener('resize', checkScrollBarVisible);
- window.removeEventListener('scroll', checkScrollBarVisible);
- container.removeEventListener('scroll', checkScrollBarVisible);
- };
- }, [container]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!scrollState.isHiddenScrollBar) {
- setScrollState(function (state) {
- var bodyNode = scrollBodyRef.current;
- if (!bodyNode) {
- return state;
- }
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, state), {}, {
- scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth
- });
- });
- }
- }, [scrollState.isHiddenScrollBar]);
- if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: {
- height: getScrollBarSize(),
- width: bodyWidth,
- bottom: offsetScroll
- },
- className: "".concat(prefixCls, "-sticky-scroll")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- onMouseDown: onMouseDown,
- ref: scrollBarRef,
- className: classnames_default()("".concat(prefixCls, "-sticky-scroll-bar"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-sticky-scroll-bar-active"), isActive)),
- style: {
- width: "".concat(scrollBarWidth, "px"),
- transform: "translate3d(".concat(scrollState.scrollLeft, "px, 0, 0)")
- }
- }));
- };
- /* harmony default export */ var stickyScrollBar = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(StickyScrollBar));
- ;// ./node_modules/rc-table/es/Table.js
- /**
- * Feature:
- * - fixed not need to set width
- * - support `rowExpandable` to config row expand logic
- * - add `summary` to support `() => ReactNode`
- *
- * Update:
- * - `dataIndex` is `array[]` now
- * - `expandable` wrap all the expand related props
- *
- * Removed:
- * - expandIconAsCell
- * - useFixedHeader
- * - rowRef
- * - columns[number].onCellClick
- * - onRowClick
- * - onRowDoubleClick
- * - onRowMouseEnter
- * - onRowMouseLeave
- * - getBodyWrapper
- * - bodyStyle
- *
- * Deprecated:
- * - All expanded props, move into expandable
- */
- var DEFAULT_PREFIX = 'rc-table';
- // Used for conditions cache
- var Table_EMPTY_DATA = [];
- // Used for customize scroll
- var EMPTY_SCROLL_TARGET = {};
- function defaultEmpty() {
- return 'No Data';
- }
- function Table(tableProps, ref) {
- var props = (0,objectSpread2["default"])({
- rowKey: 'key',
- prefixCls: DEFAULT_PREFIX,
- emptyText: defaultEmpty
- }, tableProps);
- var prefixCls = props.prefixCls,
- className = props.className,
- rowClassName = props.rowClassName,
- style = props.style,
- data = props.data,
- rowKey = props.rowKey,
- scroll = props.scroll,
- tableLayout = props.tableLayout,
- direction = props.direction,
- title = props.title,
- footer = props.footer,
- summary = props.summary,
- caption = props.caption,
- id = props.id,
- showHeader = props.showHeader,
- components = props.components,
- emptyText = props.emptyText,
- onRow = props.onRow,
- onHeaderRow = props.onHeaderRow,
- measureRowRender = props.measureRowRender,
- onScroll = props.onScroll,
- internalHooks = props.internalHooks,
- transformColumns = props.transformColumns,
- internalRefs = props.internalRefs,
- tailor = props.tailor,
- getContainerWidth = props.getContainerWidth,
- sticky = props.sticky,
- _props$rowHoverable = props.rowHoverable,
- rowHoverable = _props$rowHoverable === void 0 ? true : _props$rowHoverable;
- var mergedData = data || Table_EMPTY_DATA;
- var hasData = !!mergedData.length;
- var useInternalHooks = internalHooks === INTERNAL_HOOKS;
- // ===================== Warning ======================
- if (true) {
- ['onRowClick', 'onRowDoubleClick', 'onRowContextMenu', 'onRowMouseEnter', 'onRowMouseLeave'].forEach(function (name) {
- (0,warning["default"])(props[name] === undefined, "`".concat(name, "` is removed, please use `onRow` instead."));
- });
- (0,warning["default"])(!('getBodyWrapper' in props), '`getBodyWrapper` is deprecated, please use custom `components` instead.');
- }
- // ==================== Customize =====================
- var getComponent = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (path, defaultComponent) {
- return (0,get["default"])(components, path) || defaultComponent;
- }, [components]);
- var getRowKey = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (typeof rowKey === 'function') {
- return rowKey;
- }
- return function (record) {
- var key = record && record[rowKey];
- if (true) {
- (0,warning["default"])(key !== undefined, 'Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key.');
- }
- return key;
- };
- }, [rowKey]);
- var customizeScrollBody = getComponent(['body']);
- // ====================== Hover =======================
- var _useHover = useHover(),
- _useHover2 = (0,slicedToArray["default"])(_useHover, 3),
- startRow = _useHover2[0],
- endRow = _useHover2[1],
- onHover = _useHover2[2];
- // ====================== Expand ======================
- var _useExpand = useExpand(props, mergedData, getRowKey),
- _useExpand2 = (0,slicedToArray["default"])(_useExpand, 6),
- expandableConfig = _useExpand2[0],
- expandableType = _useExpand2[1],
- mergedExpandedKeys = _useExpand2[2],
- mergedExpandIcon = _useExpand2[3],
- mergedChildrenColumnName = _useExpand2[4],
- onTriggerExpand = _useExpand2[5];
- // ====================== Column ======================
- var scrollX = scroll === null || scroll === void 0 ? void 0 : scroll.x;
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- componentWidth = _React$useState2[0],
- setComponentWidth = _React$useState2[1];
- var _useColumns = hooks_useColumns((0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), expandableConfig), {}, {
- expandable: !!expandableConfig.expandedRowRender,
- columnTitle: expandableConfig.columnTitle,
- expandedKeys: mergedExpandedKeys,
- getRowKey: getRowKey,
- // https://github.com/ant-design/ant-design/issues/23894
- onTriggerExpand: onTriggerExpand,
- expandIcon: mergedExpandIcon,
- expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
- direction: direction,
- scrollWidth: useInternalHooks && tailor && typeof scrollX === 'number' ? scrollX : null,
- clientWidth: componentWidth
- }), useInternalHooks ? transformColumns : null),
- _useColumns2 = (0,slicedToArray["default"])(_useColumns, 4),
- columns = _useColumns2[0],
- flattenColumns = _useColumns2[1],
- flattenScrollX = _useColumns2[2],
- hasGapFixed = _useColumns2[3];
- var mergedScrollX = flattenScrollX !== null && flattenScrollX !== void 0 ? flattenScrollX : scrollX;
- var columnContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- columns: columns,
- flattenColumns: flattenColumns
- };
- }, [columns, flattenColumns]);
- // ======================= Refs =======================
- var fullTableRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var scrollHeaderRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var scrollBodyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var scrollBodyContainerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- nativeElement: fullTableRef.current,
- scrollTo: function scrollTo(config) {
- var _scrollBodyRef$curren3;
- if (scrollBodyRef.current instanceof HTMLElement) {
- // Native scroll
- var index = config.index,
- top = config.top,
- key = config.key;
- if (validNumberValue(top)) {
- var _scrollBodyRef$curren;
- (_scrollBodyRef$curren = scrollBodyRef.current) === null || _scrollBodyRef$curren === void 0 || _scrollBodyRef$curren.scrollTo({
- top: top
- });
- } else {
- var _scrollBodyRef$curren2;
- var mergedKey = key !== null && key !== void 0 ? key : getRowKey(mergedData[index]);
- (_scrollBodyRef$curren2 = scrollBodyRef.current.querySelector("[data-row-key=\"".concat(mergedKey, "\"]"))) === null || _scrollBodyRef$curren2 === void 0 || _scrollBodyRef$curren2.scrollIntoView();
- }
- } else if ((_scrollBodyRef$curren3 = scrollBodyRef.current) !== null && _scrollBodyRef$curren3 !== void 0 && _scrollBodyRef$curren3.scrollTo) {
- // Pass to proxy
- scrollBodyRef.current.scrollTo(config);
- }
- }
- };
- });
- // ====================== Scroll ======================
- var scrollSummaryRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- pingedLeft = _React$useState4[0],
- setPingedLeft = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- pingedRight = _React$useState6[0],
- setPingedRight = _React$useState6[1];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(new Map()),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- colsWidths = _React$useState8[0],
- updateColsWidths = _React$useState8[1];
- // Convert map to number width
- var colsKeys = getColumnsKey(flattenColumns);
- var pureColWidths = colsKeys.map(function (columnKey) {
- return colsWidths.get(columnKey);
- });
- var colWidths = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return pureColWidths;
- }, [pureColWidths.join('_')]);
- var stickyOffsets = hooks_useStickyOffsets(colWidths, flattenColumns, direction);
- var fixHeader = scroll && validateValue(scroll.y);
- var horizonScroll = scroll && validateValue(mergedScrollX) || Boolean(expandableConfig.fixed);
- var fixColumn = horizonScroll && flattenColumns.some(function (_ref) {
- var fixed = _ref.fixed;
- return fixed;
- });
- // Sticky
- var stickyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _useSticky = useSticky(sticky, prefixCls),
- isSticky = _useSticky.isSticky,
- offsetHeader = _useSticky.offsetHeader,
- offsetSummary = _useSticky.offsetSummary,
- offsetScroll = _useSticky.offsetScroll,
- stickyClassName = _useSticky.stickyClassName,
- container = _useSticky.container;
- // Footer (Fix footer must fixed header)
- var summaryNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return summary === null || summary === void 0 ? void 0 : summary(mergedData);
- }, [summary, mergedData]);
- var fixFooter = (fixHeader || isSticky) && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(summaryNode) && summaryNode.type === Footer_Summary && summaryNode.props.fixed;
- // Scroll
- var scrollXStyle;
- var scrollYStyle;
- var scrollTableStyle;
- if (fixHeader) {
- scrollYStyle = {
- overflowY: hasData ? 'scroll' : 'auto',
- maxHeight: scroll.y
- };
- }
- if (horizonScroll) {
- scrollXStyle = {
- overflowX: 'auto'
- };
- // When no vertical scrollbar, should hide it
- // https://github.com/ant-design/ant-design/pull/20705
- // https://github.com/ant-design/ant-design/issues/21879
- if (!fixHeader) {
- scrollYStyle = {
- overflowY: 'hidden'
- };
- }
- scrollTableStyle = {
- width: mergedScrollX === true ? 'auto' : mergedScrollX,
- minWidth: '100%'
- };
- }
- var onColumnResize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (columnKey, width) {
- updateColsWidths(function (widths) {
- if (widths.get(columnKey) !== width) {
- var newWidths = new Map(widths);
- newWidths.set(columnKey, width);
- return newWidths;
- }
- return widths;
- });
- }, []);
- var _useTimeoutLock = useTimeoutLock(null),
- _useTimeoutLock2 = (0,slicedToArray["default"])(_useTimeoutLock, 2),
- setScrollTarget = _useTimeoutLock2[0],
- getScrollTarget = _useTimeoutLock2[1];
- function forceScroll(scrollLeft, target) {
- if (!target) {
- return;
- }
- if (typeof target === 'function') {
- target(scrollLeft);
- } else if (target.scrollLeft !== scrollLeft) {
- target.scrollLeft = scrollLeft;
- // Delay to force scroll position if not sync
- // ref: https://github.com/ant-design/ant-design/issues/37179
- if (target.scrollLeft !== scrollLeft) {
- setTimeout(function () {
- target.scrollLeft = scrollLeft;
- }, 0);
- }
- }
- }
- var onInternalScroll = (0,useEvent["default"])(function (_ref2) {
- var currentTarget = _ref2.currentTarget,
- scrollLeft = _ref2.scrollLeft;
- var isRTL = direction === 'rtl';
- var mergedScrollLeft = typeof scrollLeft === 'number' ? scrollLeft : currentTarget.scrollLeft;
- var compareTarget = currentTarget || EMPTY_SCROLL_TARGET;
- if (!getScrollTarget() || getScrollTarget() === compareTarget) {
- var _stickyRef$current;
- setScrollTarget(compareTarget);
- forceScroll(mergedScrollLeft, scrollHeaderRef.current);
- forceScroll(mergedScrollLeft, scrollBodyRef.current);
- forceScroll(mergedScrollLeft, scrollSummaryRef.current);
- forceScroll(mergedScrollLeft, (_stickyRef$current = stickyRef.current) === null || _stickyRef$current === void 0 ? void 0 : _stickyRef$current.setScrollLeft);
- }
- var measureTarget = currentTarget || scrollHeaderRef.current;
- if (measureTarget) {
- var scrollWidth =
- // Should use mergedScrollX in virtual table(useInternalHooks && tailor === true)
- useInternalHooks && tailor && typeof mergedScrollX === 'number' ? mergedScrollX : measureTarget.scrollWidth;
- var clientWidth = measureTarget.clientWidth;
- // There is no space to scroll
- if (scrollWidth === clientWidth) {
- setPingedLeft(false);
- setPingedRight(false);
- return;
- }
- if (isRTL) {
- setPingedLeft(-mergedScrollLeft < scrollWidth - clientWidth);
- setPingedRight(-mergedScrollLeft > 0);
- } else {
- setPingedLeft(mergedScrollLeft > 0);
- setPingedRight(mergedScrollLeft < scrollWidth - clientWidth);
- }
- }
- });
- var onBodyScroll = (0,useEvent["default"])(function (e) {
- onInternalScroll(e);
- onScroll === null || onScroll === void 0 || onScroll(e);
- });
- var triggerOnScroll = function triggerOnScroll() {
- if (horizonScroll && scrollBodyRef.current) {
- var _scrollBodyRef$curren4;
- onInternalScroll({
- currentTarget: (0,findDOMNode.getDOM)(scrollBodyRef.current),
- scrollLeft: (_scrollBodyRef$curren4 = scrollBodyRef.current) === null || _scrollBodyRef$curren4 === void 0 ? void 0 : _scrollBodyRef$curren4.scrollLeft
- });
- } else {
- setPingedLeft(false);
- setPingedRight(false);
- }
- };
- var onFullTableResize = function onFullTableResize(_ref3) {
- var _stickyRef$current2;
- var width = _ref3.width;
- (_stickyRef$current2 = stickyRef.current) === null || _stickyRef$current2 === void 0 || _stickyRef$current2.checkScrollBarVisible();
- var mergedWidth = fullTableRef.current ? fullTableRef.current.offsetWidth : width;
- if (useInternalHooks && getContainerWidth && fullTableRef.current) {
- mergedWidth = getContainerWidth(fullTableRef.current, mergedWidth) || mergedWidth;
- }
- if (mergedWidth !== componentWidth) {
- triggerOnScroll();
- setComponentWidth(mergedWidth);
- }
- };
- // Sync scroll bar when init or `horizonScroll`, `data` and `columns.length` changed
- var mounted = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // onFullTableResize will be trigger once when ResizeObserver is mounted
- // This will reduce one duplicated triggerOnScroll time
- if (mounted.current) {
- triggerOnScroll();
- }
- }, [horizonScroll, data, columns.length]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- mounted.current = true;
- }, []);
- // ===================== Effects ======================
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- scrollbarSize = _React$useState10[0],
- setScrollbarSize = _React$useState10[1];
- var _React$useState11 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true),
- _React$useState12 = (0,slicedToArray["default"])(_React$useState11, 2),
- supportSticky = _React$useState12[0],
- setSupportSticky = _React$useState12[1]; // Only IE not support, we mark as support first
- (0,useLayoutEffect["default"])(function () {
- if (!tailor || !useInternalHooks) {
- if (scrollBodyRef.current instanceof Element) {
- setScrollbarSize(getTargetScrollBarSize(scrollBodyRef.current).width);
- } else {
- setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width);
- }
- }
- setSupportSticky(isStyleSupport('position', 'sticky'));
- }, []);
- // ================== INTERNAL HOOKS ==================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (useInternalHooks && internalRefs) {
- internalRefs.body.current = scrollBodyRef.current;
- }
- });
- // ========================================================================
- // == Render ==
- // ========================================================================
- // =================== Render: Func ===================
- var renderFixedHeaderTable = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (fixedHolderPassProps) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Header_Header, fixedHolderPassProps), fixFooter === 'top' && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Footer, fixedHolderPassProps, summaryNode));
- }, [fixFooter, summaryNode]);
- var renderFixedFooterTable = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (fixedHolderPassProps) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Footer, fixedHolderPassProps, summaryNode);
- }, [summaryNode]);
- // =================== Render: Node ===================
- var TableComponent = getComponent(['table'], 'table');
- // Table layout
- var mergedTableLayout = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (tableLayout) {
- return tableLayout;
- }
- // https://github.com/ant-design/ant-design/issues/25227
- // When scroll.x is max-content, no need to fix table layout
- // it's width should stretch out to fit content
- if (fixColumn) {
- return mergedScrollX === 'max-content' ? 'auto' : 'fixed';
- }
- if (fixHeader || isSticky || flattenColumns.some(function (_ref4) {
- var ellipsis = _ref4.ellipsis;
- return ellipsis;
- })) {
- return 'fixed';
- }
- return 'auto';
- }, [fixHeader, fixColumn, flattenColumns, tableLayout, isSticky]);
- var groupTableNode;
- // Header props
- var headerProps = {
- colWidths: colWidths,
- columCount: flattenColumns.length,
- stickyOffsets: stickyOffsets,
- onHeaderRow: onHeaderRow,
- fixHeader: fixHeader,
- scroll: scroll
- };
- // Empty
- var emptyNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (hasData) {
- return null;
- }
- if (typeof emptyText === 'function') {
- return emptyText();
- }
- return emptyText;
- }, [hasData, emptyText]);
- // Body
- var bodyTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Body, {
- data: mergedData,
- measureColumnWidth: fixHeader || horizonScroll || isSticky
- });
- var bodyColGroup = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_ColGroup, {
- colWidths: flattenColumns.map(function (_ref5) {
- var width = _ref5.width;
- return width;
- }),
- columns: flattenColumns
- });
- var captionElement = caption !== null && caption !== undefined ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("caption", {
- className: "".concat(prefixCls, "-caption")
- }, caption) : undefined;
- var dataProps = (0,pickAttrs["default"])(props, {
- data: true
- });
- var ariaProps = (0,pickAttrs["default"])(props, {
- aria: true
- });
- if (fixHeader || isSticky) {
- // >>>>>> Fixed Header
- var bodyContent;
- if (typeof customizeScrollBody === 'function') {
- bodyContent = customizeScrollBody(mergedData, {
- scrollbarSize: scrollbarSize,
- ref: scrollBodyRef,
- onScroll: onInternalScroll
- });
- headerProps.colWidths = flattenColumns.map(function (_ref6, index) {
- var width = _ref6.width;
- var colWidth = index === flattenColumns.length - 1 ? width - scrollbarSize : width;
- if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
- return colWidth;
- }
- if (true) {
- (0,warning["default"])(props.columns.length === 0, 'When use `components.body` with render props. Each column should have a fixed `width` value.');
- }
- return 0;
- });
- } else {
- bodyContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, scrollXStyle), scrollYStyle),
- onScroll: onBodyScroll,
- ref: scrollBodyRef,
- className: classnames_default()("".concat(prefixCls, "-body"))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TableComponent, (0,esm_extends["default"])({
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, scrollTableStyle), {}, {
- tableLayout: mergedTableLayout
- })
- }, ariaProps), captionElement, bodyColGroup, bodyTable, !fixFooter && summaryNode && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Footer, {
- stickyOffsets: stickyOffsets,
- flattenColumns: flattenColumns
- }, summaryNode)));
- }
- // Fixed holder share the props
- var fixedHolderProps = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({
- noData: !mergedData.length
- }, headerProps), columnContext), {}, {
- direction: direction,
- stickyClassName: stickyClassName,
- scrollX: mergedScrollX,
- tableLayout: mergedTableLayout,
- onScroll: onInternalScroll
- });
- groupTableNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, showHeader !== false && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_FixedHolder, (0,esm_extends["default"])({}, fixedHolderProps, {
- stickyTopOffset: offsetHeader,
- className: "".concat(prefixCls, "-header"),
- ref: scrollHeaderRef,
- colGroup: bodyColGroup
- }), renderFixedHeaderTable), bodyContent, fixFooter && fixFooter !== 'top' && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_FixedHolder, (0,esm_extends["default"])({}, fixedHolderProps, {
- stickyBottomOffset: offsetSummary,
- className: "".concat(prefixCls, "-summary"),
- ref: scrollSummaryRef,
- colGroup: bodyColGroup
- }), renderFixedFooterTable), isSticky && scrollBodyRef.current && scrollBodyRef.current instanceof Element && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(stickyScrollBar, {
- ref: stickyRef,
- offsetScroll: offsetScroll,
- scrollBodyRef: scrollBodyRef,
- onScroll: onInternalScroll,
- container: container,
- direction: direction
- }));
- } else {
- // >>>>>> Unique table
- groupTableNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, scrollXStyle), scrollYStyle),
- className: classnames_default()("".concat(prefixCls, "-content")),
- onScroll: onInternalScroll,
- ref: scrollBodyRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TableComponent, (0,esm_extends["default"])({
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, scrollTableStyle), {}, {
- tableLayout: mergedTableLayout
- })
- }, ariaProps), captionElement, bodyColGroup, showHeader !== false && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Header_Header, (0,esm_extends["default"])({}, headerProps, columnContext)), bodyTable, summaryNode && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Footer, {
- stickyOffsets: stickyOffsets,
- flattenColumns: flattenColumns
- }, summaryNode)));
- }
- var fullTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", (0,esm_extends["default"])({
- className: classnames_default()(prefixCls, className, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-ping-left"), pingedLeft), "".concat(prefixCls, "-ping-right"), pingedRight), "".concat(prefixCls, "-layout-fixed"), tableLayout === 'fixed'), "".concat(prefixCls, "-fixed-header"), fixHeader), "".concat(prefixCls, "-fixed-column"), fixColumn), "".concat(prefixCls, "-fixed-column-gapped"), fixColumn && hasGapFixed), "".concat(prefixCls, "-scroll-horizontal"), horizonScroll), "".concat(prefixCls, "-has-fix-left"), flattenColumns[0] && flattenColumns[0].fixed), "".concat(prefixCls, "-has-fix-right"), flattenColumns[flattenColumns.length - 1] && flattenColumns[flattenColumns.length - 1].fixed === 'right')),
- style: style,
- id: id,
- ref: fullTableRef
- }, dataProps), title && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Panel, {
- className: "".concat(prefixCls, "-title")
- }, title(mergedData)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: scrollBodyContainerRef,
- className: "".concat(prefixCls, "-container")
- }, groupTableNode), footer && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Panel, {
- className: "".concat(prefixCls, "-footer")
- }, footer(mergedData)));
- if (horizonScroll) {
- fullTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onFullTableResize
- }, fullTable);
- }
- var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction);
- var TableContextValue = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- // Scroll
- scrollX: mergedScrollX,
- // Table
- prefixCls: prefixCls,
- getComponent: getComponent,
- scrollbarSize: scrollbarSize,
- direction: direction,
- fixedInfoList: fixedInfoList,
- isSticky: isSticky,
- supportSticky: supportSticky,
- componentWidth: componentWidth,
- fixHeader: fixHeader,
- fixColumn: fixColumn,
- horizonScroll: horizonScroll,
- // Body
- tableLayout: mergedTableLayout,
- rowClassName: rowClassName,
- expandedRowClassName: expandableConfig.expandedRowClassName,
- expandIcon: mergedExpandIcon,
- expandableType: expandableType,
- expandRowByClick: expandableConfig.expandRowByClick,
- expandedRowRender: expandableConfig.expandedRowRender,
- expandedRowOffset: expandableConfig.expandedRowOffset,
- onTriggerExpand: onTriggerExpand,
- expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
- indentSize: expandableConfig.indentSize,
- allColumnsFixedLeft: flattenColumns.every(function (col) {
- return col.fixed === 'left';
- }),
- emptyNode: emptyNode,
- // Column
- columns: columns,
- flattenColumns: flattenColumns,
- onColumnResize: onColumnResize,
- colWidths: colWidths,
- // Row
- hoverStartRow: startRow,
- hoverEndRow: endRow,
- onHover: onHover,
- rowExpandable: expandableConfig.rowExpandable,
- onRow: onRow,
- getRowKey: getRowKey,
- expandedKeys: mergedExpandedKeys,
- childrenColumnName: mergedChildrenColumnName,
- rowHoverable: rowHoverable,
- // Measure Row
- measureRowRender: measureRowRender
- };
- }, [
- // Scroll
- mergedScrollX,
- // Table
- prefixCls, getComponent, scrollbarSize, direction, fixedInfoList, isSticky, supportSticky, componentWidth, fixHeader, fixColumn, horizonScroll,
- // Body
- mergedTableLayout, rowClassName, expandableConfig.expandedRowClassName, mergedExpandIcon, expandableType, expandableConfig.expandRowByClick, expandableConfig.expandedRowRender, expandableConfig.expandedRowOffset, onTriggerExpand, expandableConfig.expandIconColumnIndex, expandableConfig.indentSize, emptyNode,
- // Column
- columns, flattenColumns, onColumnResize, colWidths,
- // Row
- startRow, endRow, onHover, expandableConfig.rowExpandable, onRow, getRowKey, mergedExpandedKeys, mergedChildrenColumnName, rowHoverable, measureRowRender]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(context_TableContext.Provider, {
- value: TableContextValue
- }, fullTable);
- }
- var RefTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Table);
- if (true) {
- RefTable.displayName = 'Table';
- }
- function genTable(shouldTriggerRender) {
- return TableContext_makeImmutable(RefTable, shouldTriggerRender);
- }
- var ImmutableTable = genTable();
- ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
- ImmutableTable.INTERNAL_HOOKS = INTERNAL_HOOKS;
- ImmutableTable.Column = sugar_Column;
- ImmutableTable.ColumnGroup = sugar_ColumnGroup;
- ImmutableTable.Summary = FooterComponents;
- /* harmony default export */ var es_Table = (ImmutableTable);
- ;// ./node_modules/rc-table/es/VirtualTable/context.js
- var StaticContext = createContext(null);
- var GridContext = createContext(null);
- ;// ./node_modules/rc-table/es/VirtualTable/VirtualCell.js
- /**
- * Return the width of the column by `colSpan`.
- * When `colSpan` is `0` will be trade as `1`.
- */
- function getColumnWidth(colIndex, colSpan, columnsOffset) {
- var mergedColSpan = colSpan || 1;
- return columnsOffset[colIndex + mergedColSpan] - (columnsOffset[colIndex] || 0);
- }
- function VirtualCell(props) {
- var rowInfo = props.rowInfo,
- column = props.column,
- colIndex = props.colIndex,
- indent = props.indent,
- index = props.index,
- component = props.component,
- renderIndex = props.renderIndex,
- record = props.record,
- style = props.style,
- className = props.className,
- inverse = props.inverse,
- getHeight = props.getHeight;
- var render = column.render,
- dataIndex = column.dataIndex,
- columnClassName = column.className,
- colWidth = column.width;
- var _useContext = useContext(GridContext, ['columnsOffset']),
- columnsOffset = _useContext.columnsOffset;
- // TODO: support `expandableRowOffset`
- var _getCellProps = getCellProps(rowInfo, column, colIndex, indent, index),
- key = _getCellProps.key,
- fixedInfo = _getCellProps.fixedInfo,
- appendCellNode = _getCellProps.appendCellNode,
- additionalCellProps = _getCellProps.additionalCellProps;
- var cellStyle = additionalCellProps.style,
- _additionalCellProps$ = additionalCellProps.colSpan,
- colSpan = _additionalCellProps$ === void 0 ? 1 : _additionalCellProps$,
- _additionalCellProps$2 = additionalCellProps.rowSpan,
- rowSpan = _additionalCellProps$2 === void 0 ? 1 : _additionalCellProps$2;
- // ========================= ColWidth =========================
- // column width
- var startColIndex = colIndex - 1;
- var concatColWidth = getColumnWidth(startColIndex, colSpan, columnsOffset);
- // margin offset
- var marginOffset = colSpan > 1 ? colWidth - concatColWidth : 0;
- // ========================== Style ===========================
- var mergedStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])((0,objectSpread2["default"])({}, cellStyle), style), {}, {
- flex: "0 0 ".concat(concatColWidth, "px"),
- width: "".concat(concatColWidth, "px"),
- marginRight: marginOffset,
- pointerEvents: 'auto'
- });
- // When `colSpan` or `rowSpan` is `0`, should skip render.
- var needHide = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (inverse) {
- return rowSpan <= 1;
- } else {
- return colSpan === 0 || rowSpan === 0 || rowSpan > 1;
- }
- }, [rowSpan, colSpan, inverse]);
- // 0 rowSpan or colSpan should not render
- if (needHide) {
- mergedStyle.visibility = 'hidden';
- } else if (inverse) {
- mergedStyle.height = getHeight === null || getHeight === void 0 ? void 0 : getHeight(rowSpan);
- }
- var mergedRender = needHide ? function () {
- return null;
- } : render;
- // ========================== Render ==========================
- var cellSpan = {};
- // Virtual should reset `colSpan` & `rowSpan`
- if (rowSpan === 0 || colSpan === 0) {
- cellSpan.rowSpan = 1;
- cellSpan.colSpan = 1;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, (0,esm_extends["default"])({
- className: classnames_default()(columnClassName, className),
- ellipsis: column.ellipsis,
- align: column.align,
- scope: column.rowScope,
- component: component,
- prefixCls: rowInfo.prefixCls,
- key: key,
- record: record,
- index: index,
- renderIndex: renderIndex,
- dataIndex: dataIndex,
- render: mergedRender,
- shouldCellUpdate: column.shouldCellUpdate
- }, fixedInfo, {
- appendNode: appendCellNode,
- additionalProps: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, additionalCellProps), {}, {
- style: mergedStyle
- }, cellSpan)
- }));
- }
- /* harmony default export */ var VirtualTable_VirtualCell = (VirtualCell);
- ;// ./node_modules/rc-table/es/VirtualTable/BodyLine.js
- var BodyLine_excluded = ["data", "index", "className", "rowKey", "style", "extra", "getHeight"];
- var BodyLine = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var data = props.data,
- index = props.index,
- className = props.className,
- rowKey = props.rowKey,
- style = props.style,
- extra = props.extra,
- getHeight = props.getHeight,
- restProps = (0,objectWithoutProperties["default"])(props, BodyLine_excluded);
- var record = data.record,
- indent = data.indent,
- renderIndex = data.index;
- var _useContext = useContext(context_TableContext, ['prefixCls', 'flattenColumns', 'fixColumn', 'componentWidth', 'scrollX']),
- scrollX = _useContext.scrollX,
- flattenColumns = _useContext.flattenColumns,
- prefixCls = _useContext.prefixCls,
- fixColumn = _useContext.fixColumn,
- componentWidth = _useContext.componentWidth;
- var _useContext2 = useContext(StaticContext, ['getComponent']),
- getComponent = _useContext2.getComponent;
- var rowInfo = useRowInfo(record, rowKey, index, indent);
- var RowComponent = getComponent(['body', 'row'], 'div');
- var cellComponent = getComponent(['body', 'cell'], 'div');
- // ========================== Expand ==========================
- var rowSupportExpand = rowInfo.rowSupportExpand,
- expanded = rowInfo.expanded,
- rowProps = rowInfo.rowProps,
- expandedRowRender = rowInfo.expandedRowRender,
- expandedRowClassName = rowInfo.expandedRowClassName;
- var expandRowNode;
- if (rowSupportExpand && expanded) {
- var expandContent = expandedRowRender(record, index, indent + 1, expanded);
- var expandedClsName = computedExpandedClassName(expandedRowClassName, record, index, indent);
- var additionalProps = {};
- if (fixColumn) {
- additionalProps = {
- style: (0,defineProperty["default"])({}, '--virtual-width', "".concat(componentWidth, "px"))
- };
- }
- var rowCellCls = "".concat(prefixCls, "-expanded-row-cell");
- expandRowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RowComponent, {
- className: classnames_default()("".concat(prefixCls, "-expanded-row"), "".concat(prefixCls, "-expanded-row-level-").concat(indent + 1), expandedClsName)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Cell, {
- component: cellComponent,
- prefixCls: prefixCls,
- className: classnames_default()(rowCellCls, (0,defineProperty["default"])({}, "".concat(rowCellCls, "-fixed"), fixColumn)),
- additionalProps: additionalProps
- }, expandContent));
- }
- // ========================== Render ==========================
- var rowStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, style), {}, {
- width: scrollX
- });
- if (extra) {
- rowStyle.position = 'absolute';
- rowStyle.pointerEvents = 'none';
- }
- var rowNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RowComponent, (0,esm_extends["default"])({}, rowProps, restProps, {
- "data-row-key": rowKey,
- ref: rowSupportExpand ? null : ref,
- className: classnames_default()(className, "".concat(prefixCls, "-row"), rowProps === null || rowProps === void 0 ? void 0 : rowProps.className, (0,defineProperty["default"])({}, "".concat(prefixCls, "-row-extra"), extra)),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, rowStyle), rowProps === null || rowProps === void 0 ? void 0 : rowProps.style)
- }), flattenColumns.map(function (column, colIndex) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(VirtualTable_VirtualCell, {
- key: colIndex,
- component: cellComponent,
- rowInfo: rowInfo,
- column: column,
- colIndex: colIndex,
- indent: indent,
- index: index,
- renderIndex: renderIndex,
- record: record,
- inverse: extra,
- getHeight: getHeight
- });
- }));
- if (rowSupportExpand) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: ref
- }, rowNode, expandRowNode);
- }
- return rowNode;
- });
- var ResponseBodyLine = TableContext_responseImmutable(BodyLine);
- if (true) {
- ResponseBodyLine.displayName = 'BodyLine';
- }
- /* harmony default export */ var VirtualTable_BodyLine = (ResponseBodyLine);
- ;// ./node_modules/rc-table/es/VirtualTable/BodyGrid.js
- var BodyGrid_Grid = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var data = props.data,
- onScroll = props.onScroll;
- var _useContext = useContext(context_TableContext, ['flattenColumns', 'onColumnResize', 'getRowKey', 'prefixCls', 'expandedKeys', 'childrenColumnName', 'scrollX', 'direction']),
- flattenColumns = _useContext.flattenColumns,
- onColumnResize = _useContext.onColumnResize,
- getRowKey = _useContext.getRowKey,
- expandedKeys = _useContext.expandedKeys,
- prefixCls = _useContext.prefixCls,
- childrenColumnName = _useContext.childrenColumnName,
- scrollX = _useContext.scrollX,
- direction = _useContext.direction;
- var _useContext2 = useContext(StaticContext),
- sticky = _useContext2.sticky,
- scrollY = _useContext2.scrollY,
- listItemHeight = _useContext2.listItemHeight,
- getComponent = _useContext2.getComponent,
- onTablePropScroll = _useContext2.onScroll;
- // =========================== Ref ============================
- var listRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- // =========================== Data ===========================
- var flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
- // ========================== Column ==========================
- var columnsWidth = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var total = 0;
- return flattenColumns.map(function (_ref) {
- var width = _ref.width,
- minWidth = _ref.minWidth,
- key = _ref.key;
- var finalWidth = Math.max(width || 0, minWidth || 0);
- total += finalWidth;
- return [key, finalWidth, total];
- });
- }, [flattenColumns]);
- var columnsOffset = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return columnsWidth.map(function (colWidth) {
- return colWidth[2];
- });
- }, [columnsWidth]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- columnsWidth.forEach(function (_ref2) {
- var _ref3 = (0,slicedToArray["default"])(_ref2, 2),
- key = _ref3[0],
- width = _ref3[1];
- onColumnResize(key, width);
- });
- }, [columnsWidth]);
- // =========================== Ref ============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- var _listRef$current2;
- var obj = {
- scrollTo: function scrollTo(config) {
- var _listRef$current;
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.scrollTo(config);
- },
- nativeElement: (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.nativeElement
- };
- Object.defineProperty(obj, 'scrollLeft', {
- get: function get() {
- var _listRef$current3;
- return ((_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 ? void 0 : _listRef$current3.getScrollInfo().x) || 0;
- },
- set: function set(value) {
- var _listRef$current4;
- (_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0 || _listRef$current4.scrollTo({
- left: value
- });
- }
- });
- // https://github.com/ant-design/ant-design/issues/54734
- Object.defineProperty(obj, 'scrollTop', {
- get: function get() {
- var _listRef$current5;
- return ((_listRef$current5 = listRef.current) === null || _listRef$current5 === void 0 ? void 0 : _listRef$current5.getScrollInfo().y) || 0;
- },
- set: function set(value) {
- var _listRef$current6;
- (_listRef$current6 = listRef.current) === null || _listRef$current6 === void 0 || _listRef$current6.scrollTo({
- top: value
- });
- }
- });
- return obj;
- });
- // ======================= Col/Row Span =======================
- var getRowSpan = function getRowSpan(column, index) {
- var _flattenData$index;
- var record = (_flattenData$index = flattenData[index]) === null || _flattenData$index === void 0 ? void 0 : _flattenData$index.record;
- var onCell = column.onCell;
- if (onCell) {
- var _cellProps$rowSpan;
- var cellProps = onCell(record, index);
- return (_cellProps$rowSpan = cellProps === null || cellProps === void 0 ? void 0 : cellProps.rowSpan) !== null && _cellProps$rowSpan !== void 0 ? _cellProps$rowSpan : 1;
- }
- return 1;
- };
- var extraRender = function extraRender(info) {
- var start = info.start,
- end = info.end,
- getSize = info.getSize,
- offsetY = info.offsetY;
- // Do nothing if no data
- if (end < 0) {
- return null;
- }
- // Find first rowSpan column
- var firstRowSpanColumns = flattenColumns.filter(
- // rowSpan is 0
- function (column) {
- return getRowSpan(column, start) === 0;
- });
- var startIndex = start;
- var _loop = function _loop(i) {
- firstRowSpanColumns = firstRowSpanColumns.filter(function (column) {
- return getRowSpan(column, i) === 0;
- });
- if (!firstRowSpanColumns.length) {
- startIndex = i;
- return 1; // break
- }
- };
- for (var i = start; i >= 0; i -= 1) {
- if (_loop(i)) break;
- }
- // Find last rowSpan column
- var lastRowSpanColumns = flattenColumns.filter(
- // rowSpan is not 1
- function (column) {
- return getRowSpan(column, end) !== 1;
- });
- var endIndex = end;
- var _loop2 = function _loop2(_i) {
- lastRowSpanColumns = lastRowSpanColumns.filter(function (column) {
- return getRowSpan(column, _i) !== 1;
- });
- if (!lastRowSpanColumns.length) {
- endIndex = Math.max(_i - 1, end);
- return 1; // break
- }
- };
- for (var _i = end; _i < flattenData.length; _i += 1) {
- if (_loop2(_i)) break;
- }
- // Collect the line who has rowSpan
- var spanLines = [];
- var _loop3 = function _loop3(_i2) {
- var item = flattenData[_i2];
- // This code will never reach, just incase
- if (!item) {
- return 1; // continue
- }
- if (flattenColumns.some(function (column) {
- return getRowSpan(column, _i2) > 1;
- })) {
- spanLines.push(_i2);
- }
- };
- for (var _i2 = startIndex; _i2 <= endIndex; _i2 += 1) {
- if (_loop3(_i2)) continue;
- }
- // Patch extra line on the page
- var nodes = spanLines.map(function (index) {
- var item = flattenData[index];
- var rowKey = getRowKey(item.record, index);
- var getHeight = function getHeight(rowSpan) {
- var endItemIndex = index + rowSpan - 1;
- var endItemKey = getRowKey(flattenData[endItemIndex].record, endItemIndex);
- var sizeInfo = getSize(rowKey, endItemKey);
- return sizeInfo.bottom - sizeInfo.top;
- };
- var sizeInfo = getSize(rowKey);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(VirtualTable_BodyLine, {
- key: index,
- data: item,
- rowKey: rowKey,
- index: index,
- style: {
- top: -offsetY + sizeInfo.top
- },
- extra: true,
- getHeight: getHeight
- });
- });
- return nodes;
- };
- // ========================= Context ==========================
- var gridContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- columnsOffset: columnsOffset
- };
- }, [columnsOffset]);
- // ========================== Render ==========================
- var tblPrefixCls = "".concat(prefixCls, "-tbody");
- // default 'div' in rc-virtual-list
- var wrapperComponent = getComponent(['body', 'wrapper']);
- // ========================== Sticky Scroll Bar ==========================
- var horizontalScrollBarStyle = {};
- if (sticky) {
- horizontalScrollBarStyle.position = 'sticky';
- horizontalScrollBarStyle.bottom = 0;
- if ((0,esm_typeof["default"])(sticky) === 'object' && sticky.offsetScroll) {
- horizontalScrollBarStyle.bottom = sticky.offsetScroll;
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(GridContext.Provider, {
- value: gridContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_virtual_list_es, {
- fullHeight: false,
- ref: listRef,
- prefixCls: "".concat(tblPrefixCls, "-virtual"),
- styles: {
- horizontalScrollBar: horizontalScrollBarStyle
- },
- className: tblPrefixCls,
- height: scrollY,
- itemHeight: listItemHeight || 24,
- data: flattenData,
- itemKey: function itemKey(item) {
- return getRowKey(item.record);
- },
- component: wrapperComponent,
- scrollWidth: scrollX,
- direction: direction,
- onVirtualScroll: function onVirtualScroll(_ref4) {
- var _listRef$current7;
- var x = _ref4.x;
- onScroll({
- currentTarget: (_listRef$current7 = listRef.current) === null || _listRef$current7 === void 0 ? void 0 : _listRef$current7.nativeElement,
- scrollLeft: x
- });
- },
- onScroll: onTablePropScroll,
- extraRender: extraRender
- }, function (item, index, itemProps) {
- var rowKey = getRowKey(item.record, index);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(VirtualTable_BodyLine, {
- data: item,
- rowKey: rowKey,
- index: index,
- style: itemProps.style
- });
- }));
- });
- var ResponseGrid = TableContext_responseImmutable(BodyGrid_Grid);
- if (true) {
- ResponseGrid.displayName = 'ResponseGrid';
- }
- /* harmony default export */ var BodyGrid = (ResponseGrid);
- ;// ./node_modules/rc-table/es/VirtualTable/index.js
- var renderBody = function renderBody(rawData, props) {
- var ref = props.ref,
- onScroll = props.onScroll;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(BodyGrid, {
- ref: ref,
- data: rawData,
- onScroll: onScroll
- });
- };
- function VirtualTable(props, ref) {
- var data = props.data,
- columns = props.columns,
- scroll = props.scroll,
- sticky = props.sticky,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? DEFAULT_PREFIX : _props$prefixCls,
- className = props.className,
- listItemHeight = props.listItemHeight,
- components = props.components,
- onScroll = props.onScroll;
- var _ref = scroll || {},
- scrollX = _ref.x,
- scrollY = _ref.y;
- // Fill scrollX
- if (typeof scrollX !== 'number') {
- if (true) {
- (0,rc_util_es.warning)(!scrollX, '`scroll.x` in virtual table must be number.');
- }
- scrollX = 1;
- }
- // Fill scrollY
- if (typeof scrollY !== 'number') {
- scrollY = 500;
- if (true) {
- (0,rc_util_es.warning)(false, '`scroll.y` in virtual table must be number.');
- }
- }
- var getComponent = (0,rc_util_es.useEvent)(function (path, defaultComponent) {
- return (0,get["default"])(components, path) || defaultComponent;
- });
- // Memo this
- var onInternalScroll = (0,rc_util_es.useEvent)(onScroll);
- // ========================= Context ==========================
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- sticky: sticky,
- scrollY: scrollY,
- listItemHeight: listItemHeight,
- getComponent: getComponent,
- onScroll: onInternalScroll
- };
- }, [sticky, scrollY, listItemHeight, getComponent, onInternalScroll]);
- // ========================== Render ==========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StaticContext.Provider, {
- value: context
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Table, (0,esm_extends["default"])({}, props, {
- className: classnames_default()(className, "".concat(prefixCls, "-virtual")),
- scroll: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, scroll), {}, {
- x: scrollX
- }),
- components: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, components), {}, {
- // fix https://github.com/ant-design/ant-design/issues/48991
- body: data !== null && data !== void 0 && data.length ? renderBody : undefined
- }),
- columns: columns,
- internalHooks: INTERNAL_HOOKS,
- tailor: true,
- ref: ref
- })));
- }
- var RefVirtualTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(VirtualTable);
- if (true) {
- RefVirtualTable.displayName = 'VirtualTable';
- }
- function genVirtualTable(shouldTriggerRender) {
- return TableContext_makeImmutable(RefVirtualTable, shouldTriggerRender);
- }
- /* harmony default export */ var es_VirtualTable = (genVirtualTable());
- ;// ./node_modules/rc-table/es/index.js
- /* harmony default export */ var rc_table_es = (es_Table);
- ;// ./components/table/Column.ts
- /* istanbul ignore next */
- /** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
- const table_Column_Column = _ => null;
- /* harmony default export */ var table_Column = (table_Column_Column);
- ;// ./components/table/ColumnGroup.ts
- /* istanbul ignore next */
- /** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
- const ColumnGroup_ColumnGroup = _ => null;
- /* harmony default export */ var table_ColumnGroup = (ColumnGroup_ColumnGroup);
- ;// ./node_modules/rc-tree/es/contextTypes.js
- /**
- * Webpack has bug for import loop, which is not the same behavior as ES module.
- * When util.js imports the TreeNode for tree generate will cause treeContextTypes be empty.
- */
- var TreeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /** Internal usage, safe to remove. Do not use in prod */
- var contextTypes_UnstableContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- ;// ./node_modules/rc-tree/es/Indent.js
- var Indent = function Indent(_ref) {
- var prefixCls = _ref.prefixCls,
- level = _ref.level,
- isStart = _ref.isStart,
- isEnd = _ref.isEnd;
- var baseClassName = "".concat(prefixCls, "-indent-unit");
- var list = [];
- for (var i = 0; i < level; i += 1) {
- list.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: i,
- className: classnames_default()(baseClassName, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(baseClassName, "-start"), isStart[i]), "".concat(baseClassName, "-end"), isEnd[i]))
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- "aria-hidden": "true",
- className: "".concat(prefixCls, "-indent")
- }, list);
- };
- /* harmony default export */ var es_Indent = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(Indent));
- ;// ./node_modules/rc-tree/es/TreeNode.js
- var TreeNode_excluded = ["eventKey", "className", "style", "dragOver", "dragOverGapTop", "dragOverGapBottom", "isLeaf", "isStart", "isEnd", "expanded", "selected", "checked", "halfChecked", "loading", "domRef", "active", "data", "onMouseMove", "selectable"];
- var ICON_OPEN = 'open';
- var ICON_CLOSE = 'close';
- var defaultTitle = '---';
- var TreeNode = function TreeNode(props) {
- var _unstableContext$node, _context$filterTreeNo, _classNames4;
- var eventKey = props.eventKey,
- className = props.className,
- style = props.style,
- dragOver = props.dragOver,
- dragOverGapTop = props.dragOverGapTop,
- dragOverGapBottom = props.dragOverGapBottom,
- isLeaf = props.isLeaf,
- isStart = props.isStart,
- isEnd = props.isEnd,
- expanded = props.expanded,
- selected = props.selected,
- checked = props.checked,
- halfChecked = props.halfChecked,
- loading = props.loading,
- domRef = props.domRef,
- active = props.active,
- data = props.data,
- onMouseMove = props.onMouseMove,
- selectable = props.selectable,
- otherProps = (0,objectWithoutProperties["default"])(props, TreeNode_excluded);
- var context = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(TreeContext);
- var unstableContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(contextTypes_UnstableContext);
- var selectHandleRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- dragNodeHighlight = _React$useState2[0],
- setDragNodeHighlight = _React$useState2[1];
- // ======= State: Disabled State =======
- var isDisabled = !!(context.disabled || props.disabled || (_unstableContext$node = unstableContext.nodeDisabled) !== null && _unstableContext$node !== void 0 && _unstableContext$node.call(unstableContext, data));
- var isCheckable = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- // Return false if tree or treeNode is not checkable
- if (!context.checkable || props.checkable === false) {
- return false;
- }
- return context.checkable;
- }, [context.checkable, props.checkable]);
- // ======= Event Handlers: Selection and Check =======
- var onSelect = function onSelect(e) {
- if (isDisabled) {
- return;
- }
- context.onNodeSelect(e, convertNodePropsToEventData(props));
- };
- var onCheck = function onCheck(e) {
- if (isDisabled) {
- return;
- }
- if (!isCheckable || props.disableCheckbox) {
- return;
- }
- context.onNodeCheck(e, convertNodePropsToEventData(props), !checked);
- };
- // ======= State: Selectable Check =======
- var isSelectable = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- // Ignore when selectable is undefined or null
- if (typeof selectable === 'boolean') {
- return selectable;
- }
- return context.selectable;
- }, [selectable, context.selectable]);
- var onSelectorClick = function onSelectorClick(e) {
- // Click trigger before select/check operation
- context.onNodeClick(e, convertNodePropsToEventData(props));
- if (isSelectable) {
- onSelect(e);
- } else {
- onCheck(e);
- }
- };
- var onSelectorDoubleClick = function onSelectorDoubleClick(e) {
- context.onNodeDoubleClick(e, convertNodePropsToEventData(props));
- };
- var onMouseEnter = function onMouseEnter(e) {
- context.onNodeMouseEnter(e, convertNodePropsToEventData(props));
- };
- var onMouseLeave = function onMouseLeave(e) {
- context.onNodeMouseLeave(e, convertNodePropsToEventData(props));
- };
- var onContextMenu = function onContextMenu(e) {
- context.onNodeContextMenu(e, convertNodePropsToEventData(props));
- };
- // ======= Drag: Drag Enabled =======
- var isDraggable = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- return !!(context.draggable && (!context.draggable.nodeDraggable || context.draggable.nodeDraggable(data)));
- }, [context.draggable, data]);
- // ======= Drag: Drag Event Handlers =======
- var onDragStart = function onDragStart(e) {
- e.stopPropagation();
- setDragNodeHighlight(true);
- context.onNodeDragStart(e, props);
- try {
- // ie throw error
- // firefox-need-it
- e.dataTransfer.setData('text/plain', '');
- } catch (_unused) {
- // empty
- }
- };
- var onDragEnter = function onDragEnter(e) {
- e.preventDefault();
- e.stopPropagation();
- context.onNodeDragEnter(e, props);
- };
- var onDragOver = function onDragOver(e) {
- e.preventDefault();
- e.stopPropagation();
- context.onNodeDragOver(e, props);
- };
- var onDragLeave = function onDragLeave(e) {
- e.stopPropagation();
- context.onNodeDragLeave(e, props);
- };
- var onDragEnd = function onDragEnd(e) {
- e.stopPropagation();
- setDragNodeHighlight(false);
- context.onNodeDragEnd(e, props);
- };
- var onDrop = function onDrop(e) {
- e.preventDefault();
- e.stopPropagation();
- setDragNodeHighlight(false);
- context.onNodeDrop(e, props);
- };
- // ======= Expand: Node Expansion =======
- var onExpand = function onExpand(e) {
- if (loading) {
- return;
- }
- context.onNodeExpand(e, convertNodePropsToEventData(props));
- };
- // ======= State: Has Children =======
- var hasChildren = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- var _ref = getEntity(context.keyEntities, eventKey) || {},
- children = _ref.children;
- return Boolean((children || []).length);
- }, [context.keyEntities, eventKey]);
- // ======= State: Leaf Check =======
- var memoizedIsLeaf = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (isLeaf === false) {
- return false;
- }
- return isLeaf || !context.loadData && !hasChildren || context.loadData && props.loaded && !hasChildren;
- }, [isLeaf, context.loadData, hasChildren, props.loaded]);
- // ============== Effect ==============
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().useEffect(function () {
- // Load data to avoid default expanded tree without data
- if (loading) {
- return;
- }
- // read from state to avoid loadData at same time
- if (typeof context.loadData === 'function' && expanded && !memoizedIsLeaf && !props.loaded) {
- // We needn't reload data when has children in sync logic
- // It's only needed in node expanded
- context.onNodeLoad(convertNodePropsToEventData(props));
- }
- }, [loading, context.loadData, context.onNodeLoad, expanded, memoizedIsLeaf, props]);
- // ==================== Render: Drag Handler ====================
- var dragHandlerNode = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- var _context$draggable;
- if (!((_context$draggable = context.draggable) !== null && _context$draggable !== void 0 && _context$draggable.icon)) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: "".concat(context.prefixCls, "-draggable-icon")
- }, context.draggable.icon);
- }, [context.draggable]);
- // ====================== Render: Switcher ======================
- var renderSwitcherIconDom = function renderSwitcherIconDom(isInternalLeaf) {
- var switcherIcon = props.switcherIcon || context.switcherIcon;
- // if switcherIconDom is null, no render switcher span
- if (typeof switcherIcon === 'function') {
- return switcherIcon((0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- isLeaf: isInternalLeaf
- }));
- }
- return switcherIcon;
- };
- // Switcher
- var renderSwitcher = function renderSwitcher() {
- if (memoizedIsLeaf) {
- // if switcherIconDom is null, no render switcher span
- var _switcherIconDom = renderSwitcherIconDom(true);
- return _switcherIconDom !== false ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(context.prefixCls, "-switcher"), "".concat(context.prefixCls, "-switcher-noop"))
- }, _switcherIconDom) : null;
- }
- var switcherIconDom = renderSwitcherIconDom(false);
- return switcherIconDom !== false ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- onClick: onExpand,
- className: classnames_default()("".concat(context.prefixCls, "-switcher"), "".concat(context.prefixCls, "-switcher_").concat(expanded ? ICON_OPEN : ICON_CLOSE))
- }, switcherIconDom) : null;
- };
- // ====================== Checkbox ======================
- var checkboxNode = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (!isCheckable) {
- return null;
- }
- // [Legacy] Custom element should be separate with `checkable` in future
- var $custom = typeof isCheckable !== 'boolean' ? isCheckable : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(context.prefixCls, "-checkbox"), (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(context.prefixCls, "-checkbox-checked"), checked), "".concat(context.prefixCls, "-checkbox-indeterminate"), !checked && halfChecked), "".concat(context.prefixCls, "-checkbox-disabled"), isDisabled || props.disableCheckbox)),
- onClick: onCheck,
- role: "checkbox",
- "aria-checked": halfChecked ? 'mixed' : checked,
- "aria-disabled": isDisabled || props.disableCheckbox,
- "aria-label": "Select ".concat(typeof props.title === 'string' ? props.title : 'tree node')
- }, $custom);
- }, [isCheckable, checked, halfChecked, isDisabled, props.disableCheckbox, props.title]);
- // ============== State: Node State (Open/Close) ==============
- var nodeState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (memoizedIsLeaf) {
- return null;
- }
- return expanded ? ICON_OPEN : ICON_CLOSE;
- }, [memoizedIsLeaf, expanded]);
- // ==================== Render: Title + Icon ====================
- var iconNode = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(context.prefixCls, "-iconEle"), "".concat(context.prefixCls, "-icon__").concat(nodeState || 'docu'), (0,defineProperty["default"])({}, "".concat(context.prefixCls, "-icon_loading"), loading))
- });
- }, [context.prefixCls, nodeState, loading]);
- // =================== Drop Indicator ===================
- var dropIndicatorNode = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- var rootDraggable = Boolean(context.draggable);
- // allowDrop is calculated in Tree.tsx, there is no need for calc it here
- var showIndicator = !props.disabled && rootDraggable && context.dragOverNodeKey === eventKey;
- if (!showIndicator) {
- return null;
- }
- return context.dropIndicatorRender({
- dropPosition: context.dropPosition,
- dropLevelOffset: context.dropLevelOffset,
- indent: context.indent,
- prefixCls: context.prefixCls,
- direction: context.direction
- });
- }, [context.dropPosition, context.dropLevelOffset, context.indent, context.prefixCls, context.direction, context.draggable, context.dragOverNodeKey, context.dropIndicatorRender]);
- // Icon + Title
- var selectorNode = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- var _props$title = props.title,
- title = _props$title === void 0 ? defaultTitle : _props$title;
- var wrapClass = "".concat(context.prefixCls, "-node-content-wrapper");
- // Icon - Still show loading icon when loading without showIcon
- var $icon;
- if (context.showIcon) {
- var currentIcon = props.icon || context.icon;
- $icon = currentIcon ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: classnames_default()("".concat(context.prefixCls, "-iconEle"), "".concat(context.prefixCls, "-icon__customize"))
- }, typeof currentIcon === 'function' ? currentIcon(props) : currentIcon) : iconNode;
- } else if (context.loadData && loading) {
- $icon = iconNode;
- }
- // Title
- var titleNode;
- if (typeof title === 'function') {
- titleNode = title(data);
- } else if (context.titleRender) {
- titleNode = context.titleRender(data);
- } else {
- titleNode = title;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- ref: selectHandleRef,
- title: typeof title === 'string' ? title : '',
- className: classnames_default()(wrapClass, "".concat(wrapClass, "-").concat(nodeState || 'normal'), (0,defineProperty["default"])({}, "".concat(context.prefixCls, "-node-selected"), !isDisabled && (selected || dragNodeHighlight))),
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onContextMenu: onContextMenu,
- onClick: onSelectorClick,
- onDoubleClick: onSelectorDoubleClick
- }, $icon, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: "".concat(context.prefixCls, "-title")
- }, titleNode), dropIndicatorNode);
- }, [context.prefixCls, context.showIcon, props, context.icon, iconNode, context.titleRender, data, nodeState, onMouseEnter, onMouseLeave, onContextMenu, onSelectorClick, onSelectorDoubleClick]);
- var dataOrAriaAttributeProps = (0,pickAttrs["default"])(otherProps, {
- aria: true,
- data: true
- });
- var _ref2 = getEntity(context.keyEntities, eventKey) || {},
- level = _ref2.level;
- var isEndNode = isEnd[isEnd.length - 1];
- var draggableWithoutDisabled = !isDisabled && isDraggable;
- var dragging = context.draggingNodeKey === eventKey;
- var ariaSelected = selectable !== undefined ? {
- 'aria-selected': !!selectable
- } : undefined;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", (0,esm_extends["default"])({
- ref: domRef,
- role: "treeitem",
- "aria-expanded": isLeaf ? undefined : expanded,
- className: classnames_default()(className, "".concat(context.prefixCls, "-treenode"), (_classNames4 = {}, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])(_classNames4, "".concat(context.prefixCls, "-treenode-disabled"), isDisabled), "".concat(context.prefixCls, "-treenode-switcher-").concat(expanded ? 'open' : 'close'), !isLeaf), "".concat(context.prefixCls, "-treenode-checkbox-checked"), checked), "".concat(context.prefixCls, "-treenode-checkbox-indeterminate"), halfChecked), "".concat(context.prefixCls, "-treenode-selected"), selected), "".concat(context.prefixCls, "-treenode-loading"), loading), "".concat(context.prefixCls, "-treenode-active"), active), "".concat(context.prefixCls, "-treenode-leaf-last"), isEndNode), "".concat(context.prefixCls, "-treenode-draggable"), isDraggable), "dragging", dragging), (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])(_classNames4, 'drop-target', context.dropTargetKey === eventKey), 'drop-container', context.dropContainerKey === eventKey), 'drag-over', !isDisabled && dragOver), 'drag-over-gap-top', !isDisabled && dragOverGapTop), 'drag-over-gap-bottom', !isDisabled && dragOverGapBottom), 'filter-node', (_context$filterTreeNo = context.filterTreeNode) === null || _context$filterTreeNo === void 0 ? void 0 : _context$filterTreeNo.call(context, convertNodePropsToEventData(props))), "".concat(context.prefixCls, "-treenode-leaf"), memoizedIsLeaf))),
- style: style
- // Draggable config
- ,
- draggable: draggableWithoutDisabled,
- onDragStart: draggableWithoutDisabled ? onDragStart : undefined
- // Drop config
- ,
- onDragEnter: isDraggable ? onDragEnter : undefined,
- onDragOver: isDraggable ? onDragOver : undefined,
- onDragLeave: isDraggable ? onDragLeave : undefined,
- onDrop: isDraggable ? onDrop : undefined,
- onDragEnd: isDraggable ? onDragEnd : undefined,
- onMouseMove: onMouseMove
- }, ariaSelected, dataOrAriaAttributeProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_Indent, {
- prefixCls: context.prefixCls,
- level: level,
- isStart: isStart,
- isEnd: isEnd
- }), dragHandlerNode, renderSwitcher(), checkboxNode, selectorNode);
- };
- TreeNode.isTreeNode = 1;
- if (true) {
- TreeNode.displayName = 'TreeNode';
- }
- /* harmony default export */ var es_TreeNode = (TreeNode);
- ;// ./node_modules/rc-tree/es/util.js
- var util_excluded = ["children"];
- /* eslint-disable no-lonely-if */
- /**
- * Legacy code. Should avoid to use if you are new to import these code.
- */
- function arrDel(list, value) {
- if (!list) return [];
- var clone = list.slice();
- var index = clone.indexOf(value);
- if (index >= 0) {
- clone.splice(index, 1);
- }
- return clone;
- }
- function arrAdd(list, value) {
- var clone = (list || []).slice();
- if (clone.indexOf(value) === -1) {
- clone.push(value);
- }
- return clone;
- }
- function posToArr(pos) {
- return pos.split('-');
- }
- function getDragChildrenKeys(dragNodeKey, keyEntities) {
- // not contains self
- // self for left or right drag
- var dragChildrenKeys = [];
- var entity = getEntity(keyEntities, dragNodeKey);
- function dig() {
- var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- list.forEach(function (_ref) {
- var key = _ref.key,
- children = _ref.children;
- dragChildrenKeys.push(key);
- dig(children);
- });
- }
- dig(entity.children);
- return dragChildrenKeys;
- }
- function isLastChild(treeNodeEntity) {
- if (treeNodeEntity.parent) {
- var posArr = posToArr(treeNodeEntity.pos);
- return Number(posArr[posArr.length - 1]) === treeNodeEntity.parent.children.length - 1;
- }
- return false;
- }
- function isFirstChild(treeNodeEntity) {
- var posArr = posToArr(treeNodeEntity.pos);
- return Number(posArr[posArr.length - 1]) === 0;
- }
- // Only used when drag, not affect SSR.
- function calcDropPosition(event, dragNodeProps, targetNodeProps, indent, startMousePosition, allowDrop, flattenedNodes, keyEntities, expandKeys, direction) {
- var _abstractDropNodeEnti;
- var clientX = event.clientX,
- clientY = event.clientY;
- var _getBoundingClientRec = event.target.getBoundingClientRect(),
- top = _getBoundingClientRec.top,
- height = _getBoundingClientRec.height;
- // optional chain for testing
- var horizontalMouseOffset = (direction === 'rtl' ? -1 : 1) * (((startMousePosition === null || startMousePosition === void 0 ? void 0 : startMousePosition.x) || 0) - clientX);
- var rawDropLevelOffset = (horizontalMouseOffset - 12) / indent;
- // Filter the expanded keys to exclude the node that not has children currently (like async nodes).
- var filteredExpandKeys = expandKeys.filter(function (key) {
- var _keyEntities$key;
- return (_keyEntities$key = keyEntities[key]) === null || _keyEntities$key === void 0 || (_keyEntities$key = _keyEntities$key.children) === null || _keyEntities$key === void 0 ? void 0 : _keyEntities$key.length;
- });
- // find abstract drop node by horizontal offset
- var abstractDropNodeEntity = getEntity(keyEntities, targetNodeProps.eventKey);
- if (clientY < top + height / 2) {
- // first half, set abstract drop node to previous node
- var nodeIndex = flattenedNodes.findIndex(function (flattenedNode) {
- return flattenedNode.key === abstractDropNodeEntity.key;
- });
- var prevNodeIndex = nodeIndex <= 0 ? 0 : nodeIndex - 1;
- var prevNodeKey = flattenedNodes[prevNodeIndex].key;
- abstractDropNodeEntity = getEntity(keyEntities, prevNodeKey);
- }
- var initialAbstractDropNodeKey = abstractDropNodeEntity.key;
- var abstractDragOverEntity = abstractDropNodeEntity;
- var dragOverNodeKey = abstractDropNodeEntity.key;
- var dropPosition = 0;
- var dropLevelOffset = 0;
- // Only allow cross level drop when dragging on a non-expanded node
- if (!filteredExpandKeys.includes(initialAbstractDropNodeKey)) {
- for (var i = 0; i < rawDropLevelOffset; i += 1) {
- if (isLastChild(abstractDropNodeEntity)) {
- abstractDropNodeEntity = abstractDropNodeEntity.parent;
- dropLevelOffset += 1;
- } else {
- break;
- }
- }
- }
- var abstractDragDataNode = dragNodeProps.data;
- var abstractDropDataNode = abstractDropNodeEntity.node;
- var dropAllowed = true;
- if (isFirstChild(abstractDropNodeEntity) && abstractDropNodeEntity.level === 0 && clientY < top + height / 2 && allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: -1
- }) && abstractDropNodeEntity.key === targetNodeProps.eventKey) {
- // first half of first node in first level
- dropPosition = -1;
- } else if ((abstractDragOverEntity.children || []).length && filteredExpandKeys.includes(dragOverNodeKey)) {
- // drop on expanded node
- // only allow drop inside
- if (allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: 0
- })) {
- dropPosition = 0;
- } else {
- dropAllowed = false;
- }
- } else if (dropLevelOffset === 0) {
- if (rawDropLevelOffset > -1.5) {
- // | Node | <- abstractDropNode
- // | -^-===== | <- mousePosition
- // 1. try drop after
- // 2. do not allow drop
- if (allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: 1
- })) {
- dropPosition = 1;
- } else {
- dropAllowed = false;
- }
- } else {
- // | Node | <- abstractDropNode
- // | ---==^== | <- mousePosition
- // whether it has children or doesn't has children
- // always
- // 1. try drop inside
- // 2. try drop after
- // 3. do not allow drop
- if (allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: 0
- })) {
- dropPosition = 0;
- } else if (allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: 1
- })) {
- dropPosition = 1;
- } else {
- dropAllowed = false;
- }
- }
- } else {
- // | Node1 | <- abstractDropNode
- // | Node2 |
- // --^--|----=====| <- mousePosition
- // 1. try insert after Node1
- // 2. do not allow drop
- if (allowDrop({
- dragNode: abstractDragDataNode,
- dropNode: abstractDropDataNode,
- dropPosition: 1
- })) {
- dropPosition = 1;
- } else {
- dropAllowed = false;
- }
- }
- return {
- dropPosition: dropPosition,
- dropLevelOffset: dropLevelOffset,
- dropTargetKey: abstractDropNodeEntity.key,
- dropTargetPos: abstractDropNodeEntity.pos,
- dragOverNodeKey: dragOverNodeKey,
- dropContainerKey: dropPosition === 0 ? null : ((_abstractDropNodeEnti = abstractDropNodeEntity.parent) === null || _abstractDropNodeEnti === void 0 ? void 0 : _abstractDropNodeEnti.key) || null,
- dropAllowed: dropAllowed
- };
- }
- /**
- * Return selectedKeys according with multiple prop
- * @param selectedKeys
- * @param props
- * @returns [string]
- */
- function calcSelectedKeys(selectedKeys, props) {
- if (!selectedKeys) return undefined;
- var multiple = props.multiple;
- if (multiple) {
- return selectedKeys.slice();
- }
- if (selectedKeys.length) {
- return [selectedKeys[0]];
- }
- return selectedKeys;
- }
- var internalProcessProps = function internalProcessProps(props) {
- return props;
- };
- function convertDataToTree(treeData, processor) {
- if (!treeData) return [];
- var _ref2 = processor || {},
- _ref2$processProps = _ref2.processProps,
- processProps = _ref2$processProps === void 0 ? internalProcessProps : _ref2$processProps;
- var list = Array.isArray(treeData) ? treeData : [treeData];
- return list.map(function (_ref3) {
- var children = _ref3.children,
- props = (0,objectWithoutProperties["default"])(_ref3, util_excluded);
- var childrenNodes = convertDataToTree(children, processor);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_TreeNode, (0,esm_extends["default"])({
- key: props.key
- }, processProps(props)), childrenNodes);
- });
- }
- /**
- * Parse `checkedKeys` to { checkedKeys, halfCheckedKeys } style
- */
- function parseCheckedKeys(keys) {
- if (!keys) {
- return null;
- }
- // Convert keys to object format
- var keyProps;
- if (Array.isArray(keys)) {
- // [Legacy] Follow the api doc
- keyProps = {
- checkedKeys: keys,
- halfCheckedKeys: undefined
- };
- } else if ((0,esm_typeof["default"])(keys) === 'object') {
- keyProps = {
- checkedKeys: keys.checked || undefined,
- halfCheckedKeys: keys.halfChecked || undefined
- };
- } else {
- (0,warning["default"])(false, '`checkedKeys` is not an array or an object');
- return null;
- }
- return keyProps;
- }
- /**
- * If user use `autoExpandParent` we should get the list of parent node
- * @param keyList
- * @param keyEntities
- */
- function conductExpandParent(keyList, keyEntities) {
- var expandedKeys = new Set();
- function conductUp(key) {
- if (expandedKeys.has(key)) return;
- var entity = getEntity(keyEntities, key);
- if (!entity) return;
- expandedKeys.add(key);
- var parent = entity.parent,
- node = entity.node;
- if (node.disabled) return;
- if (parent) {
- conductUp(parent.key);
- }
- }
- (keyList || []).forEach(function (key) {
- conductUp(key);
- });
- return (0,toConsumableArray["default"])(expandedKeys);
- }
- ;// ./components/_util/hooks/useMultipleSelect.ts
- /**
- * @title multipleSelect hooks
- * @description multipleSelect by hold down shift key
- */
- function useMultipleSelect(getKey) {
- const [prevSelectedIndex, setPrevSelectedIndex] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null);
- const multipleSelect = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((currentSelectedIndex, data, selectedKeys) => {
- const configPrevSelectedIndex = prevSelectedIndex !== null && prevSelectedIndex !== void 0 ? prevSelectedIndex : currentSelectedIndex;
- // add/delete the selected range
- const startIndex = Math.min(configPrevSelectedIndex || 0, currentSelectedIndex);
- const endIndex = Math.max(configPrevSelectedIndex || 0, currentSelectedIndex);
- const rangeKeys = data.slice(startIndex, endIndex + 1).map(item => getKey(item));
- const shouldSelected = rangeKeys.some(rangeKey => !selectedKeys.has(rangeKey));
- const changedKeys = [];
- rangeKeys.forEach(item => {
- if (shouldSelected) {
- if (!selectedKeys.has(item)) {
- changedKeys.push(item);
- }
- selectedKeys.add(item);
- } else {
- selectedKeys.delete(item);
- changedKeys.push(item);
- }
- });
- setPrevSelectedIndex(shouldSelected ? endIndex : null);
- return changedKeys;
- }, [prevSelectedIndex]);
- const updatePrevSelectedIndex = val => {
- setPrevSelectedIndex(val);
- };
- return [multipleSelect, updatePrevSelectedIndex];
- }
- ;// ./components/table/hooks/useSelection.tsx
- // TODO: warning if use ajax!!!
- const SELECTION_COLUMN = {};
- const SELECTION_ALL = 'SELECT_ALL';
- const SELECTION_INVERT = 'SELECT_INVERT';
- const SELECTION_NONE = 'SELECT_NONE';
- const useSelection_EMPTY_LIST = [];
- const flattenData = (childrenColumnName, data, list = []) => {
- (data || []).forEach(record => {
- list.push(record);
- if (record && typeof record === 'object' && childrenColumnName in record) {
- flattenData(childrenColumnName, record[childrenColumnName], list);
- }
- });
- return list;
- };
- const useSelection = (config, rowSelection) => {
- const {
- preserveSelectedRowKeys,
- selectedRowKeys,
- defaultSelectedRowKeys,
- getCheckboxProps,
- getTitleCheckboxProps,
- onChange: onSelectionChange,
- onSelect,
- onSelectAll,
- onSelectInvert,
- onSelectNone,
- onSelectMultiple,
- columnWidth: selectionColWidth,
- type: selectionType,
- selections,
- fixed,
- renderCell: customizeRenderCell,
- hideSelectAll,
- checkStrictly = true
- } = rowSelection || {};
- const {
- prefixCls,
- data,
- pageData,
- getRecordByKey,
- getRowKey,
- expandType,
- childrenColumnName,
- locale: tableLocale,
- getPopupContainer
- } = config;
- const warning = (0,_util_warning.devUseWarning)('Table');
- // ========================= MultipleSelect =========================
- const [multipleSelect, updatePrevSelectedIndex] = useMultipleSelect(item => item);
- // ========================= Keys =========================
- const [mergedSelectedKeys, setMergedSelectedKeys] = (0,useMergedState["default"])(selectedRowKeys || defaultSelectedRowKeys || useSelection_EMPTY_LIST, {
- value: selectedRowKeys
- });
- // ======================== Caches ========================
- const preserveRecordsRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(new Map());
- const updatePreserveRecordsCache = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(keys => {
- if (preserveSelectedRowKeys) {
- const newCache = new Map();
- // Keep key if mark as preserveSelectedRowKeys
- keys.forEach(key => {
- let record = getRecordByKey(key);
- if (!record && preserveRecordsRef.current.has(key)) {
- record = preserveRecordsRef.current.get(key);
- }
- newCache.set(key, record);
- });
- // Refresh to new cache
- preserveRecordsRef.current = newCache;
- }
- }, [getRecordByKey, preserveSelectedRowKeys]);
- // Update cache with selectedKeys
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- updatePreserveRecordsCache(mergedSelectedKeys);
- }, [mergedSelectedKeys]);
- // Get flatten data
- const flattedData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => flattenData(childrenColumnName, pageData), [childrenColumnName, pageData]);
- const {
- keyEntities
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (checkStrictly) {
- return {
- keyEntities: null
- };
- }
- let convertData = data;
- if (preserveSelectedRowKeys) {
- // use flattedData keys
- const keysSet = new Set(flattedData.map((record, index) => getRowKey(record, index)));
- // remove preserveRecords that duplicate data
- const preserveRecords = Array.from(preserveRecordsRef.current).reduce((total, [key, value]) => keysSet.has(key) ? total : total.concat(value), []);
- convertData = [].concat((0,toConsumableArray["default"])(convertData), (0,toConsumableArray["default"])(preserveRecords));
- }
- return convertDataToEntities(convertData, {
- externalGetKey: getRowKey,
- childrenPropName: childrenColumnName
- });
- }, [data, getRowKey, checkStrictly, childrenColumnName, preserveSelectedRowKeys, flattedData]);
- // Get all checkbox props
- const checkboxPropsMap = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const map = new Map();
- flattedData.forEach((record, index) => {
- const key = getRowKey(record, index);
- const checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
- map.set(key, checkboxProps);
- true ? warning(!('checked' in checkboxProps || 'defaultChecked' in checkboxProps), 'usage', 'Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead.') : 0;
- });
- return map;
- }, [flattedData, getRowKey, getCheckboxProps]);
- const isCheckboxDisabled = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(r => {
- const rowKey = getRowKey(r);
- let checkboxProps;
- if (checkboxPropsMap.has(rowKey)) {
- checkboxProps = checkboxPropsMap.get(getRowKey(r));
- } else {
- checkboxProps = getCheckboxProps ? getCheckboxProps(r) : undefined;
- }
- return !!(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.disabled);
- }, [checkboxPropsMap, getRowKey]);
- const [derivedSelectedKeys, derivedHalfSelectedKeys] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (checkStrictly) {
- return [mergedSelectedKeys || [], []];
- }
- const {
- checkedKeys,
- halfCheckedKeys
- } = conductCheck(mergedSelectedKeys, true, keyEntities, isCheckboxDisabled);
- return [checkedKeys || [], halfCheckedKeys];
- }, [mergedSelectedKeys, checkStrictly, keyEntities, isCheckboxDisabled]);
- const derivedSelectedKeySet = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const keys = selectionType === 'radio' ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
- return new Set(keys);
- }, [derivedSelectedKeys, selectionType]);
- const derivedHalfSelectedKeySet = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => selectionType === 'radio' ? new Set() : new Set(derivedHalfSelectedKeys), [derivedHalfSelectedKeys, selectionType]);
- // Reset if rowSelection reset
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (!rowSelection) {
- setMergedSelectedKeys(useSelection_EMPTY_LIST);
- }
- }, [!!rowSelection]);
- const setSelectedKeys = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((keys, method) => {
- let availableKeys;
- let records;
- updatePreserveRecordsCache(keys);
- if (preserveSelectedRowKeys) {
- availableKeys = keys;
- records = keys.map(key => preserveRecordsRef.current.get(key));
- } else {
- // Filter key which not exist in the `dataSource`
- availableKeys = [];
- records = [];
- keys.forEach(key => {
- const record = getRecordByKey(key);
- if (record !== undefined) {
- availableKeys.push(key);
- records.push(record);
- }
- });
- }
- setMergedSelectedKeys(availableKeys);
- onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(availableKeys, records, {
- type: method
- });
- }, [setMergedSelectedKeys, getRecordByKey, onSelectionChange, preserveSelectedRowKeys]);
- // ====================== Selections ======================
- // Trigger single `onSelect` event
- const triggerSingleSelection = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((key, selected, keys, event) => {
- if (onSelect) {
- const rows = keys.map(k => getRecordByKey(k));
- onSelect(getRecordByKey(key), selected, rows, event);
- }
- setSelectedKeys(keys, 'single');
- }, [onSelect, getRecordByKey, setSelectedKeys]);
- const mergedSelections = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (!selections || hideSelectAll) {
- return null;
- }
- const selectionList = selections === true ? [SELECTION_ALL, SELECTION_INVERT, SELECTION_NONE] : selections;
- return selectionList.map(selection => {
- if (selection === SELECTION_ALL) {
- return {
- key: 'all',
- text: tableLocale.selectionAll,
- onSelect() {
- setSelectedKeys(data.map((record, index) => getRowKey(record, index)).filter(key => {
- const checkProps = checkboxPropsMap.get(key);
- return !(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled) || derivedSelectedKeySet.has(key);
- }), 'all');
- }
- };
- }
- if (selection === SELECTION_INVERT) {
- return {
- key: 'invert',
- text: tableLocale.selectInvert,
- onSelect() {
- const keySet = new Set(derivedSelectedKeySet);
- pageData.forEach((record, index) => {
- const key = getRowKey(record, index);
- const checkProps = checkboxPropsMap.get(key);
- if (!(checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled)) {
- if (keySet.has(key)) {
- keySet.delete(key);
- } else {
- keySet.add(key);
- }
- }
- });
- const keys = Array.from(keySet);
- if (onSelectInvert) {
- warning.deprecated(false, 'onSelectInvert', 'onChange');
- onSelectInvert(keys);
- }
- setSelectedKeys(keys, 'invert');
- }
- };
- }
- if (selection === SELECTION_NONE) {
- return {
- key: 'none',
- text: tableLocale.selectNone,
- onSelect() {
- onSelectNone === null || onSelectNone === void 0 ? void 0 : onSelectNone();
- setSelectedKeys(Array.from(derivedSelectedKeySet).filter(key => {
- const checkProps = checkboxPropsMap.get(key);
- return checkProps === null || checkProps === void 0 ? void 0 : checkProps.disabled;
- }), 'none');
- }
- };
- }
- return selection;
- }).map(selection => Object.assign(Object.assign({}, selection), {
- onSelect: (...rest) => {
- var _a2;
- var _a;
- (_a = selection.onSelect) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [selection].concat(rest));
- updatePrevSelectedIndex(null);
- }
- }));
- }, [selections, derivedSelectedKeySet, pageData, getRowKey, onSelectInvert, setSelectedKeys]);
- // ======================= Columns ========================
- const transformColumns = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(columns => {
- var _a;
- // >>>>>>>>>>> Skip if not exists `rowSelection`
- if (!rowSelection) {
- true ? warning(!columns.includes(SELECTION_COLUMN), 'usage', '`rowSelection` is not config but `SELECTION_COLUMN` exists in the `columns`.') : 0;
- return columns.filter(col => col !== SELECTION_COLUMN);
- }
- // >>>>>>>>>>> Support selection
- let cloneColumns = (0,toConsumableArray["default"])(columns);
- const keySet = new Set(derivedSelectedKeySet);
- // Record key only need check with enabled
- const recordKeys = flattedData.map(getRowKey).filter(key => !checkboxPropsMap.get(key).disabled);
- const checkedCurrentAll = recordKeys.every(key => keySet.has(key));
- const checkedCurrentSome = recordKeys.some(key => keySet.has(key));
- const onSelectAllChange = () => {
- const changeKeys = [];
- if (checkedCurrentAll) {
- recordKeys.forEach(key => {
- keySet.delete(key);
- changeKeys.push(key);
- });
- } else {
- recordKeys.forEach(key => {
- if (!keySet.has(key)) {
- keySet.add(key);
- changeKeys.push(key);
- }
- });
- }
- const keys = Array.from(keySet);
- onSelectAll === null || onSelectAll === void 0 ? void 0 : onSelectAll(!checkedCurrentAll, keys.map(k => getRecordByKey(k)), changeKeys.map(k => getRecordByKey(k)));
- setSelectedKeys(keys, 'all');
- updatePrevSelectedIndex(null);
- };
- // ===================== Render =====================
- // Title Cell
- let title;
- let columnTitleCheckbox;
- if (selectionType !== 'radio') {
- let customizeSelections;
- if (mergedSelections) {
- const menu = {
- getPopupContainer,
- items: mergedSelections.map((selection, index) => {
- const {
- key,
- text,
- onSelect: onSelectionClick
- } = selection;
- return {
- key: key !== null && key !== void 0 ? key : index,
- onClick: () => {
- onSelectionClick === null || onSelectionClick === void 0 ? void 0 : onSelectionClick(recordKeys);
- },
- label: text
- };
- })
- };
- customizeSelections = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-selection-extra`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_dropdown, {
- menu: menu,
- getPopupContainer: getPopupContainer
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DownOutlined, null))));
- }
- const allDisabledData = flattedData.map((record, index) => {
- const key = getRowKey(record, index);
- const checkboxProps = checkboxPropsMap.get(key) || {};
- return Object.assign({
- checked: keySet.has(key)
- }, checkboxProps);
- }).filter(({
- disabled
- }) => disabled);
- const allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;
- const allDisabledAndChecked = allDisabled && allDisabledData.every(({
- checked
- }) => checked);
- const allDisabledSomeChecked = allDisabled && allDisabledData.some(({
- checked
- }) => checked);
- const customCheckboxProps = (getTitleCheckboxProps === null || getTitleCheckboxProps === void 0 ? void 0 : getTitleCheckboxProps()) || {};
- const {
- onChange,
- disabled
- } = customCheckboxProps;
- columnTitleCheckbox = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_checkbox, Object.assign({
- "aria-label": customizeSelections ? 'Custom selection' : 'Select all'
- }, customCheckboxProps, {
- checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,
- indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,
- onChange: e => {
- onSelectAllChange();
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
- },
- disabled: disabled !== null && disabled !== void 0 ? disabled : flattedData.length === 0 || allDisabled,
- skipGroup: true
- }));
- title = !hideSelectAll && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-selection`
- }, columnTitleCheckbox, customizeSelections));
- }
- // Body Cell
- let renderCell;
- if (selectionType === 'radio') {
- renderCell = (_, record, index) => {
- const key = getRowKey(record, index);
- const checked = keySet.has(key);
- const checkboxProps = checkboxPropsMap.get(key);
- return {
- node: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_radio, Object.assign({}, checkboxProps, {
- checked: checked,
- onClick: e => {
- var _a;
- e.stopPropagation();
- (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
- },
- onChange: event => {
- var _a;
- if (!keySet.has(key)) {
- triggerSingleSelection(key, true, [key], event.nativeEvent);
- }
- (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onChange) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, event);
- }
- }))),
- checked
- };
- };
- } else {
- renderCell = (_, record, index) => {
- var _a;
- const key = getRowKey(record, index);
- const checked = keySet.has(key);
- const indeterminate = derivedHalfSelectedKeySet.has(key);
- const checkboxProps = checkboxPropsMap.get(key);
- let mergedIndeterminate;
- if (expandType === 'nest') {
- mergedIndeterminate = indeterminate;
- true ? warning(typeof (checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== 'boolean', 'usage', 'set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.') : 0;
- } else {
- mergedIndeterminate = (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.indeterminate) !== null && _a !== void 0 ? _a : indeterminate;
- }
- // Record checked
- return {
- node: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_checkbox, Object.assign({}, checkboxProps, {
- indeterminate: mergedIndeterminate,
- checked: checked,
- skipGroup: true,
- onClick: e => {
- var _a;
- e.stopPropagation();
- (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
- },
- onChange: event => {
- var _a;
- const {
- nativeEvent
- } = event;
- const {
- shiftKey
- } = nativeEvent;
- const currentSelectedIndex = recordKeys.findIndex(item => item === key);
- const isMultiple = derivedSelectedKeys.some(item => recordKeys.includes(item));
- if (shiftKey && checkStrictly && isMultiple) {
- const changedKeys = multipleSelect(currentSelectedIndex, recordKeys, keySet);
- const keys = Array.from(keySet);
- onSelectMultiple === null || onSelectMultiple === void 0 ? void 0 : onSelectMultiple(!checked, keys.map(recordKey => getRecordByKey(recordKey)), changedKeys.map(recordKey => getRecordByKey(recordKey)));
- setSelectedKeys(keys, 'multiple');
- } else {
- // Single record selected
- const originCheckedKeys = derivedSelectedKeys;
- if (checkStrictly) {
- const checkedKeys = checked ? arrDel(originCheckedKeys, key) : arrAdd(originCheckedKeys, key);
- triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);
- } else {
- // Always fill first
- const result = conductCheck([].concat((0,toConsumableArray["default"])(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);
- const {
- checkedKeys,
- halfCheckedKeys
- } = result;
- let nextCheckedKeys = checkedKeys;
- // If remove, we do it again to correction
- if (checked) {
- const tempKeySet = new Set(checkedKeys);
- tempKeySet.delete(key);
- nextCheckedKeys = conductCheck(Array.from(tempKeySet), {
- checked: false,
- halfCheckedKeys
- }, keyEntities, isCheckboxDisabled).checkedKeys;
- }
- triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);
- }
- }
- if (checked) {
- updatePrevSelectedIndex(null);
- } else {
- updatePrevSelectedIndex(currentSelectedIndex);
- }
- (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onChange) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, event);
- }
- }))),
- checked
- };
- };
- }
- const renderSelectionCell = (_, record, index) => {
- const {
- node,
- checked
- } = renderCell(_, record, index);
- if (customizeRenderCell) {
- return customizeRenderCell(checked, record, index, node);
- }
- return node;
- };
- // Insert selection column if not exist
- if (!cloneColumns.includes(SELECTION_COLUMN)) {
- // Always after expand icon
- if (cloneColumns.findIndex(col => {
- var _a;
- return ((_a = col[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN';
- }) === 0) {
- const [expandColumn, ...restColumns] = cloneColumns;
- cloneColumns = [expandColumn, SELECTION_COLUMN].concat((0,toConsumableArray["default"])(restColumns));
- } else {
- // Normal insert at first column
- cloneColumns = [SELECTION_COLUMN].concat((0,toConsumableArray["default"])(cloneColumns));
- }
- }
- // Deduplicate selection column
- const selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);
- true ? warning(cloneColumns.filter(col => col === SELECTION_COLUMN).length <= 1, 'usage', 'Multiple `SELECTION_COLUMN` exist in `columns`.') : 0;
- cloneColumns = cloneColumns.filter((column, index) => column !== SELECTION_COLUMN || index === selectionColumnIndex);
- // Fixed column logic
- const prevCol = cloneColumns[selectionColumnIndex - 1];
- const nextCol = cloneColumns[selectionColumnIndex + 1];
- let mergedFixed = fixed;
- if (mergedFixed === undefined) {
- if ((nextCol === null || nextCol === void 0 ? void 0 : nextCol.fixed) !== undefined) {
- mergedFixed = nextCol.fixed;
- } else if ((prevCol === null || prevCol === void 0 ? void 0 : prevCol.fixed) !== undefined) {
- mergedFixed = prevCol.fixed;
- }
- }
- if (mergedFixed && prevCol && ((_a = prevCol[INTERNAL_COL_DEFINE]) === null || _a === void 0 ? void 0 : _a.columnType) === 'EXPAND_COLUMN' && prevCol.fixed === undefined) {
- prevCol.fixed = mergedFixed;
- }
- const columnCls = classnames_default()(`${prefixCls}-selection-col`, {
- [`${prefixCls}-selection-col-with-dropdown`]: selections && selectionType === 'checkbox'
- });
- const renderColumnTitle = () => {
- if (!(rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.columnTitle)) {
- return title;
- }
- if (typeof rowSelection.columnTitle === 'function') {
- return rowSelection.columnTitle(columnTitleCheckbox);
- }
- return rowSelection.columnTitle;
- };
- // Replace with real selection column
- const selectionColumn = {
- fixed: mergedFixed,
- width: selectionColWidth,
- className: `${prefixCls}-selection-column`,
- title: renderColumnTitle(),
- render: renderSelectionCell,
- onCell: rowSelection.onCell,
- align: rowSelection.align,
- [INTERNAL_COL_DEFINE]: {
- className: columnCls
- }
- };
- return cloneColumns.map(col => col === SELECTION_COLUMN ? selectionColumn : col);
- }, [getRowKey, flattedData, rowSelection, derivedSelectedKeys, derivedSelectedKeySet, derivedHalfSelectedKeySet, selectionColWidth, mergedSelections, expandType, checkboxPropsMap, onSelectMultiple, triggerSingleSelection, isCheckboxDisabled]);
- return [transformColumns, derivedSelectedKeySet];
- };
- /* harmony default export */ var hooks_useSelection = (useSelection);
- ;// ./components/_util/hooks/useProxyImperativeHandle.ts
- // Proxy the dom ref with `{ nativeElement, otherFn }` type
- // ref: https://github.com/ant-design/ant-design/discussions/45242
- function fillProxy(element, handler) {
- element._antProxy = element._antProxy || {};
- Object.keys(handler).forEach(key => {
- if (!(key in element._antProxy)) {
- const ori = element[key];
- element._antProxy[key] = ori;
- element[key] = handler[key];
- }
- });
- return element;
- }
- function useProxyImperativeHandle(ref, init) {
- return (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, () => {
- const refObj = init();
- const {
- nativeElement
- } = refObj;
- if (typeof Proxy !== 'undefined') {
- return new Proxy(nativeElement, {
- get(obj, prop) {
- if (refObj[prop]) {
- return refObj[prop];
- }
- return Reflect.get(obj, prop);
- }
- });
- }
- // Fallback of IE
- return fillProxy(nativeElement, refObj);
- });
- }
- ;// ./components/table/ExpandIcon.tsx
- function ExpandIcon_renderExpandIcon(locale) {
- return props => {
- const {
- prefixCls,
- onExpand,
- record,
- expanded,
- expandable
- } = props;
- const iconPrefix = `${prefixCls}-row-expand-icon`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- onClick: e => {
- onExpand(record, e);
- e.stopPropagation();
- },
- className: classnames_default()(iconPrefix, {
- [`${iconPrefix}-spaced`]: !expandable,
- [`${iconPrefix}-expanded`]: expandable && expanded,
- [`${iconPrefix}-collapsed`]: expandable && !expanded
- }),
- "aria-label": expanded ? locale.collapse : locale.expand,
- "aria-expanded": expanded
- });
- };
- }
- /* harmony default export */ var ExpandIcon = (ExpandIcon_renderExpandIcon);
- ;// ./components/table/hooks/useContainerWidth.ts
- function useContainerWidth(prefixCls) {
- const getContainerWidth = (ele, width) => {
- const container = ele.querySelector(`.${prefixCls}-container`);
- let returnWidth = width;
- if (container) {
- const style = getComputedStyle(container);
- const borderLeft = parseInt(style.borderLeftWidth, 10);
- const borderRight = parseInt(style.borderRightWidth, 10);
- returnWidth = width - borderLeft - borderRight;
- }
- return returnWidth;
- };
- return getContainerWidth;
- }
- ;// ./components/table/util.ts
- const getColumnKey = (column, defaultKey) => {
- if ('key' in column && column.key !== undefined && column.key !== null) {
- return column.key;
- }
- if (column.dataIndex) {
- return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;
- }
- return defaultKey;
- };
- function getColumnPos(index, pos) {
- return pos ? `${pos}-${index}` : `${index}`;
- }
- const renderColumnTitle = (title, props) => {
- if (typeof title === 'function') {
- return title(props);
- }
- return title;
- };
- /**
- * Safe get column title
- *
- * Should filter [object Object]
- *
- * @param title
- */
- const safeColumnTitle = (title, props) => {
- const res = renderColumnTitle(title, props);
- if (Object.prototype.toString.call(res) === '[object Object]') {
- return '';
- }
- return res;
- };
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FilterFilled.js
- // This icon file is generated automatically.
- var FilterFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z" } }] }, "name": "filter", "theme": "filled" };
- /* harmony default export */ var asn_FilterFilled = (FilterFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/FilterFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FilterFilled_FilterFilled = function FilterFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FilterFilled
- }));
- };
- /** */
- var FilterFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FilterFilled_FilterFilled);
- if (true) {
- FilterFilled_RefIcon.displayName = 'FilterFilled';
- }
- /* harmony default export */ var icons_FilterFilled = (FilterFilled_RefIcon);
- ;// ./components/_util/hooks/useSyncState.ts
- function hooks_useSyncState_useSyncState(initialValue) {
- const ref = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(initialValue);
- const forceUpdate = useForceUpdate();
- return [() => ref.current, newValue => {
- ref.current = newValue;
- // re-render
- forceUpdate();
- }];
- }
- ;// ./node_modules/rc-tree/es/DropIndicator.js
- var DropIndicator = function DropIndicator(props) {
- var dropPosition = props.dropPosition,
- dropLevelOffset = props.dropLevelOffset,
- indent = props.indent;
- var style = {
- pointerEvents: 'none',
- position: 'absolute',
- right: 0,
- backgroundColor: 'red',
- height: 2
- };
- switch (dropPosition) {
- case -1:
- style.top = 0;
- style.left = -dropLevelOffset * indent;
- break;
- case 1:
- style.bottom = 0;
- style.left = -dropLevelOffset * indent;
- break;
- case 0:
- style.bottom = 0;
- style.left = indent;
- break;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- style: style
- });
- };
- if (true) {
- DropIndicator.displayName = 'DropIndicator';
- }
- /* harmony default export */ var es_DropIndicator = (DropIndicator);
- ;// ./node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js
- function _objectDestructuringEmpty(t) {
- if (null == t) throw new TypeError("Cannot destructure " + t);
- }
- ;// ./node_modules/rc-tree/es/useUnmount.js
- /**
- * Trigger only when component unmount
- */
- function useUnmount(triggerStart, triggerEnd) {
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- firstMount = _React$useState2[0],
- setFirstMount = _React$useState2[1];
- (0,useLayoutEffect["default"])(function () {
- if (firstMount) {
- triggerStart();
- return function () {
- triggerEnd();
- };
- }
- }, [firstMount]);
- (0,useLayoutEffect["default"])(function () {
- setFirstMount(true);
- return function () {
- setFirstMount(false);
- };
- }, []);
- }
- /* harmony default export */ var es_useUnmount = (useUnmount);
- ;// ./node_modules/rc-tree/es/MotionTreeNode.js
- var MotionTreeNode_excluded = ["className", "style", "motion", "motionNodes", "motionType", "onMotionStart", "onMotionEnd", "active", "treeNodeRequiredProps"];
- var MotionTreeNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (oriProps, ref) {
- var className = oriProps.className,
- style = oriProps.style,
- motion = oriProps.motion,
- motionNodes = oriProps.motionNodes,
- motionType = oriProps.motionType,
- onOriginMotionStart = oriProps.onMotionStart,
- onOriginMotionEnd = oriProps.onMotionEnd,
- active = oriProps.active,
- treeNodeRequiredProps = oriProps.treeNodeRequiredProps,
- props = (0,objectWithoutProperties["default"])(oriProps, MotionTreeNode_excluded);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- visible = _React$useState2[0],
- setVisible = _React$useState2[1];
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(TreeContext),
- prefixCls = _React$useContext.prefixCls;
- // Calculate target visible here.
- // And apply in effect to make `leave` motion work.
- var targetVisible = motionNodes && motionType !== 'hide';
- (0,useLayoutEffect["default"])(function () {
- if (motionNodes) {
- if (targetVisible !== visible) {
- setVisible(targetVisible);
- }
- }
- }, [motionNodes]);
- var triggerMotionStart = function triggerMotionStart() {
- if (motionNodes) {
- onOriginMotionStart();
- }
- };
- // Should only trigger once
- var triggerMotionEndRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- var triggerMotionEnd = function triggerMotionEnd() {
- if (motionNodes && !triggerMotionEndRef.current) {
- triggerMotionEndRef.current = true;
- onOriginMotionEnd();
- }
- };
- // Effect if unmount
- es_useUnmount(triggerMotionStart, triggerMotionEnd);
- // Motion end event
- var onVisibleChanged = function onVisibleChanged(nextVisible) {
- if (targetVisible === nextVisible) {
- triggerMotionEnd();
- }
- };
- if (motionNodes) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], (0,esm_extends["default"])({
- ref: ref,
- visible: visible
- }, motion, {
- motionAppear: motionType === 'show',
- onVisibleChanged: onVisibleChanged
- }), function (_ref, motionRef) {
- var motionClassName = _ref.className,
- motionStyle = _ref.style;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: motionRef,
- className: classnames_default()("".concat(prefixCls, "-treenode-motion"), motionClassName),
- style: motionStyle
- }, motionNodes.map(function (treeNode) {
- var restProps = Object.assign({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)),
- title = treeNode.title,
- key = treeNode.key,
- isStart = treeNode.isStart,
- isEnd = treeNode.isEnd;
- delete restProps.children;
- var treeNodeProps = getTreeNodeProps(key, treeNodeRequiredProps);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TreeNode, (0,esm_extends["default"])({}, restProps, treeNodeProps, {
- title: title,
- active: active,
- data: treeNode.data,
- key: key,
- isStart: isStart,
- isEnd: isEnd
- }));
- }));
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TreeNode, (0,esm_extends["default"])({
- domRef: ref,
- className: className,
- style: style
- }, props, {
- active: active
- }));
- });
- if (true) {
- MotionTreeNode.displayName = 'MotionTreeNode';
- }
- /* harmony default export */ var es_MotionTreeNode = (MotionTreeNode);
- ;// ./node_modules/rc-tree/es/utils/diffUtil.js
- function findExpandedKeys() {
- var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var prevLen = prev.length;
- var nextLen = next.length;
- if (Math.abs(prevLen - nextLen) !== 1) {
- return {
- add: false,
- key: null
- };
- }
- function find(shorter, longer) {
- var cache = new Map();
- shorter.forEach(function (key) {
- cache.set(key, true);
- });
- var keys = longer.filter(function (key) {
- return !cache.has(key);
- });
- return keys.length === 1 ? keys[0] : null;
- }
- if (prevLen < nextLen) {
- return {
- add: true,
- key: find(prev, next)
- };
- }
- return {
- add: false,
- key: find(next, prev)
- };
- }
- function getExpandRange(shorter, longer, key) {
- var shorterStartIndex = shorter.findIndex(function (data) {
- return data.key === key;
- });
- var shorterEndNode = shorter[shorterStartIndex + 1];
- var longerStartIndex = longer.findIndex(function (data) {
- return data.key === key;
- });
- if (shorterEndNode) {
- var longerEndIndex = longer.findIndex(function (data) {
- return data.key === shorterEndNode.key;
- });
- return longer.slice(longerStartIndex + 1, longerEndIndex);
- }
- return longer.slice(longerStartIndex + 1);
- }
- ;// ./node_modules/rc-tree/es/NodeList.js
- var NodeList_excluded = ["prefixCls", "data", "selectable", "checkable", "expandedKeys", "selectedKeys", "checkedKeys", "loadedKeys", "loadingKeys", "halfCheckedKeys", "keyEntities", "disabled", "dragging", "dragOverNodeKey", "dropPosition", "motion", "height", "itemHeight", "virtual", "scrollWidth", "focusable", "activeItem", "focused", "tabIndex", "onKeyDown", "onFocus", "onBlur", "onActiveChange", "onListChangeStart", "onListChangeEnd"];
- /**
- * Handle virtual list of the TreeNodes.
- */
- var NodeList_HIDDEN_STYLE = {
- width: 0,
- height: 0,
- display: 'flex',
- overflow: 'hidden',
- opacity: 0,
- border: 0,
- padding: 0,
- margin: 0
- };
- var NodeList_noop = function noop() {};
- var MOTION_KEY = "RC_TREE_MOTION_".concat(Math.random());
- var MotionNode = {
- key: MOTION_KEY
- };
- var MotionEntity = {
- key: MOTION_KEY,
- level: 0,
- index: 0,
- pos: '0',
- node: MotionNode,
- nodes: [MotionNode]
- };
- var MotionFlattenData = {
- parent: null,
- children: [],
- pos: MotionEntity.pos,
- data: MotionNode,
- title: null,
- key: MOTION_KEY,
- /** Hold empty list here since we do not use it */
- isStart: [],
- isEnd: []
- };
- /**
- * We only need get visible content items to play the animation.
- */
- function getMinimumRangeTransitionRange(list, virtual, height, itemHeight) {
- if (virtual === false || !height) {
- return list;
- }
- return list.slice(0, Math.ceil(height / itemHeight) + 1);
- }
- function NodeList_itemKey(item) {
- var key = item.key,
- pos = item.pos;
- return treeUtil_getKey(key, pos);
- }
- function getAccessibilityPath(item) {
- var path = String(item.data.key);
- var current = item;
- while (current.parent) {
- current = current.parent;
- path = "".concat(current.data.key, " > ").concat(path);
- }
- return path;
- }
- var NodeList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var prefixCls = props.prefixCls,
- data = props.data,
- selectable = props.selectable,
- checkable = props.checkable,
- expandedKeys = props.expandedKeys,
- selectedKeys = props.selectedKeys,
- checkedKeys = props.checkedKeys,
- loadedKeys = props.loadedKeys,
- loadingKeys = props.loadingKeys,
- halfCheckedKeys = props.halfCheckedKeys,
- keyEntities = props.keyEntities,
- disabled = props.disabled,
- dragging = props.dragging,
- dragOverNodeKey = props.dragOverNodeKey,
- dropPosition = props.dropPosition,
- motion = props.motion,
- height = props.height,
- itemHeight = props.itemHeight,
- virtual = props.virtual,
- scrollWidth = props.scrollWidth,
- focusable = props.focusable,
- activeItem = props.activeItem,
- focused = props.focused,
- tabIndex = props.tabIndex,
- onKeyDown = props.onKeyDown,
- onFocus = props.onFocus,
- onBlur = props.onBlur,
- onActiveChange = props.onActiveChange,
- onListChangeStart = props.onListChangeStart,
- onListChangeEnd = props.onListChangeEnd,
- domProps = (0,objectWithoutProperties["default"])(props, NodeList_excluded);
- // =============================== Ref ================================
- var listRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- var indentMeasurerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- return {
- scrollTo: function scrollTo(scroll) {
- listRef.current.scrollTo(scroll);
- },
- getIndentWidth: function getIndentWidth() {
- return indentMeasurerRef.current.offsetWidth;
- }
- };
- });
- // ============================== Motion ==============================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(expandedKeys),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- prevExpandedKeys = _React$useState2[0],
- setPrevExpandedKeys = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(data),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- prevData = _React$useState4[0],
- setPrevData = _React$useState4[1];
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(data),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- transitionData = _React$useState6[0],
- setTransitionData = _React$useState6[1];
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- transitionRange = _React$useState8[0],
- setTransitionRange = _React$useState8[1];
- var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState10 = (0,slicedToArray["default"])(_React$useState9, 2),
- motionType = _React$useState10[0],
- setMotionType = _React$useState10[1];
- // When motion end but data change, this will makes data back to previous one
- var dataRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(data);
- dataRef.current = data;
- function onMotionEnd() {
- var latestData = dataRef.current;
- setPrevData(latestData);
- setTransitionData(latestData);
- setTransitionRange([]);
- setMotionType(null);
- onListChangeEnd();
- }
- // Do animation if expanded keys changed
- // layoutEffect here to avoid blink of node removing
- (0,useLayoutEffect["default"])(function () {
- setPrevExpandedKeys(expandedKeys);
- var diffExpanded = findExpandedKeys(prevExpandedKeys, expandedKeys);
- if (diffExpanded.key !== null) {
- if (diffExpanded.add) {
- var keyIndex = prevData.findIndex(function (_ref) {
- var key = _ref.key;
- return key === diffExpanded.key;
- });
- var rangeNodes = getMinimumRangeTransitionRange(getExpandRange(prevData, data, diffExpanded.key), virtual, height, itemHeight);
- var newTransitionData = prevData.slice();
- newTransitionData.splice(keyIndex + 1, 0, MotionFlattenData);
- setTransitionData(newTransitionData);
- setTransitionRange(rangeNodes);
- setMotionType('show');
- } else {
- var _keyIndex = data.findIndex(function (_ref2) {
- var key = _ref2.key;
- return key === diffExpanded.key;
- });
- var _rangeNodes = getMinimumRangeTransitionRange(getExpandRange(data, prevData, diffExpanded.key), virtual, height, itemHeight);
- var _newTransitionData = data.slice();
- _newTransitionData.splice(_keyIndex + 1, 0, MotionFlattenData);
- setTransitionData(_newTransitionData);
- setTransitionRange(_rangeNodes);
- setMotionType('hide');
- }
- } else if (prevData !== data) {
- // If whole data changed, we just refresh the list
- setPrevData(data);
- setTransitionData(data);
- }
- }, [expandedKeys, data]);
- // We should clean up motion if is changed by dragging
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!dragging) {
- onMotionEnd();
- }
- }, [dragging]);
- var mergedData = motion ? transitionData : data;
- var treeNodeRequiredProps = {
- expandedKeys: expandedKeys,
- selectedKeys: selectedKeys,
- loadedKeys: loadedKeys,
- loadingKeys: loadingKeys,
- checkedKeys: checkedKeys,
- halfCheckedKeys: halfCheckedKeys,
- dragOverNodeKey: dragOverNodeKey,
- dropPosition: dropPosition,
- keyEntities: keyEntities
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, focused && activeItem && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: NodeList_HIDDEN_STYLE,
- "aria-live": "assertive"
- }, getAccessibilityPath(activeItem)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("input", {
- style: NodeList_HIDDEN_STYLE,
- disabled: focusable === false || disabled,
- tabIndex: focusable !== false ? tabIndex : null,
- onKeyDown: onKeyDown,
- onFocus: onFocus,
- onBlur: onBlur,
- value: "",
- onChange: NodeList_noop,
- "aria-label": "for screen reader"
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-treenode"),
- "aria-hidden": true,
- style: {
- position: 'absolute',
- pointerEvents: 'none',
- visibility: 'hidden',
- height: 0,
- overflow: 'hidden',
- border: 0,
- padding: 0
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-indent")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: indentMeasurerRef,
- className: "".concat(prefixCls, "-indent-unit")
- }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_virtual_list_es, (0,esm_extends["default"])({}, domProps, {
- data: mergedData,
- itemKey: NodeList_itemKey,
- height: height,
- fullHeight: false,
- virtual: virtual,
- itemHeight: itemHeight,
- scrollWidth: scrollWidth,
- prefixCls: "".concat(prefixCls, "-list"),
- ref: listRef,
- role: "tree",
- onVisibleChange: function onVisibleChange(originList) {
- // The best match is using `fullList` - `originList` = `restList`
- // and check the `restList` to see if has the MOTION_KEY node
- // but this will cause performance issue for long list compare
- // we just check `originList` and repeat trigger `onMotionEnd`
- if (originList.every(function (item) {
- return NodeList_itemKey(item) !== MOTION_KEY;
- })) {
- onMotionEnd();
- }
- }
- }), function (treeNode) {
- var pos = treeNode.pos,
- restProps = Object.assign({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)),
- title = treeNode.title,
- key = treeNode.key,
- isStart = treeNode.isStart,
- isEnd = treeNode.isEnd;
- var mergedKey = treeUtil_getKey(key, pos);
- delete restProps.key;
- delete restProps.children;
- var treeNodeProps = getTreeNodeProps(mergedKey, treeNodeRequiredProps);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_MotionTreeNode, (0,esm_extends["default"])({}, restProps, treeNodeProps, {
- title: title,
- active: !!activeItem && key === activeItem.key,
- pos: pos,
- data: treeNode.data,
- isStart: isStart,
- isEnd: isEnd,
- motion: motion,
- motionNodes: key === MOTION_KEY ? transitionRange : null,
- motionType: motionType,
- onMotionStart: onListChangeStart,
- onMotionEnd: onMotionEnd,
- treeNodeRequiredProps: treeNodeRequiredProps,
- onMouseMove: function onMouseMove() {
- onActiveChange(null);
- }
- }));
- }));
- });
- if (true) {
- NodeList.displayName = 'NodeList';
- }
- /* harmony default export */ var es_NodeList = (NodeList);
- ;// ./node_modules/rc-tree/es/Tree.js
- // TODO: https://www.w3.org/TR/2017/NOTE-wai-aria-practices-1.1-20171214/examples/treeview/treeview-2/treeview-2a.html
- // Fully accessibility support
- var MAX_RETRY_TIMES = 10;
- var Tree = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(Tree, _React$Component);
- var _super = (0,createSuper["default"])(Tree);
- function Tree() {
- var _this;
- (0,classCallCheck["default"])(this, Tree);
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
- _args[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(_args));
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "destroyed", false);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "delayedDragEnterLogic", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "loadingRetryTimes", {});
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "state", {
- keyEntities: {},
- indent: null,
- selectedKeys: [],
- checkedKeys: [],
- halfCheckedKeys: [],
- loadedKeys: [],
- loadingKeys: [],
- expandedKeys: [],
- draggingNodeKey: null,
- dragChildrenKeys: [],
- // dropTargetKey is the key of abstract-drop-node
- // the abstract-drop-node is the real drop node when drag and drop
- // not the DOM drag over node
- dropTargetKey: null,
- dropPosition: null,
- // the drop position of abstract-drop-node, inside 0, top -1, bottom 1
- dropContainerKey: null,
- // the container key of abstract-drop-node if dropPosition is -1 or 1
- dropLevelOffset: null,
- // the drop level offset of abstract-drag-over-node
- dropTargetPos: null,
- // the pos of abstract-drop-node
- dropAllowed: true,
- // if drop to abstract-drop-node is allowed
- // the abstract-drag-over-node
- // if mouse is on the bottom of top dom node or no the top of the bottom dom node
- // abstract-drag-over-node is the top node
- dragOverNodeKey: null,
- treeData: [],
- flattenNodes: [],
- focused: false,
- activeKey: null,
- listChanging: false,
- prevProps: null,
- fieldNames: treeUtil_fillFieldNames()
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "dragStartMousePosition", null);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "dragNodeProps", null);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "currentMouseOverDroppableNodeKey", null);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "listRef", /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createRef());
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDragStart", function (event, nodeProps) {
- var _this$state = _this.state,
- expandedKeys = _this$state.expandedKeys,
- keyEntities = _this$state.keyEntities;
- var onDragStart = _this.props.onDragStart;
- var eventKey = nodeProps.eventKey;
- _this.dragNodeProps = nodeProps;
- _this.dragStartMousePosition = {
- x: event.clientX,
- y: event.clientY
- };
- var newExpandedKeys = arrDel(expandedKeys, eventKey);
- _this.setState({
- draggingNodeKey: eventKey,
- dragChildrenKeys: getDragChildrenKeys(eventKey, keyEntities),
- indent: _this.listRef.current.getIndentWidth()
- });
- _this.setExpandedKeys(newExpandedKeys);
- window.addEventListener('dragend', _this.onWindowDragEnd);
- onDragStart === null || onDragStart === void 0 || onDragStart({
- event: event,
- node: convertNodePropsToEventData(nodeProps)
- });
- });
- /**
- * [Legacy] Select handler is smaller than node,
- * so that this will trigger when drag enter node or select handler.
- * This is a little tricky if customize css without padding.
- * Better for use mouse move event to refresh drag state.
- * But let's just keep it to avoid event trigger logic change.
- */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDragEnter", function (event, nodeProps) {
- var _this$state2 = _this.state,
- expandedKeys = _this$state2.expandedKeys,
- keyEntities = _this$state2.keyEntities,
- dragChildrenKeys = _this$state2.dragChildrenKeys,
- flattenNodes = _this$state2.flattenNodes,
- indent = _this$state2.indent;
- var _this$props = _this.props,
- onDragEnter = _this$props.onDragEnter,
- onExpand = _this$props.onExpand,
- allowDrop = _this$props.allowDrop,
- direction = _this$props.direction;
- var pos = nodeProps.pos,
- eventKey = nodeProps.eventKey;
- // record the key of node which is latest entered, used in dragleave event.
- if (_this.currentMouseOverDroppableNodeKey !== eventKey) {
- _this.currentMouseOverDroppableNodeKey = eventKey;
- }
- if (!_this.dragNodeProps) {
- _this.resetDragState();
- return;
- }
- var _calcDropPosition = calcDropPosition(event, _this.dragNodeProps, nodeProps, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),
- dropPosition = _calcDropPosition.dropPosition,
- dropLevelOffset = _calcDropPosition.dropLevelOffset,
- dropTargetKey = _calcDropPosition.dropTargetKey,
- dropContainerKey = _calcDropPosition.dropContainerKey,
- dropTargetPos = _calcDropPosition.dropTargetPos,
- dropAllowed = _calcDropPosition.dropAllowed,
- dragOverNodeKey = _calcDropPosition.dragOverNodeKey;
- if (
- // don't allow drop inside its children
- dragChildrenKeys.includes(dropTargetKey) ||
- // don't allow drop when drop is not allowed caculated by calcDropPosition
- !dropAllowed) {
- _this.resetDragState();
- return;
- }
- // Side effect for delay drag
- if (!_this.delayedDragEnterLogic) {
- _this.delayedDragEnterLogic = {};
- }
- Object.keys(_this.delayedDragEnterLogic).forEach(function (key) {
- clearTimeout(_this.delayedDragEnterLogic[key]);
- });
- if (_this.dragNodeProps.eventKey !== nodeProps.eventKey) {
- // hoist expand logic here
- // since if logic is on the bottom
- // it will be blocked by abstract dragover node check
- // => if you dragenter from top, you mouse will still be consider as in the top node
- event.persist();
- _this.delayedDragEnterLogic[pos] = window.setTimeout(function () {
- if (_this.state.draggingNodeKey === null) {
- return;
- }
- var newExpandedKeys = (0,toConsumableArray["default"])(expandedKeys);
- var entity = getEntity(keyEntities, nodeProps.eventKey);
- if (entity && (entity.children || []).length) {
- newExpandedKeys = arrAdd(expandedKeys, nodeProps.eventKey);
- }
- if (!_this.props.hasOwnProperty('expandedKeys')) {
- _this.setExpandedKeys(newExpandedKeys);
- }
- onExpand === null || onExpand === void 0 || onExpand(newExpandedKeys, {
- node: convertNodePropsToEventData(nodeProps),
- expanded: true,
- nativeEvent: event.nativeEvent
- });
- }, 800);
- }
- // Skip if drag node is self
- if (_this.dragNodeProps.eventKey === dropTargetKey && dropLevelOffset === 0) {
- _this.resetDragState();
- return;
- }
- // Update drag over node and drag state
- _this.setState({
- dragOverNodeKey: dragOverNodeKey,
- dropPosition: dropPosition,
- dropLevelOffset: dropLevelOffset,
- dropTargetKey: dropTargetKey,
- dropContainerKey: dropContainerKey,
- dropTargetPos: dropTargetPos,
- dropAllowed: dropAllowed
- });
- onDragEnter === null || onDragEnter === void 0 || onDragEnter({
- event: event,
- node: convertNodePropsToEventData(nodeProps),
- expandedKeys: expandedKeys
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDragOver", function (event, nodeProps) {
- var _this$state3 = _this.state,
- dragChildrenKeys = _this$state3.dragChildrenKeys,
- flattenNodes = _this$state3.flattenNodes,
- keyEntities = _this$state3.keyEntities,
- expandedKeys = _this$state3.expandedKeys,
- indent = _this$state3.indent;
- var _this$props2 = _this.props,
- onDragOver = _this$props2.onDragOver,
- allowDrop = _this$props2.allowDrop,
- direction = _this$props2.direction;
- if (!_this.dragNodeProps) {
- return;
- }
- var _calcDropPosition2 = calcDropPosition(event, _this.dragNodeProps, nodeProps, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),
- dropPosition = _calcDropPosition2.dropPosition,
- dropLevelOffset = _calcDropPosition2.dropLevelOffset,
- dropTargetKey = _calcDropPosition2.dropTargetKey,
- dropContainerKey = _calcDropPosition2.dropContainerKey,
- dropTargetPos = _calcDropPosition2.dropTargetPos,
- dropAllowed = _calcDropPosition2.dropAllowed,
- dragOverNodeKey = _calcDropPosition2.dragOverNodeKey;
- if (dragChildrenKeys.includes(dropTargetKey) || !dropAllowed) {
- // don't allow drop inside its children
- // don't allow drop when drop is not allowed calculated by calcDropPosition
- return;
- }
- // Update drag position
- if (_this.dragNodeProps.eventKey === dropTargetKey && dropLevelOffset === 0) {
- if (!(_this.state.dropPosition === null && _this.state.dropLevelOffset === null && _this.state.dropTargetKey === null && _this.state.dropContainerKey === null && _this.state.dropTargetPos === null && _this.state.dropAllowed === false && _this.state.dragOverNodeKey === null)) {
- _this.resetDragState();
- }
- } else if (!(dropPosition === _this.state.dropPosition && dropLevelOffset === _this.state.dropLevelOffset && dropTargetKey === _this.state.dropTargetKey && dropContainerKey === _this.state.dropContainerKey && dropTargetPos === _this.state.dropTargetPos && dropAllowed === _this.state.dropAllowed && dragOverNodeKey === _this.state.dragOverNodeKey)) {
- _this.setState({
- dropPosition: dropPosition,
- dropLevelOffset: dropLevelOffset,
- dropTargetKey: dropTargetKey,
- dropContainerKey: dropContainerKey,
- dropTargetPos: dropTargetPos,
- dropAllowed: dropAllowed,
- dragOverNodeKey: dragOverNodeKey
- });
- }
- onDragOver === null || onDragOver === void 0 || onDragOver({
- event: event,
- node: convertNodePropsToEventData(nodeProps)
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDragLeave", function (event, nodeProps) {
- // if it is outside the droppable area
- // currentMouseOverDroppableNodeKey will be updated in dragenter event when into another droppable receiver.
- if (_this.currentMouseOverDroppableNodeKey === nodeProps.eventKey && !event.currentTarget.contains(event.relatedTarget)) {
- _this.resetDragState();
- _this.currentMouseOverDroppableNodeKey = null;
- }
- var onDragLeave = _this.props.onDragLeave;
- onDragLeave === null || onDragLeave === void 0 || onDragLeave({
- event: event,
- node: convertNodePropsToEventData(nodeProps)
- });
- });
- // since stopPropagation() is called in treeNode
- // if onWindowDrag is called, whice means state is keeped, drag state should be cleared
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onWindowDragEnd", function (event) {
- _this.onNodeDragEnd(event, null, true);
- window.removeEventListener('dragend', _this.onWindowDragEnd);
- });
- // if onNodeDragEnd is called, onWindowDragEnd won't be called since stopPropagation() is called
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDragEnd", function (event, nodeProps) {
- var onDragEnd = _this.props.onDragEnd;
- _this.setState({
- dragOverNodeKey: null
- });
- _this.cleanDragState();
- onDragEnd === null || onDragEnd === void 0 || onDragEnd({
- event: event,
- node: convertNodePropsToEventData(nodeProps)
- });
- _this.dragNodeProps = null;
- window.removeEventListener('dragend', _this.onWindowDragEnd);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDrop", function (event, _) {
- var _this$getActiveItem;
- var outsideTree = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var _this$state4 = _this.state,
- dragChildrenKeys = _this$state4.dragChildrenKeys,
- dropPosition = _this$state4.dropPosition,
- dropTargetKey = _this$state4.dropTargetKey,
- dropTargetPos = _this$state4.dropTargetPos,
- dropAllowed = _this$state4.dropAllowed;
- if (!dropAllowed) {
- return;
- }
- var onDrop = _this.props.onDrop;
- _this.setState({
- dragOverNodeKey: null
- });
- _this.cleanDragState();
- if (dropTargetKey === null) return;
- var abstractDropNodeProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, getTreeNodeProps(dropTargetKey, _this.getTreeNodeRequiredProps())), {}, {
- active: ((_this$getActiveItem = _this.getActiveItem()) === null || _this$getActiveItem === void 0 ? void 0 : _this$getActiveItem.key) === dropTargetKey,
- data: getEntity(_this.state.keyEntities, dropTargetKey).node
- });
- var dropToChild = dragChildrenKeys.includes(dropTargetKey);
- (0,warning["default"])(!dropToChild, "Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");
- var posArr = posToArr(dropTargetPos);
- var dropResult = {
- event: event,
- node: convertNodePropsToEventData(abstractDropNodeProps),
- dragNode: _this.dragNodeProps ? convertNodePropsToEventData(_this.dragNodeProps) : null,
- dragNodesKeys: [_this.dragNodeProps.eventKey].concat(dragChildrenKeys),
- dropToGap: dropPosition !== 0,
- dropPosition: dropPosition + Number(posArr[posArr.length - 1])
- };
- if (!outsideTree) {
- onDrop === null || onDrop === void 0 || onDrop(dropResult);
- }
- _this.dragNodeProps = null;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "cleanDragState", function () {
- var draggingNodeKey = _this.state.draggingNodeKey;
- if (draggingNodeKey !== null) {
- _this.setState({
- draggingNodeKey: null,
- dropPosition: null,
- dropContainerKey: null,
- dropTargetKey: null,
- dropLevelOffset: null,
- dropAllowed: true,
- dragOverNodeKey: null
- });
- }
- _this.dragStartMousePosition = null;
- _this.currentMouseOverDroppableNodeKey = null;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "triggerExpandActionExpand", function (e, treeNode) {
- var _this$state5 = _this.state,
- expandedKeys = _this$state5.expandedKeys,
- flattenNodes = _this$state5.flattenNodes;
- var expanded = treeNode.expanded,
- key = treeNode.key,
- isLeaf = treeNode.isLeaf;
- if (isLeaf || e.shiftKey || e.metaKey || e.ctrlKey) {
- return;
- }
- var node = flattenNodes.filter(function (nodeItem) {
- return nodeItem.key === key;
- })[0];
- var eventNode = convertNodePropsToEventData((0,objectSpread2["default"])((0,objectSpread2["default"])({}, getTreeNodeProps(key, _this.getTreeNodeRequiredProps())), {}, {
- data: node.data
- }));
- _this.setExpandedKeys(expanded ? arrDel(expandedKeys, key) : arrAdd(expandedKeys, key));
- _this.onNodeExpand(e, eventNode);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeClick", function (e, treeNode) {
- var _this$props3 = _this.props,
- onClick = _this$props3.onClick,
- expandAction = _this$props3.expandAction;
- if (expandAction === 'click') {
- _this.triggerExpandActionExpand(e, treeNode);
- }
- onClick === null || onClick === void 0 || onClick(e, treeNode);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeDoubleClick", function (e, treeNode) {
- var _this$props4 = _this.props,
- onDoubleClick = _this$props4.onDoubleClick,
- expandAction = _this$props4.expandAction;
- if (expandAction === 'doubleClick') {
- _this.triggerExpandActionExpand(e, treeNode);
- }
- onDoubleClick === null || onDoubleClick === void 0 || onDoubleClick(e, treeNode);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeSelect", function (e, treeNode) {
- var selectedKeys = _this.state.selectedKeys;
- var _this$state6 = _this.state,
- keyEntities = _this$state6.keyEntities,
- fieldNames = _this$state6.fieldNames;
- var _this$props5 = _this.props,
- onSelect = _this$props5.onSelect,
- multiple = _this$props5.multiple;
- var selected = treeNode.selected;
- var key = treeNode[fieldNames.key];
- var targetSelected = !selected;
- // Update selected keys
- if (!targetSelected) {
- selectedKeys = arrDel(selectedKeys, key);
- } else if (!multiple) {
- selectedKeys = [key];
- } else {
- selectedKeys = arrAdd(selectedKeys, key);
- }
- // [Legacy] Not found related usage in doc or upper libs
- var selectedNodes = selectedKeys.map(function (selectedKey) {
- var entity = getEntity(keyEntities, selectedKey);
- return entity ? entity.node : null;
- }).filter(Boolean);
- _this.setUncontrolledState({
- selectedKeys: selectedKeys
- });
- onSelect === null || onSelect === void 0 || onSelect(selectedKeys, {
- event: 'select',
- selected: targetSelected,
- node: treeNode,
- selectedNodes: selectedNodes,
- nativeEvent: e.nativeEvent
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeCheck", function (e, treeNode, checked) {
- var _this$state7 = _this.state,
- keyEntities = _this$state7.keyEntities,
- oriCheckedKeys = _this$state7.checkedKeys,
- oriHalfCheckedKeys = _this$state7.halfCheckedKeys;
- var _this$props6 = _this.props,
- checkStrictly = _this$props6.checkStrictly,
- onCheck = _this$props6.onCheck;
- var key = treeNode.key;
- // Prepare trigger arguments
- var checkedObj;
- var eventObj = {
- event: 'check',
- node: treeNode,
- checked: checked,
- nativeEvent: e.nativeEvent
- };
- if (checkStrictly) {
- var checkedKeys = checked ? arrAdd(oriCheckedKeys, key) : arrDel(oriCheckedKeys, key);
- var halfCheckedKeys = arrDel(oriHalfCheckedKeys, key);
- checkedObj = {
- checked: checkedKeys,
- halfChecked: halfCheckedKeys
- };
- eventObj.checkedNodes = checkedKeys.map(function (checkedKey) {
- return getEntity(keyEntities, checkedKey);
- }).filter(Boolean).map(function (entity) {
- return entity.node;
- });
- _this.setUncontrolledState({
- checkedKeys: checkedKeys
- });
- } else {
- // Always fill first
- var _conductCheck = conductCheck([].concat((0,toConsumableArray["default"])(oriCheckedKeys), [key]), true, keyEntities),
- _checkedKeys = _conductCheck.checkedKeys,
- _halfCheckedKeys = _conductCheck.halfCheckedKeys;
- // If remove, we do it again to correction
- if (!checked) {
- var keySet = new Set(_checkedKeys);
- keySet.delete(key);
- var _conductCheck2 = conductCheck(Array.from(keySet), {
- checked: false,
- halfCheckedKeys: _halfCheckedKeys
- }, keyEntities);
- _checkedKeys = _conductCheck2.checkedKeys;
- _halfCheckedKeys = _conductCheck2.halfCheckedKeys;
- }
- checkedObj = _checkedKeys;
- // [Legacy] This is used for `rc-tree-select`
- eventObj.checkedNodes = [];
- eventObj.checkedNodesPositions = [];
- eventObj.halfCheckedKeys = _halfCheckedKeys;
- _checkedKeys.forEach(function (checkedKey) {
- var entity = getEntity(keyEntities, checkedKey);
- if (!entity) return;
- var node = entity.node,
- pos = entity.pos;
- eventObj.checkedNodes.push(node);
- eventObj.checkedNodesPositions.push({
- node: node,
- pos: pos
- });
- });
- _this.setUncontrolledState({
- checkedKeys: _checkedKeys
- }, false, {
- halfCheckedKeys: _halfCheckedKeys
- });
- }
- onCheck === null || onCheck === void 0 || onCheck(checkedObj, eventObj);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeLoad", function (treeNode) {
- var _entity$children;
- var key = treeNode.key;
- var keyEntities = _this.state.keyEntities;
- // Skip if has children already
- var entity = getEntity(keyEntities, key);
- if (entity !== null && entity !== void 0 && (_entity$children = entity.children) !== null && _entity$children !== void 0 && _entity$children.length) {
- return;
- }
- var loadPromise = new Promise(function (resolve, reject) {
- // We need to get the latest state of loading/loaded keys
- _this.setState(function (_ref) {
- var _ref$loadedKeys = _ref.loadedKeys,
- loadedKeys = _ref$loadedKeys === void 0 ? [] : _ref$loadedKeys,
- _ref$loadingKeys = _ref.loadingKeys,
- loadingKeys = _ref$loadingKeys === void 0 ? [] : _ref$loadingKeys;
- var _this$props7 = _this.props,
- loadData = _this$props7.loadData,
- onLoad = _this$props7.onLoad;
- if (!loadData || loadedKeys.includes(key) || loadingKeys.includes(key)) {
- return null;
- }
- // Process load data
- var promise = loadData(treeNode);
- promise.then(function () {
- var currentLoadedKeys = _this.state.loadedKeys;
- var newLoadedKeys = arrAdd(currentLoadedKeys, key);
- // onLoad should trigger before internal setState to avoid `loadData` trigger twice.
- // https://github.com/ant-design/ant-design/issues/12464
- onLoad === null || onLoad === void 0 || onLoad(newLoadedKeys, {
- event: 'load',
- node: treeNode
- });
- _this.setUncontrolledState({
- loadedKeys: newLoadedKeys
- });
- _this.setState(function (prevState) {
- return {
- loadingKeys: arrDel(prevState.loadingKeys, key)
- };
- });
- resolve();
- }).catch(function (e) {
- _this.setState(function (prevState) {
- return {
- loadingKeys: arrDel(prevState.loadingKeys, key)
- };
- });
- // If exceed max retry times, we give up retry
- _this.loadingRetryTimes[key] = (_this.loadingRetryTimes[key] || 0) + 1;
- if (_this.loadingRetryTimes[key] >= MAX_RETRY_TIMES) {
- var currentLoadedKeys = _this.state.loadedKeys;
- (0,warning["default"])(false, 'Retry for `loadData` many times but still failed. No more retry.');
- _this.setUncontrolledState({
- loadedKeys: arrAdd(currentLoadedKeys, key)
- });
- resolve();
- }
- reject(e);
- });
- return {
- loadingKeys: arrAdd(loadingKeys, key)
- };
- });
- });
- // Not care warning if we ignore this
- loadPromise.catch(function () {});
- return loadPromise;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeMouseEnter", function (event, node) {
- var onMouseEnter = _this.props.onMouseEnter;
- onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({
- event: event,
- node: node
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeMouseLeave", function (event, node) {
- var onMouseLeave = _this.props.onMouseLeave;
- onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({
- event: event,
- node: node
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeContextMenu", function (event, node) {
- var onRightClick = _this.props.onRightClick;
- if (onRightClick) {
- event.preventDefault();
- onRightClick({
- event: event,
- node: node
- });
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onFocus", function () {
- var onFocus = _this.props.onFocus;
- _this.setState({
- focused: true
- });
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- onFocus === null || onFocus === void 0 || onFocus.apply(void 0, args);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onBlur", function () {
- var onBlur = _this.props.onBlur;
- _this.setState({
- focused: false
- });
- _this.onActiveChange(null);
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- onBlur === null || onBlur === void 0 || onBlur.apply(void 0, args);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getTreeNodeRequiredProps", function () {
- var _this$state8 = _this.state,
- expandedKeys = _this$state8.expandedKeys,
- selectedKeys = _this$state8.selectedKeys,
- loadedKeys = _this$state8.loadedKeys,
- loadingKeys = _this$state8.loadingKeys,
- checkedKeys = _this$state8.checkedKeys,
- halfCheckedKeys = _this$state8.halfCheckedKeys,
- dragOverNodeKey = _this$state8.dragOverNodeKey,
- dropPosition = _this$state8.dropPosition,
- keyEntities = _this$state8.keyEntities;
- return {
- expandedKeys: expandedKeys || [],
- selectedKeys: selectedKeys || [],
- loadedKeys: loadedKeys || [],
- loadingKeys: loadingKeys || [],
- checkedKeys: checkedKeys || [],
- halfCheckedKeys: halfCheckedKeys || [],
- dragOverNodeKey: dragOverNodeKey,
- dropPosition: dropPosition,
- keyEntities: keyEntities
- };
- });
- // =========================== Expanded ===========================
- /** Set uncontrolled `expandedKeys`. This will also auto update `flattenNodes`. */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "setExpandedKeys", function (expandedKeys) {
- var _this$state9 = _this.state,
- treeData = _this$state9.treeData,
- fieldNames = _this$state9.fieldNames;
- var flattenNodes = flattenTreeData(treeData, expandedKeys, fieldNames);
- _this.setUncontrolledState({
- expandedKeys: expandedKeys,
- flattenNodes: flattenNodes
- }, true);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onNodeExpand", function (e, treeNode) {
- var expandedKeys = _this.state.expandedKeys;
- var _this$state10 = _this.state,
- listChanging = _this$state10.listChanging,
- fieldNames = _this$state10.fieldNames;
- var _this$props8 = _this.props,
- onExpand = _this$props8.onExpand,
- loadData = _this$props8.loadData;
- var expanded = treeNode.expanded;
- var key = treeNode[fieldNames.key];
- // Do nothing when motion is in progress
- if (listChanging) {
- return;
- }
- // Update selected keys
- var certain = expandedKeys.includes(key);
- var targetExpanded = !expanded;
- (0,warning["default"])(expanded && certain || !expanded && !certain, 'Expand state not sync with index check');
- expandedKeys = targetExpanded ? arrAdd(expandedKeys, key) : arrDel(expandedKeys, key);
- _this.setExpandedKeys(expandedKeys);
- onExpand === null || onExpand === void 0 || onExpand(expandedKeys, {
- node: treeNode,
- expanded: targetExpanded,
- nativeEvent: e.nativeEvent
- });
- // Async Load data
- if (targetExpanded && loadData) {
- var loadPromise = _this.onNodeLoad(treeNode);
- if (loadPromise) {
- loadPromise.then(function () {
- // [Legacy] Refresh logic
- var newFlattenTreeData = flattenTreeData(_this.state.treeData, expandedKeys, fieldNames);
- _this.setUncontrolledState({
- flattenNodes: newFlattenTreeData
- });
- }).catch(function () {
- var currentExpandedKeys = _this.state.expandedKeys;
- var expandedKeysToRestore = arrDel(currentExpandedKeys, key);
- _this.setExpandedKeys(expandedKeysToRestore);
- });
- }
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onListChangeStart", function () {
- _this.setUncontrolledState({
- listChanging: true
- });
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onListChangeEnd", function () {
- setTimeout(function () {
- _this.setUncontrolledState({
- listChanging: false
- });
- });
- });
- // =========================== Keyboard ===========================
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onActiveChange", function (newActiveKey) {
- var activeKey = _this.state.activeKey;
- var _this$props9 = _this.props,
- onActiveChange = _this$props9.onActiveChange,
- _this$props9$itemScro = _this$props9.itemScrollOffset,
- itemScrollOffset = _this$props9$itemScro === void 0 ? 0 : _this$props9$itemScro;
- if (activeKey === newActiveKey) {
- return;
- }
- _this.setState({
- activeKey: newActiveKey
- });
- if (newActiveKey !== null) {
- _this.scrollTo({
- key: newActiveKey,
- offset: itemScrollOffset
- });
- }
- onActiveChange === null || onActiveChange === void 0 || onActiveChange(newActiveKey);
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "getActiveItem", function () {
- var _this$state11 = _this.state,
- activeKey = _this$state11.activeKey,
- flattenNodes = _this$state11.flattenNodes;
- if (activeKey === null) {
- return null;
- }
- return flattenNodes.find(function (_ref2) {
- var key = _ref2.key;
- return key === activeKey;
- }) || null;
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "offsetActiveKey", function (offset) {
- var _this$state12 = _this.state,
- flattenNodes = _this$state12.flattenNodes,
- activeKey = _this$state12.activeKey;
- var index = flattenNodes.findIndex(function (_ref3) {
- var key = _ref3.key;
- return key === activeKey;
- });
- // Align with index
- if (index === -1 && offset < 0) {
- index = flattenNodes.length;
- }
- index = (index + offset + flattenNodes.length) % flattenNodes.length;
- var item = flattenNodes[index];
- if (item) {
- var _key4 = item.key;
- _this.onActiveChange(_key4);
- } else {
- _this.onActiveChange(null);
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onKeyDown", function (event) {
- var _this$state13 = _this.state,
- activeKey = _this$state13.activeKey,
- expandedKeys = _this$state13.expandedKeys,
- checkedKeys = _this$state13.checkedKeys,
- fieldNames = _this$state13.fieldNames;
- var _this$props10 = _this.props,
- onKeyDown = _this$props10.onKeyDown,
- checkable = _this$props10.checkable,
- selectable = _this$props10.selectable;
- // >>>>>>>>>> Direction
- switch (event.which) {
- case KeyCode["default"].UP:
- {
- _this.offsetActiveKey(-1);
- event.preventDefault();
- break;
- }
- case KeyCode["default"].DOWN:
- {
- _this.offsetActiveKey(1);
- event.preventDefault();
- break;
- }
- }
- // >>>>>>>>>> Expand & Selection
- var activeItem = _this.getActiveItem();
- if (activeItem && activeItem.data) {
- var treeNodeRequiredProps = _this.getTreeNodeRequiredProps();
- var expandable = activeItem.data.isLeaf === false || !!(activeItem.data[fieldNames.children] || []).length;
- var eventNode = convertNodePropsToEventData((0,objectSpread2["default"])((0,objectSpread2["default"])({}, getTreeNodeProps(activeKey, treeNodeRequiredProps)), {}, {
- data: activeItem.data,
- active: true
- }));
- switch (event.which) {
- // >>> Expand
- case KeyCode["default"].LEFT:
- {
- // Collapse if possible
- if (expandable && expandedKeys.includes(activeKey)) {
- _this.onNodeExpand({}, eventNode);
- } else if (activeItem.parent) {
- _this.onActiveChange(activeItem.parent.key);
- }
- event.preventDefault();
- break;
- }
- case KeyCode["default"].RIGHT:
- {
- // Expand if possible
- if (expandable && !expandedKeys.includes(activeKey)) {
- _this.onNodeExpand({}, eventNode);
- } else if (activeItem.children && activeItem.children.length) {
- _this.onActiveChange(activeItem.children[0].key);
- }
- event.preventDefault();
- break;
- }
- // Selection
- case KeyCode["default"].ENTER:
- case KeyCode["default"].SPACE:
- {
- if (checkable && !eventNode.disabled && eventNode.checkable !== false && !eventNode.disableCheckbox) {
- _this.onNodeCheck({}, eventNode, !checkedKeys.includes(activeKey));
- } else if (!checkable && selectable && !eventNode.disabled && eventNode.selectable !== false) {
- _this.onNodeSelect({}, eventNode);
- }
- break;
- }
- }
- }
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
- });
- /**
- * Only update the value which is not in props
- */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "setUncontrolledState", function (state) {
- var atomic = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var forceState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- if (!_this.destroyed) {
- var needSync = false;
- var allPassed = true;
- var newState = {};
- Object.keys(state).forEach(function (name) {
- if (_this.props.hasOwnProperty(name)) {
- allPassed = false;
- return;
- }
- needSync = true;
- newState[name] = state[name];
- });
- if (needSync && (!atomic || allPassed)) {
- _this.setState((0,objectSpread2["default"])((0,objectSpread2["default"])({}, newState), forceState));
- }
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "scrollTo", function (scroll) {
- _this.listRef.current.scrollTo(scroll);
- });
- return _this;
- }
- (0,createClass["default"])(Tree, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- this.destroyed = false;
- this.onUpdated();
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate() {
- this.onUpdated();
- }
- }, {
- key: "onUpdated",
- value: function onUpdated() {
- var _this$props11 = this.props,
- activeKey = _this$props11.activeKey,
- _this$props11$itemScr = _this$props11.itemScrollOffset,
- itemScrollOffset = _this$props11$itemScr === void 0 ? 0 : _this$props11$itemScr;
- if (activeKey !== undefined && activeKey !== this.state.activeKey) {
- this.setState({
- activeKey: activeKey
- });
- if (activeKey !== null) {
- this.scrollTo({
- key: activeKey,
- offset: itemScrollOffset
- });
- }
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- window.removeEventListener('dragend', this.onWindowDragEnd);
- this.destroyed = true;
- }
- }, {
- key: "resetDragState",
- value: function resetDragState() {
- this.setState({
- dragOverNodeKey: null,
- dropPosition: null,
- dropLevelOffset: null,
- dropTargetKey: null,
- dropContainerKey: null,
- dropTargetPos: null,
- dropAllowed: false
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this$state14 = this.state,
- focused = _this$state14.focused,
- flattenNodes = _this$state14.flattenNodes,
- keyEntities = _this$state14.keyEntities,
- draggingNodeKey = _this$state14.draggingNodeKey,
- activeKey = _this$state14.activeKey,
- dropLevelOffset = _this$state14.dropLevelOffset,
- dropContainerKey = _this$state14.dropContainerKey,
- dropTargetKey = _this$state14.dropTargetKey,
- dropPosition = _this$state14.dropPosition,
- dragOverNodeKey = _this$state14.dragOverNodeKey,
- indent = _this$state14.indent;
- var _this$props12 = this.props,
- prefixCls = _this$props12.prefixCls,
- className = _this$props12.className,
- style = _this$props12.style,
- showLine = _this$props12.showLine,
- focusable = _this$props12.focusable,
- _this$props12$tabInde = _this$props12.tabIndex,
- tabIndex = _this$props12$tabInde === void 0 ? 0 : _this$props12$tabInde,
- selectable = _this$props12.selectable,
- showIcon = _this$props12.showIcon,
- icon = _this$props12.icon,
- switcherIcon = _this$props12.switcherIcon,
- draggable = _this$props12.draggable,
- checkable = _this$props12.checkable,
- checkStrictly = _this$props12.checkStrictly,
- disabled = _this$props12.disabled,
- motion = _this$props12.motion,
- loadData = _this$props12.loadData,
- filterTreeNode = _this$props12.filterTreeNode,
- height = _this$props12.height,
- itemHeight = _this$props12.itemHeight,
- scrollWidth = _this$props12.scrollWidth,
- virtual = _this$props12.virtual,
- titleRender = _this$props12.titleRender,
- dropIndicatorRender = _this$props12.dropIndicatorRender,
- onContextMenu = _this$props12.onContextMenu,
- onScroll = _this$props12.onScroll,
- direction = _this$props12.direction,
- rootClassName = _this$props12.rootClassName,
- rootStyle = _this$props12.rootStyle;
- var domProps = (0,pickAttrs["default"])(this.props, {
- aria: true,
- data: true
- });
- // It's better move to hooks but we just simply keep here
- var draggableConfig;
- if (draggable) {
- if ((0,esm_typeof["default"])(draggable) === 'object') {
- draggableConfig = draggable;
- } else if (typeof draggable === 'function') {
- draggableConfig = {
- nodeDraggable: draggable
- };
- } else {
- draggableConfig = {};
- }
- }
- var contextValue = {
- prefixCls: prefixCls,
- selectable: selectable,
- showIcon: showIcon,
- icon: icon,
- switcherIcon: switcherIcon,
- draggable: draggableConfig,
- draggingNodeKey: draggingNodeKey,
- checkable: checkable,
- checkStrictly: checkStrictly,
- disabled: disabled,
- keyEntities: keyEntities,
- dropLevelOffset: dropLevelOffset,
- dropContainerKey: dropContainerKey,
- dropTargetKey: dropTargetKey,
- dropPosition: dropPosition,
- dragOverNodeKey: dragOverNodeKey,
- indent: indent,
- direction: direction,
- dropIndicatorRender: dropIndicatorRender,
- loadData: loadData,
- filterTreeNode: filterTreeNode,
- titleRender: titleRender,
- onNodeClick: this.onNodeClick,
- onNodeDoubleClick: this.onNodeDoubleClick,
- onNodeExpand: this.onNodeExpand,
- onNodeSelect: this.onNodeSelect,
- onNodeCheck: this.onNodeCheck,
- onNodeLoad: this.onNodeLoad,
- onNodeMouseEnter: this.onNodeMouseEnter,
- onNodeMouseLeave: this.onNodeMouseLeave,
- onNodeContextMenu: this.onNodeContextMenu,
- onNodeDragStart: this.onNodeDragStart,
- onNodeDragEnter: this.onNodeDragEnter,
- onNodeDragOver: this.onNodeDragOver,
- onNodeDragLeave: this.onNodeDragLeave,
- onNodeDragEnd: this.onNodeDragEnd,
- onNodeDrop: this.onNodeDrop
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TreeContext.Provider, {
- value: contextValue
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(prefixCls, className, rootClassName, (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-show-line"), showLine), "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-active-focused"), activeKey !== null)),
- style: rootStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_NodeList, (0,esm_extends["default"])({
- ref: this.listRef,
- prefixCls: prefixCls,
- style: style,
- data: flattenNodes,
- disabled: disabled,
- selectable: selectable,
- checkable: !!checkable,
- motion: motion,
- dragging: draggingNodeKey !== null,
- height: height,
- itemHeight: itemHeight,
- virtual: virtual,
- focusable: focusable,
- focused: focused,
- tabIndex: tabIndex,
- activeItem: this.getActiveItem(),
- onFocus: this.onFocus,
- onBlur: this.onBlur,
- onKeyDown: this.onKeyDown,
- onActiveChange: this.onActiveChange,
- onListChangeStart: this.onListChangeStart,
- onListChangeEnd: this.onListChangeEnd,
- onContextMenu: onContextMenu,
- onScroll: onScroll,
- scrollWidth: scrollWidth
- }, this.getTreeNodeRequiredProps(), domProps))));
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function getDerivedStateFromProps(props, prevState) {
- var prevProps = prevState.prevProps;
- var newState = {
- prevProps: props
- };
- function needSync(name) {
- return !prevProps && props.hasOwnProperty(name) || prevProps && prevProps[name] !== props[name];
- }
- // ================== Tree Node ==================
- var treeData;
- // fieldNames
- var fieldNames = prevState.fieldNames;
- if (needSync('fieldNames')) {
- fieldNames = treeUtil_fillFieldNames(props.fieldNames);
- newState.fieldNames = fieldNames;
- }
- // Check if `treeData` or `children` changed and save into the state.
- if (needSync('treeData')) {
- treeData = props.treeData;
- } else if (needSync('children')) {
- (0,warning["default"])(false, '`children` of Tree is deprecated. Please use `treeData` instead.');
- treeData = convertTreeToData(props.children);
- }
- // Save flatten nodes info and convert `treeData` into keyEntities
- if (treeData) {
- newState.treeData = treeData;
- var entitiesMap = convertDataToEntities(treeData, {
- fieldNames: fieldNames
- });
- newState.keyEntities = (0,objectSpread2["default"])((0,defineProperty["default"])({}, MOTION_KEY, MotionEntity), entitiesMap.keyEntities);
- // Warning if treeNode not provide key
- if (true) {
- warningWithoutKey(treeData, fieldNames);
- }
- }
- var keyEntities = newState.keyEntities || prevState.keyEntities;
- // ================ expandedKeys =================
- if (needSync('expandedKeys') || prevProps && needSync('autoExpandParent')) {
- newState.expandedKeys = props.autoExpandParent || !prevProps && props.defaultExpandParent ? conductExpandParent(props.expandedKeys, keyEntities) : props.expandedKeys;
- } else if (!prevProps && props.defaultExpandAll) {
- var cloneKeyEntities = (0,objectSpread2["default"])({}, keyEntities);
- delete cloneKeyEntities[MOTION_KEY];
- // Only take the key who has the children to enhance the performance
- var nextExpandedKeys = [];
- Object.keys(cloneKeyEntities).forEach(function (key) {
- var entity = cloneKeyEntities[key];
- if (entity.children && entity.children.length) {
- nextExpandedKeys.push(entity.key);
- }
- });
- newState.expandedKeys = nextExpandedKeys;
- } else if (!prevProps && props.defaultExpandedKeys) {
- newState.expandedKeys = props.autoExpandParent || props.defaultExpandParent ? conductExpandParent(props.defaultExpandedKeys, keyEntities) : props.defaultExpandedKeys;
- }
- if (!newState.expandedKeys) {
- delete newState.expandedKeys;
- }
- // ================ flattenNodes =================
- if (treeData || newState.expandedKeys) {
- var flattenNodes = flattenTreeData(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys, fieldNames);
- newState.flattenNodes = flattenNodes;
- }
- // ================ selectedKeys =================
- if (props.selectable) {
- if (needSync('selectedKeys')) {
- newState.selectedKeys = calcSelectedKeys(props.selectedKeys, props);
- } else if (!prevProps && props.defaultSelectedKeys) {
- newState.selectedKeys = calcSelectedKeys(props.defaultSelectedKeys, props);
- }
- }
- // ================= checkedKeys =================
- if (props.checkable) {
- var checkedKeyEntity;
- if (needSync('checkedKeys')) {
- checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {};
- } else if (!prevProps && props.defaultCheckedKeys) {
- checkedKeyEntity = parseCheckedKeys(props.defaultCheckedKeys) || {};
- } else if (treeData) {
- // If `treeData` changed, we also need check it
- checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {
- checkedKeys: prevState.checkedKeys,
- halfCheckedKeys: prevState.halfCheckedKeys
- };
- }
- if (checkedKeyEntity) {
- var _checkedKeyEntity = checkedKeyEntity,
- _checkedKeyEntity$che = _checkedKeyEntity.checkedKeys,
- checkedKeys = _checkedKeyEntity$che === void 0 ? [] : _checkedKeyEntity$che,
- _checkedKeyEntity$hal = _checkedKeyEntity.halfCheckedKeys,
- halfCheckedKeys = _checkedKeyEntity$hal === void 0 ? [] : _checkedKeyEntity$hal;
- if (!props.checkStrictly) {
- var conductKeys = conductCheck(checkedKeys, true, keyEntities);
- checkedKeys = conductKeys.checkedKeys;
- halfCheckedKeys = conductKeys.halfCheckedKeys;
- }
- newState.checkedKeys = checkedKeys;
- newState.halfCheckedKeys = halfCheckedKeys;
- }
- }
- // ================= loadedKeys ==================
- if (needSync('loadedKeys')) {
- newState.loadedKeys = props.loadedKeys;
- }
- return newState;
- }
- }]);
- return Tree;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- (0,defineProperty["default"])(Tree, "defaultProps", {
- prefixCls: 'rc-tree',
- showLine: false,
- showIcon: true,
- selectable: true,
- multiple: false,
- checkable: false,
- disabled: false,
- checkStrictly: false,
- draggable: false,
- defaultExpandParent: true,
- autoExpandParent: false,
- defaultExpandAll: false,
- defaultExpandedKeys: [],
- defaultCheckedKeys: [],
- defaultSelectedKeys: [],
- dropIndicatorRender: es_DropIndicator,
- allowDrop: function allowDrop() {
- return true;
- },
- expandAction: false
- });
- (0,defineProperty["default"])(Tree, "TreeNode", es_TreeNode);
- /* harmony default export */ var es_Tree = (Tree);
- ;// ./node_modules/rc-tree/es/index.js
- /* harmony default export */ var rc_tree_es = (es_Tree);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FileOutlined.js
- // This icon file is generated automatically.
- var FileOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z" } }] }, "name": "file", "theme": "outlined" };
- /* harmony default export */ var asn_FileOutlined = (FileOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/FileOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FileOutlined_FileOutlined = function FileOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FileOutlined
- }));
- };
- /** */
- var FileOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FileOutlined_FileOutlined);
- if (true) {
- FileOutlined_RefIcon.displayName = 'FileOutlined';
- }
- /* harmony default export */ var icons_FileOutlined = (FileOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FolderOpenOutlined.js
- // This icon file is generated automatically.
- var FolderOpenOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, "name": "folder-open", "theme": "outlined" };
- /* harmony default export */ var asn_FolderOpenOutlined = (FolderOpenOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/FolderOpenOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FolderOpenOutlined_FolderOpenOutlined = function FolderOpenOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FolderOpenOutlined
- }));
- };
- /** */
- var FolderOpenOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FolderOpenOutlined_FolderOpenOutlined);
- if (true) {
- FolderOpenOutlined_RefIcon.displayName = 'FolderOpenOutlined';
- }
- /* harmony default export */ var icons_FolderOpenOutlined = (FolderOpenOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FolderOutlined.js
- // This icon file is generated automatically.
- var FolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, "name": "folder", "theme": "outlined" };
- /* harmony default export */ var asn_FolderOutlined = (FolderOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/FolderOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FolderOutlined_FolderOutlined = function FolderOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FolderOutlined
- }));
- };
- /** */
- var FolderOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FolderOutlined_FolderOutlined);
- if (true) {
- FolderOutlined_RefIcon.displayName = 'FolderOutlined';
- }
- /* harmony default export */ var icons_FolderOutlined = (FolderOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/HolderOutlined.js
- // This icon file is generated automatically.
- var HolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z" } }] }, "name": "holder", "theme": "outlined" };
- /* harmony default export */ var asn_HolderOutlined = (HolderOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/HolderOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var HolderOutlined_HolderOutlined = function HolderOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_HolderOutlined
- }));
- };
- /** */
- var HolderOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(HolderOutlined_HolderOutlined);
- if (true) {
- HolderOutlined_RefIcon.displayName = 'HolderOutlined';
- }
- /* harmony default export */ var icons_HolderOutlined = (HolderOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/tree/style/index.ts + 1 modules
- var tree_style = __webpack_require__("./components/tree/style/index.ts");
- ;// ./components/tree/utils/dropIndicator.tsx
- const dropIndicator_offset = 4;
- function dropIndicatorRender(props) {
- const {
- dropPosition,
- dropLevelOffset,
- prefixCls,
- indent,
- direction = 'ltr'
- } = props;
- const startPosition = direction === 'ltr' ? 'left' : 'right';
- const endPosition = direction === 'ltr' ? 'right' : 'left';
- const style = {
- [startPosition]: -dropLevelOffset * indent + dropIndicator_offset,
- [endPosition]: 0
- };
- switch (dropPosition) {
- case -1:
- style.top = -3;
- break;
- case 1:
- style.bottom = -3;
- break;
- default:
- // dropPosition === 0
- style.bottom = -3;
- style[startPosition] = indent + dropIndicator_offset;
- break;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- style: style,
- className: `${prefixCls}-drop-indicator`
- });
- }
- /* harmony default export */ var dropIndicator = (dropIndicatorRender);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CaretDownFilled.js
- // This icon file is generated automatically.
- var CaretDownFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "filled" };
- /* harmony default export */ var asn_CaretDownFilled = (CaretDownFilled);
- ;// ./node_modules/@ant-design/icons/es/icons/CaretDownFilled.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CaretDownFilled_CaretDownFilled = function CaretDownFilled(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CaretDownFilled
- }));
- };
- /** */
- var CaretDownFilled_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CaretDownFilled_CaretDownFilled);
- if (true) {
- CaretDownFilled_RefIcon.displayName = 'CaretDownFilled';
- }
- /* harmony default export */ var icons_CaretDownFilled = (CaretDownFilled_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/MinusSquareOutlined.js
- // This icon file is generated automatically.
- var MinusSquareOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "minus-square", "theme": "outlined" };
- /* harmony default export */ var asn_MinusSquareOutlined = (MinusSquareOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var MinusSquareOutlined_MinusSquareOutlined = function MinusSquareOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_MinusSquareOutlined
- }));
- };
- /** */
- var MinusSquareOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(MinusSquareOutlined_MinusSquareOutlined);
- if (true) {
- MinusSquareOutlined_RefIcon.displayName = 'MinusSquareOutlined';
- }
- /* harmony default export */ var icons_MinusSquareOutlined = (MinusSquareOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/PlusSquareOutlined.js
- // This icon file is generated automatically.
- var PlusSquareOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z" } }, { "tag": "path", "attrs": { "d": "M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z" } }] }, "name": "plus-square", "theme": "outlined" };
- /* harmony default export */ var asn_PlusSquareOutlined = (PlusSquareOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var PlusSquareOutlined_PlusSquareOutlined = function PlusSquareOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_PlusSquareOutlined
- }));
- };
- /** */
- var PlusSquareOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(PlusSquareOutlined_PlusSquareOutlined);
- if (true) {
- PlusSquareOutlined_RefIcon.displayName = 'PlusSquareOutlined';
- }
- /* harmony default export */ var icons_PlusSquareOutlined = (PlusSquareOutlined_RefIcon);
- ;// ./components/tree/utils/iconUtil.tsx
- const SwitcherIconCom = props => {
- var _a, _b;
- const {
- prefixCls,
- switcherIcon,
- treeNodeProps,
- showLine,
- switcherLoadingIcon
- } = props;
- const {
- isLeaf,
- expanded,
- loading
- } = treeNodeProps;
- if (loading) {
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(switcherLoadingIcon)) {
- return switcherLoadingIcon;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, {
- className: `${prefixCls}-switcher-loading-icon`
- });
- }
- let showLeafIcon;
- if (showLine && typeof showLine === 'object') {
- showLeafIcon = showLine.showLeafIcon;
- }
- if (isLeaf) {
- if (!showLine) {
- return null;
- }
- if (typeof showLeafIcon !== 'boolean' && !!showLeafIcon) {
- const leafIcon = typeof showLeafIcon === 'function' ? showLeafIcon(treeNodeProps) : showLeafIcon;
- const leafCls = `${prefixCls}-switcher-line-custom-icon`;
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(leafIcon)) {
- return (0,reactNode.cloneElement)(leafIcon, {
- className: classnames_default()((_a = leafIcon.props) === null || _a === void 0 ? void 0 : _a.className, leafCls)
- });
- }
- return leafIcon;
- }
- return showLeafIcon ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FileOutlined, {
- className: `${prefixCls}-switcher-line-icon`
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-switcher-leaf-line`
- }));
- }
- const switcherCls = `${prefixCls}-switcher-icon`;
- const switcher = typeof switcherIcon === 'function' ? switcherIcon(treeNodeProps) : switcherIcon;
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(switcher)) {
- return (0,reactNode.cloneElement)(switcher, {
- className: classnames_default()((_b = switcher.props) === null || _b === void 0 ? void 0 : _b.className, switcherCls)
- });
- }
- if (switcher !== undefined) {
- return switcher;
- }
- if (showLine) {
- return expanded ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_MinusSquareOutlined, {
- className: `${prefixCls}-switcher-line-icon`
- })) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_PlusSquareOutlined, {
- className: `${prefixCls}-switcher-line-icon`
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CaretDownFilled, {
- className: switcherCls
- });
- };
- /* harmony default export */ var iconUtil = (SwitcherIconCom);
- ;// ./components/tree/Tree.tsx
- const Tree_Tree = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef((props, ref) => {
- var _a;
- const {
- getPrefixCls,
- direction,
- virtual,
- tree
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- className,
- showIcon = false,
- showLine,
- switcherIcon,
- switcherLoadingIcon,
- blockNode = false,
- children,
- checkable = false,
- selectable = true,
- draggable,
- motion: customMotion,
- style
- } = props;
- const prefixCls = getPrefixCls('tree', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, (0,_util_motion["default"])(rootPrefixCls)), {
- motionAppear: false
- });
- const newProps = Object.assign(Object.assign({}, props), {
- checkable,
- selectable,
- showIcon,
- motion,
- blockNode,
- showLine: Boolean(showLine),
- dropIndicatorRender: dropIndicator
- });
- const [wrapCSSVar, hashId, cssVarCls] = (0,tree_style["default"])(prefixCls);
- const [, token] = (0,useToken["default"])();
- const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);
- const draggableConfig = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- if (!draggable) {
- return false;
- }
- let mergedDraggable = {};
- switch (typeof draggable) {
- case 'function':
- mergedDraggable.nodeDraggable = draggable;
- break;
- case 'object':
- mergedDraggable = Object.assign({}, draggable);
- break;
- default:
- break;
- // Do nothing
- }
- if (mergedDraggable.icon !== false) {
- mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_HolderOutlined, null);
- }
- return mergedDraggable;
- }, [draggable]);
- const renderSwitcherIcon = nodeProps => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(iconUtil, {
- prefixCls: prefixCls,
- switcherIcon: switcherIcon,
- switcherLoadingIcon: switcherLoadingIcon,
- treeNodeProps: nodeProps,
- showLine: showLine
- }));
- return wrapCSSVar(
- /*#__PURE__*/
- // @ts-ignore
- external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(rc_tree_es, Object.assign({
- itemHeight: itemHeight,
- ref: ref,
- virtual: virtual
- }, newProps, {
- // newProps may contain style so declare style below it
- style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),
- prefixCls: prefixCls,
- className: classnames_default()({
- [`${prefixCls}-icon-hide`]: !showIcon,
- [`${prefixCls}-block-node`]: blockNode,
- [`${prefixCls}-unselectable`]: !selectable,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),
- direction: direction,
- checkable: checkable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: `${prefixCls}-checkbox-inner`
- }) : checkable,
- selectable: selectable,
- switcherIcon: renderSwitcherIcon,
- draggable: draggableConfig
- }), children));
- });
- if (true) {
- Tree_Tree.displayName = 'Tree';
- }
- /* harmony default export */ var tree_Tree = (Tree_Tree);
- ;// ./components/tree/utils/dictUtil.ts
- const RECORD_NONE = 0;
- const RECORD_START = 1;
- const RECORD_END = 2;
- function traverseNodesKey(treeData, callback, fieldNames) {
- const {
- key: fieldKey,
- children: fieldChildren
- } = fieldNames;
- function processNode(dataNode) {
- const key = dataNode[fieldKey];
- const children = dataNode[fieldChildren];
- if (callback(key, dataNode) !== false) {
- traverseNodesKey(children || [], callback, fieldNames);
- }
- }
- treeData.forEach(processNode);
- }
- /** 计算选中范围,只考虑expanded情况以优化性能 */
- function calcRangeKeys({
- treeData,
- expandedKeys,
- startKey,
- endKey,
- fieldNames
- }) {
- const keys = [];
- let record = RECORD_NONE;
- if (startKey && startKey === endKey) {
- return [startKey];
- }
- if (!startKey || !endKey) {
- return [];
- }
- function matchKey(key) {
- return key === startKey || key === endKey;
- }
- traverseNodesKey(treeData, key => {
- if (record === RECORD_END) {
- return false;
- }
- if (matchKey(key)) {
- // Match test
- keys.push(key);
- if (record === RECORD_NONE) {
- record = RECORD_START;
- } else if (record === RECORD_START) {
- record = RECORD_END;
- return false;
- }
- } else if (record === RECORD_START) {
- // Append selection
- keys.push(key);
- }
- return expandedKeys.includes(key);
- }, treeUtil_fillFieldNames(fieldNames));
- return keys;
- }
- function convertDirectoryKeysToNodes(treeData, keys, fieldNames) {
- const restKeys = (0,toConsumableArray["default"])(keys);
- const nodes = [];
- traverseNodesKey(treeData, (key, node) => {
- const index = restKeys.indexOf(key);
- if (index !== -1) {
- nodes.push(node);
- restKeys.splice(index, 1);
- }
- return !!restKeys.length;
- }, treeUtil_fillFieldNames(fieldNames));
- return nodes;
- }
- ;// ./components/tree/DirectoryTree.tsx
- var DirectoryTree_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getIcon(props) {
- const {
- isLeaf,
- expanded
- } = props;
- if (isLeaf) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FileOutlined, null);
- }
- return expanded ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FolderOpenOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FolderOutlined, null);
- }
- function getTreeData({
- treeData,
- children
- }) {
- return treeData || convertTreeToData(children);
- }
- const DirectoryTree = (_a, ref) => {
- var {
- defaultExpandAll,
- defaultExpandParent,
- defaultExpandedKeys
- } = _a,
- props = DirectoryTree_rest(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
- // Shift click usage
- const lastSelectedKey = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const cachedSelectedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const getInitExpandedKeys = () => {
- const {
- keyEntities
- } = convertDataToEntities(getTreeData(props));
- let initExpandedKeys;
- // Expanded keys
- if (defaultExpandAll) {
- initExpandedKeys = Object.keys(keyEntities);
- } else if (defaultExpandParent) {
- initExpandedKeys = conductExpandParent(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
- } else {
- initExpandedKeys = props.expandedKeys || defaultExpandedKeys || [];
- }
- return initExpandedKeys;
- };
- const [selectedKeys, setSelectedKeys] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(props.selectedKeys || props.defaultSelectedKeys || []);
- const [expandedKeys, setExpandedKeys] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(() => getInitExpandedKeys());
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if ('selectedKeys' in props) {
- setSelectedKeys(props.selectedKeys);
- }
- }, [props.selectedKeys]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if ('expandedKeys' in props) {
- setExpandedKeys(props.expandedKeys);
- }
- }, [props.expandedKeys]);
- const onExpand = (keys, info) => {
- var _a;
- if (!('expandedKeys' in props)) {
- setExpandedKeys(keys);
- }
- // Call origin function
- return (_a = props.onExpand) === null || _a === void 0 ? void 0 : _a.call(props, keys, info);
- };
- const onSelect = (keys, event) => {
- var _a;
- const {
- multiple,
- fieldNames
- } = props;
- const {
- node,
- nativeEvent
- } = event;
- const {
- key = ''
- } = node;
- const treeData = getTreeData(props);
- // const newState: DirectoryTreeState = {};
- // We need wrap this event since some value is not same
- const newEvent = Object.assign(Object.assign({}, event), {
- selected: true
- });
- // Windows / Mac single pick
- const ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
- const shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
- // Generate new selected keys
- let newSelectedKeys;
- if (multiple && ctrlPick) {
- // Control click
- newSelectedKeys = keys;
- lastSelectedKey.current = key;
- cachedSelectedKeys.current = newSelectedKeys;
- newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
- } else if (multiple && shiftPick) {
- // Shift click
- newSelectedKeys = Array.from(new Set([].concat((0,toConsumableArray["default"])(cachedSelectedKeys.current || []), (0,toConsumableArray["default"])(calcRangeKeys({
- treeData,
- expandedKeys,
- startKey: key,
- endKey: lastSelectedKey.current,
- fieldNames
- })))));
- newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
- } else {
- // Single click
- newSelectedKeys = [key];
- lastSelectedKey.current = key;
- cachedSelectedKeys.current = newSelectedKeys;
- newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
- }
- (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, newSelectedKeys, newEvent);
- if (!('selectedKeys' in props)) {
- setSelectedKeys(newSelectedKeys);
- }
- };
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- className,
- showIcon = true,
- expandAction = 'click'
- } = props,
- otherProps = DirectoryTree_rest(props, ["prefixCls", "className", "showIcon", "expandAction"]);
- const prefixCls = getPrefixCls('tree', customizePrefixCls);
- const connectClassName = classnames_default()(`${prefixCls}-directory`, {
- [`${prefixCls}-directory-rtl`]: direction === 'rtl'
- }, className);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(tree_Tree, Object.assign({
- icon: getIcon,
- ref: ref,
- blockNode: true
- }, otherProps, {
- showIcon: showIcon,
- expandAction: expandAction,
- prefixCls: prefixCls,
- className: connectClassName,
- expandedKeys: expandedKeys,
- selectedKeys: selectedKeys,
- onSelect: onSelect,
- onExpand: onExpand
- }));
- };
- const ForwardDirectoryTree = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DirectoryTree);
- if (true) {
- ForwardDirectoryTree.displayName = 'DirectoryTree';
- }
- /* harmony default export */ var tree_DirectoryTree = (ForwardDirectoryTree);
- ;// ./components/tree/index.tsx
- const components_tree_Tree = tree_Tree;
- components_tree_Tree.DirectoryTree = tree_DirectoryTree;
- components_tree_Tree.TreeNode = es_TreeNode;
- /* harmony default export */ var tree = (components_tree_Tree);
- ;// ./components/table/hooks/useFilter/FilterSearch.tsx
- const FilterSearch = props => {
- const {
- value,
- filterSearch,
- tablePrefixCls,
- locale,
- onChange
- } = props;
- if (!filterSearch) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${tablePrefixCls}-filter-dropdown-search`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_Input, {
- prefix: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SearchOutlined, null),
- placeholder: locale.filterSearchPlaceholder,
- onChange: onChange,
- value: value,
- // for skip min-width of input
- htmlSize: 1,
- className: `${tablePrefixCls}-filter-dropdown-search-input`
- }));
- };
- /* harmony default export */ var useFilter_FilterSearch = (FilterSearch);
- ;// ./components/table/hooks/useFilter/FilterWrapper.tsx
- const onKeyDown = event => {
- const {
- keyCode
- } = event;
- if (keyCode === KeyCode["default"].ENTER) {
- event.stopPropagation();
- }
- };
- const FilterDropdownMenuWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: props.className,
- onClick: e => e.stopPropagation(),
- onKeyDown: onKeyDown,
- ref: ref
- }, props.children)));
- if (true) {
- FilterDropdownMenuWrapper.displayName = 'FilterDropdownMenuWrapper';
- }
- /* harmony default export */ var FilterWrapper = (FilterDropdownMenuWrapper);
- ;// ./components/table/hooks/useFilter/FilterDropdown.tsx
- function flattenKeys(filters) {
- let keys = [];
- (filters || []).forEach(({
- value,
- children
- }) => {
- keys.push(value);
- if (children) {
- keys = [].concat((0,toConsumableArray["default"])(keys), (0,toConsumableArray["default"])(flattenKeys(children)));
- }
- });
- return keys;
- }
- function hasSubMenu(filters) {
- return filters.some(({
- children
- }) => children);
- }
- function searchValueMatched(searchValue, text) {
- if (typeof text === 'string' || typeof text === 'number') {
- return text === null || text === void 0 ? void 0 : text.toString().toLowerCase().includes(searchValue.trim().toLowerCase());
- }
- return false;
- }
- function renderFilterItems({
- filters,
- prefixCls,
- filteredKeys,
- filterMultiple,
- searchValue,
- filterSearch
- }) {
- return filters.map((filter, index) => {
- const key = String(filter.value);
- if (filter.children) {
- return {
- key: key || index,
- label: filter.text,
- popupClassName: `${prefixCls}-dropdown-submenu`,
- children: renderFilterItems({
- filters: filter.children,
- prefixCls,
- filteredKeys,
- filterMultiple,
- searchValue,
- filterSearch
- })
- };
- }
- const Component = filterMultiple ? components_checkbox : components_radio;
- const item = {
- key: filter.value !== undefined ? key : index,
- label: (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, {
- checked: filteredKeys.includes(key)
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, filter.text)))
- };
- if (searchValue.trim()) {
- if (typeof filterSearch === 'function') {
- return filterSearch(searchValue, filter) ? item : null;
- }
- return searchValueMatched(searchValue, filter.text) ? item : null;
- }
- return item;
- });
- }
- function wrapStringListType(keys) {
- return keys || [];
- }
- const FilterDropdown = props => {
- var _a, _b, _c, _d;
- const {
- tablePrefixCls,
- prefixCls,
- column,
- dropdownPrefixCls,
- columnKey,
- filterOnClose,
- filterMultiple,
- filterMode = 'menu',
- filterSearch = false,
- filterState,
- triggerFilter,
- locale,
- children,
- getPopupContainer,
- rootClassName
- } = props;
- const {
- filterResetToDefaultFilteredValue,
- defaultFilteredValue,
- filterDropdownProps = {},
- // Deprecated
- filterDropdownOpen,
- filterDropdownVisible,
- onFilterDropdownVisibleChange,
- onFilterDropdownOpenChange
- } = column;
- const [visible, setVisible] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const filtered = !!(filterState && (((_a = filterState.filteredKeys) === null || _a === void 0 ? void 0 : _a.length) || filterState.forceFiltered));
- const triggerVisible = newVisible => {
- var _a;
- setVisible(newVisible);
- (_a = filterDropdownProps.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(filterDropdownProps, newVisible);
- // deprecated
- onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 ? void 0 : onFilterDropdownOpenChange(newVisible);
- onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 ? void 0 : onFilterDropdownVisibleChange(newVisible);
- };
- // =================Warning===================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Table');
- const deprecatedList = [['filterDropdownOpen', 'filterDropdownProps.open'], ['filterDropdownVisible', 'filterDropdownProps.open'], ['onFilterDropdownOpenChange', 'filterDropdownProps.onOpenChange'], ['onFilterDropdownVisibleChange', 'filterDropdownProps.onOpenChange']];
- deprecatedList.forEach(([deprecatedName, newName]) => {
- warning.deprecated(!(deprecatedName in column), deprecatedName, newName);
- });
- warning.deprecated(!('filterCheckall' in locale), 'filterCheckall', 'locale.filterCheckAll');
- }
- const mergedVisible = (_d = (_c = (_b = filterDropdownProps.open) !== null && _b !== void 0 ? _b : filterDropdownOpen) !== null && _c !== void 0 ? _c : filterDropdownVisible) !== null && _d !== void 0 ? _d : visible; // inner state
- // ===================== Select Keys =====================
- const propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;
- const [getFilteredKeysSync, setFilteredKeysSync] = hooks_useSyncState_useSyncState(wrapStringListType(propFilteredKeys));
- const onSelectKeys = ({
- selectedKeys
- }) => {
- setFilteredKeysSync(selectedKeys);
- };
- const onCheck = (keys, {
- node,
- checked
- }) => {
- if (!filterMultiple) {
- onSelectKeys({
- selectedKeys: checked && node.key ? [node.key] : []
- });
- } else {
- onSelectKeys({
- selectedKeys: keys
- });
- }
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (!visible) {
- return;
- }
- onSelectKeys({
- selectedKeys: wrapStringListType(propFilteredKeys)
- });
- }, [propFilteredKeys]);
- // ====================== Open Keys ======================
- const [openKeys, setOpenKeys] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const onOpenChange = keys => {
- setOpenKeys(keys);
- };
- // search in tree mode column filter
- const [searchValue, setSearchValue] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState('');
- const onSearch = e => {
- const {
- value
- } = e.target;
- setSearchValue(value);
- };
- // clear search value after close filter dropdown
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (!visible) {
- setSearchValue('');
- }
- }, [visible]);
- // ======================= Submit ========================
- const internalTriggerFilter = keys => {
- const mergedKeys = (keys === null || keys === void 0 ? void 0 : keys.length) ? keys : null;
- if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {
- return null;
- }
- if ((0,isEqual["default"])(mergedKeys, filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys, true)) {
- return null;
- }
- triggerFilter({
- column,
- key: columnKey,
- filteredKeys: mergedKeys
- });
- };
- const onConfirm = () => {
- triggerVisible(false);
- internalTriggerFilter(getFilteredKeysSync());
- };
- const onReset = ({
- confirm,
- closeDropdown
- } = {
- confirm: false,
- closeDropdown: false
- }) => {
- if (confirm) {
- internalTriggerFilter([]);
- }
- if (closeDropdown) {
- triggerVisible(false);
- }
- setSearchValue('');
- if (filterResetToDefaultFilteredValue) {
- setFilteredKeysSync((defaultFilteredValue || []).map(key => String(key)));
- } else {
- setFilteredKeysSync([]);
- }
- };
- const doFilter = ({
- closeDropdown
- } = {
- closeDropdown: true
- }) => {
- if (closeDropdown) {
- triggerVisible(false);
- }
- internalTriggerFilter(getFilteredKeysSync());
- };
- const onVisibleChange = (newVisible, info) => {
- if (info.source === 'trigger') {
- if (newVisible && propFilteredKeys !== undefined) {
- // Sync filteredKeys on appear in controlled mode (propFilteredKeys !== undefined)
- setFilteredKeysSync(wrapStringListType(propFilteredKeys));
- }
- triggerVisible(newVisible);
- if (!newVisible && !column.filterDropdown && filterOnClose) {
- onConfirm();
- }
- }
- };
- // ======================== Style ========================
- const dropdownMenuClass = classnames_default()({
- [`${dropdownPrefixCls}-menu-without-submenu`]: !hasSubMenu(column.filters || [])
- });
- const onCheckAll = e => {
- if (e.target.checked) {
- const allFilterKeys = flattenKeys(column === null || column === void 0 ? void 0 : column.filters).map(key => String(key));
- setFilteredKeysSync(allFilterKeys);
- } else {
- setFilteredKeysSync([]);
- }
- };
- const getTreeData = ({
- filters
- }) => (filters || []).map((filter, index) => {
- const key = String(filter.value);
- const item = {
- title: filter.text,
- key: filter.value !== undefined ? key : String(index)
- };
- if (filter.children) {
- item.children = getTreeData({
- filters: filter.children
- });
- }
- return item;
- });
- const getFilterData = node => {
- var _a;
- return Object.assign(Object.assign({}, node), {
- text: node.title,
- value: node.key,
- children: ((_a = node.children) === null || _a === void 0 ? void 0 : _a.map(item => getFilterData(item))) || []
- });
- };
- let dropdownContent;
- const {
- direction,
- renderEmpty
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- if (typeof column.filterDropdown === 'function') {
- dropdownContent = column.filterDropdown({
- prefixCls: `${dropdownPrefixCls}-custom`,
- setSelectedKeys: selectedKeys => onSelectKeys({
- selectedKeys: selectedKeys
- }),
- selectedKeys: getFilteredKeysSync(),
- confirm: doFilter,
- clearFilters: onReset,
- filters: column.filters,
- visible: mergedVisible,
- close: () => {
- triggerVisible(false);
- }
- });
- } else if (column.filterDropdown) {
- dropdownContent = column.filterDropdown;
- } else {
- const selectedKeys = getFilteredKeysSync() || [];
- const getFilterComponent = () => {
- var _a, _b;
- const empty = (_a = renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Table.filter')) !== null && _a !== void 0 ? _a : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_empty, {
- image: components_empty.PRESENTED_IMAGE_SIMPLE,
- description: locale.filterEmptyText,
- styles: {
- image: {
- height: 24
- }
- },
- style: {
- margin: 0,
- padding: '16px 0'
- }
- }));
- if ((column.filters || []).length === 0) {
- return empty;
- }
- if (filterMode === 'tree') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(useFilter_FilterSearch, {
- filterSearch: filterSearch,
- value: searchValue,
- onChange: onSearch,
- tablePrefixCls: tablePrefixCls,
- locale: locale
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${tablePrefixCls}-filter-dropdown-tree`
- }, filterMultiple ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_checkbox, {
- checked: selectedKeys.length === flattenKeys(column.filters).length,
- indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,
- className: `${tablePrefixCls}-filter-dropdown-checkall`,
- onChange: onCheckAll
- }, (_b = locale === null || locale === void 0 ? void 0 : locale.filterCheckall) !== null && _b !== void 0 ? _b : locale === null || locale === void 0 ? void 0 : locale.filterCheckAll)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(tree, {
- checkable: true,
- selectable: false,
- blockNode: true,
- multiple: filterMultiple,
- checkStrictly: !filterMultiple,
- className: `${dropdownPrefixCls}-menu`,
- onCheck: onCheck,
- checkedKeys: selectedKeys,
- selectedKeys: selectedKeys,
- showIcon: false,
- treeData: getTreeData({
- filters: column.filters
- }),
- autoExpandParent: true,
- defaultExpandAll: true,
- filterTreeNode: searchValue.trim() ? node => {
- if (typeof filterSearch === 'function') {
- return filterSearch(searchValue, getFilterData(node));
- }
- return searchValueMatched(searchValue, node.title);
- } : undefined
- })));
- }
- const items = renderFilterItems({
- filters: column.filters || [],
- filterSearch,
- prefixCls,
- filteredKeys: getFilteredKeysSync(),
- filterMultiple,
- searchValue
- });
- const isEmpty = items.every(item => item === null);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(useFilter_FilterSearch, {
- filterSearch: filterSearch,
- value: searchValue,
- onChange: onSearch,
- tablePrefixCls: tablePrefixCls,
- locale: locale
- }), isEmpty ? empty : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_menu, {
- selectable: true,
- multiple: filterMultiple,
- prefixCls: `${dropdownPrefixCls}-menu`,
- className: dropdownMenuClass,
- onSelect: onSelectKeys,
- onDeselect: onSelectKeys,
- selectedKeys: selectedKeys,
- getPopupContainer: getPopupContainer,
- openKeys: openKeys,
- onOpenChange: onOpenChange,
- items: items
- })));
- };
- const getResetDisabled = () => {
- if (filterResetToDefaultFilteredValue) {
- return (0,isEqual["default"])((defaultFilteredValue || []).map(key => String(key)), selectedKeys, true);
- }
- return selectedKeys.length === 0;
- };
- dropdownContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, getFilterComponent(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-dropdown-btns`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: "link",
- size: "small",
- disabled: getResetDisabled(),
- onClick: () => onReset()
- }, locale.filterReset), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: "primary",
- size: "small",
- onClick: onConfirm
- }, locale.filterConfirm)));
- }
- // We should not block customize Menu with additional props
- if (column.filterDropdown) {
- dropdownContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(OverrideProvider, {
- selectable: undefined
- }, dropdownContent);
- }
- dropdownContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(FilterWrapper, {
- className: `${prefixCls}-dropdown`
- }, dropdownContent);
- const getDropdownTrigger = () => {
- let filterIcon;
- if (typeof column.filterIcon === 'function') {
- filterIcon = column.filterIcon(filtered);
- } else if (column.filterIcon) {
- filterIcon = column.filterIcon;
- } else {
- filterIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FilterFilled, null);
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- role: "button",
- tabIndex: -1,
- className: classnames_default()(`${prefixCls}-trigger`, {
- active: filtered
- }),
- onClick: e => {
- e.stopPropagation();
- }
- }, filterIcon);
- };
- const mergedDropdownProps = extendsObject({
- trigger: ['click'],
- placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight',
- children: getDropdownTrigger(),
- getPopupContainer
- }, Object.assign(Object.assign({}, filterDropdownProps), {
- rootClassName: classnames_default()(rootClassName, filterDropdownProps.rootClassName),
- open: mergedVisible,
- onOpenChange: onVisibleChange,
- popupRender: () => {
- if (typeof (filterDropdownProps === null || filterDropdownProps === void 0 ? void 0 : filterDropdownProps.dropdownRender) === 'function') {
- return filterDropdownProps.dropdownRender(dropdownContent);
- }
- return dropdownContent;
- }
- }));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-column`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${tablePrefixCls}-column-title`
- }, children), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_dropdown, Object.assign({}, mergedDropdownProps)));
- };
- /* harmony default export */ var useFilter_FilterDropdown = (FilterDropdown);
- ;// ./components/table/hooks/useFilter/index.tsx
- const collectFilterStates = (columns, init, pos) => {
- let filterStates = [];
- (columns || []).forEach((column, index) => {
- var _a;
- const columnPos = getColumnPos(index, pos);
- const filterDropdownIsDefined = column.filterDropdown !== undefined;
- if (column.filters || filterDropdownIsDefined || 'onFilter' in column) {
- if ('filteredValue' in column) {
- // Controlled
- let filteredValues = column.filteredValue;
- if (!filterDropdownIsDefined) {
- filteredValues = (_a = filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.map(String)) !== null && _a !== void 0 ? _a : filteredValues;
- }
- filterStates.push({
- column,
- key: getColumnKey(column, columnPos),
- filteredKeys: filteredValues,
- forceFiltered: column.filtered
- });
- } else {
- // Uncontrolled
- filterStates.push({
- column,
- key: getColumnKey(column, columnPos),
- filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : undefined,
- forceFiltered: column.filtered
- });
- }
- }
- if ('children' in column) {
- filterStates = [].concat((0,toConsumableArray["default"])(filterStates), (0,toConsumableArray["default"])(collectFilterStates(column.children, init, columnPos)));
- }
- });
- return filterStates;
- };
- function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, locale, triggerFilter, getPopupContainer, pos, rootClassName) {
- return columns.map((column, index) => {
- const columnPos = getColumnPos(index, pos);
- const {
- filterOnClose = true,
- filterMultiple = true,
- filterMode,
- filterSearch
- } = column;
- let newColumn = column;
- if (newColumn.filters || newColumn.filterDropdown) {
- const columnKey = getColumnKey(newColumn, columnPos);
- const filterState = filterStates.find(({
- key
- }) => columnKey === key);
- newColumn = Object.assign(Object.assign({}, newColumn), {
- title: renderProps => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(useFilter_FilterDropdown, {
- tablePrefixCls: prefixCls,
- prefixCls: `${prefixCls}-filter`,
- dropdownPrefixCls: dropdownPrefixCls,
- column: newColumn,
- columnKey: columnKey,
- filterState: filterState,
- filterOnClose: filterOnClose,
- filterMultiple: filterMultiple,
- filterMode: filterMode,
- filterSearch: filterSearch,
- triggerFilter: triggerFilter,
- locale: locale,
- getPopupContainer: getPopupContainer,
- rootClassName: rootClassName
- }, renderColumnTitle(column.title, renderProps)))
- });
- }
- if ('children' in newColumn) {
- newColumn = Object.assign(Object.assign({}, newColumn), {
- children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, locale, triggerFilter, getPopupContainer, columnPos, rootClassName)
- });
- }
- return newColumn;
- });
- }
- const generateFilterInfo = filterStates => {
- const currentFilters = {};
- filterStates.forEach(({
- key,
- filteredKeys,
- column
- }) => {
- const keyAsString = key;
- const {
- filters,
- filterDropdown
- } = column;
- if (filterDropdown) {
- currentFilters[keyAsString] = filteredKeys || null;
- } else if (Array.isArray(filteredKeys)) {
- const keys = flattenKeys(filters);
- currentFilters[keyAsString] = keys.filter(originKey => filteredKeys.includes(String(originKey)));
- } else {
- currentFilters[keyAsString] = null;
- }
- });
- return currentFilters;
- };
- const getFilterData = (data, filterStates, childrenColumnName) => {
- const filterDatas = filterStates.reduce((currentData, filterState) => {
- const {
- column: {
- onFilter,
- filters
- },
- filteredKeys
- } = filterState;
- if (onFilter && filteredKeys && filteredKeys.length) {
- return currentData
- // shallow copy
- .map(record => Object.assign({}, record)).filter(record => filteredKeys.some(key => {
- const keys = flattenKeys(filters);
- const keyIndex = keys.findIndex(k => String(k) === String(key));
- const realKey = keyIndex !== -1 ? keys[keyIndex] : key;
- // filter children
- if (record[childrenColumnName]) {
- record[childrenColumnName] = getFilterData(record[childrenColumnName], filterStates, childrenColumnName);
- }
- return onFilter(realKey, record);
- }));
- }
- return currentData;
- }, data);
- return filterDatas;
- };
- const getMergedColumns = rawMergedColumns => rawMergedColumns.flatMap(column => {
- if ('children' in column) {
- return [column].concat((0,toConsumableArray["default"])(getMergedColumns(column.children || [])));
- }
- return [column];
- });
- const useFilter = props => {
- const {
- prefixCls,
- dropdownPrefixCls,
- mergedColumns: rawMergedColumns,
- onFilterChange,
- getPopupContainer,
- locale: tableLocale,
- rootClassName
- } = props;
- const warning = (0,_util_warning.devUseWarning)('Table');
- const mergedColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => getMergedColumns(rawMergedColumns || []), [rawMergedColumns]);
- const [filterStates, setFilterStates] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(() => collectFilterStates(mergedColumns, true));
- const mergedFilterStates = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const collectedStates = collectFilterStates(mergedColumns, false);
- if (collectedStates.length === 0) {
- return collectedStates;
- }
- let filteredKeysIsAllNotControlled = true;
- let filteredKeysIsAllControlled = true;
- collectedStates.forEach(({
- filteredKeys
- }) => {
- if (filteredKeys !== undefined) {
- filteredKeysIsAllNotControlled = false;
- } else {
- filteredKeysIsAllControlled = false;
- }
- });
- // Return if not controlled
- if (filteredKeysIsAllNotControlled) {
- // Filter column may have been removed
- const keyList = (mergedColumns || []).map((column, index) => getColumnKey(column, getColumnPos(index)));
- return filterStates.filter(({
- key
- }) => keyList.includes(key)).map(item => {
- const col = mergedColumns[keyList.findIndex(key => key === item.key)];
- return Object.assign(Object.assign({}, item), {
- column: Object.assign(Object.assign({}, item.column), col),
- forceFiltered: col.filtered
- });
- });
- }
- true ? warning(filteredKeysIsAllControlled, 'usage', 'Columns should all contain `filteredValue` or not contain `filteredValue`.') : 0;
- return collectedStates;
- }, [mergedColumns, filterStates]);
- const filters = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => generateFilterInfo(mergedFilterStates), [mergedFilterStates]);
- const triggerFilter = filterState => {
- const newFilterStates = mergedFilterStates.filter(({
- key
- }) => key !== filterState.key);
- newFilterStates.push(filterState);
- setFilterStates(newFilterStates);
- onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);
- };
- const transformColumns = innerColumns => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer, undefined, rootClassName);
- return [transformColumns, mergedFilterStates, filters];
- };
- /* harmony default export */ var hooks_useFilter = (useFilter);
- ;// ./components/table/hooks/useLazyKVMap.ts
- const useLazyKVMap = (data, childrenColumnName, getRowKey) => {
- const mapCacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({});
- function getRecordByKey(key) {
- var _a;
- if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
- const kvMap = new Map();
- function dig(records) {
- records.forEach((record, index) => {
- const rowKey = getRowKey(record, index);
- kvMap.set(rowKey, record);
- if (record && typeof record === 'object' && childrenColumnName in record) {
- dig(record[childrenColumnName] || []);
- }
- });
- }
- dig(data);
- mapCacheRef.current = {
- data,
- childrenColumnName,
- kvMap,
- getRowKey
- };
- }
- return (_a = mapCacheRef.current.kvMap) === null || _a === void 0 ? void 0 : _a.get(key);
- }
- return [getRecordByKey];
- };
- /* harmony default export */ var hooks_useLazyKVMap = (useLazyKVMap);
- ;// ./components/table/hooks/usePagination.ts
- var usePagination_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const DEFAULT_PAGE_SIZE = 10;
- function getPaginationParam(mergedPagination, pagination) {
- const param = {
- current: mergedPagination.current,
- pageSize: mergedPagination.pageSize
- };
- const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};
- Object.keys(paginationObj).forEach(pageProp => {
- const value = mergedPagination[pageProp];
- if (typeof value !== 'function') {
- param[pageProp] = value;
- }
- });
- return param;
- }
- function usePagination(total, onChange, pagination) {
- const _a = pagination && typeof pagination === 'object' ? pagination : {},
- {
- total: paginationTotal = 0
- } = _a,
- paginationObj = usePagination_rest(_a, ["total"]);
- const [innerPagination, setInnerPagination] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(() => ({
- current: 'defaultCurrent' in paginationObj ? paginationObj.defaultCurrent : 1,
- pageSize: 'defaultPageSize' in paginationObj ? paginationObj.defaultPageSize : DEFAULT_PAGE_SIZE
- }));
- // ============ Basic Pagination Config ============
- const mergedPagination = extendsObject(innerPagination, paginationObj, {
- total: paginationTotal > 0 ? paginationTotal : total
- });
- // Reset `current` if data length or pageSize changed
- const maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);
- if (mergedPagination.current > maxPage) {
- // Prevent a maximum page count of 0
- mergedPagination.current = maxPage || 1;
- }
- const refreshPagination = (current, pageSize) => {
- setInnerPagination({
- current: current !== null && current !== void 0 ? current : 1,
- pageSize: pageSize || mergedPagination.pageSize
- });
- };
- const onInternalChange = (current, pageSize) => {
- var _a;
- if (pagination) {
- (_a = pagination.onChange) === null || _a === void 0 ? void 0 : _a.call(pagination, current, pageSize);
- }
- refreshPagination(current, pageSize);
- onChange(current, pageSize || (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize));
- };
- if (pagination === false) {
- return [{}, () => {}];
- }
- return [Object.assign(Object.assign({}, mergedPagination), {
- onChange: onInternalChange
- }), refreshPagination];
- }
- /* harmony default export */ var hooks_usePagination = (usePagination);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CaretDownOutlined.js
- // This icon file is generated automatically.
- var CaretDownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z" } }] }, "name": "caret-down", "theme": "outlined" };
- /* harmony default export */ var asn_CaretDownOutlined = (CaretDownOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CaretDownOutlined_CaretDownOutlined = function CaretDownOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CaretDownOutlined
- }));
- };
- /** */
- var CaretDownOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CaretDownOutlined_CaretDownOutlined);
- if (true) {
- CaretDownOutlined_RefIcon.displayName = 'CaretDownOutlined';
- }
- /* harmony default export */ var icons_CaretDownOutlined = (CaretDownOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CaretUpOutlined.js
- // This icon file is generated automatically.
- var CaretUpOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z" } }] }, "name": "caret-up", "theme": "outlined" };
- /* harmony default export */ var asn_CaretUpOutlined = (CaretUpOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CaretUpOutlined_CaretUpOutlined = function CaretUpOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CaretUpOutlined
- }));
- };
- /** */
- var CaretUpOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CaretUpOutlined_CaretUpOutlined);
- if (true) {
- CaretUpOutlined_RefIcon.displayName = 'CaretUpOutlined';
- }
- /* harmony default export */ var icons_CaretUpOutlined = (CaretUpOutlined_RefIcon);
- ;// ./components/table/hooks/useSorter.tsx
- const ASCEND = 'ascend';
- const DESCEND = 'descend';
- const getMultiplePriority = column => {
- if (typeof column.sorter === 'object' && typeof column.sorter.multiple === 'number') {
- return column.sorter.multiple;
- }
- return false;
- };
- const getSortFunction = sorter => {
- if (typeof sorter === 'function') {
- return sorter;
- }
- if (sorter && typeof sorter === 'object' && sorter.compare) {
- return sorter.compare;
- }
- return false;
- };
- const nextSortDirection = (sortDirections, current) => {
- if (!current) {
- return sortDirections[0];
- }
- return sortDirections[sortDirections.indexOf(current) + 1];
- };
- const collectSortStates = (columns, init, pos) => {
- let sortStates = [];
- const pushState = (column, columnPos) => {
- sortStates.push({
- column,
- key: getColumnKey(column, columnPos),
- multiplePriority: getMultiplePriority(column),
- sortOrder: column.sortOrder
- });
- };
- (columns || []).forEach((column, index) => {
- const columnPos = getColumnPos(index, pos);
- if (column.children) {
- if ('sortOrder' in column) {
- // Controlled
- pushState(column, columnPos);
- }
- sortStates = [].concat((0,toConsumableArray["default"])(sortStates), (0,toConsumableArray["default"])(collectSortStates(column.children, init, columnPos)));
- } else if (column.sorter) {
- if ('sortOrder' in column) {
- // Controlled
- pushState(column, columnPos);
- } else if (init && column.defaultSortOrder) {
- // Default sorter
- sortStates.push({
- column,
- key: getColumnKey(column, columnPos),
- multiplePriority: getMultiplePriority(column),
- sortOrder: column.defaultSortOrder
- });
- }
- }
- });
- return sortStates;
- };
- const injectSorter = (prefixCls, columns, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, pos) => {
- const finalColumns = (columns || []).map((column, index) => {
- const columnPos = getColumnPos(index, pos);
- let newColumn = column;
- if (newColumn.sorter) {
- const sortDirections = newColumn.sortDirections || defaultSortDirections;
- const showSorterTooltip = newColumn.showSorterTooltip === undefined ? tableShowSorterTooltip : newColumn.showSorterTooltip;
- const columnKey = getColumnKey(newColumn, columnPos);
- const sorterState = sorterStates.find(({
- key
- }) => key === columnKey);
- const sortOrder = sorterState ? sorterState.sortOrder : null;
- const nextSortOrder = nextSortDirection(sortDirections, sortOrder);
- let sorter;
- if (column.sortIcon) {
- sorter = column.sortIcon({
- sortOrder
- });
- } else {
- const upNode = sortDirections.includes(ASCEND) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CaretUpOutlined, {
- className: classnames_default()(`${prefixCls}-column-sorter-up`, {
- active: sortOrder === ASCEND
- })
- }));
- const downNode = sortDirections.includes(DESCEND) && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CaretDownOutlined, {
- className: classnames_default()(`${prefixCls}-column-sorter-down`, {
- active: sortOrder === DESCEND
- })
- }));
- sorter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: classnames_default()(`${prefixCls}-column-sorter`, {
- [`${prefixCls}-column-sorter-full`]: !!(upNode && downNode)
- })
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-column-sorter-inner`,
- "aria-hidden": "true"
- }, upNode, downNode));
- }
- const {
- cancelSort,
- triggerAsc,
- triggerDesc
- } = tableLocale || {};
- let sortTip = cancelSort;
- if (nextSortOrder === DESCEND) {
- sortTip = triggerDesc;
- } else if (nextSortOrder === ASCEND) {
- sortTip = triggerAsc;
- }
- const tooltipProps = typeof showSorterTooltip === 'object' ? Object.assign({
- title: sortTip
- }, showSorterTooltip) : {
- title: sortTip
- };
- newColumn = Object.assign(Object.assign({}, newColumn), {
- className: classnames_default()(newColumn.className, {
- [`${prefixCls}-column-sort`]: sortOrder
- }),
- title: renderProps => {
- const columnSortersClass = `${prefixCls}-column-sorters`;
- const renderColumnTitleWrapper = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-column-title`
- }, renderColumnTitle(column.title, renderProps));
- const renderSortTitle = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: columnSortersClass
- }, renderColumnTitleWrapper, sorter);
- if (showSorterTooltip) {
- if (typeof showSorterTooltip !== 'boolean' && (showSorterTooltip === null || showSorterTooltip === void 0 ? void 0 : showSorterTooltip.target) === 'sorter-icon') {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${columnSortersClass} ${prefixCls}-column-sorters-tooltip-target-sorter`
- }, renderColumnTitleWrapper, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({}, tooltipProps), sorter));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({}, tooltipProps), renderSortTitle);
- }
- return renderSortTitle;
- },
- onHeaderCell: col => {
- var _a;
- const cell = ((_a = column.onHeaderCell) === null || _a === void 0 ? void 0 : _a.call(column, col)) || {};
- const originOnClick = cell.onClick;
- const originOKeyDown = cell.onKeyDown;
- cell.onClick = event => {
- triggerSorter({
- column,
- key: columnKey,
- sortOrder: nextSortOrder,
- multiplePriority: getMultiplePriority(column)
- });
- originOnClick === null || originOnClick === void 0 ? void 0 : originOnClick(event);
- };
- cell.onKeyDown = event => {
- if (event.keyCode === KeyCode["default"].ENTER) {
- triggerSorter({
- column,
- key: columnKey,
- sortOrder: nextSortOrder,
- multiplePriority: getMultiplePriority(column)
- });
- originOKeyDown === null || originOKeyDown === void 0 ? void 0 : originOKeyDown(event);
- }
- };
- const renderTitle = safeColumnTitle(column.title, {});
- const displayTitle = renderTitle === null || renderTitle === void 0 ? void 0 : renderTitle.toString();
- // Inform the screen-reader so it can tell the visually impaired user which column is sorted
- if (sortOrder) {
- cell['aria-sort'] = sortOrder === 'ascend' ? 'ascending' : 'descending';
- }
- cell['aria-label'] = displayTitle || '';
- cell.className = classnames_default()(cell.className, `${prefixCls}-column-has-sorters`);
- cell.tabIndex = 0;
- if (column.ellipsis) {
- cell.title = (renderTitle !== null && renderTitle !== void 0 ? renderTitle : '').toString();
- }
- return cell;
- }
- });
- }
- if ('children' in newColumn) {
- newColumn = Object.assign(Object.assign({}, newColumn), {
- children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos)
- });
- }
- return newColumn;
- });
- return finalColumns;
- };
- const stateToInfo = sorterState => {
- const {
- column,
- sortOrder
- } = sorterState;
- return {
- column,
- order: sortOrder,
- field: column.dataIndex,
- columnKey: column.key
- };
- };
- const generateSorterInfo = sorterStates => {
- const activeSorters = sorterStates.filter(({
- sortOrder
- }) => sortOrder).map(stateToInfo);
- // =========== Legacy compatible support ===========
- // https://github.com/ant-design/ant-design/pull/19226
- if (activeSorters.length === 0 && sorterStates.length) {
- const lastIndex = sorterStates.length - 1;
- return Object.assign(Object.assign({}, stateToInfo(sorterStates[lastIndex])), {
- column: undefined,
- order: undefined,
- field: undefined,
- columnKey: undefined
- });
- }
- if (activeSorters.length <= 1) {
- return activeSorters[0] || {};
- }
- return activeSorters;
- };
- const getSortData = (data, sortStates, childrenColumnName) => {
- const innerSorterStates = sortStates.slice().sort((a, b) => b.multiplePriority - a.multiplePriority);
- const cloneData = data.slice();
- const runningSorters = innerSorterStates.filter(({
- column: {
- sorter
- },
- sortOrder
- }) => getSortFunction(sorter) && sortOrder);
- // Skip if no sorter needed
- if (!runningSorters.length) {
- return cloneData;
- }
- return cloneData.sort((record1, record2) => {
- for (let i = 0; i < runningSorters.length; i += 1) {
- const sorterState = runningSorters[i];
- const {
- column: {
- sorter
- },
- sortOrder
- } = sorterState;
- const compareFn = getSortFunction(sorter);
- if (compareFn && sortOrder) {
- const compareResult = compareFn(record1, record2, sortOrder);
- if (compareResult !== 0) {
- return sortOrder === ASCEND ? compareResult : -compareResult;
- }
- }
- }
- return 0;
- }).map(record => {
- const subRecords = record[childrenColumnName];
- if (subRecords) {
- return Object.assign(Object.assign({}, record), {
- [childrenColumnName]: getSortData(subRecords, sortStates, childrenColumnName)
- });
- }
- return record;
- });
- };
- const useFilterSorter = props => {
- const {
- prefixCls,
- mergedColumns,
- sortDirections,
- tableLocale,
- showSorterTooltip,
- onSorterChange
- } = props;
- const [sortStates, setSortStates] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(() => collectSortStates(mergedColumns, true));
- const getColumnKeys = (columns, pos) => {
- const newKeys = [];
- columns.forEach((item, index) => {
- const columnPos = getColumnPos(index, pos);
- newKeys.push(getColumnKey(item, columnPos));
- if (Array.isArray(item.children)) {
- const childKeys = getColumnKeys(item.children, columnPos);
- newKeys.push.apply(newKeys, (0,toConsumableArray["default"])(childKeys));
- }
- });
- return newKeys;
- };
- const mergedSorterStates = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- let validate = true;
- const collectedStates = collectSortStates(mergedColumns, false);
- // Return if not controlled
- if (!collectedStates.length) {
- const mergedColumnsKeys = getColumnKeys(mergedColumns);
- return sortStates.filter(({
- key
- }) => mergedColumnsKeys.includes(key));
- }
- const validateStates = [];
- function patchStates(state) {
- if (validate) {
- validateStates.push(state);
- } else {
- validateStates.push(Object.assign(Object.assign({}, state), {
- sortOrder: null
- }));
- }
- }
- let multipleMode = null;
- collectedStates.forEach(state => {
- if (multipleMode === null) {
- patchStates(state);
- if (state.sortOrder) {
- if (state.multiplePriority === false) {
- validate = false;
- } else {
- multipleMode = true;
- }
- }
- } else if (multipleMode && state.multiplePriority !== false) {
- patchStates(state);
- } else {
- validate = false;
- patchStates(state);
- }
- });
- return validateStates;
- }, [mergedColumns, sortStates]);
- // Get render columns title required props
- const columnTitleSorterProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a, _b;
- const sortColumns = mergedSorterStates.map(({
- column,
- sortOrder
- }) => ({
- column,
- order: sortOrder
- }));
- return {
- sortColumns,
- // Legacy
- sortColumn: (_a = sortColumns[0]) === null || _a === void 0 ? void 0 : _a.column,
- sortOrder: (_b = sortColumns[0]) === null || _b === void 0 ? void 0 : _b.order
- };
- }, [mergedSorterStates]);
- const triggerSorter = sortState => {
- let newSorterStates;
- if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) {
- newSorterStates = [sortState];
- } else {
- newSorterStates = [].concat((0,toConsumableArray["default"])(mergedSorterStates.filter(({
- key
- }) => key !== sortState.key)), [sortState]);
- }
- setSortStates(newSorterStates);
- onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
- };
- const transformColumns = innerColumns => injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip);
- const getSorters = () => generateSorterInfo(mergedSorterStates);
- return [transformColumns, mergedSorterStates, columnTitleSorterProps, getSorters];
- };
- /* harmony default export */ var useSorter = (useFilterSorter);
- ;// ./components/table/hooks/useTitleColumns.ts
- const fillTitle = (columns, columnTitleProps) => {
- const finalColumns = columns.map(column => {
- const cloneColumn = Object.assign({}, column);
- cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
- if ('children' in cloneColumn) {
- cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
- }
- return cloneColumn;
- });
- return finalColumns;
- };
- const useTitleColumns = columnTitleProps => {
- const filledColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(columns => fillTitle(columns, columnTitleProps), [columnTitleProps]);
- return [filledColumns];
- };
- /* harmony default export */ var hooks_useTitleColumns = (useTitleColumns);
- ;// ./components/table/RcTable/index.tsx
- /**
- * Same as `rc-table` but we modify trigger children update logic instead.
- */
- const RcTable = genTable((prev, next) => {
- const {
- _renderTimes: prevRenderTimes
- } = prev;
- const {
- _renderTimes: nextRenderTimes
- } = next;
- return prevRenderTimes !== nextRenderTimes;
- });
- /* harmony default export */ var table_RcTable = (RcTable);
- ;// ./components/table/RcTable/VirtualTable.tsx
- /**
- * Same as `rc-table` but we modify trigger children update logic instead.
- */
- const RcVirtualTable = genVirtualTable((prev, next) => {
- const {
- _renderTimes: prevRenderTimes
- } = prev;
- const {
- _renderTimes: nextRenderTimes
- } = next;
- return prevRenderTimes !== nextRenderTimes;
- });
- /* harmony default export */ var RcTable_VirtualTable = (RcVirtualTable);
- // EXTERNAL MODULE: ./components/table/style/index.ts + 15 modules
- var table_style = __webpack_require__("./components/table/style/index.ts");
- ;// ./components/table/InternalTable.tsx
- const InternalTable_EMPTY_LIST = [];
- const InternalTable = (props, ref) => {
- var _a, _b;
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- size: customizeSize,
- bordered,
- dropdownPrefixCls: customizeDropdownPrefixCls,
- dataSource,
- pagination,
- rowSelection,
- rowKey = 'key',
- rowClassName,
- columns,
- children,
- childrenColumnName: legacyChildrenColumnName,
- onChange,
- getPopupContainer,
- loading,
- expandIcon,
- expandable,
- expandedRowRender,
- expandIconColumnIndex,
- indentSize,
- scroll,
- sortDirections,
- locale,
- showSorterTooltip = {
- target: 'full-header'
- },
- virtual
- } = props;
- const warning = (0,_util_warning.devUseWarning)('Table');
- if (true) {
- true ? warning(!(typeof rowKey === 'function' && rowKey.length > 1), 'usage', '`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.') : 0;
- }
- const baseColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);
- const needResponsive = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => baseColumns.some(col => col.responsive), [baseColumns]);
- const screens = hooks_useBreakpoint(needResponsive);
- const mergedColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const matched = new Set(Object.keys(screens).filter(m => screens[m]));
- return baseColumns.filter(c => !c.responsive || c.responsive.some(r => matched.has(r)));
- }, [baseColumns, screens]);
- const tableProps = (0,omit["default"])(props, ['className', 'style', 'columns']);
- const {
- locale: contextLocale = en_US["default"],
- direction,
- table,
- renderEmpty,
- getPrefixCls,
- getPopupContainer: getContextPopupContainer
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const mergedSize = (0,useSize["default"])(customizeSize);
- const tableLocale = Object.assign(Object.assign({}, contextLocale.Table), locale);
- const rawData = dataSource || InternalTable_EMPTY_LIST;
- const prefixCls = getPrefixCls('table', customizePrefixCls);
- const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);
- const [, token] = (0,useToken["default"])();
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,table_style["default"])(prefixCls, rootCls);
- const mergedExpandable = Object.assign(Object.assign({
- childrenColumnName: legacyChildrenColumnName,
- expandIconColumnIndex
- }, expandable), {
- expandIcon: (_a = expandable === null || expandable === void 0 ? void 0 : expandable.expandIcon) !== null && _a !== void 0 ? _a : (_b = table === null || table === void 0 ? void 0 : table.expandable) === null || _b === void 0 ? void 0 : _b.expandIcon
- });
- const {
- childrenColumnName = 'children'
- } = mergedExpandable;
- const expandType = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (rawData.some(item => item === null || item === void 0 ? void 0 : item[childrenColumnName])) {
- return 'nest';
- }
- if (expandedRowRender || (expandable === null || expandable === void 0 ? void 0 : expandable.expandedRowRender)) {
- return 'row';
- }
- return null;
- }, [rawData]);
- const internalRefs = {
- body: external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null)
- };
- // ============================ Width =============================
- const getContainerWidth = useContainerWidth(prefixCls);
- // ============================= Refs =============================
- const rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const tblRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- useProxyImperativeHandle(ref, () => Object.assign(Object.assign({}, tblRef.current), {
- nativeElement: rootRef.current
- }));
- // ============================ RowKey ============================
- const getRowKey = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (typeof rowKey === 'function') {
- return rowKey;
- }
- return record => record === null || record === void 0 ? void 0 : record[rowKey];
- }, [rowKey]);
- const [getRecordByKey] = hooks_useLazyKVMap(rawData, childrenColumnName, getRowKey);
- // ============================ Events =============================
- const changeEventInfo = {};
- const triggerOnChange = (info, action, reset = false) => {
- var _a, _b, _c, _d;
- const changeInfo = Object.assign(Object.assign({}, changeEventInfo), info);
- if (reset) {
- (_a = changeEventInfo.resetPagination) === null || _a === void 0 ? void 0 : _a.call(changeEventInfo);
- // Reset event param
- if ((_b = changeInfo.pagination) === null || _b === void 0 ? void 0 : _b.current) {
- changeInfo.pagination.current = 1;
- }
- // Trigger pagination events
- if (pagination) {
- (_c = pagination.onChange) === null || _c === void 0 ? void 0 : _c.call(pagination, 1, (_d = changeInfo.pagination) === null || _d === void 0 ? void 0 : _d.pageSize);
- }
- }
- if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
- scrollTo(0, {
- getContainer: () => internalRefs.body.current
- });
- }
- onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
- currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates, childrenColumnName),
- action
- });
- };
- /**
- * Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read
- * state out and then put it back to title render. Move these code into `hooks` but still too
- * complex. We should provides Table props like `sorter` & `filter` to handle control in next big
- * version.
- */
- // ============================ Sorter =============================
- const onSorterChange = (sorter, sorterStates) => {
- triggerOnChange({
- sorter,
- sorterStates
- }, 'sort', false);
- };
- const [transformSorterColumns, sortStates, sorterTitleProps, getSorters] = useSorter({
- prefixCls,
- mergedColumns,
- onSorterChange,
- sortDirections: sortDirections || ['ascend', 'descend'],
- tableLocale,
- showSorterTooltip
- });
- const sortedData = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => getSortData(rawData, sortStates, childrenColumnName), [rawData, sortStates]);
- changeEventInfo.sorter = getSorters();
- changeEventInfo.sorterStates = sortStates;
- // ============================ Filter ============================
- const onFilterChange = (filters, filterStates) => {
- triggerOnChange({
- filters,
- filterStates
- }, 'filter', true);
- };
- const [transformFilterColumns, filterStates, filters] = hooks_useFilter({
- prefixCls,
- locale: tableLocale,
- dropdownPrefixCls,
- mergedColumns,
- onFilterChange,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- rootClassName: classnames_default()(rootClassName, rootCls)
- });
- const mergedData = getFilterData(sortedData, filterStates, childrenColumnName);
- changeEventInfo.filters = filters;
- changeEventInfo.filterStates = filterStates;
- // ============================ Column ============================
- const columnTitleProps = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const mergedFilters = {};
- Object.keys(filters).forEach(filterKey => {
- if (filters[filterKey] !== null) {
- mergedFilters[filterKey] = filters[filterKey];
- }
- });
- return Object.assign(Object.assign({}, sorterTitleProps), {
- filters: mergedFilters
- });
- }, [sorterTitleProps, filters]);
- const [transformTitleColumns] = hooks_useTitleColumns(columnTitleProps);
- // ========================== Pagination ==========================
- const onPaginationChange = (current, pageSize) => {
- triggerOnChange({
- pagination: Object.assign(Object.assign({}, changeEventInfo.pagination), {
- current,
- pageSize
- })
- }, 'paginate');
- };
- const [mergedPagination, resetPagination] = hooks_usePagination(mergedData.length, onPaginationChange, pagination);
- changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(mergedPagination, pagination);
- changeEventInfo.resetPagination = resetPagination;
- // ============================= Data =============================
- const pageData = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (pagination === false || !mergedPagination.pageSize) {
- return mergedData;
- }
- const {
- current = 1,
- total,
- pageSize = DEFAULT_PAGE_SIZE
- } = mergedPagination;
- true ? warning(current > 0, 'usage', '`current` should be positive number.') : 0;
- // Dynamic table data
- if (mergedData.length < total) {
- if (mergedData.length > pageSize) {
- true ? warning(false, 'usage', '`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.') : 0;
- return mergedData.slice((current - 1) * pageSize, current * pageSize);
- }
- return mergedData;
- }
- return mergedData.slice((current - 1) * pageSize, current * pageSize);
- }, [!!pagination, mergedData, mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.current, mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize, mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total]);
- // ========================== Selections ==========================
- const [transformSelectionColumns, selectedKeySet] = hooks_useSelection({
- prefixCls,
- data: mergedData,
- pageData,
- getRowKey,
- getRecordByKey,
- expandType,
- childrenColumnName,
- locale: tableLocale,
- getPopupContainer: getPopupContainer || getContextPopupContainer
- }, rowSelection);
- const internalRowClassName = (record, index, indent) => {
- let mergedRowClassName;
- if (typeof rowClassName === 'function') {
- mergedRowClassName = classnames_default()(rowClassName(record, index, indent));
- } else {
- mergedRowClassName = classnames_default()(rowClassName);
- }
- return classnames_default()({
- [`${prefixCls}-row-selected`]: selectedKeySet.has(getRowKey(record, index))
- }, mergedRowClassName);
- };
- // ========================== Expandable ==========================
- // Pass origin render status into `rc-table`, this can be removed when refactor with `rc-table`
- mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
- // Customize expandable icon
- mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || ExpandIcon(tableLocale);
- // Adjust expand icon index, no overwrite expandIconColumnIndex if set.
- if (expandType === 'nest' && mergedExpandable.expandIconColumnIndex === undefined) {
- mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;
- } else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {
- mergedExpandable.expandIconColumnIndex -= 1;
- }
- // Indent size
- if (typeof mergedExpandable.indentSize !== 'number') {
- mergedExpandable.indentSize = typeof indentSize === 'number' ? indentSize : 15;
- }
- // ============================ Render ============================
- const transformColumns = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(innerColumns => transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns)))), [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
- let topPaginationNode;
- let bottomPaginationNode;
- if (pagination !== false && (mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.total)) {
- let paginationSize;
- if (mergedPagination.size) {
- paginationSize = mergedPagination.size;
- } else {
- paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;
- }
- const renderPagination = position => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_pagination, Object.assign({}, mergedPagination, {
- className: classnames_default()(`${prefixCls}-pagination ${prefixCls}-pagination-${position}`, mergedPagination.className),
- size: paginationSize
- })));
- const defaultPosition = direction === 'rtl' ? 'left' : 'right';
- const {
- position
- } = mergedPagination;
- if (position !== null && Array.isArray(position)) {
- const topPos = position.find(p => p.includes('top'));
- const bottomPos = position.find(p => p.includes('bottom'));
- const isDisable = position.every(p => `${p}` === 'none');
- if (!topPos && !bottomPos && !isDisable) {
- bottomPaginationNode = renderPagination(defaultPosition);
- }
- if (topPos) {
- topPaginationNode = renderPagination(topPos.toLowerCase().replace('top', ''));
- }
- if (bottomPos) {
- bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace('bottom', ''));
- }
- } else {
- bottomPaginationNode = renderPagination(defaultPosition);
- }
- }
- // >>>>>>>>> Spinning
- let spinProps;
- if (typeof loading === 'boolean') {
- spinProps = {
- spinning: loading
- };
- } else if (typeof loading === 'object') {
- spinProps = Object.assign({
- spinning: true
- }, loading);
- }
- const wrapperClassNames = classnames_default()(cssVarCls, rootCls, `${prefixCls}-wrapper`, table === null || table === void 0 ? void 0 : table.className, {
- [`${prefixCls}-wrapper-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId);
- const mergedStyle = Object.assign(Object.assign({}, table === null || table === void 0 ? void 0 : table.style), style);
- // ========== empty ==========
- const mergedEmptyNode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- // When dataSource is null/undefined (detected by reference equality with EMPTY_LIST),
- // and the table is in a loading state, we only show the loading spinner without the empty placeholder.
- // For empty arrays (datasource={[]}), both loading and empty states would normally be shown.
- // discussion https://github.com/ant-design/ant-design/issues/54601#issuecomment-3158091383
- if ((spinProps === null || spinProps === void 0 ? void 0 : spinProps.spinning) && rawData === InternalTable_EMPTY_LIST) {
- return null;
- }
- if (typeof (locale === null || locale === void 0 ? void 0 : locale.emptyText) !== 'undefined') {
- return locale.emptyText;
- }
- return (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Table')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Table"
- });
- }, [spinProps === null || spinProps === void 0 ? void 0 : spinProps.spinning, rawData, locale === null || locale === void 0 ? void 0 : locale.emptyText, renderEmpty]);
- // ========================== Render ==========================
- const TableComponent = virtual ? RcTable_VirtualTable : table_RcTable;
- // >>> Virtual Table props. We set height here since it will affect height collection
- const virtualProps = {};
- const listItemHeight = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const {
- fontSize,
- lineHeight,
- lineWidth,
- padding,
- paddingXS,
- paddingSM
- } = token;
- const fontHeight = Math.floor(fontSize * lineHeight);
- switch (mergedSize) {
- case 'middle':
- return paddingSM * 2 + fontHeight + lineWidth;
- case 'small':
- return paddingXS * 2 + fontHeight + lineWidth;
- default:
- return padding * 2 + fontHeight + lineWidth;
- }
- }, [token, mergedSize]);
- if (virtual) {
- virtualProps.listItemHeight = listItemHeight;
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- ref: rootRef,
- className: wrapperClassNames,
- style: mergedStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(spin, Object.assign({
- spinning: false
- }, spinProps), topPaginationNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(TableComponent, Object.assign({}, virtualProps, tableProps, {
- ref: tblRef,
- columns: mergedColumns,
- direction: direction,
- expandable: mergedExpandable,
- prefixCls: prefixCls,
- className: classnames_default()({
- [`${prefixCls}-middle`]: mergedSize === 'middle',
- [`${prefixCls}-small`]: mergedSize === 'small',
- [`${prefixCls}-bordered`]: bordered,
- [`${prefixCls}-empty`]: rawData.length === 0
- }, cssVarCls, rootCls, hashId),
- data: pageData,
- rowKey: getRowKey,
- rowClassName: internalRowClassName,
- emptyText: mergedEmptyNode,
- // Internal
- internalHooks: INTERNAL_HOOKS,
- internalRefs: internalRefs,
- transformColumns: transformColumns,
- getContainerWidth: getContainerWidth,
- measureRowRender: measureRow => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(config_provider, {
- getPopupContainer: node => node
- }, measureRow))
- })), bottomPaginationNode)));
- };
- /* harmony default export */ var table_InternalTable = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalTable));
- ;// ./components/table/Table.tsx
- const Table_Table = (props, ref) => {
- const renderTimesRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(0);
- renderTimesRef.current += 1;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(table_InternalTable, Object.assign({}, props, {
- ref: ref,
- _renderTimes: renderTimesRef.current
- }));
- };
- const ForwardTable = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Table_Table);
- ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
- ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
- ForwardTable.SELECTION_ALL = SELECTION_ALL;
- ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
- ForwardTable.SELECTION_NONE = SELECTION_NONE;
- ForwardTable.Column = table_Column;
- ForwardTable.ColumnGroup = table_ColumnGroup;
- ForwardTable.Summary = FooterComponents;
- if (true) {
- ForwardTable.displayName = 'Table';
- }
- /* harmony default export */ var table_Table = (ForwardTable);
- ;// ./components/table/index.tsx
- /* harmony default export */ var table = (table_Table);
- // EXTERNAL MODULE: ./components/tag/style/index.ts
- var tag_style = __webpack_require__("./components/tag/style/index.ts");
- ;// ./components/tag/CheckableTag.tsx
- var CheckableTag_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const CheckableTag = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- style,
- className,
- checked,
- children,
- icon,
- onChange,
- onClick
- } = props,
- restProps = CheckableTag_rest(props, ["prefixCls", "style", "className", "checked", "children", "icon", "onChange", "onClick"]);
- const {
- getPrefixCls,
- tag
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const handleClick = e => {
- onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
- onClick === null || onClick === void 0 ? void 0 : onClick(e);
- };
- const prefixCls = getPrefixCls('tag', customizePrefixCls);
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,tag_style["default"])(prefixCls);
- const cls = classnames_default()(prefixCls, `${prefixCls}-checkable`, {
- [`${prefixCls}-checkable-checked`]: checked
- }, tag === null || tag === void 0 ? void 0 : tag.className, className, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({}, restProps, {
- ref: ref,
- style: Object.assign(Object.assign({}, style), tag === null || tag === void 0 ? void 0 : tag.style),
- className: cls,
- onClick: handleClick
- }), icon, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, children)));
- });
- /* harmony default export */ var tag_CheckableTag = (CheckableTag);
- ;// ./components/tag/style/presetCmp.ts
- // Style as status component
- // ============================== Preset ==============================
- const genPresetStyle = token => (0,genPresetColor["default"])(token, (colorKey, {
- textColor,
- lightBorderColor,
- lightColor,
- darkColor
- }) => ({
- [`${token.componentCls}${token.componentCls}-${colorKey}`]: {
- color: textColor,
- background: lightColor,
- borderColor: lightBorderColor,
- // Inverse color
- '&-inverse': {
- color: token.colorTextLightSolid,
- background: darkColor,
- borderColor: darkColor
- },
- [`&${token.componentCls}-borderless`]: {
- borderColor: 'transparent'
- }
- }
- }));
- // ============================== Export ==============================
- /* harmony default export */ var presetCmp = ((0,genStyleUtils.genSubStyleComponent)(['Tag', 'preset'], token => {
- const tagToken = (0,tag_style.prepareToken)(token);
- return genPresetStyle(tagToken);
- }, tag_style.prepareComponentToken));
- ;// ./components/_util/capitalize.ts
- function capitalize(str) {
- if (typeof str !== 'string') {
- return str;
- }
- const ret = str.charAt(0).toUpperCase() + str.slice(1);
- return ret;
- }
- ;// ./components/tag/style/statusCmp.ts
- const genTagStatusStyle = (token, status, cssVariableType) => {
- const capitalizedCssVariableType = capitalize(cssVariableType);
- return {
- [`${token.componentCls}${token.componentCls}-${status}`]: {
- color: token[`color${cssVariableType}`],
- background: token[`color${capitalizedCssVariableType}Bg`],
- borderColor: token[`color${capitalizedCssVariableType}Border`],
- [`&${token.componentCls}-borderless`]: {
- borderColor: 'transparent'
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var statusCmp = ((0,genStyleUtils.genSubStyleComponent)(['Tag', 'status'], token => {
- const tagToken = (0,tag_style.prepareToken)(token);
- return [genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
- }, tag_style.prepareComponentToken));
- ;// ./components/tag/index.tsx
- var tag_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalTag = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((tagProps, ref) => {
- const {
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- style,
- children,
- icon,
- color,
- onClose,
- bordered = true,
- visible: deprecatedVisible
- } = tagProps,
- props = tag_rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "bordered", "visible"]);
- const {
- getPrefixCls,
- direction,
- tag: tagContext
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [visible, setVisible] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true);
- const domProps = (0,omit["default"])(props, ['closeIcon', 'closable']);
- // Warning for deprecated usage
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Tag');
- warning.deprecated(!('visible' in tagProps), 'visible', 'visible && <Tag />');
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (deprecatedVisible !== undefined) {
- setVisible(deprecatedVisible);
- }
- }, [deprecatedVisible]);
- const isPreset = isPresetColor(color);
- const isStatus = isPresetStatusColor(color);
- const isInternalColor = isPreset || isStatus;
- const tagStyle = Object.assign(Object.assign({
- backgroundColor: color && !isInternalColor ? color : undefined
- }, tagContext === null || tagContext === void 0 ? void 0 : tagContext.style), style);
- const prefixCls = getPrefixCls('tag', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,tag_style["default"])(prefixCls);
- // Style
- const tagClassName = classnames_default()(prefixCls, tagContext === null || tagContext === void 0 ? void 0 : tagContext.className, {
- [`${prefixCls}-${color}`]: isInternalColor,
- [`${prefixCls}-has-color`]: color && !isInternalColor,
- [`${prefixCls}-hidden`]: !visible,
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-borderless`]: !bordered
- }, className, rootClassName, hashId, cssVarCls);
- const handleCloseClick = e => {
- e.stopPropagation();
- onClose === null || onClose === void 0 ? void 0 : onClose(e);
- if (e.defaultPrevented) {
- return;
- }
- setVisible(false);
- };
- const [, mergedCloseIcon] = useClosable(pickClosable(tagProps), pickClosable(tagContext), {
- closable: false,
- closeIconRender: iconNode => {
- const replacement = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-close-icon`,
- onClick: handleCloseClick
- }, iconNode);
- return (0,reactNode.replaceElement)(iconNode, replacement, originProps => ({
- onClick: e => {
- var _a;
- (_a = originProps === null || originProps === void 0 ? void 0 : originProps.onClick) === null || _a === void 0 ? void 0 : _a.call(originProps, e);
- handleCloseClick(e);
- },
- className: classnames_default()(originProps === null || originProps === void 0 ? void 0 : originProps.className, `${prefixCls}-close-icon`)
- }));
- }
- });
- const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
- const iconNode = icon || null;
- const kids = iconNode ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, iconNode, children && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, children))) : children;
- const tagNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", Object.assign({}, domProps, {
- ref: ref,
- className: tagClassName,
- style: tagStyle
- }), kids, mergedCloseIcon, isPreset && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(presetCmp, {
- key: "preset",
- prefixCls: prefixCls
- }), isStatus && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(statusCmp, {
- key: "status",
- prefixCls: prefixCls
- }));
- return wrapCSSVar(isNeedWave ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(wave, {
- component: "Tag"
- }, tagNode) : tagNode);
- });
- const Tag = InternalTag;
- if (true) {
- Tag.displayName = 'Tag';
- }
- Tag.CheckableTag = tag_CheckableTag;
- /* harmony default export */ var tag = (Tag);
- // EXTERNAL MODULE: ./components/theme/util/alias.ts
- var alias = __webpack_require__("./components/theme/util/alias.ts");
- ;// ./components/theme/getDesignToken.ts
- const getDesignToken = config => {
- const theme = (config === null || config === void 0 ? void 0 : config.algorithm) ? (0,cssinjs.createTheme)(config.algorithm) : default_theme["default"];
- const mergedToken = Object.assign(Object.assign({}, seed["default"]), config === null || config === void 0 ? void 0 : config.token);
- return (0,cssinjs.getComputedToken)(mergedToken, {
- override: config === null || config === void 0 ? void 0 : config.token
- }, theme, alias["default"]);
- };
- /* harmony default export */ var theme_getDesignToken = (getDesignToken);
- // EXTERNAL MODULE: ./components/theme/themes/default/index.ts + 5 modules
- var themes_default = __webpack_require__("./components/theme/themes/default/index.ts");
- // EXTERNAL MODULE: ./components/theme/themes/shared/genControlHeight.ts
- var genControlHeight = __webpack_require__("./components/theme/themes/shared/genControlHeight.ts");
- // EXTERNAL MODULE: ./components/theme/themes/shared/genFontMapToken.ts
- var genFontMapToken = __webpack_require__("./components/theme/themes/shared/genFontMapToken.ts");
- ;// ./components/theme/themes/compact/genCompactSizeMapToken.ts
- function genSizeMapToken(token) {
- const {
- sizeUnit,
- sizeStep
- } = token;
- const compactSizeStep = sizeStep - 2;
- return {
- sizeXXL: sizeUnit * (compactSizeStep + 10),
- sizeXL: sizeUnit * (compactSizeStep + 6),
- sizeLG: sizeUnit * (compactSizeStep + 2),
- sizeMD: sizeUnit * (compactSizeStep + 2),
- sizeMS: sizeUnit * (compactSizeStep + 1),
- size: sizeUnit * compactSizeStep,
- sizeSM: sizeUnit * compactSizeStep,
- sizeXS: sizeUnit * (compactSizeStep - 1),
- sizeXXS: sizeUnit * (compactSizeStep - 1)
- };
- }
- ;// ./components/theme/themes/compact/index.ts
- const derivative = (token, mapToken) => {
- const mergedMapToken = mapToken !== null && mapToken !== void 0 ? mapToken : (0,themes_default["default"])(token);
- const fontSize = mergedMapToken.fontSizeSM; // Smaller size font-size as base
- const controlHeight = mergedMapToken.controlHeight - 4;
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, mergedMapToken), genSizeMapToken(mapToken !== null && mapToken !== void 0 ? mapToken : token)), (0,genFontMapToken["default"])(fontSize)), {
- // controlHeight
- controlHeight
- }), (0,genControlHeight["default"])(Object.assign(Object.assign({}, mergedMapToken), {
- controlHeight
- })));
- };
- /* harmony default export */ var themes_compact = (derivative);
- // EXTERNAL MODULE: ./components/theme/themes/shared/genColorMapToken.ts
- var genColorMapToken = __webpack_require__("./components/theme/themes/shared/genColorMapToken.ts");
- ;// ./components/theme/themes/dark/colorAlgorithm.ts
- const getAlphaColor = (baseColor, alpha) => new fast_color_es.FastColor(baseColor).setA(alpha).toRgbString();
- const getSolidColor = (baseColor, brightness) => {
- const instance = new fast_color_es.FastColor(baseColor);
- return instance.lighten(brightness).toHexString();
- };
- ;// ./components/theme/themes/dark/colors.ts
- const generateColorPalettes = baseColor => {
- const colors = (0,colors_es.generate)(baseColor, {
- theme: 'dark'
- });
- return {
- 1: colors[0],
- 2: colors[1],
- 3: colors[2],
- 4: colors[3],
- 5: colors[6],
- 6: colors[5],
- 7: colors[4],
- 8: colors[6],
- 9: colors[5],
- 10: colors[4]
- // 8: colors[9],
- // 9: colors[8],
- // 10: colors[7],
- };
- };
- const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
- const colorBgBase = bgBaseColor || '#000';
- const colorTextBase = textBaseColor || '#fff';
- return {
- colorBgBase,
- colorTextBase,
- colorText: getAlphaColor(colorTextBase, 0.85),
- colorTextSecondary: getAlphaColor(colorTextBase, 0.65),
- colorTextTertiary: getAlphaColor(colorTextBase, 0.45),
- colorTextQuaternary: getAlphaColor(colorTextBase, 0.25),
- colorFill: getAlphaColor(colorTextBase, 0.18),
- colorFillSecondary: getAlphaColor(colorTextBase, 0.12),
- colorFillTertiary: getAlphaColor(colorTextBase, 0.08),
- colorFillQuaternary: getAlphaColor(colorTextBase, 0.04),
- colorBgSolid: getAlphaColor(colorTextBase, 0.95),
- colorBgSolidHover: getAlphaColor(colorTextBase, 1),
- colorBgSolidActive: getAlphaColor(colorTextBase, 0.9),
- colorBgElevated: getSolidColor(colorBgBase, 12),
- colorBgContainer: getSolidColor(colorBgBase, 8),
- colorBgLayout: getSolidColor(colorBgBase, 0),
- colorBgSpotlight: getSolidColor(colorBgBase, 26),
- colorBgBlur: getAlphaColor(colorTextBase, 0.04),
- colorBorder: getSolidColor(colorBgBase, 26),
- colorBorderSecondary: getSolidColor(colorBgBase, 19)
- };
- };
- ;// ./components/theme/themes/dark/index.ts
- const dark_derivative = (token, mapToken) => {
- const colorPalettes = Object.keys(seed.defaultPresetColors).map(colorKey => {
- const colors = (0,colors_es.generate)(token[colorKey], {
- theme: 'dark'
- });
- return Array.from({
- length: 10
- }, () => 1).reduce((prev, _, i) => {
- prev[`${colorKey}-${i + 1}`] = colors[i];
- prev[`${colorKey}${i + 1}`] = colors[i];
- return prev;
- }, {});
- }).reduce((prev, cur) => {
- prev = Object.assign(Object.assign({}, prev), cur);
- return prev;
- }, {});
- const mergedMapToken = mapToken !== null && mapToken !== void 0 ? mapToken : (0,themes_default["default"])(token);
- const colorMapToken = (0,genColorMapToken["default"])(token, {
- generateColorPalettes: generateColorPalettes,
- generateNeutralColorPalettes: generateNeutralColorPalettes
- });
- return Object.assign(Object.assign(Object.assign(Object.assign({}, mergedMapToken), colorPalettes), colorMapToken), {
- // Customize selected item background color
- // https://github.com/ant-design/ant-design/issues/30524#issuecomment-871961867
- colorPrimaryBg: colorMapToken.colorPrimaryBorder,
- colorPrimaryBgHover: colorMapToken.colorPrimaryBorderHover
- });
- };
- /* harmony default export */ var dark = (dark_derivative);
- ;// ./components/theme/index.tsx
- // ZombieJ: We export as object to user but array in internal.
- // This is used to minimize the bundle size for antd package but safe to refactor as object also.
- // Please do not export internal `useToken` directly to avoid something export unexpected.
- /** Get current context Design Token. Will be different if you are using nest theme config. */
- function theme_useToken() {
- const [theme, token, hashId] = (0,useToken["default"])();
- return {
- theme,
- token,
- hashId
- };
- }
- /* harmony default export */ var theme = ({
- /** Default seedToken */
- defaultSeed: context.defaultConfig.token,
- useToken: theme_useToken,
- defaultAlgorithm: themes_default["default"],
- darkAlgorithm: dark,
- compactAlgorithm: themes_compact,
- getDesignToken: theme_getDesignToken,
- /**
- * @private Private variable
- * @warring 🔥 Do not use in production. 🔥
- */
- defaultConfig: context.defaultConfig,
- /**
- * @private Private variable
- * @warring 🔥 Do not use in production. 🔥
- */
- _internalContext: context.DesignTokenContext
- });
- ;// ./components/time-picker/index.tsx
- var time_picker_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const {
- TimePicker: InternalTimePicker,
- RangePicker: InternalRangePicker
- } = date_picker;
- const time_picker_RangePicker = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalRangePicker, Object.assign({}, props, {
- picker: "time",
- mode: undefined,
- ref: ref
- }))));
- const TimePicker = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_a, ref) => {
- var {
- addon,
- renderExtraFooter,
- variant,
- bordered
- } = _a,
- restProps = time_picker_rest(_a, ["addon", "renderExtraFooter", "variant", "bordered"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('TimePicker');
- warning.deprecated(!addon, 'addon', 'renderExtraFooter');
- }
- const [mergedVariant] = useVariants('timePicker', variant, bordered);
- const internalRenderExtraFooter = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (renderExtraFooter) {
- return renderExtraFooter;
- }
- if (addon) {
- return addon;
- }
- return undefined;
- }, [addon, renderExtraFooter]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(InternalTimePicker, Object.assign({}, restProps, {
- mode: undefined,
- ref: ref,
- renderExtraFooter: internalRenderExtraFooter,
- variant: mergedVariant
- }));
- });
- if (true) {
- TimePicker.displayName = 'TimePicker';
- }
- // We don't care debug panel
- /* istanbul ignore next */
- const time_picker_PurePanel = _util_PurePanel(TimePicker, 'popupAlign', undefined, 'picker');
- TimePicker._InternalPanelDoNotUseOrYouWillBeFired = time_picker_PurePanel;
- TimePicker.RangePicker = time_picker_RangePicker;
- TimePicker._InternalPanelDoNotUseOrYouWillBeFired = time_picker_PurePanel;
- /* harmony default export */ var time_picker = (TimePicker);
- // EXTERNAL MODULE: ./components/timeline/style/index.ts
- var timeline_style = __webpack_require__("./components/timeline/style/index.ts");
- ;// ./components/timeline/TimelineItem.tsx
- var TimelineItem_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TimelineItem = _a => {
- var {
- prefixCls: customizePrefixCls,
- className,
- color = 'blue',
- dot,
- pending = false,
- position /** Dead, but do not pass in <li {...omit()} */,
- label,
- children
- } = _a,
- restProps = TimelineItem_rest(_a, ["prefixCls", "className", "color", "dot", "pending", "position", "label", "children"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('timeline', customizePrefixCls);
- const itemClassName = classnames_default()(`${prefixCls}-item`, {
- [`${prefixCls}-item-pending`]: pending
- }, className);
- const customColor = /blue|red|green|gray/.test(color || '') ? undefined : color;
- const dotClassName = classnames_default()(`${prefixCls}-item-head`, {
- [`${prefixCls}-item-head-custom`]: !!dot,
- [`${prefixCls}-item-head-${color}`]: !customColor
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", Object.assign({}, restProps, {
- className: itemClassName
- }), label && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-item-label`
- }, label), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-item-tail`
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: dotClassName,
- style: {
- borderColor: customColor,
- color: customColor
- }
- }, dot), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-item-content`
- }, children));
- };
- /* harmony default export */ var timeline_TimelineItem = (TimelineItem);
- ;// ./components/timeline/TimelineItemList.tsx
- var TimelineItemList_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TimelineItemList = _a => {
- var {
- prefixCls,
- className,
- pending = false,
- children,
- items,
- rootClassName,
- reverse = false,
- direction,
- hashId,
- pendingDot,
- mode = ''
- } = _a,
- restProps = TimelineItemList_rest(_a, ["prefixCls", "className", "pending", "children", "items", "rootClassName", "reverse", "direction", "hashId", "pendingDot", "mode"]);
- const getPositionCls = (position, idx) => {
- if (mode === 'alternate') {
- if (position === 'right') return `${prefixCls}-item-right`;
- if (position === 'left') return `${prefixCls}-item-left`;
- return idx % 2 === 0 ? `${prefixCls}-item-left` : `${prefixCls}-item-right`;
- }
- if (mode === 'left') return `${prefixCls}-item-left`;
- if (mode === 'right') return `${prefixCls}-item-right`;
- if (position === 'right') return `${prefixCls}-item-right`;
- return '';
- };
- const mergedItems = (0,toConsumableArray["default"])(items || []);
- const pendingNode = typeof pending === 'boolean' ? null : pending;
- if (pending) {
- mergedItems.push({
- pending: !!pending,
- dot: pendingDot || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null),
- children: pendingNode
- });
- }
- if (reverse) {
- mergedItems.reverse();
- }
- const itemsCount = mergedItems.length;
- const lastCls = `${prefixCls}-item-last`;
- const itemsList = mergedItems.filter(item => !!item).map((item, idx) => {
- var _a;
- const pendingClass = idx === itemsCount - 2 ? lastCls : '';
- const readyClass = idx === itemsCount - 1 ? lastCls : '';
- const {
- className: itemClassName
- } = item,
- itemProps = TimelineItemList_rest(item, ["className"]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(timeline_TimelineItem, Object.assign({}, itemProps, {
- className: classnames_default()([itemClassName, !reverse && !!pending ? pendingClass : readyClass, getPositionCls((_a = item === null || item === void 0 ? void 0 : item.position) !== null && _a !== void 0 ? _a : '', idx)]),
- key: (item === null || item === void 0 ? void 0 : item.key) || idx
- }));
- });
- const hasLabelItem = mergedItems.some(item => !!(item === null || item === void 0 ? void 0 : item.label));
- const classString = classnames_default()(prefixCls, {
- [`${prefixCls}-pending`]: !!pending,
- [`${prefixCls}-reverse`]: !!reverse,
- [`${prefixCls}-${mode}`]: !!mode && !hasLabelItem,
- [`${prefixCls}-label`]: hasLabelItem,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ol", Object.assign({}, restProps, {
- className: classString
- }), itemsList);
- };
- /* harmony default export */ var timeline_TimelineItemList = (TimelineItemList);
- ;// ./components/timeline/useItems.ts
- function timeline_useItems_useItems(items, children) {
- if (items && Array.isArray(items)) {
- return items;
- }
- return (0,toArray["default"])(children).map(ele => {
- var _a, _b;
- return Object.assign({
- children: (_b = (_a = ele === null || ele === void 0 ? void 0 : ele.props) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : ''
- }, ele.props);
- });
- }
- /* harmony default export */ var timeline_useItems = (timeline_useItems_useItems);
- ;// ./components/timeline/Timeline.tsx
- var Timeline_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- // CSSINJS
- const Timeline = props => {
- const {
- getPrefixCls,
- direction,
- timeline
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- prefixCls: customizePrefixCls,
- children,
- items,
- className,
- style
- } = props,
- restProps = Timeline_rest(props, ["prefixCls", "children", "items", "className", "style"]);
- const prefixCls = getPrefixCls('timeline', customizePrefixCls);
- // =================== Warning =====================
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Timeline');
- warning.deprecated(!children, 'Timeline.Item', 'items');
- }
- // Style
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,timeline_style["default"])(prefixCls, rootCls);
- const mergedItems = timeline_useItems(items, children);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(timeline_TimelineItemList, Object.assign({}, restProps, {
- className: classnames_default()(timeline === null || timeline === void 0 ? void 0 : timeline.className, className, cssVarCls, rootCls),
- style: Object.assign(Object.assign({}, timeline === null || timeline === void 0 ? void 0 : timeline.style), style),
- prefixCls: prefixCls,
- direction: direction,
- items: mergedItems,
- hashId: hashId
- })));
- };
- Timeline.Item = timeline_TimelineItem;
- if (true) {
- Timeline.displayName = 'Timeline';
- }
- /* harmony default export */ var timeline_Timeline = (Timeline);
- ;// ./components/timeline/index.tsx
- /* harmony default export */ var timeline = (timeline_Timeline);
- ;// ./node_modules/@rc-component/tour/es/hooks/useClosable.js
- function isConfigObj(closable) {
- return closable !== null && (0,esm_typeof["default"])(closable) === 'object';
- }
- /**
- * Convert `closable` to ClosableConfig.
- * When `preset` is true, will auto fill ClosableConfig with default value.
- */
- function getClosableConfig(closable, closeIcon, preset) {
- if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) {
- return null;
- }
- var mergedCloseIcon = typeof closeIcon !== 'boolean' ? closeIcon : undefined;
- if (isConfigObj(closable)) {
- var _closable$closeIcon;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, closable), {}, {
- closeIcon: (_closable$closeIcon = closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : mergedCloseIcon
- });
- }
- // When StepClosable no need auto fill, but RootClosable need this.
- return preset || closable || closeIcon ? {
- closeIcon: mergedCloseIcon
- } : 'empty';
- }
- function useClosable_useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);
- var rootClosableConfig = getClosableConfig(closable, closeIcon, true);
- if (stepClosableConfig !== 'empty') {
- return stepClosableConfig;
- }
- return rootClosableConfig;
- }, [closable, closeIcon, stepClosable, stepCloseIcon]);
- }
- ;// ./node_modules/@rc-component/tour/es/util.js
- function isInViewPort(element) {
- var viewWidth = window.innerWidth || document.documentElement.clientWidth;
- var viewHeight = window.innerHeight || document.documentElement.clientHeight;
- var _element$getBoundingC = element.getBoundingClientRect(),
- top = _element$getBoundingC.top,
- right = _element$getBoundingC.right,
- bottom = _element$getBoundingC.bottom,
- left = _element$getBoundingC.left;
- return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight;
- }
- function getPlacement(targetElement, placement, stepPlacement) {
- var _ref;
- return (_ref = stepPlacement !== null && stepPlacement !== void 0 ? stepPlacement : placement) !== null && _ref !== void 0 ? _ref : targetElement === null ? 'center' : 'bottom';
- }
- ;// ./node_modules/@rc-component/tour/es/hooks/useTarget.js
- function isValidNumber(val) {
- return typeof val === 'number' && !Number.isNaN(val);
- }
- function useTarget(target, open, gap, scrollIntoViewOptions) {
- // ========================= Target =========================
- // We trade `undefined` as not get target by function yet.
- // `null` as empty target.
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(undefined),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- targetElement = _useState2[0],
- setTargetElement = _useState2[1];
- (0,useLayoutEffect["default"])(function () {
- var nextElement = typeof target === 'function' ? target() : target;
- setTargetElement(nextElement || null);
- });
- // ========================= Align ==========================
- var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- posInfo = _useState4[0],
- setPosInfo = _useState4[1];
- var updatePos = (0,useEvent["default"])(function () {
- if (targetElement) {
- // Exist target element. We should scroll and get target position
- if (!isInViewPort(targetElement) && open) {
- targetElement.scrollIntoView(scrollIntoViewOptions);
- }
- var _targetElement$getBou = targetElement.getBoundingClientRect(),
- left = _targetElement$getBou.left,
- top = _targetElement$getBou.top,
- width = _targetElement$getBou.width,
- height = _targetElement$getBou.height;
- var nextPosInfo = {
- left: left,
- top: top,
- width: width,
- height: height,
- radius: 0
- };
- setPosInfo(function (origin) {
- if (JSON.stringify(origin) !== JSON.stringify(nextPosInfo)) {
- return nextPosInfo;
- }
- return origin;
- });
- } else {
- // Not exist target which means we just show in center
- setPosInfo(null);
- }
- });
- var getGapOffset = function getGapOffset(index) {
- var _ref;
- return (_ref = Array.isArray(gap === null || gap === void 0 ? void 0 : gap.offset) ? gap === null || gap === void 0 ? void 0 : gap.offset[index] : gap === null || gap === void 0 ? void 0 : gap.offset) !== null && _ref !== void 0 ? _ref : 6;
- };
- (0,useLayoutEffect["default"])(function () {
- updatePos();
- // update when window resize
- window.addEventListener('resize', updatePos);
- return function () {
- window.removeEventListener('resize', updatePos);
- };
- }, [targetElement, open, updatePos]);
- // ======================== PosInfo =========================
- var mergedPosInfo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if (!posInfo) {
- return posInfo;
- }
- var gapOffsetX = getGapOffset(0);
- var gapOffsetY = getGapOffset(1);
- var gapRadius = isValidNumber(gap === null || gap === void 0 ? void 0 : gap.radius) ? gap === null || gap === void 0 ? void 0 : gap.radius : 2;
- return {
- left: posInfo.left - gapOffsetX,
- top: posInfo.top - gapOffsetY,
- width: posInfo.width + gapOffsetX * 2,
- height: posInfo.height + gapOffsetY * 2,
- radius: gapRadius
- };
- }, [posInfo, gap]);
- return [mergedPosInfo, targetElement];
- }
- ;// ./node_modules/@rc-component/tour/es/Mask.js
- var COVER_PROPS = {
- fill: 'transparent',
- pointerEvents: 'auto'
- };
- var es_Mask_Mask = function Mask(props) {
- var prefixCls = props.prefixCls,
- rootClassName = props.rootClassName,
- pos = props.pos,
- showMask = props.showMask,
- _props$style = props.style,
- style = _props$style === void 0 ? {} : _props$style,
- _props$fill = props.fill,
- fill = _props$fill === void 0 ? "rgba(0,0,0,0.5)" : _props$fill,
- open = props.open,
- animated = props.animated,
- zIndex = props.zIndex,
- disabledInteraction = props.disabledInteraction;
- var id = hooks_useId();
- var maskId = "".concat(prefixCls, "-mask-").concat(id);
- var mergedAnimated = (0,esm_typeof["default"])(animated) === 'object' ? animated === null || animated === void 0 ? void 0 : animated.placeholder : animated;
- var isSafari = typeof navigator !== 'undefined' && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
- var maskRectSize = isSafari ? {
- width: '100%',
- height: '100%'
- } : {
- width: '100vw',
- height: '100vh'
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(portal_es, {
- open: open,
- autoLock: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-mask"), rootClassName),
- style: (0,objectSpread2["default"])({
- position: 'fixed',
- left: 0,
- right: 0,
- top: 0,
- bottom: 0,
- zIndex: zIndex,
- pointerEvents: pos && !disabledInteraction ? 'none' : 'auto'
- }, style)
- }, showMask ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("svg", {
- style: {
- width: '100%',
- height: '100%'
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("defs", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("mask", {
- id: maskId
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", (0,esm_extends["default"])({
- x: "0",
- y: "0"
- }, maskRectSize, {
- fill: "white"
- })), pos && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", {
- x: pos.left,
- y: pos.top,
- rx: pos.radius,
- width: pos.width,
- height: pos.height,
- fill: "black",
- className: mergedAnimated ? "".concat(prefixCls, "-placeholder-animated") : ''
- }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", {
- x: "0",
- y: "0",
- width: "100%",
- height: "100%",
- fill: fill,
- mask: "url(#".concat(maskId, ")")
- }), pos && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", (0,esm_extends["default"])({}, COVER_PROPS, {
- x: "0",
- y: "0",
- width: "100%",
- height: pos.top
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", (0,esm_extends["default"])({}, COVER_PROPS, {
- x: "0",
- y: "0",
- width: pos.left,
- height: "100%"
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", (0,esm_extends["default"])({}, COVER_PROPS, {
- x: "0",
- y: pos.top + pos.height,
- width: "100%",
- height: "calc(100vh - ".concat(pos.top + pos.height, "px)")
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("rect", (0,esm_extends["default"])({}, COVER_PROPS, {
- x: pos.left + pos.width,
- y: "0",
- width: "calc(100vw - ".concat(pos.left + pos.width, "px)"),
- height: "100%"
- })))) : null));
- };
- /* harmony default export */ var es_Mask = (es_Mask_Mask);
- ;// ./node_modules/@rc-component/tour/es/placements.js
- var es_placements_autoAdjustOverflow = {
- adjustX: 1,
- adjustY: 1
- };
- var es_placements_targetOffset = [0, 0];
- var basePlacements = {
- left: {
- points: ['cr', 'cl'],
- offset: [-8, 0]
- },
- right: {
- points: ['cl', 'cr'],
- offset: [8, 0]
- },
- top: {
- points: ['bc', 'tc'],
- offset: [0, -8]
- },
- bottom: {
- points: ['tc', 'bc'],
- offset: [0, 8]
- },
- topLeft: {
- points: ['bl', 'tl'],
- offset: [0, -8]
- },
- leftTop: {
- points: ['tr', 'tl'],
- offset: [-8, 0]
- },
- topRight: {
- points: ['br', 'tr'],
- offset: [0, -8]
- },
- rightTop: {
- points: ['tl', 'tr'],
- offset: [8, 0]
- },
- bottomRight: {
- points: ['tr', 'br'],
- offset: [0, 8]
- },
- rightBottom: {
- points: ['bl', 'br'],
- offset: [8, 0]
- },
- bottomLeft: {
- points: ['tl', 'bl'],
- offset: [0, 8]
- },
- leftBottom: {
- points: ['br', 'bl'],
- offset: [-8, 0]
- }
- };
- function placements_getPlacements() {
- var arrowPointAtCenter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var placements = {};
- Object.keys(basePlacements).forEach(function (key) {
- placements[key] = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, basePlacements[key]), {}, {
- autoArrow: arrowPointAtCenter,
- targetOffset: es_placements_targetOffset
- });
- });
- return placements;
- }
- var tour_es_placements_placements = placements_getPlacements();
- ;// ./node_modules/@rc-component/tour/es/TourStep/DefaultPanel.js
- function DefaultPanel(props) {
- var _closable$closeIcon;
- var prefixCls = props.prefixCls,
- current = props.current,
- total = props.total,
- title = props.title,
- description = props.description,
- onClose = props.onClose,
- onPrev = props.onPrev,
- onNext = props.onNext,
- onFinish = props.onFinish,
- className = props.className,
- closable = props.closable;
- var ariaProps = (0,pickAttrs["default"])(closable || {}, true);
- var closeIcon = (_closable$closeIcon = closable === null || closable === void 0 ? void 0 : closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: "".concat(prefixCls, "-close-x")
- }, "\xD7");
- var mergedClosable = !!closable;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-content"), className)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-inner")
- }, mergedClosable && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", (0,esm_extends["default"])({
- type: "button",
- onClick: onClose,
- "aria-label": "Close"
- }, ariaProps, {
- className: "".concat(prefixCls, "-close")
- }), closeIcon), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-header")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-title")
- }, title)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-description")
- }, description), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-footer")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-sliders")
- }, total > 1 ? (0,toConsumableArray["default"])(Array.from({
- length: total
- }).keys()).map(function (item, index) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: item,
- className: index === current ? 'active' : ''
- });
- }) : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: "".concat(prefixCls, "-buttons")
- }, current !== 0 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: "".concat(prefixCls, "-prev-btn"),
- onClick: onPrev
- }, "Prev") : null, current === total - 1 ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: "".concat(prefixCls, "-finish-btn"),
- onClick: onFinish
- }, "Finish") : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- className: "".concat(prefixCls, "-next-btn"),
- onClick: onNext
- }, "Next")))));
- }
- ;// ./node_modules/@rc-component/tour/es/TourStep/index.js
- var TourStep = function TourStep(props) {
- var current = props.current,
- renderPanel = props.renderPanel;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, typeof renderPanel === 'function' ? renderPanel(props, current) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(DefaultPanel, props));
- };
- /* harmony default export */ var es_TourStep = (TourStep);
- ;// ./node_modules/@rc-component/tour/es/Tour.js
- var Tour_excluded = ["prefixCls", "steps", "defaultCurrent", "current", "onChange", "onClose", "onFinish", "open", "mask", "arrow", "rootClassName", "placement", "renderPanel", "gap", "animated", "scrollIntoViewOptions", "zIndex", "closeIcon", "closable", "builtinPlacements", "disabledInteraction"];
- var CENTER_PLACEHOLDER = {
- left: '50%',
- top: '50%',
- width: 1,
- height: 1
- };
- var defaultScrollIntoViewOptions = {
- block: 'center',
- inline: 'center'
- };
- var Tour = function Tour(props) {
- var _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-tour' : _props$prefixCls,
- _props$steps = props.steps,
- steps = _props$steps === void 0 ? [] : _props$steps,
- defaultCurrent = props.defaultCurrent,
- current = props.current,
- onChange = props.onChange,
- onClose = props.onClose,
- _onFinish = props.onFinish,
- open = props.open,
- _props$mask = props.mask,
- mask = _props$mask === void 0 ? true : _props$mask,
- _props$arrow = props.arrow,
- arrow = _props$arrow === void 0 ? true : _props$arrow,
- rootClassName = props.rootClassName,
- placement = props.placement,
- renderPanel = props.renderPanel,
- gap = props.gap,
- animated = props.animated,
- _props$scrollIntoView = props.scrollIntoViewOptions,
- scrollIntoViewOptions = _props$scrollIntoView === void 0 ? defaultScrollIntoViewOptions : _props$scrollIntoView,
- _props$zIndex = props.zIndex,
- zIndex = _props$zIndex === void 0 ? 1001 : _props$zIndex,
- closeIcon = props.closeIcon,
- closable = props.closable,
- builtinPlacements = props.builtinPlacements,
- disabledInteraction = props.disabledInteraction,
- restProps = (0,objectWithoutProperties["default"])(props, Tour_excluded);
- var triggerRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var _useMergedState = (0,useMergedState["default"])(0, {
- value: current,
- defaultValue: defaultCurrent
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedCurrent = _useMergedState2[0],
- setMergedCurrent = _useMergedState2[1];
- var _useMergedState3 = (0,useMergedState["default"])(undefined, {
- value: open,
- postState: function postState(origin) {
- return mergedCurrent < 0 || mergedCurrent >= steps.length ? false : origin !== null && origin !== void 0 ? origin : true;
- }
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedOpen = _useMergedState4[0],
- setMergedOpen = _useMergedState4[1];
- // Record if already rended in the DOM to avoid `findDOMNode` issue
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(mergedOpen),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- hasOpened = _React$useState2[0],
- setHasOpened = _React$useState2[1];
- var openRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(mergedOpen);
- (0,useLayoutEffect["default"])(function () {
- if (mergedOpen) {
- if (!openRef.current) {
- setMergedCurrent(0);
- }
- setHasOpened(true);
- }
- openRef.current = mergedOpen;
- }, [mergedOpen]);
- var _ref = steps[mergedCurrent] || {},
- target = _ref.target,
- stepPlacement = _ref.placement,
- stepStyle = _ref.style,
- stepArrow = _ref.arrow,
- stepClassName = _ref.className,
- stepMask = _ref.mask,
- _ref$scrollIntoViewOp = _ref.scrollIntoViewOptions,
- stepScrollIntoViewOptions = _ref$scrollIntoViewOp === void 0 ? defaultScrollIntoViewOptions : _ref$scrollIntoViewOp,
- stepCloseIcon = _ref.closeIcon,
- stepClosable = _ref.closable;
- var mergedClosable = useClosable_useClosable(stepClosable, stepCloseIcon, closable, closeIcon);
- var mergedMask = mergedOpen && (stepMask !== null && stepMask !== void 0 ? stepMask : mask);
- var mergedScrollIntoViewOptions = stepScrollIntoViewOptions !== null && stepScrollIntoViewOptions !== void 0 ? stepScrollIntoViewOptions : scrollIntoViewOptions;
- var _useTarget = useTarget(target, open, gap, mergedScrollIntoViewOptions),
- _useTarget2 = (0,slicedToArray["default"])(_useTarget, 2),
- posInfo = _useTarget2[0],
- targetElement = _useTarget2[1];
- var mergedPlacement = getPlacement(targetElement, placement, stepPlacement);
- // ========================= arrow =========================
- var mergedArrow = targetElement ? typeof stepArrow === 'undefined' ? arrow : stepArrow : false;
- var arrowPointAtCenter = (0,esm_typeof["default"])(mergedArrow) === 'object' ? mergedArrow.pointAtCenter : false;
- (0,useLayoutEffect["default"])(function () {
- var _triggerRef$current;
- (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.forceAlign();
- }, [arrowPointAtCenter, mergedCurrent]);
- // ========================= Change =========================
- var onInternalChange = function onInternalChange(nextCurrent) {
- setMergedCurrent(nextCurrent);
- onChange === null || onChange === void 0 ? void 0 : onChange(nextCurrent);
- };
- var mergedBuiltinPlacements = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- if (builtinPlacements) {
- return typeof builtinPlacements === 'function' ? builtinPlacements({
- arrowPointAtCenter: arrowPointAtCenter
- }) : builtinPlacements;
- }
- return placements_getPlacements(arrowPointAtCenter);
- }, [builtinPlacements, arrowPointAtCenter]);
- // ========================= Render =========================
- // Skip if not init yet
- if (targetElement === undefined || !hasOpened) {
- return null;
- }
- var handleClose = function handleClose() {
- setMergedOpen(false);
- onClose === null || onClose === void 0 ? void 0 : onClose(mergedCurrent);
- };
- var getPopupElement = function getPopupElement() {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TourStep, (0,esm_extends["default"])({
- arrow: mergedArrow,
- key: "content",
- prefixCls: prefixCls,
- total: steps.length,
- renderPanel: renderPanel,
- onPrev: function onPrev() {
- onInternalChange(mergedCurrent - 1);
- },
- onNext: function onNext() {
- onInternalChange(mergedCurrent + 1);
- },
- onClose: handleClose,
- current: mergedCurrent,
- onFinish: function onFinish() {
- handleClose();
- _onFinish === null || _onFinish === void 0 ? void 0 : _onFinish();
- }
- }, steps[mergedCurrent], {
- closable: mergedClosable
- }));
- };
- var mergedShowMask = typeof mergedMask === 'boolean' ? mergedMask : !!mergedMask;
- var mergedMaskStyle = typeof mergedMask === 'boolean' ? undefined : mergedMask;
- // when targetElement is not exist, use body as triggerDOMNode
- var getTriggerDOMNode = function getTriggerDOMNode(node) {
- return node || targetElement || document.body;
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_Mask, {
- zIndex: zIndex,
- prefixCls: prefixCls,
- pos: posInfo,
- showMask: mergedShowMask,
- style: mergedMaskStyle === null || mergedMaskStyle === void 0 ? void 0 : mergedMaskStyle.style,
- fill: mergedMaskStyle === null || mergedMaskStyle === void 0 ? void 0 : mergedMaskStyle.color,
- open: mergedOpen,
- animated: animated,
- rootClassName: rootClassName,
- disabledInteraction: disabledInteraction
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(trigger_es, (0,esm_extends["default"])({}, restProps, {
- builtinPlacements: mergedBuiltinPlacements,
- ref: triggerRef,
- popupStyle: stepStyle,
- popupPlacement: mergedPlacement,
- popupVisible: mergedOpen,
- popupClassName: classnames_default()(rootClassName, stepClassName),
- prefixCls: prefixCls,
- popup: getPopupElement,
- forceRender: false,
- destroyPopupOnHide: true,
- zIndex: zIndex,
- getTriggerDOMNode: getTriggerDOMNode,
- arrow: !!mergedArrow
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(portal_es, {
- open: mergedOpen,
- autoLock: true
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(rootClassName, "".concat(prefixCls, "-target-placeholder")),
- style: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, posInfo || CENTER_PLACEHOLDER), {}, {
- position: 'fixed',
- pointerEvents: 'none'
- })
- }))));
- };
- /* harmony default export */ var es_Tour = (Tour);
- ;// ./node_modules/@rc-component/tour/es/index.js
- /* harmony default export */ var tour_es = (es_Tour);
- ;// ./components/tour/panelRender.tsx
- function isValidNode(node) {
- return node !== undefined && node !== null;
- }
- // Due to the independent design of Panel, it will be too coupled to put in rc-tour,
- // so a set of Panel logic is implemented separately in antd.
- const TourPanel = props => {
- var _a, _b;
- const {
- stepProps,
- current,
- type,
- indicatorsRender,
- actionsRender
- } = props;
- const {
- prefixCls,
- total = 1,
- title,
- onClose,
- onPrev,
- onNext,
- onFinish,
- cover,
- description,
- nextButtonProps,
- prevButtonProps,
- type: stepType,
- closable
- } = stepProps;
- const mergedType = stepType !== null && stepType !== void 0 ? stepType : type;
- const ariaProps = (0,pickAttrs["default"])(closable !== null && closable !== void 0 ? closable : {}, true);
- const [contextLocaleGlobal] = (0,useLocale["default"])('global', en_US["default"].global);
- const [contextLocaleTour] = (0,useLocale["default"])('Tour', en_US["default"].Tour);
- const mergedCloseIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", Object.assign({
- type: "button",
- onClick: onClose,
- className: `${prefixCls}-close`,
- "aria-label": contextLocaleGlobal === null || contextLocaleGlobal === void 0 ? void 0 : contextLocaleGlobal.close
- }, ariaProps), (closable === null || closable === void 0 ? void 0 : closable.closeIcon) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_CloseOutlined, {
- className: `${prefixCls}-close-icon`
- }));
- const isLastStep = current === total - 1;
- const prevBtnClick = () => {
- var _a;
- onPrev === null || onPrev === void 0 ? void 0 : onPrev();
- (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(prevButtonProps);
- };
- const nextBtnClick = () => {
- var _a;
- if (isLastStep) {
- onFinish === null || onFinish === void 0 ? void 0 : onFinish();
- } else {
- onNext === null || onNext === void 0 ? void 0 : onNext();
- }
- (_a = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(nextButtonProps);
- };
- const headerNode = isValidNode(title) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-header`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-title`
- }, title))) : null;
- const descriptionNode = isValidNode(description) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-description`
- }, description)) : null;
- const coverNode = isValidNode(cover) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-cover`
- }, cover) : null;
- let mergedIndicatorNode;
- if (indicatorsRender) {
- mergedIndicatorNode = indicatorsRender(current, total);
- } else {
- mergedIndicatorNode = (0,toConsumableArray["default"])(Array.from({
- length: total
- }).keys()).map((stepItem, index) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- key: stepItem,
- className: classnames_default()(index === current && `${prefixCls}-indicator-active`, `${prefixCls}-indicator`)
- })));
- }
- const mainBtnType = mergedType === 'primary' ? 'default' : 'primary';
- const secondaryBtnProps = {
- type: 'default',
- ghost: mergedType === 'primary'
- };
- const defaultActionsNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, current !== 0 ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_button, Object.assign({
- size: "small"
- }, secondaryBtnProps, prevButtonProps, {
- onClick: prevBtnClick,
- className: classnames_default()(`${prefixCls}-prev-btn`, prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.className)
- }), (_a = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.children) !== null && _a !== void 0 ? _a : contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Previous)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_button, Object.assign({
- size: "small",
- type: mainBtnType
- }, nextButtonProps, {
- onClick: nextBtnClick,
- className: classnames_default()(`${prefixCls}-next-btn`, nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.className)
- }), (_b = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.children) !== null && _b !== void 0 ? _b : isLastStep ? contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Finish : contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Next));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-content`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-inner`
- }, closable && mergedCloseIcon, coverNode, headerNode, descriptionNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-footer`
- }, total > 1 && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-indicators`
- }, mergedIndicatorNode), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-buttons`
- }, actionsRender ? actionsRender(defaultActionsNode, {
- current,
- total
- }) : defaultActionsNode))));
- };
- /* harmony default export */ var panelRender = (TourPanel);
- // EXTERNAL MODULE: ./components/tour/style/index.ts
- var tour_style = __webpack_require__("./components/tour/style/index.ts");
- ;// ./components/tour/PurePanel.tsx
- var tour_PurePanel_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const tour_PurePanel_PurePanel = props => {
- const {
- prefixCls: customizePrefixCls,
- current = 0,
- total = 6,
- className,
- style,
- type,
- closable,
- closeIcon
- } = props,
- restProps = tour_PurePanel_rest(props, ["prefixCls", "current", "total", "className", "style", "type", "closable", "closeIcon"]);
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('tour', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,tour_style["default"])(prefixCls);
- const [mergedClosable, mergedCloseIcon] = useClosable({
- closable,
- closeIcon
- }, null, {
- closable: true,
- closeIconRender: icon => {
- var _a;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(icon) ? (0,reactNode.cloneElement)(icon, {
- className: classnames_default()((_a = icon.props) === null || _a === void 0 ? void 0 : _a.className, `${prefixCls}-close-icon`)
- }) : icon;
- }
- });
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RawPurePanel, {
- prefixCls: prefixCls,
- hashId: hashId,
- className: classnames_default()(className, `${prefixCls}-pure`, type && `${prefixCls}-${type}`, cssVarCls),
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(panelRender, {
- stepProps: Object.assign(Object.assign({}, restProps), {
- prefixCls,
- total,
- closable: mergedClosable ? {
- closeIcon: mergedCloseIcon
- } : undefined
- }),
- current: current,
- type: type
- })));
- };
- /* harmony default export */ var tour_PurePanel = (withPureRenderTheme(tour_PurePanel_PurePanel));
- ;// ./components/tour/index.tsx
- var tour_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const tour_Tour = props => {
- const {
- prefixCls: customizePrefixCls,
- type,
- rootClassName,
- indicatorsRender,
- actionsRender,
- steps,
- closeIcon
- } = props,
- restProps = tour_rest(props, ["prefixCls", "type", "rootClassName", "indicatorsRender", "actionsRender", "steps", "closeIcon"]);
- const {
- getPrefixCls,
- direction,
- tour
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('tour', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,tour_style["default"])(prefixCls);
- const [, token] = (0,useToken["default"])();
- const mergedSteps = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => steps === null || steps === void 0 ? void 0 : steps.map(step => {
- var _a;
- return Object.assign(Object.assign({}, step), {
- className: classnames_default()(step.className, {
- [`${prefixCls}-primary`]: ((_a = step.type) !== null && _a !== void 0 ? _a : type) === 'primary'
- })
- });
- }), [steps, type]);
- const builtinPlacements = config => {
- var _a;
- return getPlacements({
- arrowPointAtCenter: (_a = config === null || config === void 0 ? void 0 : config.arrowPointAtCenter) !== null && _a !== void 0 ? _a : true,
- autoAdjustOverflow: true,
- offset: token.marginXXS,
- arrowWidth: token.sizePopupArrow,
- borderRadius: token.borderRadius
- });
- };
- const customClassName = classnames_default()({
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, hashId, cssVarCls, rootClassName);
- const mergedRenderPanel = (stepProps, stepCurrent) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(panelRender, {
- type: type,
- stepProps: stepProps,
- current: stepCurrent,
- indicatorsRender: indicatorsRender,
- actionsRender: actionsRender
- }));
- // ============================ zIndex ============================
- const [zIndex, contextZIndex] = (0,useZIndex.useZIndex)('Tour', restProps.zIndex);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(zindexContext["default"].Provider, {
- value: contextZIndex
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(tour_es, Object.assign({}, restProps, {
- closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : tour === null || tour === void 0 ? void 0 : tour.closeIcon,
- zIndex: zIndex,
- rootClassName: customClassName,
- prefixCls: prefixCls,
- animated: true,
- renderPanel: mergedRenderPanel,
- builtinPlacements: builtinPlacements,
- steps: mergedSteps
- }))));
- };
- if (true) {
- tour_Tour.displayName = 'Tour';
- }
- tour_Tour._InternalPanelDoNotUseOrYouWillBeFired = tour_PurePanel;
- /* harmony default export */ var tour = (tour_Tour);
- ;// ./components/_util/transKeys.ts
- const groupKeysMap = keys => {
- const map = new Map();
- keys.forEach((key, index) => {
- map.set(key, index);
- });
- return map;
- };
- const groupDisabledKeysMap = dataSource => {
- const map = new Map();
- dataSource.forEach(({
- disabled,
- key
- }, index) => {
- if (disabled) {
- map.set(key, index);
- }
- });
- return map;
- };
- ;// ./components/transfer/hooks/useData.ts
- const useData = (dataSource, rowKey, targetKeys) => {
- const mergedDataSource = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => (dataSource || []).map(record => {
- if (rowKey) {
- return Object.assign(Object.assign({}, record), {
- key: rowKey(record)
- });
- }
- return record;
- }), [dataSource, rowKey]);
- const [leftDataSource, rightDataSource] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- var _a;
- const leftData = [];
- const rightData = Array.from({
- length: (_a = targetKeys === null || targetKeys === void 0 ? void 0 : targetKeys.length) !== null && _a !== void 0 ? _a : 0
- });
- const targetKeysMap = groupKeysMap(targetKeys || []);
- mergedDataSource.forEach(record => {
- // rightData should be ordered by targetKeys
- // leftData should be ordered by dataSource
- if (targetKeysMap.has(record.key)) {
- const idx = targetKeysMap.get(record.key);
- rightData[idx] = record;
- } else {
- leftData.push(record);
- }
- });
- return [leftData, rightData];
- }, [mergedDataSource, targetKeys]);
- return [mergedDataSource, leftDataSource.filter(Boolean), rightDataSource.filter(Boolean)];
- };
- /* harmony default export */ var hooks_useData = (useData);
- ;// ./components/transfer/hooks/useSelection.ts
- const EMPTY_KEYS = [];
- function filterKeys(keys, dataKeys) {
- const filteredKeys = keys.filter(key => dataKeys.has(key));
- return keys.length === filteredKeys.length ? keys : filteredKeys;
- }
- function useSelection_flattenKeys(keys) {
- return Array.from(keys).join(';');
- }
- function useSelection_useSelection(leftDataSource, rightDataSource, selectedKeys) {
- // Prepare `dataSource` keys
- const [leftKeys, rightKeys] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => [new Set(leftDataSource.map(src => src === null || src === void 0 ? void 0 : src.key)), new Set(rightDataSource.map(src => src === null || src === void 0 ? void 0 : src.key))], [leftDataSource, rightDataSource]);
- // Selected Keys
- const [mergedSelectedKeys, setMergedSelectedKeys] = (0,rc_util_es.useMergedState)(EMPTY_KEYS, {
- value: selectedKeys
- });
- const sourceSelectedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => filterKeys(mergedSelectedKeys, leftKeys), [mergedSelectedKeys, leftKeys]);
- const targetSelectedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => filterKeys(mergedSelectedKeys, rightKeys), [mergedSelectedKeys, rightKeys]);
- // // Reset when data changed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setMergedSelectedKeys([].concat((0,toConsumableArray["default"])(filterKeys(mergedSelectedKeys, leftKeys)), (0,toConsumableArray["default"])(filterKeys(mergedSelectedKeys, rightKeys))));
- }, [useSelection_flattenKeys(leftKeys), useSelection_flattenKeys(rightKeys)]);
- // Update keys
- const setSourceSelectedKeys = (0,rc_util_es.useEvent)(nextSrcKeys => {
- setMergedSelectedKeys([].concat((0,toConsumableArray["default"])(nextSrcKeys), (0,toConsumableArray["default"])(targetSelectedKeys)));
- });
- const setTargetSelectedKeys = (0,rc_util_es.useEvent)(nextTargetKeys => {
- setMergedSelectedKeys([].concat((0,toConsumableArray["default"])(sourceSelectedKeys), (0,toConsumableArray["default"])(nextTargetKeys)));
- });
- return [
- // Keys
- sourceSelectedKeys, targetSelectedKeys,
- // Updater
- setSourceSelectedKeys, setTargetSelectedKeys];
- }
- /* harmony default export */ var transfer_hooks_useSelection = (useSelection_useSelection);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/DeleteOutlined.js
- // This icon file is generated automatically.
- var DeleteOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
- /* harmony default export */ var asn_DeleteOutlined = (DeleteOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/DeleteOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var DeleteOutlined_DeleteOutlined = function DeleteOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_DeleteOutlined
- }));
- };
- /** */
- var DeleteOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DeleteOutlined_DeleteOutlined);
- if (true) {
- DeleteOutlined_RefIcon.displayName = 'DeleteOutlined';
- }
- /* harmony default export */ var icons_DeleteOutlined = (DeleteOutlined_RefIcon);
- ;// ./components/transfer/ListItem.tsx
- const ListItem = props => {
- const {
- renderedText,
- renderedEl,
- item,
- checked,
- disabled,
- prefixCls,
- onClick,
- onRemove,
- showRemove
- } = props;
- const className = classnames_default()(`${prefixCls}-content-item`, {
- [`${prefixCls}-content-item-disabled`]: disabled || item.disabled,
- [`${prefixCls}-content-item-checked`]: checked && !item.disabled
- });
- let title;
- if (typeof renderedText === 'string' || typeof renderedText === 'number') {
- title = String(renderedText);
- }
- const [contextLocale] = (0,useLocale["default"])('Transfer', en_US["default"].Transfer);
- const liProps = {
- className,
- title
- };
- const labelNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-content-item-text`
- }, renderedEl);
- if (showRemove) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", Object.assign({}, liProps), labelNode, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- disabled: disabled || item.disabled,
- className: `${prefixCls}-content-item-remove`,
- "aria-label": contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.remove,
- onClick: () => onRemove === null || onRemove === void 0 ? void 0 : onRemove(item)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DeleteOutlined, null)));
- }
- // Default click to select
- liProps.onClick = disabled || item.disabled ? undefined : event => onClick(item, event);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("li", Object.assign({}, liProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_checkbox, {
- className: `${prefixCls}-checkbox`,
- checked: checked,
- disabled: disabled || item.disabled
- }), labelNode);
- };
- /* harmony default export */ var transfer_ListItem = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.memo(ListItem));
- ;// ./components/transfer/ListBody.tsx
- const OmitProps = ['handleFilter', 'handleClear', 'checkedKeys'];
- const parsePagination = pagination => {
- const defaultPagination = {
- simple: true,
- showSizeChanger: false,
- showLessItems: false
- };
- return Object.assign(Object.assign({}, defaultPagination), pagination);
- };
- const TransferListBody = (props, ref) => {
- const {
- prefixCls,
- filteredRenderItems,
- selectedKeys,
- disabled: globalDisabled,
- showRemove,
- pagination,
- onScroll,
- onItemSelect,
- onItemRemove
- } = props;
- const [current, setCurrent] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(1);
- const mergedPagination = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!pagination) {
- return null;
- }
- const convertPagination = typeof pagination === 'object' ? pagination : {};
- return parsePagination(convertPagination);
- }, [pagination]);
- const [pageSize, setPageSize] = (0,useMergedState["default"])(10, {
- value: mergedPagination === null || mergedPagination === void 0 ? void 0 : mergedPagination.pageSize
- });
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (mergedPagination) {
- const maxPageCount = Math.ceil(filteredRenderItems.length / pageSize);
- setCurrent(Math.min(current, maxPageCount));
- }
- }, [filteredRenderItems, mergedPagination, pageSize]);
- const onInternalClick = (item, e) => {
- onItemSelect(item.key, !selectedKeys.includes(item.key), e);
- };
- const onRemove = item => {
- onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove([item.key]);
- };
- const onPageChange = cur => {
- setCurrent(cur);
- };
- const onSizeChange = (cur, size) => {
- setCurrent(cur);
- setPageSize(size);
- };
- const memoizedItems = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const displayItems = mergedPagination ? filteredRenderItems.slice((current - 1) * pageSize, current * pageSize) : filteredRenderItems;
- return displayItems;
- }, [current, filteredRenderItems, mergedPagination, pageSize]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- items: memoizedItems
- }));
- const paginationNode = mergedPagination ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_pagination, {
- size: "small",
- disabled: globalDisabled,
- simple: mergedPagination.simple,
- pageSize: pageSize,
- showLessItems: mergedPagination.showLessItems,
- showSizeChanger: mergedPagination.showSizeChanger,
- className: `${prefixCls}-pagination`,
- total: filteredRenderItems.length,
- current: current,
- onChange: onPageChange,
- onShowSizeChange: onSizeChange
- })) : null;
- const cls = classnames_default()(`${prefixCls}-content`, {
- [`${prefixCls}-content-show-remove`]: showRemove
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("ul", {
- className: cls,
- onScroll: onScroll
- }, (memoizedItems || []).map(({
- renderedEl,
- renderedText,
- item
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(transfer_ListItem, {
- key: item.key,
- item: item,
- renderedText: renderedText,
- renderedEl: renderedEl,
- prefixCls: prefixCls,
- showRemove: showRemove,
- onClick: onInternalClick,
- onRemove: onRemove,
- checked: selectedKeys.includes(item.key),
- disabled: globalDisabled || item.disabled
- })))), paginationNode);
- };
- if (true) {
- TransferListBody.displayName = 'TransferListBody';
- }
- /* harmony default export */ var ListBody = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(TransferListBody));
- ;// ./components/transfer/search.tsx
- const search_Search = props => {
- const {
- placeholder = '',
- value,
- prefixCls,
- disabled,
- onChange,
- handleClear
- } = props;
- const handleChange = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(e => {
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
- if (e.target.value === '') {
- handleClear === null || handleClear === void 0 ? void 0 : handleClear();
- }
- }, [onChange]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_Input, {
- placeholder: placeholder,
- className: prefixCls,
- value: value,
- onChange: handleChange,
- disabled: disabled,
- allowClear: true,
- prefix: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_SearchOutlined, null)
- });
- };
- if (true) {
- search_Search.displayName = 'Search';
- }
- /* harmony default export */ var transfer_search = (search_Search);
- ;// ./components/transfer/list.tsx
- const list_defaultRender = () => null;
- function isRenderResultPlainObject(result) {
- return !!(result && ! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(result) && Object.prototype.toString.call(result) === '[object Object]');
- }
- function getEnabledItemKeys(items) {
- return items.filter(data => !data.disabled).map(data => data.key);
- }
- const isValidIcon = icon => icon !== undefined;
- const getShowSearchOption = showSearch => {
- if (showSearch && typeof showSearch === 'object') {
- return Object.assign(Object.assign({}, showSearch), {
- defaultValue: showSearch.defaultValue || ''
- });
- }
- return {
- defaultValue: '',
- placeholder: ''
- };
- };
- const TransferList = props => {
- const {
- prefixCls,
- dataSource = [],
- titleText = '',
- checkedKeys,
- disabled,
- showSearch = false,
- style,
- searchPlaceholder,
- notFoundContent,
- selectAll,
- deselectAll,
- selectCurrent,
- selectInvert,
- removeAll,
- removeCurrent,
- showSelectAll = true,
- showRemove,
- pagination,
- direction,
- itemsUnit,
- itemUnit,
- selectAllLabel,
- selectionsIcon,
- footer,
- renderList,
- onItemSelectAll,
- onItemRemove,
- handleFilter,
- handleClear,
- filterOption,
- render = list_defaultRender
- } = props;
- const searchOptions = getShowSearchOption(showSearch);
- const [filterValue, setFilterValue] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(searchOptions.defaultValue);
- const listBodyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({});
- const internalHandleFilter = e => {
- setFilterValue(e.target.value);
- handleFilter(e);
- };
- const internalHandleClear = () => {
- setFilterValue('');
- handleClear();
- };
- const matchFilter = (text, item) => {
- if (filterOption) {
- return filterOption(filterValue, item, direction);
- }
- return text.includes(filterValue);
- };
- const renderListBody = listProps => {
- let bodyContent = renderList ? renderList(Object.assign(Object.assign({}, listProps), {
- onItemSelect: (key, check) => listProps.onItemSelect(key, check)
- })) : null;
- const customize = !!bodyContent;
- if (!customize) {
- // @ts-ignore
- bodyContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ListBody, Object.assign({
- ref: listBodyRef
- }, listProps));
- }
- return {
- customize,
- bodyContent
- };
- };
- const renderItem = item => {
- const renderResult = render(item);
- const isRenderResultPlain = isRenderResultPlainObject(renderResult);
- return {
- item,
- renderedEl: isRenderResultPlain ? renderResult.label : renderResult,
- renderedText: isRenderResultPlain ? renderResult.value : renderResult
- };
- };
- const notFoundContentEle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => Array.isArray(notFoundContent) ? notFoundContent[direction === 'left' ? 0 : 1] : notFoundContent, [notFoundContent, direction]);
- const [filteredItems, filteredRenderItems] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const filterItems = [];
- const filterRenderItems = [];
- dataSource.forEach(item => {
- const renderedItem = renderItem(item);
- if (filterValue && !matchFilter(renderedItem.renderedText, item)) {
- return;
- }
- filterItems.push(item);
- filterRenderItems.push(renderedItem);
- });
- return [filterItems, filterRenderItems];
- }, [dataSource, filterValue]);
- const checkedActiveItems = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- return filteredItems.filter(item => checkedKeys.includes(item.key) && !item.disabled);
- }, [checkedKeys, filteredItems]);
- const checkStatus = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (checkedActiveItems.length === 0) {
- return 'none';
- }
- const checkedKeysMap = groupKeysMap(checkedKeys);
- if (filteredItems.every(item => checkedKeysMap.has(item.key) || !!item.disabled)) {
- return 'all';
- }
- return 'part';
- }, [checkedKeys, checkedActiveItems]);
- const listBody = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- const search = showSearch ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-body-search-wrapper`
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(transfer_search, {
- prefixCls: `${prefixCls}-search`,
- onChange: internalHandleFilter,
- handleClear: internalHandleClear,
- placeholder: searchOptions.placeholder || searchPlaceholder,
- value: filterValue,
- disabled: disabled
- }))) : null;
- const {
- customize,
- bodyContent
- } = renderListBody(Object.assign(Object.assign({}, (0,omit["default"])(props, OmitProps)), {
- filteredItems,
- filteredRenderItems,
- selectedKeys: checkedKeys
- }));
- let bodyNode;
- // We should wrap customize list body in a classNamed div to use flex layout.
- if (customize) {
- bodyNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-body-customize-wrapper`
- }, bodyContent);
- } else {
- bodyNode = filteredItems.length ? bodyContent : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-body-not-found`
- }, notFoundContentEle));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${prefixCls}-body`, {
- [`${prefixCls}-body-with-search`]: showSearch
- })
- }, search, bodyNode);
- }, [showSearch, prefixCls, searchPlaceholder, filterValue, disabled, checkedKeys, filteredItems, filteredRenderItems, notFoundContentEle]);
- const checkBox = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_checkbox, {
- disabled: dataSource.filter(d => !d.disabled).length === 0 || disabled,
- checked: checkStatus === 'all',
- indeterminate: checkStatus === 'part',
- className: `${prefixCls}-checkbox`,
- onChange: () => {
- // Only select enabled items
- onItemSelectAll === null || onItemSelectAll === void 0 ? void 0 : onItemSelectAll(filteredItems.filter(item => !item.disabled).map(({
- key
- }) => key), checkStatus !== 'all');
- }
- });
- const getSelectAllLabel = (selectedCount, totalCount) => {
- if (selectAllLabel) {
- return typeof selectAllLabel === 'function' ? selectAllLabel({
- selectedCount,
- totalCount
- }) : selectAllLabel;
- }
- const unit = totalCount > 1 ? itemsUnit : itemUnit;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, (selectedCount > 0 ? `${selectedCount}/` : '') + totalCount, " ", unit);
- };
- // Custom Layout
- const footerDom = footer && (footer.length < 2 ? footer(props) : footer(props, {
- direction
- }));
- const listCls = classnames_default()(prefixCls, {
- [`${prefixCls}-with-pagination`]: !!pagination,
- [`${prefixCls}-with-footer`]: !!footerDom
- });
- // ====================== Get filtered, checked item list ======================
- const listFooter = footerDom ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-footer`
- }, footerDom) : null;
- const checkAllCheckbox = !showRemove && !pagination && checkBox;
- let items;
- if (showRemove) {
- items = [/* Remove Current Page */
- pagination ? {
- key: 'removeCurrent',
- label: removeCurrent,
- onClick() {
- var _a;
- const pageKeys = getEnabledItemKeys((((_a = listBodyRef.current) === null || _a === void 0 ? void 0 : _a.items) || []).map(entity => entity.item));
- onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove(pageKeys);
- }
- } : null, /* Remove All */
- {
- key: 'removeAll',
- label: removeAll,
- onClick() {
- onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove(getEnabledItemKeys(filteredItems));
- }
- }].filter(Boolean);
- } else {
- items = [{
- key: 'selectAll',
- label: checkStatus === 'all' ? deselectAll : selectAll,
- onClick() {
- const keys = getEnabledItemKeys(filteredItems);
- onItemSelectAll === null || onItemSelectAll === void 0 ? void 0 : onItemSelectAll(keys, keys.length !== checkedKeys.length);
- }
- }, pagination ? {
- key: 'selectCurrent',
- label: selectCurrent,
- onClick() {
- var _a;
- const pageItems = ((_a = listBodyRef.current) === null || _a === void 0 ? void 0 : _a.items) || [];
- onItemSelectAll === null || onItemSelectAll === void 0 ? void 0 : onItemSelectAll(getEnabledItemKeys(pageItems.map(entity => entity.item)), true);
- }
- } : null, {
- key: 'selectInvert',
- label: selectInvert,
- onClick() {
- var _a;
- const availablePageItemKeys = getEnabledItemKeys((((_a = listBodyRef.current) === null || _a === void 0 ? void 0 : _a.items) || []).map(entity => entity.item));
- const checkedKeySet = new Set(checkedKeys);
- const newCheckedKeysSet = new Set(checkedKeySet);
- availablePageItemKeys.forEach(key => {
- if (checkedKeySet.has(key)) {
- newCheckedKeysSet.delete(key);
- } else {
- newCheckedKeysSet.add(key);
- }
- });
- onItemSelectAll === null || onItemSelectAll === void 0 ? void 0 : onItemSelectAll(Array.from(newCheckedKeysSet), 'replace');
- }
- }];
- }
- const dropdown = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_dropdown, {
- className: `${prefixCls}-header-dropdown`,
- menu: {
- items
- },
- disabled: disabled
- }, isValidIcon(selectionsIcon) ? selectionsIcon : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(icons_DownOutlined, null));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: listCls,
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: `${prefixCls}-header`
- }, showSelectAll ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, checkAllCheckbox, dropdown)) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: `${prefixCls}-header-selected`
- }, getSelectAllLabel(checkedActiveItems.length, filteredItems.length)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
- className: `${prefixCls}-header-title`
- }, titleText)), listBody, listFooter);
- };
- if (true) {
- TransferList.displayName = 'TransferList';
- }
- /* harmony default export */ var transfer_list = (TransferList);
- ;// ./components/transfer/operation.tsx
- const Operation = props => {
- const {
- disabled,
- moveToLeft,
- moveToRight,
- leftArrowText = '',
- rightArrowText = '',
- leftActive,
- rightActive,
- className,
- style,
- direction,
- oneWay
- } = props;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: className,
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: "primary",
- size: "small",
- disabled: disabled || !rightActive,
- onClick: moveToRight,
- icon: direction !== 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null)
- }, rightArrowText), !oneWay && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, {
- type: "primary",
- size: "small",
- disabled: disabled || !leftActive,
- onClick: moveToLeft,
- icon: direction !== 'rtl' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LeftOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(RightOutlined["default"], null)
- }, leftArrowText)));
- };
- if (true) {
- Operation.displayName = 'Operation';
- }
- /* harmony default export */ var operation = (Operation);
- // EXTERNAL MODULE: ./components/transfer/style/index.ts
- var transfer_style = __webpack_require__("./components/transfer/style/index.ts");
- ;// ./components/transfer/index.tsx
- const Transfer = props => {
- const {
- dataSource,
- targetKeys = [],
- selectedKeys,
- selectAllLabels = [],
- operations = [],
- style = {},
- listStyle = {},
- locale = {},
- titles,
- disabled,
- showSearch = false,
- operationStyle,
- showSelectAll,
- oneWay,
- pagination,
- status: customStatus,
- prefixCls: customizePrefixCls,
- className,
- rootClassName,
- selectionsIcon,
- filterOption,
- render,
- footer,
- children,
- rowKey,
- onScroll,
- onChange,
- onSearch,
- onSelectChange
- } = props;
- const {
- getPrefixCls,
- renderEmpty,
- direction: dir,
- transfer
- } = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('transfer', customizePrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,transfer_style["default"])(prefixCls);
- // Fill record with `key`
- const [mergedDataSource, leftDataSource, rightDataSource] = hooks_useData(dataSource, rowKey, targetKeys);
- // Get direction selected keys
- const [
- // Keys
- sourceSelectedKeys, targetSelectedKeys,
- // Setters
- setSourceSelectedKeys, setTargetSelectedKeys] = transfer_hooks_useSelection(leftDataSource, rightDataSource, selectedKeys);
- const [leftMultipleSelect, updateLeftPrevSelectedIndex] = useMultipleSelect(item => item.key);
- const [rightMultipleSelect, updateRightPrevSelectedIndex] = useMultipleSelect(item => item.key);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Transfer');
- true ? warning(!pagination || !children, 'usage', '`pagination` not support customize render list.') : 0;
- }
- const setStateKeys = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((direction, keys) => {
- if (direction === 'left') {
- const nextKeys = typeof keys === 'function' ? keys(sourceSelectedKeys || []) : keys;
- setSourceSelectedKeys(nextKeys);
- } else {
- const nextKeys = typeof keys === 'function' ? keys(targetSelectedKeys || []) : keys;
- setTargetSelectedKeys(nextKeys);
- }
- }, [sourceSelectedKeys, targetSelectedKeys]);
- const setPrevSelectedIndex = (direction, value) => {
- const isLeftDirection = direction === 'left';
- const updatePrevSelectedIndex = isLeftDirection ? updateLeftPrevSelectedIndex : updateRightPrevSelectedIndex;
- updatePrevSelectedIndex(value);
- };
- const handleSelectChange = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)((direction, holder) => {
- if (direction === 'left') {
- onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(holder, targetSelectedKeys);
- } else {
- onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(sourceSelectedKeys, holder);
- }
- }, [sourceSelectedKeys, targetSelectedKeys]);
- const getTitles = transferLocale => {
- var _a;
- return (_a = titles !== null && titles !== void 0 ? titles : transferLocale.titles) !== null && _a !== void 0 ? _a : [];
- };
- const handleLeftScroll = e => {
- onScroll === null || onScroll === void 0 ? void 0 : onScroll('left', e);
- };
- const handleRightScroll = e => {
- onScroll === null || onScroll === void 0 ? void 0 : onScroll('right', e);
- };
- const moveTo = direction => {
- const moveKeys = direction === 'right' ? sourceSelectedKeys : targetSelectedKeys;
- const dataSourceDisabledKeysMap = groupDisabledKeysMap(mergedDataSource);
- // filter the disabled options
- const newMoveKeys = moveKeys.filter(key => !dataSourceDisabledKeysMap.has(key));
- const newMoveKeysMap = groupKeysMap(newMoveKeys);
- // move items to target box
- const newTargetKeys = direction === 'right' ? newMoveKeys.concat(targetKeys) : targetKeys.filter(targetKey => !newMoveKeysMap.has(targetKey));
- // empty checked keys
- const oppositeDirection = direction === 'right' ? 'left' : 'right';
- setStateKeys(oppositeDirection, []);
- handleSelectChange(oppositeDirection, []);
- onChange === null || onChange === void 0 ? void 0 : onChange(newTargetKeys, direction, newMoveKeys);
- };
- const moveToLeft = () => {
- moveTo('left');
- setPrevSelectedIndex('left', null);
- };
- const moveToRight = () => {
- moveTo('right');
- setPrevSelectedIndex('right', null);
- };
- const onItemSelectAll = (direction, keys, checkAll) => {
- setStateKeys(direction, prevKeys => {
- let mergedCheckedKeys = [];
- if (checkAll === 'replace') {
- mergedCheckedKeys = keys;
- } else if (checkAll) {
- // Merge current keys with origin key
- mergedCheckedKeys = Array.from(new Set([].concat((0,toConsumableArray["default"])(prevKeys), (0,toConsumableArray["default"])(keys))));
- } else {
- const selectedKeysMap = groupKeysMap(keys);
- // Remove current keys from origin keys
- mergedCheckedKeys = prevKeys.filter(key => !selectedKeysMap.has(key));
- }
- handleSelectChange(direction, mergedCheckedKeys);
- return mergedCheckedKeys;
- });
- setPrevSelectedIndex(direction, null);
- };
- const onLeftItemSelectAll = (keys, checkAll) => {
- onItemSelectAll('left', keys, checkAll);
- };
- const onRightItemSelectAll = (keys, checkAll) => {
- onItemSelectAll('right', keys, checkAll);
- };
- const leftFilter = e => onSearch === null || onSearch === void 0 ? void 0 : onSearch('left', e.target.value);
- const rightFilter = e => onSearch === null || onSearch === void 0 ? void 0 : onSearch('right', e.target.value);
- const handleLeftClear = () => onSearch === null || onSearch === void 0 ? void 0 : onSearch('left', '');
- const handleRightClear = () => onSearch === null || onSearch === void 0 ? void 0 : onSearch('right', '');
- const handleSingleSelect = (direction, holder, selectedKey, checked, currentSelectedIndex) => {
- const isSelected = holder.has(selectedKey);
- if (isSelected) {
- holder.delete(selectedKey);
- setPrevSelectedIndex(direction, null);
- }
- if (checked) {
- holder.add(selectedKey);
- setPrevSelectedIndex(direction, currentSelectedIndex);
- }
- };
- const handleMultipleSelect = (direction, data, holder, currentSelectedIndex) => {
- const isLeftDirection = direction === 'left';
- const multipleSelect = isLeftDirection ? leftMultipleSelect : rightMultipleSelect;
- multipleSelect(currentSelectedIndex, data, holder);
- };
- const onItemSelect = (direction, selectedKey, checked, multiple) => {
- const isLeftDirection = direction === 'left';
- const holder = (0,toConsumableArray["default"])(isLeftDirection ? sourceSelectedKeys : targetSelectedKeys);
- const holderSet = new Set(holder);
- const data = (0,toConsumableArray["default"])(isLeftDirection ? leftDataSource : rightDataSource).filter(item => !(item === null || item === void 0 ? void 0 : item.disabled));
- const currentSelectedIndex = data.findIndex(item => item.key === selectedKey);
- // multiple select by hold down the shift key
- if (multiple && holder.length > 0) {
- handleMultipleSelect(direction, data, holderSet, currentSelectedIndex);
- } else {
- handleSingleSelect(direction, holderSet, selectedKey, checked, currentSelectedIndex);
- }
- const holderArr = Array.from(holderSet);
- handleSelectChange(direction, holderArr);
- if (!props.selectedKeys) {
- setStateKeys(direction, holderArr);
- }
- };
- const onLeftItemSelect = (selectedKey, checked, e) => {
- onItemSelect('left', selectedKey, checked, e === null || e === void 0 ? void 0 : e.shiftKey);
- };
- const onRightItemSelect = (selectedKey, checked, e) => {
- onItemSelect('right', selectedKey, checked, e === null || e === void 0 ? void 0 : e.shiftKey);
- };
- const onRightItemRemove = keys => {
- setStateKeys('right', []);
- onChange === null || onChange === void 0 ? void 0 : onChange(targetKeys.filter(key => !keys.includes(key)), 'left', (0,toConsumableArray["default"])(keys));
- };
- const handleListStyle = direction => {
- if (typeof listStyle === 'function') {
- return listStyle({
- direction
- });
- }
- return listStyle || {};
- };
- const formItemContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(FormItemInputContext);
- const {
- hasFeedback,
- status
- } = formItemContext;
- const getLocale = transferLocale => Object.assign(Object.assign(Object.assign({}, transferLocale), {
- notFoundContent: (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Transfer')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(defaultRenderEmpty, {
- componentName: "Transfer"
- })
- }), locale);
- const mergedStatus = getMergedStatus(status, customStatus);
- const mergedPagination = !children && pagination;
- const leftActive = rightDataSource.filter(d => targetSelectedKeys.includes(d.key) && !d.disabled).length > 0;
- const rightActive = leftDataSource.filter(d => sourceSelectedKeys.includes(d.key) && !d.disabled).length > 0;
- const cls = classnames_default()(prefixCls, {
- [`${prefixCls}-disabled`]: disabled,
- [`${prefixCls}-customize-list`]: !!children,
- [`${prefixCls}-rtl`]: dir === 'rtl'
- }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), transfer === null || transfer === void 0 ? void 0 : transfer.className, className, rootClassName, hashId, cssVarCls);
- const [contextLocale] = (0,useLocale["default"])('Transfer', en_US["default"].Transfer);
- const listLocale = getLocale(contextLocale);
- const [leftTitle, rightTitle] = getTitles(listLocale);
- const mergedSelectionsIcon = selectionsIcon !== null && selectionsIcon !== void 0 ? selectionsIcon : transfer === null || transfer === void 0 ? void 0 : transfer.selectionsIcon;
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: cls,
- style: Object.assign(Object.assign({}, transfer === null || transfer === void 0 ? void 0 : transfer.style), style)
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(transfer_list, Object.assign({
- prefixCls: `${prefixCls}-list`,
- titleText: leftTitle,
- dataSource: leftDataSource,
- filterOption: filterOption,
- style: handleListStyle('left'),
- checkedKeys: sourceSelectedKeys,
- handleFilter: leftFilter,
- handleClear: handleLeftClear,
- onItemSelect: onLeftItemSelect,
- onItemSelectAll: onLeftItemSelectAll,
- render: render,
- showSearch: showSearch,
- renderList: children,
- footer: footer,
- onScroll: handleLeftScroll,
- disabled: disabled,
- direction: dir === 'rtl' ? 'right' : 'left',
- showSelectAll: showSelectAll,
- selectAllLabel: selectAllLabels[0],
- pagination: mergedPagination,
- selectionsIcon: mergedSelectionsIcon
- }, listLocale)), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(operation, {
- className: `${prefixCls}-operation`,
- rightActive: rightActive,
- rightArrowText: operations[0],
- moveToRight: moveToRight,
- leftActive: leftActive,
- leftArrowText: operations[1],
- moveToLeft: moveToLeft,
- style: operationStyle,
- disabled: disabled,
- direction: dir,
- oneWay: oneWay
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(transfer_list, Object.assign({
- prefixCls: `${prefixCls}-list`,
- titleText: rightTitle,
- dataSource: rightDataSource,
- filterOption: filterOption,
- style: handleListStyle('right'),
- checkedKeys: targetSelectedKeys,
- handleFilter: rightFilter,
- handleClear: handleRightClear,
- onItemSelect: onRightItemSelect,
- onItemSelectAll: onRightItemSelectAll,
- onItemRemove: onRightItemRemove,
- render: render,
- showSearch: showSearch,
- renderList: children,
- footer: footer,
- onScroll: handleRightScroll,
- disabled: disabled,
- direction: dir === 'rtl' ? 'left' : 'right',
- showSelectAll: showSelectAll,
- selectAllLabel: selectAllLabels[1],
- showRemove: oneWay,
- pagination: mergedPagination,
- selectionsIcon: mergedSelectionsIcon
- }, listLocale))));
- };
- if (true) {
- Transfer.displayName = 'Transfer';
- }
- Transfer.List = transfer_list;
- Transfer.Search = transfer_search;
- Transfer.Operation = operation;
- /* harmony default export */ var transfer = (Transfer);
- ;// ./node_modules/rc-tree-select/es/hooks/useCache.js
- /**
- * This function will try to call requestIdleCallback if available to save performance.
- * No need `getLabel` here since already fetch on `rawLabeledValue`.
- */
- /* harmony default export */ var hooks_useCache = (function (values) {
- var cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef({
- valueLabels: new Map()
- });
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var valueLabels = cacheRef.current.valueLabels;
- var valueLabelsCache = new Map();
- var filledValues = values.map(function (item) {
- var value = item.value,
- label = item.label;
- var mergedLabel = label !== null && label !== void 0 ? label : valueLabels.get(value);
- // Save in cache
- valueLabelsCache.set(value, mergedLabel);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- label: mergedLabel
- });
- });
- cacheRef.current.valueLabels = valueLabelsCache;
- return [filledValues];
- }, [values]);
- });
- ;// ./node_modules/rc-tree-select/es/hooks/useCheckedKeys.js
- var useCheckedKeys = function useCheckedKeys(rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var extractValues = function extractValues(values) {
- return values.map(function (_ref) {
- var value = _ref.value;
- return value;
- });
- };
- var checkedKeys = extractValues(rawLabeledValues);
- var halfCheckedKeys = extractValues(rawHalfCheckedValues);
- var missingValues = checkedKeys.filter(function (key) {
- return !keyEntities[key];
- });
- var finalCheckedKeys = checkedKeys;
- var finalHalfCheckedKeys = halfCheckedKeys;
- if (treeConduction) {
- var conductResult = conductCheck(checkedKeys, true, keyEntities);
- finalCheckedKeys = conductResult.checkedKeys;
- finalHalfCheckedKeys = conductResult.halfCheckedKeys;
- }
- return [Array.from(new Set([].concat((0,toConsumableArray["default"])(missingValues), (0,toConsumableArray["default"])(finalCheckedKeys)))), finalHalfCheckedKeys];
- }, [rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities]);
- };
- /* harmony default export */ var hooks_useCheckedKeys = (useCheckedKeys);
- ;// ./node_modules/rc-tree-select/es/utils/valueUtil.js
- var utils_valueUtil_toArray = function toArray(value) {
- return Array.isArray(value) ? value : value !== undefined ? [value] : [];
- };
- var valueUtil_fillFieldNames = function fillFieldNames(fieldNames) {
- var _ref = fieldNames || {},
- label = _ref.label,
- value = _ref.value,
- children = _ref.children;
- return {
- _title: label ? [label] : ['title', 'label'],
- value: value || 'value',
- key: value || 'value',
- children: children || 'children'
- };
- };
- var valueUtil_isCheckDisabled = function isCheckDisabled(node) {
- return !node || node.disabled || node.disableCheckbox || node.checkable === false;
- };
- var getAllKeys = function getAllKeys(treeData, fieldNames) {
- var keys = [];
- var dig = function dig(list) {
- list.forEach(function (item) {
- var children = item[fieldNames.children];
- if (children) {
- keys.push(item[fieldNames.value]);
- dig(children);
- }
- });
- };
- dig(treeData);
- return keys;
- };
- var isNil = function isNil(val) {
- return val === null || val === undefined;
- };
- ;// ./node_modules/rc-tree-select/es/hooks/useDataEntities.js
- /* harmony default export */ var useDataEntities = (function (treeData, fieldNames) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var collection = convertDataToEntities(treeData, {
- fieldNames: fieldNames,
- initWrapper: function initWrapper(wrapper) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, wrapper), {}, {
- valueEntities: new Map()
- });
- },
- processEntity: function processEntity(entity, wrapper) {
- var val = entity.node[fieldNames.value];
- // Check if exist same value
- if (true) {
- var key = entity.node.key;
- (0,warning["default"])(!isNil(val), 'TreeNode `value` is invalidate: undefined');
- (0,warning["default"])(!wrapper.valueEntities.has(val), "Same `value` exist in the tree: ".concat(val));
- (0,warning["default"])(!key || String(key) === String(val), "`key` or `value` with TreeNode must be the same or you can remove one of them. key: ".concat(key, ", value: ").concat(val, "."));
- }
- wrapper.valueEntities.set(val, entity);
- }
- });
- return collection;
- }, [treeData, fieldNames]);
- });
- ;// ./node_modules/rc-tree-select/es/TreeNode.js
- /* istanbul ignore file */
- /** This is a placeholder, not real render in dom */
- var TreeNode_TreeNode = function TreeNode() {
- return null;
- };
- /* harmony default export */ var rc_tree_select_es_TreeNode = (TreeNode_TreeNode);
- ;// ./node_modules/rc-tree-select/es/utils/legacyUtil.js
- var es_utils_legacyUtil_excluded = ["children", "value"];
- function legacyUtil_convertChildrenToData(nodes) {
- return (0,toArray["default"])(nodes).map(function (node) {
- if (! /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(node) || !node.type) {
- return null;
- }
- var _ref = node,
- key = _ref.key,
- _ref$props = _ref.props,
- children = _ref$props.children,
- value = _ref$props.value,
- restProps = (0,objectWithoutProperties["default"])(_ref$props, es_utils_legacyUtil_excluded);
- var data = (0,objectSpread2["default"])({
- key: key,
- value: value
- }, restProps);
- var childData = legacyUtil_convertChildrenToData(children);
- if (childData.length) {
- data.children = childData;
- }
- return data;
- }).filter(function (data) {
- return data;
- });
- }
- function fillLegacyProps(dataNode) {
- if (!dataNode) {
- return dataNode;
- }
- var cloneNode = (0,objectSpread2["default"])({}, dataNode);
- if (!('props' in cloneNode)) {
- Object.defineProperty(cloneNode, 'props', {
- get: function get() {
- (0,warning["default"])(false, 'New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access.');
- return cloneNode;
- }
- });
- }
- return cloneNode;
- }
- function fillAdditionalInfo(extra, triggerValue, checkedValues, treeData, showPosition, fieldNames) {
- var triggerNode = null;
- var nodeList = null;
- function generateMap() {
- function dig(list) {
- var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
- var parentIncluded = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- return list.map(function (option, index) {
- var pos = "".concat(level, "-").concat(index);
- var value = option[fieldNames.value];
- var included = checkedValues.includes(value);
- var children = dig(option[fieldNames.children] || [], pos, included);
- var node = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_tree_select_es_TreeNode, option, children.map(function (child) {
- return child.node;
- }));
- // Link with trigger node
- if (triggerValue === value) {
- triggerNode = node;
- }
- if (included) {
- var checkedNode = {
- pos: pos,
- node: node,
- children: children
- };
- if (!parentIncluded) {
- nodeList.push(checkedNode);
- }
- return checkedNode;
- }
- return null;
- }).filter(function (node) {
- return node;
- });
- }
- if (!nodeList) {
- nodeList = [];
- dig(treeData);
- // Sort to keep the checked node length
- nodeList.sort(function (_ref2, _ref3) {
- var val1 = _ref2.node.props.value;
- var val2 = _ref3.node.props.value;
- var index1 = checkedValues.indexOf(val1);
- var index2 = checkedValues.indexOf(val2);
- return index1 - index2;
- });
- }
- }
- Object.defineProperty(extra, 'triggerNode', {
- get: function get() {
- (0,warning["default"])(false, '`triggerNode` is deprecated. Please consider decoupling data with node.');
- generateMap();
- return triggerNode;
- }
- });
- Object.defineProperty(extra, 'allCheckedNodes', {
- get: function get() {
- (0,warning["default"])(false, '`allCheckedNodes` is deprecated. Please consider decoupling data with node.');
- generateMap();
- if (showPosition) {
- return nodeList;
- }
- return nodeList.map(function (_ref4) {
- var node = _ref4.node;
- return node;
- });
- }
- });
- }
- ;// ./node_modules/rc-tree-select/es/hooks/useFilterTreeData.js
- var useFilterTreeData = function useFilterTreeData(treeData, searchValue, options) {
- var fieldNames = options.fieldNames,
- treeNodeFilterProp = options.treeNodeFilterProp,
- filterTreeNode = options.filterTreeNode;
- var fieldChildren = fieldNames.children;
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!searchValue || filterTreeNode === false) {
- return treeData;
- }
- var filterOptionFunc = typeof filterTreeNode === 'function' ? filterTreeNode : function (_, dataNode) {
- return String(dataNode[treeNodeFilterProp]).toUpperCase().includes(searchValue.toUpperCase());
- };
- var filterTreeNodes = function filterTreeNodes(nodes) {
- var keepAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- return nodes.reduce(function (filtered, node) {
- var children = node[fieldChildren];
- var isMatch = keepAll || filterOptionFunc(searchValue, fillLegacyProps(node));
- var filteredChildren = filterTreeNodes(children || [], isMatch);
- if (isMatch || filteredChildren.length) {
- filtered.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, node), {}, (0,defineProperty["default"])({
- isLeaf: undefined
- }, fieldChildren, filteredChildren)));
- }
- return filtered;
- }, []);
- };
- return filterTreeNodes(treeData);
- }, [treeData, searchValue, fieldChildren, treeNodeFilterProp, filterTreeNode]);
- };
- /* harmony default export */ var hooks_useFilterTreeData = (useFilterTreeData);
- ;// ./node_modules/rc-tree-select/es/hooks/useRefFunc.js
- /**
- * Same as `React.useCallback` but always return a memoized function
- * but redirect to real function.
- */
- function useRefFunc_useRefFunc(callback) {
- var funcRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- funcRef.current = callback;
- var cacheFn = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function () {
- return funcRef.current.apply(funcRef, arguments);
- }, []);
- return cacheFn;
- }
- ;// ./node_modules/rc-tree-select/es/hooks/useTreeData.js
- function buildTreeStructure(nodes, config) {
- var id = config.id,
- pId = config.pId,
- rootPId = config.rootPId;
- var nodeMap = new Map();
- var rootNodes = [];
- nodes.forEach(function (node) {
- var nodeKey = node[id];
- var clonedNode = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, node), {}, {
- key: node.key || nodeKey
- });
- nodeMap.set(nodeKey, clonedNode);
- });
- nodeMap.forEach(function (node) {
- var parentKey = node[pId];
- var parent = nodeMap.get(parentKey);
- if (parent) {
- parent.children = parent.children || [];
- parent.children.push(node);
- } else if (parentKey === rootPId || rootPId === null) {
- rootNodes.push(node);
- }
- });
- return rootNodes;
- }
- /**
- * 将 `treeData` 或 `children` 转换为格式化的 `treeData`。
- * 如果 `treeData` 或 `children` 没有变化,则不会重新计算。
- */
- function useTreeData(treeData, children, simpleMode) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (treeData) {
- if (simpleMode) {
- var config = (0,objectSpread2["default"])({
- id: 'id',
- pId: 'pId',
- rootPId: null
- }, (0,esm_typeof["default"])(simpleMode) === 'object' ? simpleMode : {});
- return buildTreeStructure(treeData, config);
- }
- return treeData;
- }
- return legacyUtil_convertChildrenToData(children);
- }, [children, simpleMode, treeData]);
- }
- ;// ./node_modules/rc-tree-select/es/LegacyContext.js
- var LegacySelectContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var LegacyContext = (LegacySelectContext);
- ;// ./node_modules/rc-tree-select/es/TreeSelectContext.js
- var TreeSelectContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext(null);
- /* harmony default export */ var es_TreeSelectContext = (TreeSelectContext);
- ;// ./node_modules/rc-tree-select/es/OptionList.js
- var OptionList_HIDDEN_STYLE = {
- width: 0,
- height: 0,
- display: 'flex',
- overflow: 'hidden',
- opacity: 0,
- border: 0,
- padding: 0,
- margin: 0
- };
- var OptionList_OptionList = function OptionList(_, ref) {
- var _useBaseProps = useBaseProps(),
- prefixCls = _useBaseProps.prefixCls,
- multiple = _useBaseProps.multiple,
- searchValue = _useBaseProps.searchValue,
- toggleOpen = _useBaseProps.toggleOpen,
- open = _useBaseProps.open,
- notFoundContent = _useBaseProps.notFoundContent;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_TreeSelectContext),
- virtual = _React$useContext.virtual,
- listHeight = _React$useContext.listHeight,
- listItemHeight = _React$useContext.listItemHeight,
- listItemScrollOffset = _React$useContext.listItemScrollOffset,
- treeData = _React$useContext.treeData,
- fieldNames = _React$useContext.fieldNames,
- onSelect = _React$useContext.onSelect,
- dropdownMatchSelectWidth = _React$useContext.dropdownMatchSelectWidth,
- treeExpandAction = _React$useContext.treeExpandAction,
- treeTitleRender = _React$useContext.treeTitleRender,
- onPopupScroll = _React$useContext.onPopupScroll,
- leftMaxCount = _React$useContext.leftMaxCount,
- leafCountOnly = _React$useContext.leafCountOnly,
- valueEntities = _React$useContext.valueEntities;
- var _React$useContext2 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(LegacyContext),
- checkable = _React$useContext2.checkable,
- checkedKeys = _React$useContext2.checkedKeys,
- halfCheckedKeys = _React$useContext2.halfCheckedKeys,
- treeExpandedKeys = _React$useContext2.treeExpandedKeys,
- treeDefaultExpandAll = _React$useContext2.treeDefaultExpandAll,
- treeDefaultExpandedKeys = _React$useContext2.treeDefaultExpandedKeys,
- onTreeExpand = _React$useContext2.onTreeExpand,
- treeIcon = _React$useContext2.treeIcon,
- showTreeIcon = _React$useContext2.showTreeIcon,
- switcherIcon = _React$useContext2.switcherIcon,
- treeLine = _React$useContext2.treeLine,
- treeNodeFilterProp = _React$useContext2.treeNodeFilterProp,
- loadData = _React$useContext2.loadData,
- treeLoadedKeys = _React$useContext2.treeLoadedKeys,
- treeMotion = _React$useContext2.treeMotion,
- onTreeLoad = _React$useContext2.onTreeLoad,
- keyEntities = _React$useContext2.keyEntities;
- var treeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var memoTreeData = (0,useMemo["default"])(function () {
- return treeData;
- },
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [open, treeData], function (prev, next) {
- return next[0] && prev[1] !== next[1];
- });
- // ========================== Values ==========================
- var mergedCheckedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!checkable) {
- return null;
- }
- return {
- checked: checkedKeys,
- halfChecked: halfCheckedKeys
- };
- }, [checkable, checkedKeys, halfCheckedKeys]);
- // ========================== Scroll ==========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // Single mode should scroll to current key
- if (open && !multiple && checkedKeys.length) {
- var _treeRef$current;
- (_treeRef$current = treeRef.current) === null || _treeRef$current === void 0 || _treeRef$current.scrollTo({
- key: checkedKeys[0]
- });
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [open]);
- // ========================== Events ==========================
- var onListMouseDown = function onListMouseDown(event) {
- event.preventDefault();
- };
- var onInternalSelect = function onInternalSelect(__, info) {
- var node = info.node;
- if (checkable && valueUtil_isCheckDisabled(node)) {
- return;
- }
- onSelect(node.key, {
- selected: !checkedKeys.includes(node.key)
- });
- if (!multiple) {
- toggleOpen(false);
- }
- };
- // =========================== Keys ===========================
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(treeDefaultExpandedKeys),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- expandedKeys = _React$useState2[0],
- setExpandedKeys = _React$useState2[1];
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState4 = (0,slicedToArray["default"])(_React$useState3, 2),
- searchExpandedKeys = _React$useState4[0],
- setSearchExpandedKeys = _React$useState4[1];
- var mergedExpandedKeys = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (treeExpandedKeys) {
- return (0,toConsumableArray["default"])(treeExpandedKeys);
- }
- return searchValue ? searchExpandedKeys : expandedKeys;
- }, [expandedKeys, searchExpandedKeys, treeExpandedKeys, searchValue]);
- var onInternalExpand = function onInternalExpand(keys) {
- setExpandedKeys(keys);
- setSearchExpandedKeys(keys);
- if (onTreeExpand) {
- onTreeExpand(keys);
- }
- };
- // ========================== Search ==========================
- var lowerSearchValue = String(searchValue).toLowerCase();
- var filterTreeNode = function filterTreeNode(treeNode) {
- if (!lowerSearchValue) {
- return false;
- }
- return String(treeNode[treeNodeFilterProp]).toLowerCase().includes(lowerSearchValue);
- };
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (searchValue) {
- setSearchExpandedKeys(getAllKeys(treeData, fieldNames));
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [searchValue]);
- // ========================= Disabled =========================
- // Cache disabled states in React state to ensure re-render when cache updates
- var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(function () {
- return new Map();
- }),
- _React$useState6 = (0,slicedToArray["default"])(_React$useState5, 2),
- disabledCache = _React$useState6[0],
- setDisabledCache = _React$useState6[1];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (leftMaxCount) {
- setDisabledCache(new Map());
- }
- }, [leftMaxCount]);
- function getDisabledWithCache(node) {
- var value = node[fieldNames.value];
- if (!disabledCache.has(value)) {
- var entity = valueEntities.get(value);
- var isLeaf = (entity.children || []).length === 0;
- if (!isLeaf) {
- var checkableChildren = entity.children.filter(function (childTreeNode) {
- return !childTreeNode.node.disabled && !childTreeNode.node.disableCheckbox && !checkedKeys.includes(childTreeNode.node[fieldNames.value]);
- });
- var checkableChildrenCount = checkableChildren.length;
- disabledCache.set(value, checkableChildrenCount > leftMaxCount);
- } else {
- disabledCache.set(value, false);
- }
- }
- return disabledCache.get(value);
- }
- var nodeDisabled = (0,rc_util_es.useEvent)(function (node) {
- var nodeValue = node[fieldNames.value];
- if (checkedKeys.includes(nodeValue)) {
- return false;
- }
- if (leftMaxCount === null) {
- return false;
- }
- if (leftMaxCount <= 0) {
- return true;
- }
- // This is a low performance calculation
- if (leafCountOnly && leftMaxCount) {
- return getDisabledWithCache(node);
- }
- return false;
- });
- // ========================== Get First Selectable Node ==========================
- var getFirstMatchingNode = function getFirstMatchingNode(nodes) {
- var _iterator = _createForOfIteratorHelper(nodes),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var node = _step.value;
- if (node.disabled || node.selectable === false) {
- continue;
- }
- if (searchValue) {
- if (filterTreeNode(node)) {
- return node;
- }
- } else {
- return node;
- }
- if (node[fieldNames.children]) {
- var matchInChildren = getFirstMatchingNode(node[fieldNames.children]);
- if (matchInChildren) {
- return matchInChildren;
- }
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return null;
- };
- // ========================== Active ==========================
- var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null),
- _React$useState8 = (0,slicedToArray["default"])(_React$useState7, 2),
- activeKey = _React$useState8[0],
- setActiveKey = _React$useState8[1];
- var activeEntity = keyEntities[activeKey];
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!open) {
- return;
- }
- var nextActiveKey = null;
- var getFirstNode = function getFirstNode() {
- var firstNode = getFirstMatchingNode(memoTreeData);
- return firstNode ? firstNode[fieldNames.value] : null;
- };
- // single mode active first checked node
- if (!multiple && checkedKeys.length && !searchValue) {
- nextActiveKey = checkedKeys[0];
- } else {
- nextActiveKey = getFirstNode();
- }
- setActiveKey(nextActiveKey);
- }, [open, searchValue]);
- // ========================= Keyboard =========================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, function () {
- var _treeRef$current2;
- return {
- scrollTo: (_treeRef$current2 = treeRef.current) === null || _treeRef$current2 === void 0 ? void 0 : _treeRef$current2.scrollTo,
- onKeyDown: function onKeyDown(event) {
- var _treeRef$current3;
- var which = event.which;
- switch (which) {
- // >>> Arrow keys
- case KeyCode["default"].UP:
- case KeyCode["default"].DOWN:
- case KeyCode["default"].LEFT:
- case KeyCode["default"].RIGHT:
- (_treeRef$current3 = treeRef.current) === null || _treeRef$current3 === void 0 || _treeRef$current3.onKeyDown(event);
- break;
- // >>> Select item
- case KeyCode["default"].ENTER:
- {
- if (activeEntity) {
- var isNodeDisabled = nodeDisabled(activeEntity.node);
- var _ref = (activeEntity === null || activeEntity === void 0 ? void 0 : activeEntity.node) || {},
- selectable = _ref.selectable,
- value = _ref.value,
- disabled = _ref.disabled;
- if (selectable !== false && !disabled && !isNodeDisabled) {
- onInternalSelect(null, {
- node: {
- key: activeKey
- },
- selected: !checkedKeys.includes(value)
- });
- }
- }
- break;
- }
- // >>> Close
- case KeyCode["default"].ESC:
- {
- toggleOpen(false);
- }
- }
- },
- onKeyUp: function onKeyUp() {}
- };
- });
- var hasLoadDataFn = (0,useMemo["default"])(function () {
- return searchValue ? false : true;
- }, [searchValue, treeExpandedKeys || expandedKeys], function (_ref2, _ref3) {
- var _ref4 = (0,slicedToArray["default"])(_ref2, 1),
- preSearchValue = _ref4[0];
- var _ref5 = (0,slicedToArray["default"])(_ref3, 2),
- nextSearchValue = _ref5[0],
- nextExcludeSearchExpandedKeys = _ref5[1];
- return preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys);
- });
- var syncLoadData = hasLoadDataFn ? loadData : null;
- // ========================== Render ==========================
- if (memoTreeData.length === 0) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- role: "listbox",
- className: "".concat(prefixCls, "-empty"),
- onMouseDown: onListMouseDown
- }, notFoundContent);
- }
- var treeProps = {
- fieldNames: fieldNames
- };
- if (treeLoadedKeys) {
- treeProps.loadedKeys = treeLoadedKeys;
- }
- if (mergedExpandedKeys) {
- treeProps.expandedKeys = mergedExpandedKeys;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- onMouseDown: onListMouseDown
- }, activeEntity && open && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: OptionList_HIDDEN_STYLE,
- "aria-live": "assertive"
- }, activeEntity.node.value), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(contextTypes_UnstableContext.Provider, {
- value: {
- nodeDisabled: nodeDisabled
- }
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_tree_es, (0,esm_extends["default"])({
- ref: treeRef,
- focusable: false,
- prefixCls: "".concat(prefixCls, "-tree"),
- treeData: memoTreeData,
- height: listHeight,
- itemHeight: listItemHeight,
- itemScrollOffset: listItemScrollOffset,
- virtual: virtual !== false && dropdownMatchSelectWidth !== false,
- multiple: multiple,
- icon: treeIcon,
- showIcon: showTreeIcon,
- switcherIcon: switcherIcon,
- showLine: treeLine,
- loadData: syncLoadData,
- motion: treeMotion,
- activeKey: activeKey
- // We handle keys by out instead tree self
- ,
- checkable: checkable,
- checkStrictly: true,
- checkedKeys: mergedCheckedKeys,
- selectedKeys: !checkable ? checkedKeys : [],
- defaultExpandAll: treeDefaultExpandAll,
- titleRender: treeTitleRender
- }, treeProps, {
- // Proxy event out
- onActiveChange: setActiveKey,
- onSelect: onInternalSelect,
- onCheck: onInternalSelect,
- onExpand: onInternalExpand,
- onLoad: onTreeLoad,
- filterTreeNode: filterTreeNode,
- expandAction: treeExpandAction,
- onScroll: onPopupScroll
- }))));
- };
- var es_OptionList_RefOptionList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(OptionList_OptionList);
- if (true) {
- es_OptionList_RefOptionList.displayName = 'OptionList';
- }
- /* harmony default export */ var rc_tree_select_es_OptionList = (es_OptionList_RefOptionList);
- ;// ./node_modules/rc-tree-select/es/utils/strategyUtil.js
- var SHOW_ALL = 'SHOW_ALL';
- var strategyUtil_SHOW_PARENT = 'SHOW_PARENT';
- var strategyUtil_SHOW_CHILD = 'SHOW_CHILD';
- function strategyUtil_formatStrategyValues(values, strategy, keyEntities, fieldNames) {
- var valueSet = new Set(values);
- if (strategy === strategyUtil_SHOW_CHILD) {
- return values.filter(function (key) {
- var entity = keyEntities[key];
- return !entity || !entity.children || !entity.children.some(function (_ref) {
- var node = _ref.node;
- return valueSet.has(node[fieldNames.value]);
- }) || !entity.children.every(function (_ref2) {
- var node = _ref2.node;
- return valueUtil_isCheckDisabled(node) || valueSet.has(node[fieldNames.value]);
- });
- });
- }
- if (strategy === strategyUtil_SHOW_PARENT) {
- return values.filter(function (key) {
- var entity = keyEntities[key];
- var parent = entity ? entity.parent : null;
- return !parent || valueUtil_isCheckDisabled(parent.node) || !valueSet.has(parent.key);
- });
- }
- return values;
- }
- ;// ./node_modules/rc-tree-select/es/utils/warningPropsUtil.js
- function utils_warningPropsUtil_warningProps(props) {
- var searchPlaceholder = props.searchPlaceholder,
- treeCheckStrictly = props.treeCheckStrictly,
- treeCheckable = props.treeCheckable,
- labelInValue = props.labelInValue,
- value = props.value,
- multiple = props.multiple,
- showCheckedStrategy = props.showCheckedStrategy,
- maxCount = props.maxCount;
- (0,warning["default"])(!searchPlaceholder, '`searchPlaceholder` has been removed.');
- if (treeCheckStrictly && labelInValue === false) {
- (0,warning["default"])(false, '`treeCheckStrictly` will force set `labelInValue` to `true`.');
- }
- if (labelInValue || treeCheckStrictly) {
- (0,warning["default"])(utils_valueUtil_toArray(value).every(function (val) {
- return val && (0,esm_typeof["default"])(val) === 'object' && 'value' in val;
- }), 'Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead.');
- }
- if (treeCheckStrictly || multiple || treeCheckable) {
- (0,warning["default"])(!value || Array.isArray(value), '`value` should be an array when `TreeSelect` is checkable or multiple.');
- } else {
- (0,warning["default"])(!Array.isArray(value), '`value` should not be array when `TreeSelect` is single mode.');
- }
- if (maxCount && (showCheckedStrategy === 'SHOW_ALL' && !treeCheckStrictly || showCheckedStrategy === 'SHOW_PARENT')) {
- (0,warning["default"])(false, '`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.');
- }
- }
- /* harmony default export */ var es_utils_warningPropsUtil = (utils_warningPropsUtil_warningProps);
- ;// ./node_modules/rc-tree-select/es/TreeSelect.js
- var TreeSelect_excluded = ["id", "prefixCls", "value", "defaultValue", "onChange", "onSelect", "onDeselect", "searchValue", "inputValue", "onSearch", "autoClearSearchValue", "filterTreeNode", "treeNodeFilterProp", "showCheckedStrategy", "treeNodeLabelProp", "multiple", "treeCheckable", "treeCheckStrictly", "labelInValue", "maxCount", "fieldNames", "treeDataSimpleMode", "treeData", "children", "loadData", "treeLoadedKeys", "onTreeLoad", "treeDefaultExpandAll", "treeExpandedKeys", "treeDefaultExpandedKeys", "onTreeExpand", "treeExpandAction", "virtual", "listHeight", "listItemHeight", "listItemScrollOffset", "onDropdownVisibleChange", "dropdownMatchSelectWidth", "treeLine", "treeIcon", "showTreeIcon", "switcherIcon", "treeMotion", "treeTitleRender", "onPopupScroll"];
- function TreeSelect_isRawValue(value) {
- return !value || (0,esm_typeof["default"])(value) !== 'object';
- }
- var TreeSelect = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var id = props.id,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? 'rc-tree-select' : _props$prefixCls,
- value = props.value,
- defaultValue = props.defaultValue,
- onChange = props.onChange,
- onSelect = props.onSelect,
- onDeselect = props.onDeselect,
- searchValue = props.searchValue,
- inputValue = props.inputValue,
- onSearch = props.onSearch,
- _props$autoClearSearc = props.autoClearSearchValue,
- autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
- filterTreeNode = props.filterTreeNode,
- _props$treeNodeFilter = props.treeNodeFilterProp,
- treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'value' : _props$treeNodeFilter,
- showCheckedStrategy = props.showCheckedStrategy,
- treeNodeLabelProp = props.treeNodeLabelProp,
- multiple = props.multiple,
- treeCheckable = props.treeCheckable,
- treeCheckStrictly = props.treeCheckStrictly,
- labelInValue = props.labelInValue,
- maxCount = props.maxCount,
- fieldNames = props.fieldNames,
- treeDataSimpleMode = props.treeDataSimpleMode,
- treeData = props.treeData,
- children = props.children,
- loadData = props.loadData,
- treeLoadedKeys = props.treeLoadedKeys,
- onTreeLoad = props.onTreeLoad,
- treeDefaultExpandAll = props.treeDefaultExpandAll,
- treeExpandedKeys = props.treeExpandedKeys,
- treeDefaultExpandedKeys = props.treeDefaultExpandedKeys,
- onTreeExpand = props.onTreeExpand,
- treeExpandAction = props.treeExpandAction,
- virtual = props.virtual,
- _props$listHeight = props.listHeight,
- listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,
- _props$listItemHeight = props.listItemHeight,
- listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,
- _props$listItemScroll = props.listItemScrollOffset,
- listItemScrollOffset = _props$listItemScroll === void 0 ? 0 : _props$listItemScroll,
- onDropdownVisibleChange = props.onDropdownVisibleChange,
- _props$dropdownMatchS = props.dropdownMatchSelectWidth,
- dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,
- treeLine = props.treeLine,
- treeIcon = props.treeIcon,
- showTreeIcon = props.showTreeIcon,
- switcherIcon = props.switcherIcon,
- treeMotion = props.treeMotion,
- treeTitleRender = props.treeTitleRender,
- onPopupScroll = props.onPopupScroll,
- restProps = (0,objectWithoutProperties["default"])(props, TreeSelect_excluded);
- var mergedId = useId_useId(id);
- var treeConduction = treeCheckable && !treeCheckStrictly;
- var mergedCheckable = treeCheckable || treeCheckStrictly;
- var mergedLabelInValue = treeCheckStrictly || labelInValue;
- var mergedMultiple = mergedCheckable || multiple;
- var _useMergedState = (0,useMergedState["default"])(defaultValue, {
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- internalValue = _useMergedState2[0],
- setInternalValue = _useMergedState2[1];
- // `multiple` && `!treeCheckable` should be show all
- var mergedShowCheckedStrategy = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (!treeCheckable) {
- return SHOW_ALL;
- }
- return showCheckedStrategy || strategyUtil_SHOW_CHILD;
- }, [showCheckedStrategy, treeCheckable]);
- // ========================== Warning ===========================
- if (true) {
- es_utils_warningPropsUtil(props);
- }
- // ========================= FieldNames =========================
- var mergedFieldNames = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return valueUtil_fillFieldNames(fieldNames);
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [JSON.stringify(fieldNames)]
- /* eslint-enable react-hooks/exhaustive-deps */);
- // =========================== Search ===========================
- var _useMergedState3 = (0,useMergedState["default"])('', {
- value: searchValue !== undefined ? searchValue : inputValue,
- postState: function postState(search) {
- return search || '';
- }
- }),
- _useMergedState4 = (0,slicedToArray["default"])(_useMergedState3, 2),
- mergedSearchValue = _useMergedState4[0],
- setSearchValue = _useMergedState4[1];
- var onInternalSearch = function onInternalSearch(searchText) {
- setSearchValue(searchText);
- onSearch === null || onSearch === void 0 || onSearch(searchText);
- };
- // ============================ Data ============================
- // `useTreeData` only do convert of `children` or `simpleMode`.
- // Else will return origin `treeData` for perf consideration.
- // Do not do anything to loop the data.
- var mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);
- var _useDataEntities = useDataEntities(mergedTreeData, mergedFieldNames),
- keyEntities = _useDataEntities.keyEntities,
- valueEntities = _useDataEntities.valueEntities;
- /** Get `missingRawValues` which not exist in the tree yet */
- var splitRawValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (newRawValues) {
- var missingRawValues = [];
- var existRawValues = [];
- // Keep missing value in the cache
- newRawValues.forEach(function (val) {
- if (valueEntities.has(val)) {
- existRawValues.push(val);
- } else {
- missingRawValues.push(val);
- }
- });
- return {
- missingRawValues: missingRawValues,
- existRawValues: existRawValues
- };
- }, [valueEntities]);
- // Filtered Tree
- var filteredTreeData = hooks_useFilterTreeData(mergedTreeData, mergedSearchValue, {
- fieldNames: mergedFieldNames,
- treeNodeFilterProp: treeNodeFilterProp,
- filterTreeNode: filterTreeNode
- });
- // =========================== Label ============================
- var getLabel = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (item) {
- if (item) {
- if (treeNodeLabelProp) {
- return item[treeNodeLabelProp];
- }
- // Loop from fieldNames
- var titleList = mergedFieldNames._title;
- for (var i = 0; i < titleList.length; i += 1) {
- var title = item[titleList[i]];
- if (title !== undefined) {
- return title;
- }
- }
- }
- }, [mergedFieldNames, treeNodeLabelProp]);
- // ========================= Wrap Value =========================
- var toLabeledValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (draftValues) {
- var values = utils_valueUtil_toArray(draftValues);
- return values.map(function (val) {
- if (TreeSelect_isRawValue(val)) {
- return {
- value: val
- };
- }
- return val;
- });
- }, []);
- var convert2LabelValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (draftValues) {
- var values = toLabeledValues(draftValues);
- return values.map(function (item) {
- var rawLabel = item.label;
- var rawValue = item.value,
- rawHalfChecked = item.halfChecked;
- var rawDisabled;
- var entity = valueEntities.get(rawValue);
- // Fill missing label & status
- if (entity) {
- var _rawLabel;
- rawLabel = treeTitleRender ? treeTitleRender(entity.node) : (_rawLabel = rawLabel) !== null && _rawLabel !== void 0 ? _rawLabel : getLabel(entity.node);
- rawDisabled = entity.node.disabled;
- } else if (rawLabel === undefined) {
- // We try to find in current `labelInValue` value
- var labelInValueItem = toLabeledValues(internalValue).find(function (labeledItem) {
- return labeledItem.value === rawValue;
- });
- rawLabel = labelInValueItem.label;
- }
- return {
- label: rawLabel,
- value: rawValue,
- halfChecked: rawHalfChecked,
- disabled: rawDisabled
- };
- });
- }, [valueEntities, getLabel, toLabeledValues, internalValue]);
- // =========================== Values ===========================
- var rawMixedLabeledValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return toLabeledValues(internalValue === null ? [] : internalValue);
- }, [toLabeledValues, internalValue]);
- // Split value into full check and half check
- var _React$useMemo = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var fullCheckValues = [];
- var halfCheckValues = [];
- rawMixedLabeledValues.forEach(function (item) {
- if (item.halfChecked) {
- halfCheckValues.push(item);
- } else {
- fullCheckValues.push(item);
- }
- });
- return [fullCheckValues, halfCheckValues];
- }, [rawMixedLabeledValues]),
- _React$useMemo2 = (0,slicedToArray["default"])(_React$useMemo, 2),
- rawLabeledValues = _React$useMemo2[0],
- rawHalfLabeledValues = _React$useMemo2[1];
- // const [mergedValues] = useCache(rawLabeledValues);
- var rawValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return rawLabeledValues.map(function (item) {
- return item.value;
- });
- }, [rawLabeledValues]);
- // Convert value to key. Will fill missed keys for conduct check.
- var _useCheckedKeys = hooks_useCheckedKeys(rawLabeledValues, rawHalfLabeledValues, treeConduction, keyEntities),
- _useCheckedKeys2 = (0,slicedToArray["default"])(_useCheckedKeys, 2),
- rawCheckedValues = _useCheckedKeys2[0],
- rawHalfCheckedValues = _useCheckedKeys2[1];
- // Convert rawCheckedKeys to check strategy related values
- var displayValues = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- // Collect keys which need to show
- var displayKeys = strategyUtil_formatStrategyValues(rawCheckedValues, mergedShowCheckedStrategy, keyEntities, mergedFieldNames);
- // Convert to value and filled with label
- var values = displayKeys.map(function (key) {
- var _keyEntities$key$node, _keyEntities$key;
- return (_keyEntities$key$node = (_keyEntities$key = keyEntities[key]) === null || _keyEntities$key === void 0 || (_keyEntities$key = _keyEntities$key.node) === null || _keyEntities$key === void 0 ? void 0 : _keyEntities$key[mergedFieldNames.value]) !== null && _keyEntities$key$node !== void 0 ? _keyEntities$key$node : key;
- });
- // Back fill with origin label
- var labeledValues = values.map(function (val) {
- var targetItem = rawLabeledValues.find(function (item) {
- return item.value === val;
- });
- var label = labelInValue ? targetItem === null || targetItem === void 0 ? void 0 : targetItem.label : treeTitleRender === null || treeTitleRender === void 0 ? void 0 : treeTitleRender(targetItem);
- return {
- value: val,
- label: label
- };
- });
- var rawDisplayValues = convert2LabelValues(labeledValues);
- var firstVal = rawDisplayValues[0];
- if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) {
- return [];
- }
- return rawDisplayValues.map(function (item) {
- var _item$label;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, item), {}, {
- label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value
- });
- });
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [mergedFieldNames, mergedMultiple, rawCheckedValues, rawLabeledValues, convert2LabelValues, mergedShowCheckedStrategy, keyEntities]);
- var _useCache = hooks_useCache(displayValues),
- _useCache2 = (0,slicedToArray["default"])(_useCache, 1),
- cachedDisplayValues = _useCache2[0];
- // ========================== MaxCount ==========================
- var mergedMaxCount = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- if (mergedMultiple && (mergedShowCheckedStrategy === 'SHOW_CHILD' || treeCheckStrictly || !treeCheckable)) {
- return maxCount;
- }
- return null;
- }, [maxCount, mergedMultiple, treeCheckStrictly, mergedShowCheckedStrategy, treeCheckable]);
- // =========================== Change ===========================
- var triggerChange = useRefFunc_useRefFunc(function (newRawValues, extra, source) {
- var formattedKeyList = strategyUtil_formatStrategyValues(newRawValues, mergedShowCheckedStrategy, keyEntities, mergedFieldNames);
- // Not allow pass with `maxCount`
- if (mergedMaxCount && formattedKeyList.length > mergedMaxCount) {
- return;
- }
- var labeledValues = convert2LabelValues(newRawValues);
- setInternalValue(labeledValues);
- // Clean up if needed
- if (autoClearSearchValue) {
- setSearchValue('');
- }
- // Generate rest parameters is costly, so only do it when necessary
- if (onChange) {
- var eventValues = newRawValues;
- if (treeConduction) {
- eventValues = formattedKeyList.map(function (key) {
- var entity = valueEntities.get(key);
- return entity ? entity.node[mergedFieldNames.value] : key;
- });
- }
- var _ref = extra || {
- triggerValue: undefined,
- selected: undefined
- },
- triggerValue = _ref.triggerValue,
- selected = _ref.selected;
- var returnRawValues = eventValues;
- // We need fill half check back
- if (treeCheckStrictly) {
- var halfValues = rawHalfLabeledValues.filter(function (item) {
- return !eventValues.includes(item.value);
- });
- returnRawValues = [].concat((0,toConsumableArray["default"])(returnRawValues), (0,toConsumableArray["default"])(halfValues));
- }
- var returnLabeledValues = convert2LabelValues(returnRawValues);
- var additionalInfo = {
- // [Legacy] Always return as array contains label & value
- preValue: rawLabeledValues,
- triggerValue: triggerValue
- };
- // [Legacy] Fill legacy data if user query.
- // This is expansive that we only fill when user query
- // https://github.com/react-component/tree-select/blob/fe33eb7c27830c9ac70cd1fdb1ebbe7bc679c16a/src/Select.jsx
- var showPosition = true;
- if (treeCheckStrictly || source === 'selection' && !selected) {
- showPosition = false;
- }
- fillAdditionalInfo(additionalInfo, triggerValue, newRawValues, mergedTreeData, showPosition, mergedFieldNames);
- if (mergedCheckable) {
- additionalInfo.checked = selected;
- } else {
- additionalInfo.selected = selected;
- }
- var returnValues = mergedLabelInValue ? returnLabeledValues : returnLabeledValues.map(function (item) {
- return item.value;
- });
- onChange(mergedMultiple ? returnValues : returnValues[0], mergedLabelInValue ? null : returnLabeledValues.map(function (item) {
- return item.label;
- }), additionalInfo);
- }
- });
- // ========================== Options ===========================
- /** Trigger by option list */
- var onOptionSelect = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (selectedKey, _ref2) {
- var _node$mergedFieldName;
- var selected = _ref2.selected,
- source = _ref2.source;
- var entity = keyEntities[selectedKey];
- var node = entity === null || entity === void 0 ? void 0 : entity.node;
- var selectedValue = (_node$mergedFieldName = node === null || node === void 0 ? void 0 : node[mergedFieldNames.value]) !== null && _node$mergedFieldName !== void 0 ? _node$mergedFieldName : selectedKey;
- // Never be falsy but keep it safe
- if (!mergedMultiple) {
- // Single mode always set value
- triggerChange([selectedValue], {
- selected: true,
- triggerValue: selectedValue
- }, 'option');
- } else {
- var newRawValues = selected ? [].concat((0,toConsumableArray["default"])(rawValues), [selectedValue]) : rawCheckedValues.filter(function (v) {
- return v !== selectedValue;
- });
- // Add keys if tree conduction
- if (treeConduction) {
- // Should keep missing values
- var _splitRawValues = splitRawValues(newRawValues),
- missingRawValues = _splitRawValues.missingRawValues,
- existRawValues = _splitRawValues.existRawValues;
- var keyList = existRawValues.map(function (val) {
- return valueEntities.get(val).key;
- });
- // Conduction by selected or not
- var checkedKeys;
- if (selected) {
- var _conductCheck = conductCheck(keyList, true, keyEntities);
- checkedKeys = _conductCheck.checkedKeys;
- } else {
- var _conductCheck2 = conductCheck(keyList, {
- checked: false,
- halfCheckedKeys: rawHalfCheckedValues
- }, keyEntities);
- checkedKeys = _conductCheck2.checkedKeys;
- }
- // Fill back of keys
- newRawValues = [].concat((0,toConsumableArray["default"])(missingRawValues), (0,toConsumableArray["default"])(checkedKeys.map(function (key) {
- return keyEntities[key].node[mergedFieldNames.value];
- })));
- }
- triggerChange(newRawValues, {
- selected: selected,
- triggerValue: selectedValue
- }, source || 'option');
- }
- // Trigger select event
- if (selected || !mergedMultiple) {
- onSelect === null || onSelect === void 0 || onSelect(selectedValue, fillLegacyProps(node));
- } else {
- onDeselect === null || onDeselect === void 0 || onDeselect(selectedValue, fillLegacyProps(node));
- }
- }, [splitRawValues, valueEntities, keyEntities, mergedFieldNames, mergedMultiple, rawValues, triggerChange, treeConduction, onSelect, onDeselect, rawCheckedValues, rawHalfCheckedValues, maxCount]);
- // ========================== Dropdown ==========================
- var onInternalDropdownVisibleChange = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (open) {
- if (onDropdownVisibleChange) {
- var legacyParam = {};
- Object.defineProperty(legacyParam, 'documentClickClose', {
- get: function get() {
- (0,warning["default"])(false, 'Second param of `onDropdownVisibleChange` has been removed.');
- return false;
- }
- });
- onDropdownVisibleChange(open, legacyParam);
- }
- }, [onDropdownVisibleChange]);
- // ====================== Display Change ========================
- var onDisplayValuesChange = useRefFunc_useRefFunc(function (newValues, info) {
- var newRawValues = newValues.map(function (item) {
- return item.value;
- });
- if (info.type === 'clear') {
- triggerChange(newRawValues, {}, 'selection');
- return;
- }
- // TreeSelect only have multiple mode which means display change only has remove
- if (info.values.length) {
- onOptionSelect(info.values[0].value, {
- selected: false,
- source: 'selection'
- });
- }
- });
- // ========================== Context ===========================
- var treeSelectContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- virtual: virtual,
- dropdownMatchSelectWidth: dropdownMatchSelectWidth,
- listHeight: listHeight,
- listItemHeight: listItemHeight,
- listItemScrollOffset: listItemScrollOffset,
- treeData: filteredTreeData,
- fieldNames: mergedFieldNames,
- onSelect: onOptionSelect,
- treeExpandAction: treeExpandAction,
- treeTitleRender: treeTitleRender,
- onPopupScroll: onPopupScroll,
- leftMaxCount: maxCount === undefined ? null : maxCount - cachedDisplayValues.length,
- leafCountOnly: mergedShowCheckedStrategy === 'SHOW_CHILD' && !treeCheckStrictly && !!treeCheckable,
- valueEntities: valueEntities
- };
- }, [virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, listItemScrollOffset, filteredTreeData, mergedFieldNames, onOptionSelect, treeExpandAction, treeTitleRender, onPopupScroll, maxCount, cachedDisplayValues.length, mergedShowCheckedStrategy, treeCheckStrictly, treeCheckable, valueEntities]);
- // ======================= Legacy Context =======================
- var legacyContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return {
- checkable: mergedCheckable,
- loadData: loadData,
- treeLoadedKeys: treeLoadedKeys,
- onTreeLoad: onTreeLoad,
- checkedKeys: rawCheckedValues,
- halfCheckedKeys: rawHalfCheckedValues,
- treeDefaultExpandAll: treeDefaultExpandAll,
- treeExpandedKeys: treeExpandedKeys,
- treeDefaultExpandedKeys: treeDefaultExpandedKeys,
- onTreeExpand: onTreeExpand,
- treeIcon: treeIcon,
- treeMotion: treeMotion,
- showTreeIcon: showTreeIcon,
- switcherIcon: switcherIcon,
- treeLine: treeLine,
- treeNodeFilterProp: treeNodeFilterProp,
- keyEntities: keyEntities
- };
- }, [mergedCheckable, loadData, treeLoadedKeys, onTreeLoad, rawCheckedValues, rawHalfCheckedValues, treeDefaultExpandAll, treeExpandedKeys, treeDefaultExpandedKeys, onTreeExpand, treeIcon, treeMotion, showTreeIcon, switcherIcon, treeLine, treeNodeFilterProp, keyEntities]);
- // =========================== Render ===========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_TreeSelectContext.Provider, {
- value: treeSelectContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(LegacyContext.Provider, {
- value: legacyContext
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_BaseSelect, (0,esm_extends["default"])({
- ref: ref
- }, restProps, {
- // >>> MISC
- id: mergedId,
- prefixCls: prefixCls,
- mode: mergedMultiple ? 'multiple' : undefined
- // >>> Display Value
- ,
- displayValues: cachedDisplayValues,
- onDisplayValuesChange: onDisplayValuesChange
- // >>> Search
- ,
- searchValue: mergedSearchValue,
- onSearch: onInternalSearch
- // >>> Options
- ,
- OptionList: rc_tree_select_es_OptionList,
- emptyOptions: !mergedTreeData.length,
- onDropdownVisibleChange: onInternalDropdownVisibleChange,
- dropdownMatchSelectWidth: dropdownMatchSelectWidth
- }))));
- });
- // Assign name for Debug
- if (true) {
- TreeSelect.displayName = 'TreeSelect';
- }
- var GenericTreeSelect = TreeSelect;
- GenericTreeSelect.TreeNode = rc_tree_select_es_TreeNode;
- GenericTreeSelect.SHOW_ALL = SHOW_ALL;
- GenericTreeSelect.SHOW_PARENT = strategyUtil_SHOW_PARENT;
- GenericTreeSelect.SHOW_CHILD = strategyUtil_SHOW_CHILD;
- /* harmony default export */ var es_TreeSelect = (GenericTreeSelect);
- ;// ./node_modules/rc-tree-select/es/index.js
- /* harmony default export */ var rc_tree_select_es = (es_TreeSelect);
- // EXTERNAL MODULE: ./components/tree-select/style/index.ts
- var tree_select_style = __webpack_require__("./components/tree-select/style/index.ts");
- ;// ./components/tree-select/index.tsx
- var tree_select_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const InternalTreeSelect = (props, ref) => {
- var _a, _b, _c, _d, _e;
- const {
- prefixCls: customizePrefixCls,
- size: customizeSize,
- disabled: customDisabled,
- bordered = true,
- style,
- className,
- rootClassName,
- treeCheckable,
- multiple,
- listHeight = 256,
- listItemHeight: customListItemHeight,
- placement,
- notFoundContent,
- switcherIcon,
- treeLine,
- getPopupContainer,
- popupClassName,
- dropdownClassName,
- treeIcon = false,
- transitionName,
- choiceTransitionName = '',
- status: customStatus,
- treeExpandAction,
- builtinPlacements,
- dropdownMatchSelectWidth,
- popupMatchSelectWidth,
- allowClear,
- variant: customVariant,
- dropdownStyle,
- dropdownRender,
- popupRender,
- onDropdownVisibleChange,
- onOpenChange,
- tagRender,
- maxCount,
- showCheckedStrategy,
- treeCheckStrictly,
- styles,
- classNames
- } = props,
- restProps = tree_select_rest(props, ["prefixCls", "size", "disabled", "bordered", "style", "className", "rootClassName", "treeCheckable", "multiple", "listHeight", "listItemHeight", "placement", "notFoundContent", "switcherIcon", "treeLine", "getPopupContainer", "popupClassName", "dropdownClassName", "treeIcon", "transitionName", "choiceTransitionName", "status", "treeExpandAction", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "allowClear", "variant", "dropdownStyle", "dropdownRender", "popupRender", "onDropdownVisibleChange", "onOpenChange", "tagRender", "maxCount", "showCheckedStrategy", "treeCheckStrictly", "styles", "classNames"]);
- const {
- getPopupContainer: getContextPopupContainer,
- getPrefixCls,
- renderEmpty,
- direction,
- virtual,
- popupMatchSelectWidth: contextPopupMatchSelectWidth,
- popupOverflow
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const {
- styles: contextStyles,
- classNames: contextClassNames
- } = (0,config_provider_context.useComponentConfig)('treeSelect');
- const [, token] = (0,useToken["default"])();
- const listItemHeight = customListItemHeight !== null && customListItemHeight !== void 0 ? customListItemHeight : (token === null || token === void 0 ? void 0 : token.controlHeightSM) + (token === null || token === void 0 ? void 0 : token.paddingXXS);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('TreeSelect');
- const deprecatedProps = {
- dropdownMatchSelectWidth: 'popupMatchSelectWidth',
- dropdownStyle: 'styles.popup.root',
- dropdownClassName: 'classNames.popup.root',
- popupClassName: 'classNames.popup.root',
- dropdownRender: 'popupRender',
- onDropdownVisibleChange: 'onOpenChange',
- bordered: 'variant'
- };
- Object.entries(deprecatedProps).forEach(([oldProp, newProp]) => {
- warning.deprecated(!(oldProp in props), oldProp, newProp);
- });
- true ? warning(multiple !== false || !treeCheckable, 'usage', '`multiple` will always be `true` when `treeCheckable` is true') : 0;
- true ? warning(!('showArrow' in props), 'deprecated', '`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.') : 0;
- }
- const rootPrefixCls = getPrefixCls();
- const prefixCls = getPrefixCls('select', customizePrefixCls);
- const treePrefixCls = getPrefixCls('select-tree', customizePrefixCls);
- const treeSelectPrefixCls = getPrefixCls('tree-select', customizePrefixCls);
- const {
- compactSize,
- compactItemClassnames
- } = useCompactItemContext(prefixCls, direction);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const treeSelectRootCls = hooks_useCSSVarCls(treeSelectPrefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,select_style["default"])(prefixCls, rootCls);
- const [treeSelectWrapCSSVar] = (0,tree_select_style["default"])(treeSelectPrefixCls, treePrefixCls, treeSelectRootCls);
- const [variant, enableVariantCls] = useVariants('treeSelect', customVariant, bordered);
- const mergedPopupClassName = classnames_default()(((_a = classNames === null || classNames === void 0 ? void 0 : classNames.popup) === null || _a === void 0 ? void 0 : _a.root) || ((_b = contextClassNames === null || contextClassNames === void 0 ? void 0 : contextClassNames.popup) === null || _b === void 0 ? void 0 : _b.root) || popupClassName || dropdownClassName, `${treeSelectPrefixCls}-dropdown`, {
- [`${treeSelectPrefixCls}-dropdown-rtl`]: direction === 'rtl'
- }, rootClassName, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cssVarCls, rootCls, treeSelectRootCls, hashId);
- const mergedPopupStyle = ((_c = styles === null || styles === void 0 ? void 0 : styles.popup) === null || _c === void 0 ? void 0 : _c.root) || ((_d = contextStyles === null || contextStyles === void 0 ? void 0 : contextStyles.popup) === null || _d === void 0 ? void 0 : _d.root) || dropdownStyle;
- const mergedPopupRender = select_usePopupRender(popupRender || dropdownRender);
- const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
- const isMultiple = !!(treeCheckable || multiple);
- const mergedMaxCount = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (maxCount && (showCheckedStrategy === 'SHOW_ALL' && !treeCheckStrictly || showCheckedStrategy === 'SHOW_PARENT')) {
- return undefined;
- }
- return maxCount;
- }, [maxCount, showCheckedStrategy, treeCheckStrictly]);
- const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
- const mergedPopupMatchSelectWidth = (_e = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _e !== void 0 ? _e : contextPopupMatchSelectWidth;
- // ===================== Form =====================
- const {
- status: contextStatus,
- hasFeedback,
- isFormItemInput,
- feedbackIcon
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(FormItemInputContext);
- const mergedStatus = getMergedStatus(contextStatus, customStatus);
- // ===================== Icons =====================
- const {
- suffixIcon,
- removeIcon,
- clearIcon
- } = useIcons(Object.assign(Object.assign({}, restProps), {
- multiple: isMultiple,
- showSuffixIcon,
- hasFeedback,
- feedbackIcon,
- prefixCls,
- componentName: 'TreeSelect'
- }));
- const mergedAllowClear = allowClear === true ? {
- clearIcon
- } : allowClear;
- // ===================== Empty =====================
- let mergedNotFound;
- if (notFoundContent !== undefined) {
- mergedNotFound = notFoundContent;
- } else {
- mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(defaultRenderEmpty, {
- componentName: "Select"
- });
- }
- // ==================== Render =====================
- const selectProps = (0,omit["default"])(restProps, ['suffixIcon', 'removeIcon', 'clearIcon', 'itemIcon', 'switcherIcon', 'style']);
- // ===================== Placement =====================
- const memoizedPlacement = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (placement !== undefined) {
- return placement;
- }
- return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
- }, [placement, direction]);
- const mergedSize = (0,useSize["default"])(ctx => {
- var _a;
- return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
- });
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const mergedClassName = classnames_default()(!customizePrefixCls && treeSelectPrefixCls, {
- [`${prefixCls}-lg`]: mergedSize === 'large',
- [`${prefixCls}-sm`]: mergedSize === 'small',
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-${variant}`]: enableVariantCls,
- [`${prefixCls}-in-form-item`]: isFormItemInput
- }, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, className, rootClassName, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cssVarCls, rootCls, treeSelectRootCls, hashId);
- const renderSwitcherIcon = nodeProps => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(iconUtil, {
- prefixCls: treePrefixCls,
- switcherIcon: switcherIcon,
- treeNodeProps: nodeProps,
- showLine: treeLine
- }));
- // ============================ zIndex ============================
- const [zIndex] = (0,useZIndex.useZIndex)('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex);
- const returnNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_tree_select_es, Object.assign({
- virtual: virtual,
- disabled: mergedDisabled
- }, selectProps, {
- dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
- builtinPlacements: select_mergedBuiltinPlacements(builtinPlacements, popupOverflow),
- ref: ref,
- prefixCls: prefixCls,
- className: mergedClassName,
- style: Object.assign(Object.assign({}, styles === null || styles === void 0 ? void 0 : styles.root), style),
- listHeight: listHeight,
- listItemHeight: listItemHeight,
- treeCheckable: treeCheckable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-tree-checkbox-inner`
- }) : treeCheckable,
- treeLine: !!treeLine,
- suffixIcon: suffixIcon,
- multiple: isMultiple,
- placement: memoizedPlacement,
- removeIcon: removeIcon,
- allowClear: mergedAllowClear,
- switcherIcon: renderSwitcherIcon,
- showTreeIcon: treeIcon,
- notFoundContent: mergedNotFound,
- getPopupContainer: getPopupContainer || getContextPopupContainer,
- treeMotion: null,
- dropdownClassName: mergedPopupClassName,
- dropdownStyle: Object.assign(Object.assign({}, mergedPopupStyle), {
- zIndex
- }),
- dropdownRender: mergedPopupRender,
- onDropdownVisibleChange: mergedOnOpenChange,
- choiceTransitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, '', choiceTransitionName),
- transitionName: (0,_util_motion.getTransitionName)(rootPrefixCls, 'slide-up', transitionName),
- treeExpandAction: treeExpandAction,
- tagRender: isMultiple ? tagRender : undefined,
- maxCount: mergedMaxCount,
- showCheckedStrategy: showCheckedStrategy,
- treeCheckStrictly: treeCheckStrictly
- }));
- return wrapCSSVar(treeSelectWrapCSSVar(returnNode));
- };
- const TreeSelectRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalTreeSelect);
- const tree_select_TreeSelect = TreeSelectRef;
- // We don't care debug panel
- /* istanbul ignore next */
- const tree_select_PurePanel = _util_PurePanel(tree_select_TreeSelect, 'dropdownAlign', props => (0,omit["default"])(props, ['visible']));
- tree_select_TreeSelect.TreeNode = rc_tree_select_es_TreeNode;
- tree_select_TreeSelect.SHOW_ALL = SHOW_ALL;
- tree_select_TreeSelect.SHOW_PARENT = strategyUtil_SHOW_PARENT;
- tree_select_TreeSelect.SHOW_CHILD = strategyUtil_SHOW_CHILD;
- tree_select_TreeSelect._InternalPanelDoNotUseOrYouWillBeFired = tree_select_PurePanel;
- if (true) {
- tree_select_TreeSelect.displayName = 'TreeSelect';
- }
- /* harmony default export */ var tree_select = (tree_select_TreeSelect);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/EditOutlined.js
- // This icon file is generated automatically.
- var EditOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
- /* harmony default export */ var asn_EditOutlined = (EditOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/EditOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var EditOutlined_EditOutlined = function EditOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_EditOutlined
- }));
- };
- /** */
- var EditOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(EditOutlined_EditOutlined);
- if (true) {
- EditOutlined_RefIcon.displayName = 'EditOutlined';
- }
- /* harmony default export */ var icons_EditOutlined = (EditOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/EnterOutlined.js
- // This icon file is generated automatically.
- var EnterOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z" } }] }, "name": "enter", "theme": "outlined" };
- /* harmony default export */ var asn_EnterOutlined = (EnterOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/EnterOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var EnterOutlined_EnterOutlined = function EnterOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_EnterOutlined
- }));
- };
- /** */
- var EnterOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(EnterOutlined_EnterOutlined);
- if (true) {
- EnterOutlined_RefIcon.displayName = 'EnterOutlined';
- }
- /* harmony default export */ var icons_EnterOutlined = (EnterOutlined_RefIcon);
- // EXTERNAL MODULE: ./components/typography/style/index.ts + 1 modules
- var typography_style = __webpack_require__("./components/typography/style/index.ts");
- ;// ./components/typography/Editable.tsx
- const Editable = props => {
- const {
- prefixCls,
- 'aria-label': ariaLabel,
- className,
- style,
- direction,
- maxLength,
- autoSize = true,
- value,
- onSave,
- onCancel,
- onEnd,
- component,
- enterIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EnterOutlined, null)
- } = props;
- const ref = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const inComposition = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- const lastKeyCode = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [current, setCurrent] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(value);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setCurrent(value);
- }, [value]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- var _a;
- if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.resizableTextArea) {
- const {
- textArea
- } = ref.current.resizableTextArea;
- textArea.focus();
- const {
- length
- } = textArea.value;
- textArea.setSelectionRange(length, length);
- }
- }, []);
- const onChange = ({
- target
- }) => {
- setCurrent(target.value.replace(/[\n\r]/g, ''));
- };
- const onCompositionStart = () => {
- inComposition.current = true;
- };
- const onCompositionEnd = () => {
- inComposition.current = false;
- };
- const onKeyDown = ({
- keyCode
- }) => {
- // We don't record keyCode when IME is using
- if (inComposition.current) return;
- lastKeyCode.current = keyCode;
- };
- const confirmChange = () => {
- onSave(current.trim());
- };
- const onKeyUp = ({
- keyCode,
- ctrlKey,
- altKey,
- metaKey,
- shiftKey
- }) => {
- // Check if it's a real key
- if (lastKeyCode.current !== keyCode || inComposition.current || ctrlKey || altKey || metaKey || shiftKey) {
- return;
- }
- if (keyCode === KeyCode["default"].ENTER) {
- confirmChange();
- onEnd === null || onEnd === void 0 ? void 0 : onEnd();
- } else if (keyCode === KeyCode["default"].ESC) {
- onCancel();
- }
- };
- const onBlur = () => {
- confirmChange();
- };
- const [wrapCSSVar, hashId, cssVarCls] = (0,typography_style["default"])(prefixCls);
- const textAreaClassName = classnames_default()(prefixCls, `${prefixCls}-edit-content`, {
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-${component}`]: !!component
- }, className, hashId, cssVarCls);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: textAreaClassName,
- style: style
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(input_TextArea, {
- ref: ref,
- maxLength: maxLength,
- value: current,
- onChange: onChange,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp,
- onCompositionStart: onCompositionStart,
- onCompositionEnd: onCompositionEnd,
- onBlur: onBlur,
- "aria-label": ariaLabel,
- rows: 1,
- autoSize: autoSize
- }), enterIcon !== null ? (0,reactNode.cloneElement)(enterIcon, {
- className: `${prefixCls}-edit-content-confirm`
- }) : null));
- };
- /* harmony default export */ var typography_Editable = (Editable);
- // EXTERNAL MODULE: ./node_modules/copy-to-clipboard/index.js
- var copy_to_clipboard = __webpack_require__("./node_modules/copy-to-clipboard/index.js");
- var copy_to_clipboard_default = /*#__PURE__*/__webpack_require__.n(copy_to_clipboard);
- ;// ./components/typography/hooks/useCopyClick.ts
- var __awaiter = undefined && undefined.__awaiter || function (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 (e) {
- reject(e);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e) {
- reject(e);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- const useCopyClick = ({
- copyConfig,
- children
- }) => {
- const [copied, setCopied] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [copyLoading, setCopyLoading] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const copyIdRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const cleanCopyId = () => {
- if (copyIdRef.current) {
- clearTimeout(copyIdRef.current);
- }
- };
- const copyOptions = {};
- if (copyConfig.format) {
- copyOptions.format = copyConfig.format;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => cleanCopyId, []);
- // Keep copy action up to date
- const onClick = (0,useEvent["default"])(e => __awaiter(void 0, void 0, void 0, function* () {
- var _a;
- e === null || e === void 0 ? void 0 : e.preventDefault();
- e === null || e === void 0 ? void 0 : e.stopPropagation();
- setCopyLoading(true);
- try {
- const text = typeof copyConfig.text === 'function' ? yield copyConfig.text() : copyConfig.text;
- copy_to_clipboard_default()(text || _util_toList(children, true).join('') || '', copyOptions);
- setCopyLoading(false);
- setCopied(true);
- // Trigger tips update
- cleanCopyId();
- copyIdRef.current = setTimeout(() => {
- setCopied(false);
- }, 3000);
- (_a = copyConfig.onCopy) === null || _a === void 0 ? void 0 : _a.call(copyConfig, e);
- } catch (error) {
- setCopyLoading(false);
- throw error;
- }
- }));
- return {
- copied,
- copyLoading,
- onClick
- };
- };
- /* harmony default export */ var hooks_useCopyClick = (useCopyClick);
- ;// ./components/typography/hooks/useMergedConfig.ts
- function useMergedConfig(propConfig, templateConfig) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const support = !!propConfig;
- return [support, Object.assign(Object.assign({}, templateConfig), support && typeof propConfig === 'object' ? propConfig : null)];
- }, [propConfig]);
- }
- ;// ./components/typography/hooks/usePrevious.ts
- const usePrevious = value => {
- const ref = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(undefined);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- ref.current = value;
- });
- return ref.current;
- };
- /* harmony default export */ var hooks_usePrevious = (usePrevious);
- ;// ./components/typography/hooks/useTooltipProps.ts
- const useTooltipProps = (tooltip, editConfigText, children) => (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(() => {
- if (tooltip === true) {
- return {
- title: editConfigText !== null && editConfigText !== void 0 ? editConfigText : children
- };
- }
- if (/*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(tooltip)) {
- return {
- title: tooltip
- };
- }
- if (typeof tooltip === 'object') {
- return Object.assign({
- title: editConfigText !== null && editConfigText !== void 0 ? editConfigText : children
- }, tooltip);
- }
- return {
- title: tooltip
- };
- }, [tooltip, editConfigText, children]);
- /* harmony default export */ var hooks_useTooltipProps = (useTooltipProps);
- ;// ./components/typography/Typography.tsx
- var Typography_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Typography = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- prefixCls: customizePrefixCls,
- component: Component = 'article',
- className,
- rootClassName,
- setContentRef,
- children,
- direction: typographyDirection,
- style
- } = props,
- restProps = Typography_rest(props, ["prefixCls", "component", "className", "rootClassName", "setContentRef", "children", "direction", "style"]);
- const {
- getPrefixCls,
- direction: contextDirection,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('typography');
- const direction = typographyDirection !== null && typographyDirection !== void 0 ? typographyDirection : contextDirection;
- const mergedRef = setContentRef ? (0,es_ref.composeRef)(ref, setContentRef) : ref;
- const prefixCls = getPrefixCls('typography', customizePrefixCls);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Typography');
- warning.deprecated(!setContentRef, 'setContentRef', 'ref');
- }
- // Style
- const [wrapCSSVar, hashId, cssVarCls] = (0,typography_style["default"])(prefixCls);
- const componentClassName = classnames_default()(prefixCls, contextClassName, {
- [`${prefixCls}-rtl`]: direction === 'rtl'
- }, className, rootClassName, hashId, cssVarCls);
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- return wrapCSSVar(
- /*#__PURE__*/
- // @ts-expect-error: Expression produces a union type that is too complex to represent.
- external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, Object.assign({
- className: componentClassName,
- style: mergedStyle,
- ref: mergedRef
- }, restProps), children));
- });
- if (true) {
- Typography.displayName = 'Typography';
- }
- /* harmony default export */ var typography_Typography = (Typography);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/CopyOutlined.js
- // This icon file is generated automatically.
- var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
- /* harmony default export */ var asn_CopyOutlined = (CopyOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/CopyOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var CopyOutlined_CopyOutlined = function CopyOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_CopyOutlined
- }));
- };
- /** */
- var CopyOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(CopyOutlined_CopyOutlined);
- if (true) {
- CopyOutlined_RefIcon.displayName = 'CopyOutlined';
- }
- /* harmony default export */ var icons_CopyOutlined = (CopyOutlined_RefIcon);
- ;// ./components/typography/Base/util.ts
- function util_toList(val) {
- if (val === false) {
- return [false, false];
- }
- return Array.isArray(val) ? val : [val];
- }
- function getNode(dom, defaultNode, needDom) {
- if (dom === true || dom === undefined) {
- return defaultNode;
- }
- return dom || needDom && defaultNode;
- }
- /**
- * Check for element is native ellipsis
- * ref:
- * - https://github.com/ant-design/ant-design/issues/50143
- * - https://github.com/ant-design/ant-design/issues/50414
- */
- function isEleEllipsis(ele) {
- // Create a new div to get the size
- const childDiv = document.createElement('em');
- ele.appendChild(childDiv);
- // For test case
- if (true) {
- childDiv.className = 'ant-typography-css-ellipsis-content-measure';
- }
- const rect = ele.getBoundingClientRect();
- const childRect = childDiv.getBoundingClientRect();
- // Reset
- ele.removeChild(childDiv);
- // Range checker
- return (
- // Horizontal out of range
- rect.left > childRect.left || childRect.right > rect.right ||
- // Vertical out of range
- rect.top > childRect.top || childRect.bottom > rect.bottom
- );
- }
- const isValidText = val => ['string', 'number'].includes(typeof val);
- ;// ./components/typography/Base/CopyBtn.tsx
- const CopyBtn = ({
- prefixCls,
- copied,
- locale,
- iconOnly,
- tooltips,
- icon,
- tabIndex,
- onCopy,
- loading: btnLoading
- }) => {
- const tooltipNodes = util_toList(tooltips);
- const iconNodes = util_toList(icon);
- const {
- copied: copiedText,
- copy: copyText
- } = locale !== null && locale !== void 0 ? locale : {};
- const systemStr = copied ? copiedText : copyText;
- const copyTitle = getNode(tooltipNodes[copied ? 1 : 0], systemStr);
- const ariaLabel = typeof copyTitle === 'string' ? copyTitle : systemStr;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- title: copyTitle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- className: classnames_default()(`${prefixCls}-copy`, {
- [`${prefixCls}-copy-success`]: copied,
- [`${prefixCls}-copy-icon-only`]: iconOnly
- }),
- onClick: onCopy,
- "aria-label": ariaLabel,
- tabIndex: tabIndex
- }, copied ? getNode(iconNodes[1], /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CheckOutlined, null), true) : getNode(iconNodes[0], btnLoading ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_CopyOutlined, null), true)));
- };
- /* harmony default export */ var Base_CopyBtn = (CopyBtn);
- ;// ./components/typography/Base/Ellipsis.tsx
- const MeasureText = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
- style,
- children
- }, ref) => {
- const spanRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- isExceed: () => {
- const span = spanRef.current;
- return span.scrollHeight > span.clientHeight;
- },
- getHeight: () => spanRef.current.clientHeight
- }));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- "aria-hidden": true,
- ref: spanRef,
- style: Object.assign({
- position: 'fixed',
- display: 'block',
- left: 0,
- top: 0,
- pointerEvents: 'none',
- backgroundColor: 'rgba(255, 0, 0, 0.65)'
- }, style)
- }, children);
- });
- const getNodesLen = nodeList => nodeList.reduce((totalLen, node) => totalLen + (isValidText(node) ? String(node).length : 1), 0);
- function sliceNodes(nodeList, len) {
- let currLen = 0;
- const currentNodeList = [];
- for (let i = 0; i < nodeList.length; i += 1) {
- // Match to return
- if (currLen === len) {
- return currentNodeList;
- }
- const node = nodeList[i];
- const canCut = isValidText(node);
- const nodeLen = canCut ? String(node).length : 1;
- const nextLen = currLen + nodeLen;
- // Exceed but current not which means we need cut this
- // This will not happen on validate ReactElement
- if (nextLen > len) {
- const restLen = len - currLen;
- currentNodeList.push(String(node).slice(0, restLen));
- return currentNodeList;
- }
- currentNodeList.push(node);
- currLen = nextLen;
- }
- return nodeList;
- }
- // Measure for the `text` is exceed the `rows` or not
- const STATUS_MEASURE_NONE = 0;
- const STATUS_MEASURE_PREPARE = 1;
- const STATUS_MEASURE_START = 2;
- const STATUS_MEASURE_NEED_ELLIPSIS = 3;
- const STATUS_MEASURE_NO_NEED_ELLIPSIS = 4;
- const lineClipStyle = {
- display: '-webkit-box',
- overflow: 'hidden',
- WebkitBoxOrient: 'vertical'
- };
- function EllipsisMeasure(props) {
- const {
- enableMeasure,
- width,
- text,
- children,
- rows,
- expanded,
- miscDeps,
- onEllipsis
- } = props;
- const nodeList = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => (0,toArray["default"])(text), [text]);
- const nodeLen = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => getNodesLen(nodeList), [text]);
- // ========================= Full Content =========================
- // Used for measure only, which means it's always render as no need ellipsis
- const fullContent = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => children(nodeList, false), [text]);
- // ========================= Cut Content ==========================
- const [ellipsisCutIndex, setEllipsisCutIndex] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- const cutMidRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ========================= NeedEllipsis =========================
- const measureWhiteSpaceRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const needEllipsisRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // Measure for `rows-1` height, to avoid operation exceed the line height
- const descRowsEllipsisRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const symbolRowEllipsisRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const [canEllipsis, setCanEllipsis] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [needEllipsis, setNeedEllipsis] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(STATUS_MEASURE_NONE);
- const [ellipsisHeight, setEllipsisHeight] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const [parentWhiteSpace, setParentWhiteSpace] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- // Trigger start measure
- (0,useLayoutEffect["default"])(() => {
- if (enableMeasure && width && nodeLen) {
- setNeedEllipsis(STATUS_MEASURE_PREPARE);
- } else {
- setNeedEllipsis(STATUS_MEASURE_NONE);
- }
- }, [width, text, rows, enableMeasure, nodeList]);
- // Measure process
- (0,useLayoutEffect["default"])(() => {
- var _a, _b, _c, _d;
- if (needEllipsis === STATUS_MEASURE_PREPARE) {
- setNeedEllipsis(STATUS_MEASURE_START);
- // Parent ref `white-space`
- const nextWhiteSpace = measureWhiteSpaceRef.current && getComputedStyle(measureWhiteSpaceRef.current).whiteSpace;
- setParentWhiteSpace(nextWhiteSpace);
- } else if (needEllipsis === STATUS_MEASURE_START) {
- const isOverflow = !!((_a = needEllipsisRef.current) === null || _a === void 0 ? void 0 : _a.isExceed());
- setNeedEllipsis(isOverflow ? STATUS_MEASURE_NEED_ELLIPSIS : STATUS_MEASURE_NO_NEED_ELLIPSIS);
- setEllipsisCutIndex(isOverflow ? [0, nodeLen] : null);
- setCanEllipsis(isOverflow);
- // Get the basic height of ellipsis rows
- const baseRowsEllipsisHeight = ((_b = needEllipsisRef.current) === null || _b === void 0 ? void 0 : _b.getHeight()) || 0;
- // Get the height of `rows - 1` + symbol height
- const descRowsEllipsisHeight = rows === 1 ? 0 : ((_c = descRowsEllipsisRef.current) === null || _c === void 0 ? void 0 : _c.getHeight()) || 0;
- const symbolRowEllipsisHeight = ((_d = symbolRowEllipsisRef.current) === null || _d === void 0 ? void 0 : _d.getHeight()) || 0;
- const maxRowsHeight = Math.max(baseRowsEllipsisHeight,
- // height of rows with ellipsis
- descRowsEllipsisHeight + symbolRowEllipsisHeight);
- setEllipsisHeight(maxRowsHeight + 1);
- onEllipsis(isOverflow);
- }
- }, [needEllipsis]);
- // ========================= Cut Measure ==========================
- const cutMidIndex = ellipsisCutIndex ? Math.ceil((ellipsisCutIndex[0] + ellipsisCutIndex[1]) / 2) : 0;
- (0,useLayoutEffect["default"])(() => {
- var _a;
- const [minIndex, maxIndex] = ellipsisCutIndex || [0, 0];
- if (minIndex !== maxIndex) {
- const midHeight = ((_a = cutMidRef.current) === null || _a === void 0 ? void 0 : _a.getHeight()) || 0;
- const isOverflow = midHeight > ellipsisHeight;
- let targetMidIndex = cutMidIndex;
- if (maxIndex - minIndex === 1) {
- targetMidIndex = isOverflow ? minIndex : maxIndex;
- }
- setEllipsisCutIndex(isOverflow ? [minIndex, targetMidIndex] : [targetMidIndex, maxIndex]);
- }
- }, [ellipsisCutIndex, cutMidIndex]);
- // ========================= Text Content =========================
- const finalContent = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- // Skip everything if `enableMeasure` is disabled
- if (!enableMeasure) {
- return children(nodeList, false);
- }
- if (needEllipsis !== STATUS_MEASURE_NEED_ELLIPSIS || !ellipsisCutIndex || ellipsisCutIndex[0] !== ellipsisCutIndex[1]) {
- const content = children(nodeList, false);
- // Limit the max line count to avoid scrollbar blink unless no need ellipsis
- // https://github.com/ant-design/ant-design/issues/42958
- if ([STATUS_MEASURE_NO_NEED_ELLIPSIS, STATUS_MEASURE_NONE].includes(needEllipsis)) {
- return content;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: Object.assign(Object.assign({}, lineClipStyle), {
- WebkitLineClamp: rows
- })
- }, content);
- }
- return children(expanded ? nodeList : sliceNodes(nodeList, ellipsisCutIndex[0]), canEllipsis);
- }, [expanded, needEllipsis, ellipsisCutIndex, nodeList].concat((0,toConsumableArray["default"])(miscDeps)));
- // ============================ Render ============================
- const measureStyle = {
- width,
- margin: 0,
- padding: 0,
- whiteSpace: parentWhiteSpace === 'nowrap' ? 'normal' : 'inherit'
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, finalContent, needEllipsis === STATUS_MEASURE_START && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureText, {
- style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
- WebkitLineClamp: rows
- }),
- ref: needEllipsisRef
- }, fullContent), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureText, {
- style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
- WebkitLineClamp: rows - 1
- }),
- ref: descRowsEllipsisRef
- }, fullContent), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureText, {
- style: Object.assign(Object.assign(Object.assign({}, measureStyle), lineClipStyle), {
- WebkitLineClamp: 1
- }),
- ref: symbolRowEllipsisRef
- }, children([], true)))), needEllipsis === STATUS_MEASURE_NEED_ELLIPSIS && ellipsisCutIndex && ellipsisCutIndex[0] !== ellipsisCutIndex[1] && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(MeasureText, {
- style: Object.assign(Object.assign({}, measureStyle), {
- top: 400
- }),
- ref: cutMidRef
- }, children(sliceNodes(nodeList, cutMidIndex), true))), needEllipsis === STATUS_MEASURE_PREPARE && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- style: {
- whiteSpace: 'inherit'
- },
- ref: measureWhiteSpaceRef
- })));
- }
- ;// ./components/typography/Base/EllipsisTooltip.tsx
- const EllipsisTooltip = ({
- enableEllipsis,
- isEllipsis,
- children,
- tooltipProps
- }) => {
- if (!(tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.title) || !enableEllipsis) {
- return children;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, Object.assign({
- open: isEllipsis ? undefined : false
- }, tooltipProps), children);
- };
- if (true) {
- EllipsisTooltip.displayName = 'EllipsisTooltip';
- }
- /* harmony default export */ var Base_EllipsisTooltip = (EllipsisTooltip);
- ;// ./components/typography/Base/index.tsx
- var Base_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function wrapperDecorations({
- mark,
- code,
- underline,
- delete: del,
- strong,
- keyboard,
- italic
- }, content) {
- let currentContent = content;
- function wrap(tag, needed) {
- if (!needed) {
- return;
- }
- currentContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(tag, {}, currentContent);
- }
- wrap('strong', strong);
- wrap('u', underline);
- wrap('del', del);
- wrap('code', code);
- wrap('mark', mark);
- wrap('kbd', keyboard);
- wrap('i', italic);
- return currentContent;
- }
- const ELLIPSIS_STR = '...';
- const DECORATION_PROPS = ['delete', 'mark', 'code', 'underline', 'strong', 'keyboard', 'italic'];
- const Base = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- var _a;
- const {
- prefixCls: customizePrefixCls,
- className,
- style,
- type,
- disabled,
- children,
- ellipsis,
- editable,
- copyable,
- component,
- title
- } = props,
- restProps = Base_rest(props, ["prefixCls", "className", "style", "type", "disabled", "children", "ellipsis", "editable", "copyable", "component", "title"]);
- const {
- getPrefixCls,
- direction
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const [textLocale] = (0,useLocale["default"])('Text');
- const typographyRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const editIconRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- // ============================ MISC ============================
- const prefixCls = getPrefixCls('typography', customizePrefixCls);
- const textProps = (0,omit["default"])(restProps, DECORATION_PROPS);
- // ========================== Editable ==========================
- const [enableEdit, editConfig] = useMergedConfig(editable);
- const [editing, setEditing] = (0,useMergedState["default"])(false, {
- value: editConfig.editing
- });
- const {
- triggerType = ['icon']
- } = editConfig;
- const triggerEdit = edit => {
- var _a;
- if (edit) {
- (_a = editConfig.onStart) === null || _a === void 0 ? void 0 : _a.call(editConfig);
- }
- setEditing(edit);
- };
- // Focus edit icon when back
- const prevEditing = hooks_usePrevious(editing);
- (0,useLayoutEffect["default"])(() => {
- var _a;
- if (!editing && prevEditing) {
- (_a = editIconRef.current) === null || _a === void 0 ? void 0 : _a.focus();
- }
- }, [editing]);
- const onEditClick = e => {
- e === null || e === void 0 ? void 0 : e.preventDefault();
- triggerEdit(true);
- };
- const onEditChange = value => {
- var _a;
- (_a = editConfig.onChange) === null || _a === void 0 ? void 0 : _a.call(editConfig, value);
- triggerEdit(false);
- };
- const onEditCancel = () => {
- var _a;
- (_a = editConfig.onCancel) === null || _a === void 0 ? void 0 : _a.call(editConfig);
- triggerEdit(false);
- };
- // ========================== Copyable ==========================
- const [enableCopy, copyConfig] = useMergedConfig(copyable);
- const {
- copied,
- copyLoading,
- onClick: onCopyClick
- } = hooks_useCopyClick({
- copyConfig,
- children
- });
- // ========================== Ellipsis ==========================
- const [isLineClampSupport, setIsLineClampSupport] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [isTextOverflowSupport, setIsTextOverflowSupport] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [isJsEllipsis, setIsJsEllipsis] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [isNativeEllipsis, setIsNativeEllipsis] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const [isNativeVisible, setIsNativeVisible] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(true);
- const [enableEllipsis, ellipsisConfig] = useMergedConfig(ellipsis, {
- expandable: false,
- symbol: isExpanded => isExpanded ? textLocale === null || textLocale === void 0 ? void 0 : textLocale.collapse : textLocale === null || textLocale === void 0 ? void 0 : textLocale.expand
- });
- const [expanded, setExpanded] = (0,useMergedState["default"])(ellipsisConfig.defaultExpanded || false, {
- value: ellipsisConfig.expanded
- });
- const mergedEnableEllipsis = enableEllipsis && (!expanded || ellipsisConfig.expandable === 'collapsible');
- // Shared prop to reduce bundle size
- const {
- rows = 1
- } = ellipsisConfig;
- const needMeasureEllipsis = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() =>
- // Disable ellipsis
- mergedEnableEllipsis && (
- // Provide suffix
- ellipsisConfig.suffix !== undefined || ellipsisConfig.onEllipsis ||
- // Can't use css ellipsis since we need to provide the place for button
- ellipsisConfig.expandable || enableEdit || enableCopy), [mergedEnableEllipsis, ellipsisConfig, enableEdit, enableCopy]);
- (0,useLayoutEffect["default"])(() => {
- if (enableEllipsis && !needMeasureEllipsis) {
- setIsLineClampSupport(isStyleSupport('webkitLineClamp'));
- setIsTextOverflowSupport(isStyleSupport('textOverflow'));
- }
- }, [needMeasureEllipsis, enableEllipsis]);
- const [cssEllipsis, setCssEllipsis] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(mergedEnableEllipsis);
- const canUseCssEllipsis = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (needMeasureEllipsis) {
- return false;
- }
- if (rows === 1) {
- return isTextOverflowSupport;
- }
- return isLineClampSupport;
- }, [needMeasureEllipsis, isTextOverflowSupport, isLineClampSupport]);
- // We use effect to change from css ellipsis to js ellipsis.
- // To make SSR still can see the ellipsis.
- (0,useLayoutEffect["default"])(() => {
- setCssEllipsis(canUseCssEllipsis && mergedEnableEllipsis);
- }, [canUseCssEllipsis, mergedEnableEllipsis]);
- const isMergedEllipsis = mergedEnableEllipsis && (cssEllipsis ? isNativeEllipsis : isJsEllipsis);
- const cssTextOverflow = mergedEnableEllipsis && rows === 1 && cssEllipsis;
- const cssLineClamp = mergedEnableEllipsis && rows > 1 && cssEllipsis;
- // >>>>> Expand
- const onExpandClick = (e, info) => {
- var _a;
- setExpanded(info.expanded);
- (_a = ellipsisConfig.onExpand) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, e, info);
- };
- const [ellipsisWidth, setEllipsisWidth] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(0);
- const onResize = ({
- offsetWidth
- }) => {
- setEllipsisWidth(offsetWidth);
- };
- // >>>>> JS Ellipsis
- const onJsEllipsis = jsEllipsis => {
- var _a;
- setIsJsEllipsis(jsEllipsis);
- // Trigger if changed
- if (isJsEllipsis !== jsEllipsis) {
- (_a = ellipsisConfig.onEllipsis) === null || _a === void 0 ? void 0 : _a.call(ellipsisConfig, jsEllipsis);
- }
- };
- // >>>>> Native ellipsis
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const textEle = typographyRef.current;
- if (enableEllipsis && cssEllipsis && textEle) {
- const currentEllipsis = isEleEllipsis(textEle);
- if (isNativeEllipsis !== currentEllipsis) {
- setIsNativeEllipsis(currentEllipsis);
- }
- }
- }, [enableEllipsis, cssEllipsis, children, cssLineClamp, isNativeVisible, ellipsisWidth]);
- // https://github.com/ant-design/ant-design/issues/36786
- // Use IntersectionObserver to check if element is invisible
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const textEle = typographyRef.current;
- if (typeof IntersectionObserver === 'undefined' || !textEle || !cssEllipsis || !mergedEnableEllipsis) {
- return;
- }
- /* eslint-disable-next-line compat/compat */
- const observer = new IntersectionObserver(() => {
- setIsNativeVisible(!!textEle.offsetParent);
- });
- observer.observe(textEle);
- return () => {
- observer.disconnect();
- };
- }, [cssEllipsis, mergedEnableEllipsis]);
- // ========================== Tooltip ===========================
- const tooltipProps = hooks_useTooltipProps(ellipsisConfig.tooltip, editConfig.text, children);
- const topAriaLabel = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (!enableEllipsis || cssEllipsis) {
- return undefined;
- }
- return [editConfig.text, children, title, tooltipProps.title].find(isValidText);
- }, [enableEllipsis, cssEllipsis, title, tooltipProps.title, isMergedEllipsis]);
- // =========================== Render ===========================
- // >>>>>>>>>>> Editing input
- if (editing) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Editable, {
- value: (_a = editConfig.text) !== null && _a !== void 0 ? _a : typeof children === 'string' ? children : '',
- onSave: onEditChange,
- onCancel: onEditCancel,
- onEnd: editConfig.onEnd,
- prefixCls: prefixCls,
- className: className,
- style: style,
- direction: direction,
- component: component,
- maxLength: editConfig.maxLength,
- autoSize: editConfig.autoSize,
- enterIcon: editConfig.enterIcon
- });
- }
- // >>>>>>>>>>> Typography
- // Expand
- const renderExpand = () => {
- const {
- expandable,
- symbol
- } = ellipsisConfig;
- return expandable ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- key: "expand",
- className: `${prefixCls}-${expanded ? 'collapse' : 'expand'}`,
- onClick: e => onExpandClick(e, {
- expanded: !expanded
- }),
- "aria-label": expanded ? textLocale.collapse : textLocale === null || textLocale === void 0 ? void 0 : textLocale.expand
- }, typeof symbol === 'function' ? symbol(expanded) : symbol)) : null;
- };
- // Edit
- const renderEdit = () => {
- if (!enableEdit) {
- return;
- }
- const {
- icon,
- tooltip,
- tabIndex
- } = editConfig;
- const editTitle = (0,toArray["default"])(tooltip)[0] || (textLocale === null || textLocale === void 0 ? void 0 : textLocale.edit);
- const ariaLabel = typeof editTitle === 'string' ? editTitle : '';
- return triggerType.includes('icon') ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- key: "edit",
- title: tooltip === false ? '' : editTitle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("button", {
- type: "button",
- ref: editIconRef,
- className: `${prefixCls}-edit`,
- onClick: onEditClick,
- "aria-label": ariaLabel,
- tabIndex: tabIndex
- }, icon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EditOutlined, {
- role: "button"
- })))) : null;
- };
- // Copy
- const renderCopy = () => {
- if (!enableCopy) {
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Base_CopyBtn, Object.assign({
- key: "copy"
- }, copyConfig, {
- prefixCls: prefixCls,
- copied: copied,
- locale: textLocale,
- onCopy: onCopyClick,
- loading: copyLoading,
- iconOnly: children === null || children === undefined
- }));
- };
- const renderOperations = canEllipsis => [canEllipsis && renderExpand(), renderEdit(), renderCopy()];
- const renderEllipsis = canEllipsis => [canEllipsis && !expanded && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- "aria-hidden": true,
- key: "ellipsis"
- }, ELLIPSIS_STR)), ellipsisConfig.suffix, renderOperations(canEllipsis)];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es, {
- onResize: onResize,
- disabled: !mergedEnableEllipsis
- }, resizeRef => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Base_EllipsisTooltip, {
- tooltipProps: tooltipProps,
- enableEllipsis: mergedEnableEllipsis,
- isEllipsis: isMergedEllipsis
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Typography, Object.assign({
- className: classnames_default()({
- [`${prefixCls}-${type}`]: type,
- [`${prefixCls}-disabled`]: disabled,
- [`${prefixCls}-ellipsis`]: enableEllipsis,
- [`${prefixCls}-ellipsis-single-line`]: cssTextOverflow,
- [`${prefixCls}-ellipsis-multiple-line`]: cssLineClamp
- }, className),
- prefixCls: customizePrefixCls,
- style: Object.assign(Object.assign({}, style), {
- WebkitLineClamp: cssLineClamp ? rows : undefined
- }),
- component: component,
- ref: (0,es_ref.composeRef)(resizeRef, typographyRef, ref),
- direction: direction,
- onClick: triggerType.includes('text') ? onEditClick : undefined,
- "aria-label": topAriaLabel === null || topAriaLabel === void 0 ? void 0 : topAriaLabel.toString(),
- title: title
- }, textProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(EllipsisMeasure, {
- enableMeasure: mergedEnableEllipsis && !cssEllipsis,
- text: children,
- rows: rows,
- width: ellipsisWidth,
- onEllipsis: onJsEllipsis,
- expanded: expanded,
- miscDeps: [copied, expanded, copyLoading, enableEdit, enableCopy, textLocale].concat((0,toConsumableArray["default"])(DECORATION_PROPS.map(key => props[key])))
- }, (node, canEllipsis) => wrapperDecorations(props, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, node.length > 0 && canEllipsis && !expanded && topAriaLabel ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: "show-content",
- "aria-hidden": true
- }, node)) : node, renderEllipsis(canEllipsis))))))));
- });
- /* harmony default export */ var typography_Base = (Base);
- ;// ./components/typography/Link.tsx
- var Link_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Link = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_a, ref) => {
- var {
- ellipsis,
- rel
- } = _a,
- restProps = Link_rest(_a, ["ellipsis", "rel"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Typography.Link');
- true ? warning(typeof ellipsis !== 'object', 'usage', '`ellipsis` only supports boolean value.') : 0;
- }
- const mergedProps = Object.assign(Object.assign({}, restProps), {
- rel: rel === undefined && restProps.target === '_blank' ? 'noopener noreferrer' : rel
- });
- // @ts-expect-error: https://github.com/ant-design/ant-design/issues/26622
- delete mergedProps.navigate;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Base, Object.assign({}, mergedProps, {
- ref: ref,
- ellipsis: !!ellipsis,
- component: "a"
- }));
- });
- /* harmony default export */ var typography_Link = (Link);
- ;// ./components/typography/Paragraph.tsx
- const Paragraph_Paragraph = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Base, Object.assign({
- ref: ref
- }, props, {
- component: "div"
- }))));
- /* harmony default export */ var typography_Paragraph = (Paragraph_Paragraph);
- ;// ./components/typography/Text.tsx
- var Text_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Text = (_a, ref) => {
- var {
- ellipsis
- } = _a,
- restProps = Text_rest(_a, ["ellipsis"]);
- const mergedEllipsis = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- if (ellipsis && typeof ellipsis === 'object') {
- return (0,omit["default"])(ellipsis, ['expandable', 'rows']);
- }
- return ellipsis;
- }, [ellipsis]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Typography.Text');
- true ? warning(typeof ellipsis !== 'object' || !ellipsis || !('expandable' in ellipsis) && !('rows' in ellipsis), 'usage', '`ellipsis` do not support `expandable` or `rows` props.') : 0;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Base, Object.assign({
- ref: ref
- }, restProps, {
- ellipsis: mergedEllipsis,
- component: "span"
- }));
- };
- /* harmony default export */ var typography_Text = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(Text));
- ;// ./components/typography/Title.tsx
- var Title_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const TITLE_ELE_LIST = [1, 2, 3, 4, 5];
- const Title_Title = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((props, ref) => {
- const {
- level = 1
- } = props,
- restProps = Title_rest(props, ["level"]);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Typography.Title');
- true ? warning(TITLE_ELE_LIST.includes(level), 'usage', 'Title only accept `1 | 2 | 3 | 4 | 5` as `level` value. And `5` need 4.6.0+ version.') : 0;
- }
- const component = TITLE_ELE_LIST.includes(level) ? `h${level}` : `h1`;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(typography_Base, Object.assign({
- ref: ref
- }, restProps, {
- component: component
- }));
- });
- /* harmony default export */ var typography_Title = (Title_Title);
- ;// ./components/typography/index.tsx
- const components_typography_Typography = typography_Typography;
- components_typography_Typography.Text = typography_Text;
- components_typography_Typography.Link = typography_Link;
- components_typography_Typography.Title = typography_Title;
- components_typography_Typography.Paragraph = typography_Paragraph;
- /* harmony default export */ var typography = (components_typography_Typography);
- ;// ./node_modules/rc-upload/es/attr-accept.js
- /* harmony default export */ var attr_accept = (function (file, acceptedFiles) {
- if (file && acceptedFiles) {
- var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
- var fileName = file.name || '';
- var mimeType = file.type || '';
- var baseMimeType = mimeType.replace(/\/.*$/, '');
- return acceptedFilesArray.some(function (type) {
- var validType = type.trim();
- // This is something like */*,* allow all files
- if (/^\*(\/\*)?$/.test(type)) {
- return true;
- }
- // like .jpg, .png
- if (validType.charAt(0) === '.') {
- var lowerFileName = fileName.toLowerCase();
- var lowerType = validType.toLowerCase();
- var affixList = [lowerType];
- if (lowerType === '.jpg' || lowerType === '.jpeg') {
- affixList = ['.jpg', '.jpeg'];
- }
- return affixList.some(function (affix) {
- return lowerFileName.endsWith(affix);
- });
- }
- // This is something like a image/* mime type
- if (/\/\*$/.test(validType)) {
- return baseMimeType === validType.replace(/\/.*$/, '');
- }
- // Full match
- if (mimeType === validType) {
- return true;
- }
- // Invalidate type should skip
- if (/^\w+$/.test(validType)) {
- (0,warning["default"])(false, "Upload takes an invalidate 'accept' type '".concat(validType, "'.Skip for check."));
- return true;
- }
- return false;
- });
- }
- return true;
- });
- ;// ./node_modules/rc-upload/es/request.js
- function getError(option, xhr) {
- var msg = "cannot ".concat(option.method, " ").concat(option.action, " ").concat(xhr.status, "'");
- var err = new Error(msg);
- err.status = xhr.status;
- err.method = option.method;
- err.url = option.action;
- return err;
- }
- function getBody(xhr) {
- var text = xhr.responseText || xhr.response;
- if (!text) {
- return text;
- }
- try {
- return JSON.parse(text);
- } catch (e) {
- return text;
- }
- }
- function upload(option) {
- // eslint-disable-next-line no-undef
- var xhr = new XMLHttpRequest();
- if (option.onProgress && xhr.upload) {
- xhr.upload.onprogress = function progress(e) {
- if (e.total > 0) {
- e.percent = e.loaded / e.total * 100;
- }
- option.onProgress(e);
- };
- }
- // eslint-disable-next-line no-undef
- var formData = new FormData();
- if (option.data) {
- Object.keys(option.data).forEach(function (key) {
- var value = option.data[key];
- // support key-value array data
- if (Array.isArray(value)) {
- value.forEach(function (item) {
- // { list: [ 11, 22 ] }
- // formData.append('list[]', 11);
- formData.append("".concat(key, "[]"), item);
- });
- return;
- }
- formData.append(key, value);
- });
- }
- // eslint-disable-next-line no-undef
- if (option.file instanceof Blob) {
- formData.append(option.filename, option.file, option.file.name);
- } else {
- formData.append(option.filename, option.file);
- }
- xhr.onerror = function error(e) {
- option.onError(e);
- };
- xhr.onload = function onload() {
- // allow success when 2xx status
- // see https://github.com/react-component/upload/issues/34
- if (xhr.status < 200 || xhr.status >= 300) {
- return option.onError(getError(option, xhr), getBody(xhr));
- }
- return option.onSuccess(getBody(xhr), xhr);
- };
- xhr.open(option.method, option.action, true);
- // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
- if (option.withCredentials && 'withCredentials' in xhr) {
- xhr.withCredentials = true;
- }
- var headers = option.headers || {};
- // when set headers['X-Requested-With'] = null , can close default XHR header
- // see https://github.com/react-component/upload/issues/33
- if (headers['X-Requested-With'] !== null) {
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- }
- Object.keys(headers).forEach(function (h) {
- if (headers[h] !== null) {
- xhr.setRequestHeader(h, headers[h]);
- }
- });
- xhr.send(formData);
- return {
- abort: function abort() {
- xhr.abort();
- }
- };
- }
- ;// ./node_modules/rc-upload/es/traverseFileTree.js
- // https://github.com/ant-design/ant-design/issues/50080
- var traverseFileTree = /*#__PURE__*/function () {
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(files, isAccepted) {
- var flattenFileList, progressFileList, readDirectory, _readDirectory, readFile, _readFile, _traverseFileTree, wipIndex;
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
- while (1) switch (_context4.prev = _context4.next) {
- case 0:
- _readFile = function _readFile3() {
- _readFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(item) {
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
- while (1) switch (_context3.prev = _context3.next) {
- case 0:
- return _context3.abrupt("return", new Promise(function (reslove) {
- item.file(function (file) {
- if (isAccepted(file)) {
- // https://github.com/ant-design/ant-design/issues/16426
- if (item.fullPath && !file.webkitRelativePath) {
- Object.defineProperties(file, {
- webkitRelativePath: {
- writable: true
- }
- });
- // eslint-disable-next-line no-param-reassign
- file.webkitRelativePath = item.fullPath.replace(/^\//, '');
- Object.defineProperties(file, {
- webkitRelativePath: {
- writable: false
- }
- });
- }
- reslove(file);
- } else {
- reslove(null);
- }
- });
- }));
- case 1:
- case "end":
- return _context3.stop();
- }
- }, _callee3);
- }));
- return _readFile.apply(this, arguments);
- };
- readFile = function _readFile2(_x4) {
- return _readFile.apply(this, arguments);
- };
- _readDirectory = function _readDirectory3() {
- _readDirectory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(directory) {
- var dirReader, entries, results, n, i;
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- dirReader = directory.createReader();
- entries = [];
- case 2:
- if (false) // removed by dead control flow
- {}
- _context2.next = 5;
- return new Promise(function (resolve) {
- dirReader.readEntries(resolve, function () {
- return resolve([]);
- });
- });
- case 5:
- results = _context2.sent;
- n = results.length;
- if (n) {
- _context2.next = 9;
- break;
- }
- return _context2.abrupt("break", 12);
- case 9:
- for (i = 0; i < n; i++) {
- entries.push(results[i]);
- }
- _context2.next = 2;
- break;
- case 12:
- return _context2.abrupt("return", entries);
- case 13:
- case "end":
- return _context2.stop();
- }
- }, _callee2);
- }));
- return _readDirectory.apply(this, arguments);
- };
- readDirectory = function _readDirectory2(_x3) {
- return _readDirectory.apply(this, arguments);
- };
- flattenFileList = [];
- progressFileList = [];
- files.forEach(function (file) {
- return progressFileList.push(file.webkitGetAsEntry());
- });
- // eslint-disable-next-line @typescript-eslint/naming-convention
- _traverseFileTree = /*#__PURE__*/function () {
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item, path) {
- var _file, entries;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- if (item) {
- _context.next = 2;
- break;
- }
- return _context.abrupt("return");
- case 2:
- // eslint-disable-next-line no-param-reassign
- item.path = path || '';
- if (!item.isFile) {
- _context.next = 10;
- break;
- }
- _context.next = 6;
- return readFile(item);
- case 6:
- _file = _context.sent;
- if (_file) {
- flattenFileList.push(_file);
- }
- _context.next = 15;
- break;
- case 10:
- if (!item.isDirectory) {
- _context.next = 15;
- break;
- }
- _context.next = 13;
- return readDirectory(item);
- case 13:
- entries = _context.sent;
- progressFileList.push.apply(progressFileList, (0,toConsumableArray["default"])(entries));
- case 15:
- case "end":
- return _context.stop();
- }
- }, _callee);
- }));
- return function _traverseFileTree(_x5, _x6) {
- return _ref2.apply(this, arguments);
- };
- }();
- wipIndex = 0;
- case 9:
- if (!(wipIndex < progressFileList.length)) {
- _context4.next = 15;
- break;
- }
- _context4.next = 12;
- return _traverseFileTree(progressFileList[wipIndex]);
- case 12:
- wipIndex++;
- _context4.next = 9;
- break;
- case 15:
- return _context4.abrupt("return", flattenFileList);
- case 16:
- case "end":
- return _context4.stop();
- }
- }, _callee4);
- }));
- return function traverseFileTree(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- /* harmony default export */ var es_traverseFileTree = (traverseFileTree);
- ;// ./node_modules/rc-upload/es/uid.js
- var now = +new Date();
- var uid_index = 0;
- function uid_uid() {
- // eslint-disable-next-line no-plusplus
- return "rc-upload-".concat(now, "-").concat(++uid_index);
- }
- ;// ./node_modules/rc-upload/es/AjaxUploader.js
- var AjaxUploader_excluded = ["component", "prefixCls", "className", "classNames", "disabled", "id", "name", "style", "styles", "multiple", "accept", "capture", "children", "directory", "openFileDialogOnClick", "onMouseEnter", "onMouseLeave", "hasControlInside"];
- /* eslint react/no-is-mounted:0,react/sort-comp:0,react/prop-types:0 */
- var AjaxUploader = /*#__PURE__*/function (_Component) {
- (0,inherits["default"])(AjaxUploader, _Component);
- var _super = (0,createSuper["default"])(AjaxUploader);
- function AjaxUploader() {
- var _this;
- (0,classCallCheck["default"])(this, AjaxUploader);
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(args));
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "state", {
- uid: uid_uid()
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "reqs", {});
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "fileInput", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "_isMounted", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onChange", function (e) {
- var _this$props = _this.props,
- accept = _this$props.accept,
- directory = _this$props.directory;
- var files = e.target.files;
- var acceptedFiles = (0,toConsumableArray["default"])(files).filter(function (file) {
- return !directory || attr_accept(file, accept);
- });
- _this.uploadFiles(acceptedFiles);
- _this.reset();
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onClick", function (event) {
- var el = _this.fileInput;
- if (!el) {
- return;
- }
- var target = event.target;
- var onClick = _this.props.onClick;
- if (target && target.tagName === 'BUTTON') {
- var parent = el.parentNode;
- parent.focus();
- target.blur();
- }
- el.click();
- if (onClick) {
- onClick(event);
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onKeyDown", function (e) {
- if (e.key === 'Enter') {
- _this.onClick(e);
- }
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onDataTransferFiles", /*#__PURE__*/function () {
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataTransfer, existFileCallback) {
- var _this$props2, multiple, accept, directory, items, files, acceptFiles;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- _this$props2 = _this.props, multiple = _this$props2.multiple, accept = _this$props2.accept, directory = _this$props2.directory;
- items = (0,toConsumableArray["default"])(dataTransfer.items || []);
- files = (0,toConsumableArray["default"])(dataTransfer.files || []);
- if (files.length > 0 || items.some(function (item) {
- return item.kind === 'file';
- })) {
- existFileCallback === null || existFileCallback === void 0 || existFileCallback();
- }
- if (!directory) {
- _context.next = 11;
- break;
- }
- _context.next = 7;
- return es_traverseFileTree(Array.prototype.slice.call(items), function (_file) {
- return attr_accept(_file, _this.props.accept);
- });
- case 7:
- files = _context.sent;
- _this.uploadFiles(files);
- _context.next = 14;
- break;
- case 11:
- acceptFiles = (0,toConsumableArray["default"])(files).filter(function (file) {
- return attr_accept(file, accept);
- });
- if (multiple === false) {
- acceptFiles = files.slice(0, 1);
- }
- _this.uploadFiles(acceptFiles);
- case 14:
- case "end":
- return _context.stop();
- }
- }, _callee);
- }));
- return function (_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }());
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onFilePaste", /*#__PURE__*/function () {
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
- var pastable, clipboardData;
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- pastable = _this.props.pastable;
- if (pastable) {
- _context2.next = 3;
- break;
- }
- return _context2.abrupt("return");
- case 3:
- if (!(e.type === 'paste')) {
- _context2.next = 6;
- break;
- }
- clipboardData = e.clipboardData;
- return _context2.abrupt("return", _this.onDataTransferFiles(clipboardData, function () {
- e.preventDefault();
- }));
- case 6:
- case "end":
- return _context2.stop();
- }
- }, _callee2);
- }));
- return function (_x3) {
- return _ref2.apply(this, arguments);
- };
- }());
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onFileDragOver", function (e) {
- e.preventDefault();
- });
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "onFileDrop", /*#__PURE__*/function () {
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
- var dataTransfer;
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
- while (1) switch (_context3.prev = _context3.next) {
- case 0:
- e.preventDefault();
- if (!(e.type === 'drop')) {
- _context3.next = 4;
- break;
- }
- dataTransfer = e.dataTransfer;
- return _context3.abrupt("return", _this.onDataTransferFiles(dataTransfer));
- case 4:
- case "end":
- return _context3.stop();
- }
- }, _callee3);
- }));
- return function (_x4) {
- return _ref3.apply(this, arguments);
- };
- }());
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "uploadFiles", function (files) {
- var originFiles = (0,toConsumableArray["default"])(files);
- var postFiles = originFiles.map(function (file) {
- // eslint-disable-next-line no-param-reassign
- file.uid = uid_uid();
- return _this.processFile(file, originFiles);
- });
- // Batch upload files
- Promise.all(postFiles).then(function (fileList) {
- var onBatchStart = _this.props.onBatchStart;
- onBatchStart === null || onBatchStart === void 0 || onBatchStart(fileList.map(function (_ref4) {
- var origin = _ref4.origin,
- parsedFile = _ref4.parsedFile;
- return {
- file: origin,
- parsedFile: parsedFile
- };
- }));
- fileList.filter(function (file) {
- return file.parsedFile !== null;
- }).forEach(function (file) {
- _this.post(file);
- });
- });
- });
- /**
- * Process file before upload. When all the file is ready, we start upload.
- */
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "processFile", /*#__PURE__*/function () {
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file, fileList) {
- var beforeUpload, transformedFile, action, mergedAction, data, mergedData, parsedData, parsedFile, mergedParsedFile;
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
- while (1) switch (_context4.prev = _context4.next) {
- case 0:
- beforeUpload = _this.props.beforeUpload;
- transformedFile = file;
- if (!beforeUpload) {
- _context4.next = 14;
- break;
- }
- _context4.prev = 3;
- _context4.next = 6;
- return beforeUpload(file, fileList);
- case 6:
- transformedFile = _context4.sent;
- _context4.next = 12;
- break;
- case 9:
- _context4.prev = 9;
- _context4.t0 = _context4["catch"](3);
- // Rejection will also trade as false
- transformedFile = false;
- case 12:
- if (!(transformedFile === false)) {
- _context4.next = 14;
- break;
- }
- return _context4.abrupt("return", {
- origin: file,
- parsedFile: null,
- action: null,
- data: null
- });
- case 14:
- // Get latest action
- action = _this.props.action;
- if (!(typeof action === 'function')) {
- _context4.next = 21;
- break;
- }
- _context4.next = 18;
- return action(file);
- case 18:
- mergedAction = _context4.sent;
- _context4.next = 22;
- break;
- case 21:
- mergedAction = action;
- case 22:
- // Get latest data
- data = _this.props.data;
- if (!(typeof data === 'function')) {
- _context4.next = 29;
- break;
- }
- _context4.next = 26;
- return data(file);
- case 26:
- mergedData = _context4.sent;
- _context4.next = 30;
- break;
- case 29:
- mergedData = data;
- case 30:
- parsedData =
- // string type is from legacy `transformFile`.
- // Not sure if this will work since no related test case works with it
- ((0,esm_typeof["default"])(transformedFile) === 'object' || typeof transformedFile === 'string') && transformedFile ? transformedFile : file;
- if (parsedData instanceof File) {
- parsedFile = parsedData;
- } else {
- parsedFile = new File([parsedData], file.name, {
- type: file.type
- });
- }
- mergedParsedFile = parsedFile;
- mergedParsedFile.uid = file.uid;
- return _context4.abrupt("return", {
- origin: file,
- data: mergedData,
- parsedFile: mergedParsedFile,
- action: mergedAction
- });
- case 35:
- case "end":
- return _context4.stop();
- }
- }, _callee4, null, [[3, 9]]);
- }));
- return function (_x5, _x6) {
- return _ref5.apply(this, arguments);
- };
- }());
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "saveFileInput", function (node) {
- _this.fileInput = node;
- });
- return _this;
- }
- (0,createClass["default"])(AjaxUploader, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- this._isMounted = true;
- var pastable = this.props.pastable;
- if (pastable) {
- document.addEventListener('paste', this.onFilePaste);
- }
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- this._isMounted = false;
- this.abort();
- document.removeEventListener('paste', this.onFilePaste);
- }
- }, {
- key: "componentDidUpdate",
- value: function componentDidUpdate(prevProps) {
- var pastable = this.props.pastable;
- if (pastable && !prevProps.pastable) {
- document.addEventListener('paste', this.onFilePaste);
- } else if (!pastable && prevProps.pastable) {
- document.removeEventListener('paste', this.onFilePaste);
- }
- }
- }, {
- key: "post",
- value: function post(_ref6) {
- var _this2 = this;
- var data = _ref6.data,
- origin = _ref6.origin,
- action = _ref6.action,
- parsedFile = _ref6.parsedFile;
- if (!this._isMounted) {
- return;
- }
- var _this$props3 = this.props,
- onStart = _this$props3.onStart,
- customRequest = _this$props3.customRequest,
- name = _this$props3.name,
- headers = _this$props3.headers,
- withCredentials = _this$props3.withCredentials,
- method = _this$props3.method;
- var uid = origin.uid;
- var request = customRequest || upload;
- var requestOption = {
- action: action,
- filename: name,
- data: data,
- file: parsedFile,
- headers: headers,
- withCredentials: withCredentials,
- method: method || 'post',
- onProgress: function onProgress(e) {
- var onProgress = _this2.props.onProgress;
- onProgress === null || onProgress === void 0 || onProgress(e, parsedFile);
- },
- onSuccess: function onSuccess(ret, xhr) {
- var onSuccess = _this2.props.onSuccess;
- onSuccess === null || onSuccess === void 0 || onSuccess(ret, parsedFile, xhr);
- delete _this2.reqs[uid];
- },
- onError: function onError(err, ret) {
- var onError = _this2.props.onError;
- onError === null || onError === void 0 || onError(err, ret, parsedFile);
- delete _this2.reqs[uid];
- }
- };
- onStart(origin);
- this.reqs[uid] = request(requestOption);
- }
- }, {
- key: "reset",
- value: function reset() {
- this.setState({
- uid: uid_uid()
- });
- }
- }, {
- key: "abort",
- value: function abort(file) {
- var reqs = this.reqs;
- if (file) {
- var uid = file.uid ? file.uid : file;
- if (reqs[uid] && reqs[uid].abort) {
- reqs[uid].abort();
- }
- delete reqs[uid];
- } else {
- Object.keys(reqs).forEach(function (uid) {
- if (reqs[uid] && reqs[uid].abort) {
- reqs[uid].abort();
- }
- delete reqs[uid];
- });
- }
- }
- }, {
- key: "render",
- value: function render() {
- var _this$props4 = this.props,
- Tag = _this$props4.component,
- prefixCls = _this$props4.prefixCls,
- className = _this$props4.className,
- _this$props4$classNam = _this$props4.classNames,
- classNames = _this$props4$classNam === void 0 ? {} : _this$props4$classNam,
- disabled = _this$props4.disabled,
- id = _this$props4.id,
- name = _this$props4.name,
- style = _this$props4.style,
- _this$props4$styles = _this$props4.styles,
- styles = _this$props4$styles === void 0 ? {} : _this$props4$styles,
- multiple = _this$props4.multiple,
- accept = _this$props4.accept,
- capture = _this$props4.capture,
- children = _this$props4.children,
- directory = _this$props4.directory,
- openFileDialogOnClick = _this$props4.openFileDialogOnClick,
- onMouseEnter = _this$props4.onMouseEnter,
- onMouseLeave = _this$props4.onMouseLeave,
- hasControlInside = _this$props4.hasControlInside,
- otherProps = (0,objectWithoutProperties["default"])(_this$props4, AjaxUploader_excluded);
- var cls = classnames_default()((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, prefixCls, true), "".concat(prefixCls, "-disabled"), disabled), className, className));
- // because input don't have directory/webkitdirectory type declaration
- var dirProps = directory ? {
- directory: 'directory',
- webkitdirectory: 'webkitdirectory'
- } : {};
- var events = disabled ? {} : {
- onClick: openFileDialogOnClick ? this.onClick : function () {},
- onKeyDown: openFileDialogOnClick ? this.onKeyDown : function () {},
- onMouseEnter: onMouseEnter,
- onMouseLeave: onMouseLeave,
- onDrop: this.onFileDrop,
- onDragOver: this.onFileDragOver,
- tabIndex: hasControlInside ? undefined : '0'
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Tag, (0,esm_extends["default"])({}, events, {
- className: cls,
- role: hasControlInside ? undefined : 'button',
- style: style
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("input", (0,esm_extends["default"])({}, (0,pickAttrs["default"])(otherProps, {
- aria: true,
- data: true
- }), {
- id: id
- /**
- * https://github.com/ant-design/ant-design/issues/50643,
- * https://github.com/react-component/upload/pull/575#issuecomment-2320646552
- */,
- name: name,
- disabled: disabled,
- type: "file",
- ref: this.saveFileInput,
- onClick: function onClick(e) {
- return e.stopPropagation();
- } // https://github.com/ant-design/ant-design/issues/19948
- ,
- key: this.state.uid,
- style: (0,objectSpread2["default"])({
- display: 'none'
- }, styles.input),
- className: classNames.input,
- accept: accept
- }, dirProps, {
- multiple: multiple,
- onChange: this.onChange
- }, capture != null ? {
- capture: capture
- } : {})), children);
- }
- }]);
- return AjaxUploader;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- /* harmony default export */ var es_AjaxUploader = (AjaxUploader);
- ;// ./node_modules/rc-upload/es/Upload.js
- /* eslint react/prop-types:0 */
- function Upload_empty() {}
- var Upload = /*#__PURE__*/function (_Component) {
- (0,inherits["default"])(Upload, _Component);
- var _super = (0,createSuper["default"])(Upload);
- function Upload() {
- var _this;
- (0,classCallCheck["default"])(this, Upload);
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(args));
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "uploader", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "saveUploader", function (node) {
- _this.uploader = node;
- });
- return _this;
- }
- (0,createClass["default"])(Upload, [{
- key: "abort",
- value: function abort(file) {
- this.uploader.abort(file);
- }
- }, {
- key: "render",
- value: function render() {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es_AjaxUploader, (0,esm_extends["default"])({}, this.props, {
- ref: this.saveUploader
- }));
- }
- }]);
- return Upload;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- (0,defineProperty["default"])(Upload, "defaultProps", {
- component: 'span',
- prefixCls: 'rc-upload',
- data: {},
- headers: {},
- name: 'file',
- multipart: false,
- onStart: Upload_empty,
- onError: Upload_empty,
- onSuccess: Upload_empty,
- multiple: false,
- beforeUpload: null,
- customRequest: null,
- withCredentials: false,
- openFileDialogOnClick: true,
- hasControlInside: false
- });
- /* harmony default export */ var es_Upload = (Upload);
- ;// ./node_modules/rc-upload/es/index.js
- /* harmony default export */ var rc_upload_es = (es_Upload);
- // EXTERNAL MODULE: ./components/upload/style/index.ts + 5 modules
- var upload_style = __webpack_require__("./components/upload/style/index.ts");
- ;// ./node_modules/@ant-design/icons-svg/es/asn/FileTwoTone.js
- // This icon file is generated automatically.
- var FileTwoTone = { "icon": function render(primaryColor, secondaryColor) { return { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M534 352V136H232v752h560V394H576a42 42 0 01-42-42z", "fill": secondaryColor } }, { "tag": "path", "attrs": { "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z", "fill": primaryColor } }] }; }, "name": "file", "theme": "twotone" };
- /* harmony default export */ var asn_FileTwoTone = (FileTwoTone);
- ;// ./node_modules/@ant-design/icons/es/icons/FileTwoTone.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var FileTwoTone_FileTwoTone = function FileTwoTone(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_FileTwoTone
- }));
- };
- /** */
- var FileTwoTone_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(FileTwoTone_FileTwoTone);
- if (true) {
- FileTwoTone_RefIcon.displayName = 'FileTwoTone';
- }
- /* harmony default export */ var icons_FileTwoTone = (FileTwoTone_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/PaperClipOutlined.js
- // This icon file is generated automatically.
- var PaperClipOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z" } }] }, "name": "paper-clip", "theme": "outlined" };
- /* harmony default export */ var asn_PaperClipOutlined = (PaperClipOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/PaperClipOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var PaperClipOutlined_PaperClipOutlined = function PaperClipOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_PaperClipOutlined
- }));
- };
- /** */
- var PaperClipOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(PaperClipOutlined_PaperClipOutlined);
- if (true) {
- PaperClipOutlined_RefIcon.displayName = 'PaperClipOutlined';
- }
- /* harmony default export */ var icons_PaperClipOutlined = (PaperClipOutlined_RefIcon);
- ;// ./node_modules/@ant-design/icons-svg/es/asn/PictureTwoTone.js
- // This icon file is generated automatically.
- var PictureTwoTone = { "icon": function render(primaryColor, secondaryColor) { return { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z", "fill": primaryColor } }, { "tag": "path", "attrs": { "d": "M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z", "fill": secondaryColor } }, { "tag": "path", "attrs": { "d": "M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z", "fill": secondaryColor } }, { "tag": "path", "attrs": { "d": "M276 368a28 28 0 1056 0 28 28 0 10-56 0z", "fill": secondaryColor } }, { "tag": "path", "attrs": { "d": "M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z", "fill": primaryColor } }] }; }, "name": "picture", "theme": "twotone" };
- /* harmony default export */ var asn_PictureTwoTone = (PictureTwoTone);
- ;// ./node_modules/@ant-design/icons/es/icons/PictureTwoTone.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var PictureTwoTone_PictureTwoTone = function PictureTwoTone(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_PictureTwoTone
- }));
- };
- /** */
- var PictureTwoTone_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(PictureTwoTone_PictureTwoTone);
- if (true) {
- PictureTwoTone_RefIcon.displayName = 'PictureTwoTone';
- }
- /* harmony default export */ var icons_PictureTwoTone = (PictureTwoTone_RefIcon);
- ;// ./components/upload/utils.ts
- function file2Obj(file) {
- return Object.assign(Object.assign({}, file), {
- lastModified: file.lastModified,
- lastModifiedDate: file.lastModifiedDate,
- name: file.name,
- size: file.size,
- type: file.type,
- uid: file.uid,
- percent: 0,
- originFileObj: file
- });
- }
- /** Upload fileList. Replace file if exist or just push into it. */
- function updateFileList(file, fileList) {
- const nextFileList = (0,toConsumableArray["default"])(fileList);
- const fileIndex = nextFileList.findIndex(({
- uid
- }) => uid === file.uid);
- if (fileIndex === -1) {
- nextFileList.push(file);
- } else {
- nextFileList[fileIndex] = file;
- }
- return nextFileList;
- }
- function getFileItem(file, fileList) {
- const matchKey = file.uid !== undefined ? 'uid' : 'name';
- return fileList.filter(item => item[matchKey] === file[matchKey])[0];
- }
- function removeFileItem(file, fileList) {
- const matchKey = file.uid !== undefined ? 'uid' : 'name';
- const removed = fileList.filter(item => item[matchKey] !== file[matchKey]);
- if (removed.length === fileList.length) {
- return null;
- }
- return removed;
- }
- // ==================== Default Image Preview ====================
- const extname = (url = '') => {
- const temp = url.split('/');
- const filename = temp[temp.length - 1];
- const filenameWithoutSuffix = filename.split(/#|\?/)[0];
- return (/\.[^./\\]*$/.exec(filenameWithoutSuffix) || [''])[0];
- };
- const isImageFileType = type => type.indexOf('image/') === 0;
- const isImageUrl = file => {
- if (file.type && !file.thumbUrl) {
- return isImageFileType(file.type);
- }
- const url = file.thumbUrl || file.url || '';
- const extension = extname(url);
- if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(extension)) {
- return true;
- }
- if (/^data:/.test(url)) {
- // other file types of base64
- return false;
- }
- if (extension) {
- // other file types which have extension
- return false;
- }
- return true;
- };
- const MEASURE_SIZE = 200;
- function previewImage(file) {
- return new Promise(resolve => {
- if (!file.type || !isImageFileType(file.type)) {
- resolve('');
- return;
- }
- const canvas = document.createElement('canvas');
- canvas.width = MEASURE_SIZE;
- canvas.height = MEASURE_SIZE;
- canvas.style.cssText = `position: fixed; left: 0; top: 0; width: ${MEASURE_SIZE}px; height: ${MEASURE_SIZE}px; z-index: 9999; display: none;`;
- document.body.appendChild(canvas);
- const ctx = canvas.getContext('2d');
- const img = new Image();
- img.onload = () => {
- const {
- width,
- height
- } = img;
- let drawWidth = MEASURE_SIZE;
- let drawHeight = MEASURE_SIZE;
- let offsetX = 0;
- let offsetY = 0;
- if (width > height) {
- drawHeight = height * (MEASURE_SIZE / width);
- offsetY = -(drawHeight - drawWidth) / 2;
- } else {
- drawWidth = width * (MEASURE_SIZE / height);
- offsetX = -(drawWidth - drawHeight) / 2;
- }
- ctx.drawImage(img, offsetX, offsetY, drawWidth, drawHeight);
- const dataURL = canvas.toDataURL();
- document.body.removeChild(canvas);
- window.URL.revokeObjectURL(img.src);
- resolve(dataURL);
- };
- img.crossOrigin = 'anonymous';
- if (file.type.startsWith('image/svg+xml')) {
- const reader = new FileReader();
- reader.onload = () => {
- if (reader.result && typeof reader.result === 'string') {
- img.src = reader.result;
- }
- };
- reader.readAsDataURL(file);
- } else if (file.type.startsWith('image/gif')) {
- const reader = new FileReader();
- reader.onload = () => {
- if (reader.result) {
- resolve(reader.result);
- }
- };
- reader.readAsDataURL(file);
- } else {
- img.src = window.URL.createObjectURL(file);
- }
- });
- }
- ;// ./node_modules/@ant-design/icons-svg/es/asn/DownloadOutlined.js
- // This icon file is generated automatically.
- var DownloadOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, "name": "download", "theme": "outlined" };
- /* harmony default export */ var asn_DownloadOutlined = (DownloadOutlined);
- ;// ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var DownloadOutlined_DownloadOutlined = function DownloadOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_DownloadOutlined
- }));
- };
- /** */
- var DownloadOutlined_RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(DownloadOutlined_DownloadOutlined);
- if (true) {
- DownloadOutlined_RefIcon.displayName = 'DownloadOutlined';
- }
- /* harmony default export */ var icons_DownloadOutlined = (DownloadOutlined_RefIcon);
- ;// ./components/upload/UploadList/ListItem.tsx
- const ListItem_ListItem = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(({
- prefixCls,
- className,
- style,
- locale,
- listType,
- file,
- items,
- progress: progressProps,
- iconRender,
- actionIconRender,
- itemRender,
- isImgUrl,
- showPreviewIcon,
- showRemoveIcon,
- showDownloadIcon,
- previewIcon: customPreviewIcon,
- removeIcon: customRemoveIcon,
- downloadIcon: customDownloadIcon,
- extra: customExtra,
- onPreview,
- onDownload,
- onClose
- }, ref) => {
- var _a, _b;
- // Status: which will ignore `removed` status
- const {
- status
- } = file;
- const [mergedStatus, setMergedStatus] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(status);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (status !== 'removed') {
- setMergedStatus(status);
- }
- }, [status]);
- // Delay to show the progress bar
- const [showProgress, setShowProgress] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- const timer = setTimeout(() => {
- setShowProgress(true);
- }, 300);
- return () => {
- clearTimeout(timer);
- };
- }, []);
- const iconNode = iconRender(file);
- let icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-icon`
- }, iconNode);
- if (listType === 'picture' || listType === 'picture-card' || listType === 'picture-circle') {
- if (mergedStatus === 'uploading' || !file.thumbUrl && !file.url) {
- const uploadingClassName = classnames_default()(`${prefixCls}-list-item-thumbnail`, {
- [`${prefixCls}-list-item-file`]: mergedStatus !== 'uploading'
- });
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: uploadingClassName
- }, iconNode);
- } else {
- const thumbnail = (isImgUrl === null || isImgUrl === void 0 ? void 0 : isImgUrl(file)) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("img", {
- src: file.thumbUrl || file.url,
- alt: file.name,
- className: `${prefixCls}-list-item-image`,
- crossOrigin: file.crossOrigin
- })) : iconNode;
- const aClassName = classnames_default()(`${prefixCls}-list-item-thumbnail`, {
- [`${prefixCls}-list-item-file`]: isImgUrl && !isImgUrl(file)
- });
- icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- className: aClassName,
- onClick: e => onPreview(file, e),
- href: file.url || file.thumbUrl,
- target: "_blank",
- rel: "noopener noreferrer"
- }, thumbnail);
- }
- }
- const listItemClassName = classnames_default()(`${prefixCls}-list-item`, `${prefixCls}-list-item-${mergedStatus}`);
- const linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps;
- const removeIcon = (typeof showRemoveIcon === 'function' ? showRemoveIcon(file) : showRemoveIcon) ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DeleteOutlined, null)), () => onClose(file), prefixCls, locale.removeFile,
- // acceptUploadDisabled is true, only remove icon will follow Upload disabled prop
- // https://github.com/ant-design/ant-design/issues/46171
- true) : null;
- const downloadIcon = (typeof showDownloadIcon === 'function' ? showDownloadIcon(file) : showDownloadIcon) && mergedStatus === 'done' ? actionIconRender((typeof customDownloadIcon === 'function' ? customDownloadIcon(file) : customDownloadIcon) || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_DownloadOutlined, null), () => onDownload(file), prefixCls, locale.downloadFile) : null;
- const downloadOrDelete = listType !== 'picture-card' && listType !== 'picture-circle' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: "download-delete",
- className: classnames_default()(`${prefixCls}-list-item-actions`, {
- picture: listType === 'picture'
- })
- }, downloadIcon, removeIcon));
- const extraContent = typeof customExtra === 'function' ? customExtra(file) : customExtra;
- const extra = extraContent && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-list-item-extra`
- }, extraContent));
- const listItemNameClass = classnames_default()(`${prefixCls}-list-item-name`);
- const fileName = file.url ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", Object.assign({
- key: "view",
- target: "_blank",
- rel: "noopener noreferrer",
- className: listItemNameClass,
- title: file.name
- }, linkProps, {
- href: file.url,
- onClick: e => onPreview(file, e)
- }), file.name, extra)) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- key: "view",
- className: listItemNameClass,
- onClick: e => onPreview(file, e),
- title: file.name
- }, file.name, extra));
- const previewIcon = (typeof showPreviewIcon === 'function' ? showPreviewIcon(file) : showPreviewIcon) && (file.url || file.thumbUrl) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("a", {
- href: file.url || file.thumbUrl,
- target: "_blank",
- rel: "noopener noreferrer",
- onClick: e => onPreview(file, e),
- title: locale.previewFile
- }, typeof customPreviewIcon === 'function' ? customPreviewIcon(file) : customPreviewIcon || /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_EyeOutlined, null))) : null;
- const pictureCardActions = (listType === 'picture-card' || listType === 'picture-circle') && mergedStatus !== 'uploading' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: `${prefixCls}-list-item-actions`
- }, previewIcon, mergedStatus === 'done' && downloadIcon, removeIcon));
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const rootPrefixCls = getPrefixCls();
- const dom = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: listItemClassName
- }, icon, fileName, downloadOrDelete, pictureCardActions, showProgress && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], {
- motionName: `${rootPrefixCls}-fade`,
- visible: mergedStatus === 'uploading',
- motionDeadline: 2000
- }, ({
- className: motionClassName
- }) => {
- // show loading icon if upload progress listener is disabled
- const loadingProgress = 'percent' in file ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_progress, Object.assign({
- type: "line",
- percent: file.percent,
- "aria-label": file['aria-label'],
- "aria-labelledby": file['aria-labelledby']
- }, progressProps))) : null;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-list-item-progress`, motionClassName)
- }, loadingProgress);
- })));
- const message = file.response && typeof file.response === 'string' ? file.response : ((_a = file.error) === null || _a === void 0 ? void 0 : _a.statusText) || ((_b = file.error) === null || _b === void 0 ? void 0 : _b.message) || locale.uploadError;
- const item = mergedStatus === 'error' ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_tooltip, {
- title: message,
- getPopupContainer: node => node.parentNode
- }, dom)) : dom;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: classnames_default()(`${prefixCls}-list-item-container`, className),
- style: style,
- ref: ref
- }, itemRender ? itemRender(item, file, items, {
- download: onDownload.bind(null, file),
- preview: onPreview.bind(null, file),
- remove: onClose.bind(null, file)
- }) : item);
- });
- /* harmony default export */ var UploadList_ListItem = (ListItem_ListItem);
- ;// ./components/upload/UploadList/index.tsx
- const InternalUploadList = (props, ref) => {
- const {
- listType = 'text',
- previewFile = previewImage,
- onPreview,
- onDownload,
- onRemove,
- locale,
- iconRender,
- isImageUrl: isImgUrl = isImageUrl,
- prefixCls: customizePrefixCls,
- items = [],
- showPreviewIcon = true,
- showRemoveIcon = true,
- showDownloadIcon = false,
- removeIcon,
- previewIcon,
- downloadIcon,
- extra,
- progress = {
- size: [-1, 2],
- showInfo: false
- },
- appendAction,
- appendActionVisible = true,
- itemRender,
- disabled
- } = props;
- const forceUpdate = useForceUpdate();
- const [motionAppear, setMotionAppear] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(false);
- const isPictureCardOrCirle = ['picture-card', 'picture-circle'].includes(listType);
- // ============================= Effect =============================
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- if (!listType.startsWith('picture')) {
- return;
- }
- (items || []).forEach(file => {
- if (!(file.originFileObj instanceof File || file.originFileObj instanceof Blob) || file.thumbUrl !== undefined) {
- return;
- }
- file.thumbUrl = '';
- previewFile === null || previewFile === void 0 ? void 0 : previewFile(file.originFileObj).then(previewDataUrl => {
- // Need append '' to avoid dead loop
- file.thumbUrl = previewDataUrl || '';
- forceUpdate();
- });
- });
- }, [listType, items, previewFile]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(() => {
- setMotionAppear(true);
- }, []);
- // ============================= Events =============================
- const onInternalPreview = (file, e) => {
- if (!onPreview) {
- return;
- }
- e === null || e === void 0 ? void 0 : e.preventDefault();
- return onPreview(file);
- };
- const onInternalDownload = file => {
- if (typeof onDownload === 'function') {
- onDownload(file);
- } else if (file.url) {
- window.open(file.url);
- }
- };
- const onInternalClose = file => {
- onRemove === null || onRemove === void 0 ? void 0 : onRemove(file);
- };
- const internalIconRender = file => {
- if (iconRender) {
- return iconRender(file, listType);
- }
- const isLoading = file.status === 'uploading';
- if (listType.startsWith('picture')) {
- const loadingIcon = listType === 'picture' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null) : locale.uploading;
- const fileIcon = (isImgUrl === null || isImgUrl === void 0 ? void 0 : isImgUrl(file)) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_PictureTwoTone, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_FileTwoTone, null);
- return isLoading ? loadingIcon : fileIcon;
- }
- return isLoading ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_LoadingOutlined, null) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(icons_PaperClipOutlined, null);
- };
- const actionIconRender = (customIcon, callback, prefixCls, title, acceptUploadDisabled) => {
- const btnProps = {
- type: 'text',
- size: 'small',
- title,
- onClick: e => {
- var _a, _b;
- callback();
- if (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(customIcon)) {
- (_b = (_a = customIcon.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
- }
- },
- className: `${prefixCls}-list-item-action`,
- disabled: acceptUploadDisabled ? disabled : false
- };
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(customIcon) ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, Object.assign({}, btnProps, {
- icon: (0,reactNode.cloneElement)(customIcon, Object.assign(Object.assign({}, customIcon.props), {
- onClick: () => {}
- }))
- }))) : (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_button, Object.assign({}, btnProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", null, customIcon)));
- };
- // ============================== Ref ===============================
- // Test needs
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- handlePreview: onInternalPreview,
- handleDownload: onInternalDownload
- }));
- const {
- getPrefixCls
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- // ============================= Render =============================
- const prefixCls = getPrefixCls('upload', customizePrefixCls);
- const rootPrefixCls = getPrefixCls();
- const listClassNames = classnames_default()(`${prefixCls}-list`, `${prefixCls}-list-${listType}`);
- const listItemMotion = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => (0,omit["default"])((0,_util_motion["default"])(rootPrefixCls), ['onAppearEnd', 'onEnterEnd', 'onLeaveEnd']), [rootPrefixCls]);
- const motionConfig = Object.assign(Object.assign({}, isPictureCardOrCirle ? {} : listItemMotion), {
- motionDeadline: 2000,
- motionName: `${prefixCls}-${isPictureCardOrCirle ? 'animate-inline' : 'animate'}`,
- keys: (0,toConsumableArray["default"])(items.map(file => ({
- key: file.uid,
- file
- }))),
- motionAppear
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: listClassNames
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es.CSSMotionList, Object.assign({}, motionConfig, {
- component: false
- }), ({
- key,
- file,
- className: motionClassName,
- style: motionStyle
- }) => (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(UploadList_ListItem, {
- key: key,
- locale: locale,
- prefixCls: prefixCls,
- className: motionClassName,
- style: motionStyle,
- file: file,
- items: items,
- progress: progress,
- listType: listType,
- isImgUrl: isImgUrl,
- showPreviewIcon: showPreviewIcon,
- showRemoveIcon: showRemoveIcon,
- showDownloadIcon: showDownloadIcon,
- removeIcon: removeIcon,
- previewIcon: previewIcon,
- downloadIcon: downloadIcon,
- extra: extra,
- iconRender: internalIconRender,
- actionIconRender: actionIconRender,
- itemRender: itemRender,
- onPreview: onInternalPreview,
- onDownload: onInternalDownload,
- onClose: onInternalClose
- }))), appendAction && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_motion_es["default"], Object.assign({}, motionConfig, {
- visible: appendActionVisible,
- forceRender: true
- }), ({
- className: motionClassName,
- style: motionStyle
- }) => (0,reactNode.cloneElement)(appendAction, oriProps => ({
- className: classnames_default()(oriProps.className, motionClassName),
- style: Object.assign(Object.assign(Object.assign({}, motionStyle), {
- // prevent the element has hover css pseudo-class that may cause animation to end prematurely.
- pointerEvents: motionClassName ? 'none' : undefined
- }), oriProps.style)
- })))));
- };
- const UploadList = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalUploadList);
- if (true) {
- UploadList.displayName = 'UploadList';
- }
- /* harmony default export */ var upload_UploadList = (UploadList);
- ;// ./components/upload/Upload.tsx
- var Upload_awaiter = undefined && undefined.__awaiter || function (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 (e) {
- reject(e);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e) {
- reject(e);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- const LIST_IGNORE = `__LIST_IGNORE_${Date.now()}__`;
- const InternalUpload = (props, ref) => {
- const config = (0,config_provider_context.useComponentConfig)('upload');
- const {
- fileList,
- defaultFileList,
- onRemove,
- showUploadList = true,
- listType = 'text',
- onPreview,
- onDownload,
- onChange,
- onDrop,
- previewFile,
- disabled: customDisabled,
- locale: propLocale,
- iconRender,
- isImageUrl,
- progress,
- prefixCls: customizePrefixCls,
- className,
- type = 'select',
- children,
- style,
- itemRender,
- maxCount,
- data = {},
- multiple = false,
- hasControlInside = true,
- action = '',
- accept = '',
- supportServerRender = true,
- rootClassName
- } = props;
- // ===================== Disabled =====================
- const disabled = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_DisabledContext);
- const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
- const customRequest = props.customRequest || config.customRequest;
- const [mergedFileList, setMergedFileList] = (0,useMergedState["default"])(defaultFileList || [], {
- value: fileList,
- postState: list => list !== null && list !== void 0 ? list : []
- });
- const [dragState, setDragState] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState('drop');
- const upload = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- const wrapRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Upload');
- true ? warning('fileList' in props || !('value' in props), 'usage', '`value` is not a valid prop, do you mean `fileList`?') : 0;
- warning.deprecated(!('transformFile' in props), 'transformFile', 'beforeUpload');
- }
- // Control mode will auto fill file uid if not provided
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const timestamp = Date.now();
- (fileList || []).forEach((file, index) => {
- if (!file.uid && !Object.isFrozen(file)) {
- file.uid = `__AUTO__${timestamp}_${index}__`;
- }
- });
- }, [fileList]);
- const onInternalChange = (file, changedFileList, event) => {
- let cloneList = (0,toConsumableArray["default"])(changedFileList);
- let exceedMaxCount = false;
- // Cut to match count
- if (maxCount === 1) {
- cloneList = cloneList.slice(-1);
- } else if (maxCount) {
- exceedMaxCount = cloneList.length > maxCount;
- cloneList = cloneList.slice(0, maxCount);
- }
- // Prevent React18 auto batch since input[upload] trigger process at same time
- // which makes fileList closure problem
- // eslint-disable-next-line react-dom/no-flush-sync
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(() => {
- setMergedFileList(cloneList);
- });
- const changeInfo = {
- file: file,
- fileList: cloneList
- };
- if (event) {
- changeInfo.event = event;
- }
- if (!exceedMaxCount || file.status === 'removed' ||
- // We should ignore event if current file is exceed `maxCount`
- cloneList.some(f => f.uid === file.uid)) {
- // eslint-disable-next-line react-dom/no-flush-sync
- (0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.flushSync)(() => {
- onChange === null || onChange === void 0 ? void 0 : onChange(changeInfo);
- });
- }
- };
- const mergedBeforeUpload = (file, fileListArgs) => Upload_awaiter(void 0, void 0, void 0, function* () {
- const {
- beforeUpload,
- transformFile
- } = props;
- let parsedFile = file;
- if (beforeUpload) {
- const result = yield beforeUpload(file, fileListArgs);
- if (result === false) {
- return false;
- }
- // Hack for LIST_IGNORE, we add additional info to remove from the list
- delete file[LIST_IGNORE];
- if (result === LIST_IGNORE) {
- Object.defineProperty(file, LIST_IGNORE, {
- value: true,
- configurable: true
- });
- return false;
- }
- if (typeof result === 'object' && result) {
- parsedFile = result;
- }
- }
- if (transformFile) {
- parsedFile = yield transformFile(parsedFile);
- }
- return parsedFile;
- });
- const onBatchStart = batchFileInfoList => {
- // Skip file which marked as `LIST_IGNORE`, these file will not add to file list
- const filteredFileInfoList = batchFileInfoList.filter(info => !info.file[LIST_IGNORE]);
- // Nothing to do since no file need upload
- if (!filteredFileInfoList.length) {
- return;
- }
- const objectFileList = filteredFileInfoList.map(info => file2Obj(info.file));
- // Concat new files with prev files
- let newFileList = (0,toConsumableArray["default"])(mergedFileList);
- objectFileList.forEach(fileObj => {
- // Replace file if exist
- newFileList = updateFileList(fileObj, newFileList);
- });
- objectFileList.forEach((fileObj, index) => {
- // Repeat trigger `onChange` event for compatible
- let triggerFileObj = fileObj;
- if (!filteredFileInfoList[index].parsedFile) {
- // `beforeUpload` return false
- const {
- originFileObj
- } = fileObj;
- let clone;
- try {
- clone = new File([originFileObj], originFileObj.name, {
- type: originFileObj.type
- });
- } catch (_a) {
- clone = new Blob([originFileObj], {
- type: originFileObj.type
- });
- clone.name = originFileObj.name;
- clone.lastModifiedDate = new Date();
- clone.lastModified = new Date().getTime();
- }
- clone.uid = fileObj.uid;
- triggerFileObj = clone;
- } else {
- // Inject `uploading` status
- fileObj.status = 'uploading';
- }
- onInternalChange(triggerFileObj, newFileList);
- });
- };
- const onSuccess = (response, file, xhr) => {
- try {
- if (typeof response === 'string') {
- response = JSON.parse(response);
- }
- } catch (_a) {
- /* do nothing */
- }
- // removed
- if (!getFileItem(file, mergedFileList)) {
- return;
- }
- const targetItem = file2Obj(file);
- targetItem.status = 'done';
- targetItem.percent = 100;
- targetItem.response = response;
- targetItem.xhr = xhr;
- const nextFileList = updateFileList(targetItem, mergedFileList);
- onInternalChange(targetItem, nextFileList);
- };
- const onProgress = (e, file) => {
- // removed
- if (!getFileItem(file, mergedFileList)) {
- return;
- }
- const targetItem = file2Obj(file);
- targetItem.status = 'uploading';
- targetItem.percent = e.percent;
- const nextFileList = updateFileList(targetItem, mergedFileList);
- onInternalChange(targetItem, nextFileList, e);
- };
- const onError = (error, response, file) => {
- // removed
- if (!getFileItem(file, mergedFileList)) {
- return;
- }
- const targetItem = file2Obj(file);
- targetItem.error = error;
- targetItem.response = response;
- targetItem.status = 'error';
- const nextFileList = updateFileList(targetItem, mergedFileList);
- onInternalChange(targetItem, nextFileList);
- };
- const handleRemove = file => {
- let currentFile;
- Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(ret => {
- var _a;
- // Prevent removing file
- if (ret === false) {
- return;
- }
- const removedFileList = removeFileItem(file, mergedFileList);
- if (removedFileList) {
- currentFile = Object.assign(Object.assign({}, file), {
- status: 'removed'
- });
- mergedFileList === null || mergedFileList === void 0 ? void 0 : mergedFileList.forEach(item => {
- const matchKey = currentFile.uid !== undefined ? 'uid' : 'name';
- if (item[matchKey] === currentFile[matchKey] && !Object.isFrozen(item)) {
- item.status = 'removed';
- }
- });
- (_a = upload.current) === null || _a === void 0 ? void 0 : _a.abort(currentFile);
- onInternalChange(currentFile, removedFileList);
- }
- });
- };
- const onFileDrop = e => {
- setDragState(e.type);
- if (e.type === 'drop') {
- onDrop === null || onDrop === void 0 ? void 0 : onDrop(e);
- }
- };
- // Test needs
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle(ref, () => ({
- onBatchStart,
- onSuccess,
- onProgress,
- onError,
- fileList: mergedFileList,
- upload: upload.current,
- nativeElement: wrapRef.current
- }));
- const {
- getPrefixCls,
- direction,
- upload: ctxUpload
- } = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(config_provider_context.ConfigContext);
- const prefixCls = getPrefixCls('upload', customizePrefixCls);
- const rcUploadProps = Object.assign(Object.assign({
- onBatchStart,
- onError,
- onProgress,
- onSuccess
- }, props), {
- customRequest,
- data,
- multiple,
- action,
- accept,
- supportServerRender,
- prefixCls,
- disabled: mergedDisabled,
- beforeUpload: mergedBeforeUpload,
- onChange: undefined,
- hasControlInside
- });
- delete rcUploadProps.className;
- delete rcUploadProps.style;
- // Remove id to avoid open by label when trigger is hidden
- // !children: https://github.com/ant-design/ant-design/issues/14298
- // disabled: https://github.com/ant-design/ant-design/issues/16478
- // https://github.com/ant-design/ant-design/issues/24197
- if (!children || mergedDisabled) {
- delete rcUploadProps.id;
- }
- const wrapperCls = `${prefixCls}-wrapper`;
- const [wrapCSSVar, hashId, cssVarCls] = (0,upload_style["default"])(prefixCls, wrapperCls);
- const [contextLocale] = (0,useLocale["default"])('Upload', en_US["default"].Upload);
- const {
- showRemoveIcon,
- showPreviewIcon,
- showDownloadIcon,
- removeIcon,
- previewIcon,
- downloadIcon,
- extra
- } = typeof showUploadList === 'boolean' ? {} : showUploadList;
- // use showRemoveIcon if it is specified explicitly
- const realShowRemoveIcon = typeof showRemoveIcon === 'undefined' ? !mergedDisabled : showRemoveIcon;
- const renderUploadList = (button, buttonVisible) => {
- if (!showUploadList) {
- return button;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(upload_UploadList, {
- prefixCls: prefixCls,
- listType: listType,
- items: mergedFileList,
- previewFile: previewFile,
- onPreview: onPreview,
- onDownload: onDownload,
- onRemove: handleRemove,
- showRemoveIcon: realShowRemoveIcon,
- showPreviewIcon: showPreviewIcon,
- showDownloadIcon: showDownloadIcon,
- removeIcon: removeIcon,
- previewIcon: previewIcon,
- downloadIcon: downloadIcon,
- iconRender: iconRender,
- extra: extra,
- locale: Object.assign(Object.assign({}, contextLocale), propLocale),
- isImageUrl: isImageUrl,
- progress: progress,
- appendAction: button,
- appendActionVisible: buttonVisible,
- itemRender: itemRender,
- disabled: mergedDisabled
- });
- };
- const mergedCls = classnames_default()(wrapperCls, className, rootClassName, hashId, cssVarCls, ctxUpload === null || ctxUpload === void 0 ? void 0 : ctxUpload.className, {
- [`${prefixCls}-rtl`]: direction === 'rtl',
- [`${prefixCls}-picture-card-wrapper`]: listType === 'picture-card',
- [`${prefixCls}-picture-circle-wrapper`]: listType === 'picture-circle'
- });
- const mergedStyle = Object.assign(Object.assign({}, ctxUpload === null || ctxUpload === void 0 ? void 0 : ctxUpload.style), style);
- // ======================== Render ========================
- if (type === 'drag') {
- const dragCls = classnames_default()(hashId, prefixCls, `${prefixCls}-drag`, {
- [`${prefixCls}-drag-uploading`]: mergedFileList.some(file => file.status === 'uploading'),
- [`${prefixCls}-drag-hover`]: dragState === 'dragover',
- [`${prefixCls}-disabled`]: mergedDisabled,
- [`${prefixCls}-rtl`]: direction === 'rtl'
- });
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: mergedCls,
- ref: wrapRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: dragCls,
- style: mergedStyle,
- onDrop: onFileDrop,
- onDragOver: onFileDrop,
- onDragLeave: onFileDrop
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_upload_es, Object.assign({}, rcUploadProps, {
- ref: upload,
- className: `${prefixCls}-btn`
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: `${prefixCls}-drag-container`
- }, children))), renderUploadList()));
- }
- const uploadBtnCls = classnames_default()(prefixCls, `${prefixCls}-select`, {
- [`${prefixCls}-disabled`]: mergedDisabled,
- [`${prefixCls}-hidden`]: !children
- });
- const uploadButton = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("div", {
- className: uploadBtnCls,
- style: mergedStyle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(rc_upload_es, Object.assign({}, rcUploadProps, {
- ref: upload
- })));
- if (listType === 'picture-card' || listType === 'picture-circle') {
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: mergedCls,
- ref: wrapRef
- }, renderUploadList(uploadButton, !!children)));
- }
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", {
- className: mergedCls,
- ref: wrapRef
- }, uploadButton, renderUploadList()));
- };
- const Upload_Upload = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(InternalUpload);
- if (true) {
- Upload_Upload.displayName = 'Upload';
- }
- /* harmony default export */ var upload_Upload = (Upload_Upload);
- ;// ./components/upload/Dragger.tsx
- var Dragger_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const Dragger = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef((_a, ref) => {
- var {
- style,
- height,
- hasControlInside = false
- } = _a,
- restProps = Dragger_rest(_a, ["style", "height", "hasControlInside"]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(upload_Upload, Object.assign({
- ref: ref,
- hasControlInside: hasControlInside
- }, restProps, {
- type: "drag",
- style: Object.assign(Object.assign({}, style), {
- height
- })
- }));
- });
- if (true) {
- Dragger.displayName = 'Dragger';
- }
- /* harmony default export */ var upload_Dragger = (Dragger);
- ;// ./components/upload/index.tsx
- const components_upload_Upload = upload_Upload;
- components_upload_Upload.Dragger = upload_Dragger;
- components_upload_Upload.LIST_IGNORE = LIST_IGNORE;
- /* harmony default export */ var components_upload = (components_upload_Upload);
- // EXTERNAL MODULE: ./components/version/index.tsx + 1 modules
- var components_version = __webpack_require__("./components/version/index.tsx");
- ;// ./node_modules/@rc-component/mutate-observer/es/wrapper.js
- var wrapper_DomWrapper = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(DomWrapper, _React$Component);
- var _super = (0,createSuper["default"])(DomWrapper);
- function DomWrapper() {
- (0,classCallCheck["default"])(this, DomWrapper);
- return _super.apply(this, arguments);
- }
- (0,createClass["default"])(DomWrapper, [{
- key: "render",
- value: function render() {
- return this.props.children;
- }
- }]);
- return DomWrapper;
- }((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Component);
- /* harmony default export */ var wrapper = (wrapper_DomWrapper);
- ;// ./node_modules/@rc-component/mutate-observer/es/useMutateObserver.js
- var defaultOptions = {
- subtree: true,
- childList: true,
- attributeFilter: ['style', 'class']
- };
- function useMutateObserver(nodeOrList, callback) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOptions;
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- if (!(0,canUseDom["default"])() || !nodeOrList) {
- return;
- }
- var instance;
- var nodeList = Array.isArray(nodeOrList) ? nodeOrList : [nodeOrList];
- if ('MutationObserver' in window) {
- instance = new MutationObserver(callback);
- nodeList.forEach(function (element) {
- instance.observe(element, options);
- });
- }
- return function () {
- var _instance, _instance2;
- (_instance = instance) === null || _instance === void 0 ? void 0 : _instance.takeRecords();
- (_instance2 = instance) === null || _instance2 === void 0 ? void 0 : _instance2.disconnect();
- };
- }, [options, nodeOrList]);
- }
- ;// ./node_modules/@rc-component/mutate-observer/es/MutateObserver.js
- var MutateObserver = function MutateObserver(props) {
- var children = props.children,
- options = props.options,
- _props$onMutate = props.onMutate,
- onMutate = _props$onMutate === void 0 ? function () {} : _props$onMutate;
- var callback = (0,useEvent["default"])(onMutate);
- var wrapperRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var elementRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- var canRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children) && (0,es_ref.supportRef)(children);
- var mergedRef = (0,es_ref.useComposeRef)(elementRef, canRef ? children.ref : null);
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null),
- _React$useState2 = (0,slicedToArray["default"])(_React$useState, 2),
- target = _React$useState2[0],
- setTarget = _React$useState2[1];
- useMutateObserver(target, callback, options);
- // =========================== Effect ===========================
- // Bind target
- (0,useLayoutEffect["default"])(function () {
- setTarget((0,findDOMNode["default"])(elementRef.current) || (0,findDOMNode["default"])(wrapperRef.current));
- });
- // =========================== Render ===========================
- if (!children) {
- if (true) {
- console.error('MutationObserver need children props');
- }
- return null;
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(wrapper, {
- ref: wrapperRef
- }, canRef ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, {
- ref: mergedRef
- }) : children);
- };
- /* harmony default export */ var es_MutateObserver = (MutateObserver);
- ;// ./node_modules/@rc-component/mutate-observer/es/index.js
- /* harmony default export */ var mutate_observer_es = (es_MutateObserver);
- ;// ./components/watermark/useClips.ts
- const FontGap = 3;
- const prepareCanvas = (width, height, ratio = 1) => {
- const canvas = document.createElement('canvas');
- const ctx = canvas.getContext('2d');
- const realWidth = width * ratio;
- const realHeight = height * ratio;
- canvas.setAttribute('width', `${realWidth}px`);
- canvas.setAttribute('height', `${realHeight}px`);
- ctx.save();
- return [ctx, canvas, realWidth, realHeight];
- };
- // Get boundary of rotated text
- const getRotatePos = (x, y, angle) => {
- const targetX = x * Math.cos(angle) - y * Math.sin(angle);
- const targetY = x * Math.sin(angle) + y * Math.cos(angle);
- return [targetX, targetY];
- };
- /**
- * Get the clips of text content.
- * This is a lazy hook function since SSR no need this
- */
- const useClips = () => {
- // Get single clips
- const getClips = (content, rotate, ratio, width, height, font, gapX, gapY) => {
- // ================= Text / Image =================
- const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
- if (content instanceof HTMLImageElement) {
- // Image
- ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
- } else {
- // Text
- const {
- color,
- fontSize,
- fontStyle,
- fontWeight,
- fontFamily,
- textAlign
- } = font;
- const mergedFontSize = Number(fontSize) * ratio;
- ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
- ctx.fillStyle = color;
- ctx.textAlign = textAlign;
- ctx.textBaseline = 'top';
- const contents = _util_toList(content);
- contents === null || contents === void 0 ? void 0 : contents.forEach((item, index) => {
- ctx.fillText(item !== null && item !== void 0 ? item : '', contentWidth / 2, index * (mergedFontSize + FontGap * ratio));
- });
- }
- // ==================== Rotate ====================
- const angle = Math.PI / 180 * Number(rotate);
- const maxSize = Math.max(width, height);
- const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
- // Copy from `ctx` and rotate
- rCtx.translate(realMaxSize / 2, realMaxSize / 2);
- rCtx.rotate(angle);
- if (contentWidth > 0 && contentHeight > 0) {
- rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
- }
- let left = 0;
- let right = 0;
- let top = 0;
- let bottom = 0;
- const halfWidth = contentWidth / 2;
- const halfHeight = contentHeight / 2;
- const points = [[0 - halfWidth, 0 - halfHeight], [0 + halfWidth, 0 - halfHeight], [0 + halfWidth, 0 + halfHeight], [0 - halfWidth, 0 + halfHeight]];
- points.forEach(([x, y]) => {
- const [targetX, targetY] = getRotatePos(x, y, angle);
- left = Math.min(left, targetX);
- right = Math.max(right, targetX);
- top = Math.min(top, targetY);
- bottom = Math.max(bottom, targetY);
- });
- const cutLeft = left + realMaxSize / 2;
- const cutTop = top + realMaxSize / 2;
- const cutWidth = right - left;
- const cutHeight = bottom - top;
- // ================ Fill Alternate ================
- const realGapX = gapX * ratio;
- const realGapY = gapY * ratio;
- const filledWidth = (cutWidth + realGapX) * 2;
- const filledHeight = cutHeight + realGapY;
- const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
- const drawImg = (targetX = 0, targetY = 0) => {
- fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY, cutWidth, cutHeight);
- };
- drawImg();
- drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
- drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
- return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio];
- };
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useCallback(getClips, []);
- };
- /* harmony default export */ var watermark_useClips = (useClips);
- ;// ./components/watermark/useRafDebounce.ts
- /**
- * Callback will only execute last one for each raf
- */
- function useRafDebounce(callback) {
- const executeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(false);
- const rafRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef(null);
- const wrapperCallback = (0,useEvent["default"])(callback);
- return () => {
- if (executeRef.current) {
- return;
- }
- executeRef.current = true;
- wrapperCallback();
- rafRef.current = (0,raf["default"])(() => {
- executeRef.current = false;
- });
- };
- }
- ;// ./components/watermark/useSingletonCache.ts
- /**
- * Singleton cache will only take latest `cacheParams` as key
- * and return the result for callback matching.
- */
- function useSingletonCache() {
- const cacheRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([null, null]);
- const getCache = (cacheKeys, callback) => {
- const filteredKeys = cacheKeys.map(item => item instanceof HTMLElement || Number.isNaN(item) ? '' : item);
- if (!(0,isEqual["default"])(cacheRef.current[0], filteredKeys)) {
- cacheRef.current = [filteredKeys, callback()];
- }
- return cacheRef.current[1];
- };
- return getCache;
- }
- ;// ./components/watermark/utils.ts
- /** converting camel-cased strings to be lowercase and link it with Separator */
- function toLowercaseSeparator(key) {
- return key.replace(/([A-Z])/g, '-$1').toLowerCase();
- }
- function getStyleStr(style) {
- return Object.keys(style).map(key => `${toLowercaseSeparator(key)}: ${style[key]};`).join(' ');
- }
- /** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
- function getPixelRatio() {
- return window.devicePixelRatio || 1;
- }
- /** Whether to re-render the watermark */
- const reRendering = (mutation, isWatermarkEle) => {
- let flag = false;
- // Whether to delete the watermark node
- if (mutation.removedNodes.length) {
- flag = Array.from(mutation.removedNodes).some(node => isWatermarkEle(node));
- }
- // Whether the watermark dom property value has been modified
- if (mutation.type === 'attributes' && isWatermarkEle(mutation.target)) {
- flag = true;
- }
- return flag;
- };
- ;// ./components/watermark/useWatermark.ts
- /**
- * Base size of the canvas, 1 for parallel layout and 2 for alternate layout
- * Only alternate layout is currently supported
- */
- const BaseSize = 2;
- const useWatermark_FontGap = 3;
- // Prevent external hidden elements from adding accent styles
- const emphasizedStyle = {
- visibility: 'visible !important'
- };
- function useWatermark(markStyle) {
- const watermarkMap = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(new Map());
- const appendWatermark = (base64Url, markWidth, container) => {
- if (container) {
- if (!watermarkMap.current.get(container)) {
- const newWatermarkEle = document.createElement('div');
- watermarkMap.current.set(container, newWatermarkEle);
- }
- const watermarkEle = watermarkMap.current.get(container);
- watermarkEle.setAttribute('style', getStyleStr(Object.assign(Object.assign(Object.assign({}, markStyle), {
- backgroundImage: `url('${base64Url}')`,
- backgroundSize: `${Math.floor(markWidth)}px`
- }), emphasizedStyle)));
- // Prevents using the browser `Hide Element` to hide watermarks
- watermarkEle.removeAttribute('class');
- watermarkEle.removeAttribute('hidden');
- if (watermarkEle.parentElement !== container) {
- container.append(watermarkEle);
- }
- }
- return watermarkMap.current.get(container);
- };
- const removeWatermark = container => {
- const watermarkEle = watermarkMap.current.get(container);
- if (watermarkEle && container) {
- container.removeChild(watermarkEle);
- }
- watermarkMap.current.delete(container);
- };
- const isWatermarkEle = ele => Array.from(watermarkMap.current.values()).includes(ele);
- return [appendWatermark, removeWatermark, isWatermarkEle];
- }
- ;// ./components/watermark/index.tsx
- /**
- * Only return `next` when size changed.
- * This is only used for elements compare, not a shallow equal!
- */
- function getSizeDiff(prev, next) {
- return prev.size === next.size ? prev : next;
- }
- const DEFAULT_GAP_X = 100;
- const DEFAULT_GAP_Y = 100;
- const fixedStyle = {
- position: 'relative',
- overflow: 'hidden'
- };
- const Watermark = props => {
- var _a, _b;
- const {
- /**
- * The antd content layer zIndex is basically below 10
- * https://github.com/ant-design/ant-design/blob/6192403b2ce517c017f9e58a32d58774921c10cd/components/style/themes/default.less#L335
- */
- zIndex = 9,
- rotate = -22,
- width,
- height,
- image,
- content,
- font = {},
- style,
- className,
- rootClassName,
- gap = [DEFAULT_GAP_X, DEFAULT_GAP_Y],
- offset,
- children,
- inherit = true
- } = props;
- const mergedStyle = Object.assign(Object.assign({}, fixedStyle), style);
- const [, token] = (0,useToken["default"])();
- const {
- color = token.colorFill,
- fontSize = token.fontSizeLG,
- fontWeight = 'normal',
- fontStyle = 'normal',
- fontFamily = 'sans-serif',
- textAlign = 'center'
- } = font;
- const [gapX = DEFAULT_GAP_X, gapY = DEFAULT_GAP_Y] = gap;
- const gapXCenter = gapX / 2;
- const gapYCenter = gapY / 2;
- const offsetLeft = (_a = offset === null || offset === void 0 ? void 0 : offset[0]) !== null && _a !== void 0 ? _a : gapXCenter;
- const offsetTop = (_b = offset === null || offset === void 0 ? void 0 : offset[1]) !== null && _b !== void 0 ? _b : gapYCenter;
- const markStyle = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- const mergedMarkStyle = {
- zIndex,
- position: 'absolute',
- left: 0,
- top: 0,
- width: '100%',
- height: '100%',
- pointerEvents: 'none',
- backgroundRepeat: 'repeat'
- };
- /** Calculate the style of the offset */
- let positionLeft = offsetLeft - gapXCenter;
- let positionTop = offsetTop - gapYCenter;
- if (positionLeft > 0) {
- mergedMarkStyle.left = `${positionLeft}px`;
- mergedMarkStyle.width = `calc(100% - ${positionLeft}px)`;
- positionLeft = 0;
- }
- if (positionTop > 0) {
- mergedMarkStyle.top = `${positionTop}px`;
- mergedMarkStyle.height = `calc(100% - ${positionTop}px)`;
- positionTop = 0;
- }
- mergedMarkStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
- return mergedMarkStyle;
- }, [zIndex, offsetLeft, gapXCenter, offsetTop, gapYCenter]);
- const [container, setContainer] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState();
- // Used for nest case like Modal, Drawer
- const [subElements, setSubElements] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(() => new Set());
- // Nest elements should also support watermark
- const targetElements = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- const list = container ? [container] : [];
- return [].concat(list, (0,toConsumableArray["default"])(Array.from(subElements)));
- }, [container, subElements]);
- // ============================ Content =============================
- /**
- * Get the width and height of the watermark. The default values are as follows
- * Image: [120, 64]; Content: It's calculated by content;
- */
- const getMarkSize = ctx => {
- let defaultWidth = 120;
- let defaultHeight = 64;
- if (!image && ctx.measureText) {
- ctx.font = `${Number(fontSize)}px ${fontFamily}`;
- const contents = _util_toList(content);
- const sizes = contents.map(item => {
- const metrics = ctx.measureText(item);
- return [metrics.width, metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent];
- });
- defaultWidth = Math.ceil(Math.max.apply(Math, (0,toConsumableArray["default"])(sizes.map(size => size[0]))));
- defaultHeight = Math.ceil(Math.max.apply(Math, (0,toConsumableArray["default"])(sizes.map(size => size[1])))) * contents.length + (contents.length - 1) * FontGap;
- }
- return [width !== null && width !== void 0 ? width : defaultWidth, height !== null && height !== void 0 ? height : defaultHeight];
- };
- const getClips = watermark_useClips();
- const getClipsCache = useSingletonCache();
- const [watermarkInfo, setWatermarkInfo] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(null);
- // Generate new Watermark content
- const renderWatermark = () => {
- const canvas = document.createElement('canvas');
- const ctx = canvas.getContext('2d');
- if (ctx) {
- const ratio = getPixelRatio();
- const [markWidth, markHeight] = getMarkSize(ctx);
- const drawCanvas = drawContent => {
- const params = [drawContent || '', rotate, ratio, markWidth, markHeight, {
- color,
- fontSize,
- fontStyle,
- fontWeight,
- fontFamily,
- textAlign
- }, gapX, gapY];
- const [nextClips, clipWidth] = getClipsCache(params, () => getClips.apply(void 0, params));
- setWatermarkInfo([nextClips, clipWidth]);
- };
- if (image) {
- const img = new Image();
- img.onload = () => {
- drawCanvas(img);
- };
- img.onerror = () => {
- drawCanvas(content);
- };
- img.crossOrigin = 'anonymous';
- img.referrerPolicy = 'no-referrer';
- img.src = image;
- } else {
- drawCanvas(content);
- }
- }
- };
- const syncWatermark = useRafDebounce(renderWatermark);
- // ============================= Effect =============================
- // Append watermark to the container
- const [appendWatermark, removeWatermark, isWatermarkEle] = useWatermark(markStyle);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(() => {
- if (watermarkInfo) {
- targetElements.forEach(holder => {
- appendWatermark(watermarkInfo[0], watermarkInfo[1], holder);
- });
- }
- }, [watermarkInfo, targetElements]);
- // ============================ Observe =============================
- const onMutate = (0,useEvent["default"])(mutations => {
- mutations.forEach(mutation => {
- if (reRendering(mutation, isWatermarkEle)) {
- syncWatermark();
- } else if (mutation.target === container && mutation.attributeName === 'style') {
- // We've only force container not modify.
- // Not consider nest case.
- const keyStyles = Object.keys(fixedStyle);
- for (let i = 0; i < keyStyles.length; i += 1) {
- const key = keyStyles[i];
- const oriValue = mergedStyle[key];
- const currentValue = container.style[key];
- if (oriValue && oriValue !== currentValue) {
- container.style[key] = oriValue;
- }
- }
- }
- });
- });
- useMutateObserver(targetElements, onMutate);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(syncWatermark, [rotate, zIndex, width, height, image, content, color, fontSize, fontWeight, fontStyle, fontFamily, textAlign, gapX, gapY, offsetLeft, offsetTop]);
- // ============================ Context =============================
- const watermarkContext = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => ({
- add: ele => {
- setSubElements(prev => {
- const clone = new Set(prev);
- clone.add(ele);
- return getSizeDiff(prev, clone);
- });
- },
- remove: ele => {
- removeWatermark(ele);
- setSubElements(prev => {
- const clone = new Set(prev);
- clone.delete(ele);
- return getSizeDiff(prev, clone);
- });
- }
- }), []);
- // ============================= Render =============================
- const childNode = inherit ? (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(watermark_context.Provider, {
- value: watermarkContext
- }, children)) : children;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: setContainer,
- className: classnames_default()(className, rootClassName),
- style: mergedStyle
- }, childNode);
- };
- if (true) {
- Watermark.displayName = 'Watermark';
- }
- /* harmony default export */ var watermark = (Watermark);
- ;// ./components/splitter/Panel.tsx
- const InternalPanel = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)((props, ref) => {
- const {
- prefixCls,
- className,
- children,
- size,
- style = {}
- } = props;
- const panelClassName = classnames_default()(`${prefixCls}-panel`, {
- [`${prefixCls}-panel-hidden`]: size === 0
- }, className);
- const hasSize = size !== undefined;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: ref,
- className: panelClassName,
- style: Object.assign(Object.assign({}, style), {
- // Use auto when start from ssr
- flexBasis: hasSize ? size : 'auto',
- flexGrow: hasSize ? 0 : 1
- })
- }, children);
- });
- if (true) {
- InternalPanel.displayName = 'Panel';
- }
- const splitter_Panel_Panel = () => null;
- /* harmony default export */ var splitter_Panel = (splitter_Panel_Panel);
- ;// ./components/splitter/hooks/useItems.ts
- var splitter_hooks_useItems_rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- function getCollapsible(collapsible) {
- if (collapsible && typeof collapsible === 'object') {
- return Object.assign(Object.assign({}, collapsible), {
- showCollapsibleIcon: collapsible.showCollapsibleIcon === undefined ? 'auto' : collapsible.showCollapsibleIcon
- });
- }
- const mergedCollapsible = !!collapsible;
- return {
- start: mergedCollapsible,
- end: mergedCollapsible,
- showCollapsibleIcon: 'auto'
- };
- }
- /**
- * Convert `children` into `items`.
- */
- function hooks_useItems_useItems(children) {
- const items = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => (0,toArray["default"])(children).filter(item => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(item)).map(node => {
- const {
- props
- } = node;
- const {
- collapsible
- } = props,
- restProps = splitter_hooks_useItems_rest(props, ["collapsible"]);
- return Object.assign(Object.assign({}, restProps), {
- collapsible: getCollapsible(collapsible)
- });
- }), [children]);
- return items;
- }
- /* harmony default export */ var hooks_useItems = (hooks_useItems_useItems);
- ;// ./components/splitter/hooks/useResizable.ts
- function getShowCollapsibleIcon(prev, next) {
- if (prev.collapsible && next.collapsible) {
- if (prev.showCollapsibleIcon === true || next.showCollapsibleIcon === true) {
- return true;
- }
- if (prev.showCollapsibleIcon === 'auto' || next.showCollapsibleIcon === 'auto') {
- return 'auto';
- }
- return false;
- }
- if (prev.collapsible) {
- return prev.showCollapsibleIcon;
- }
- if (next.collapsible) {
- return next.showCollapsibleIcon;
- }
- return false;
- }
- function useResizable(items, pxSizes, isRTL) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(() => {
- const resizeInfos = [];
- for (let i = 0; i < items.length - 1; i += 1) {
- const prevItem = items[i];
- const nextItem = items[i + 1];
- const prevSize = pxSizes[i];
- const nextSize = pxSizes[i + 1];
- const {
- resizable: prevResizable = true,
- min: prevMin,
- collapsible: prevCollapsible
- } = prevItem;
- const {
- resizable: nextResizable = true,
- min: nextMin,
- collapsible: nextCollapsible
- } = nextItem;
- const mergedResizable =
- // Both need to be resizable
- prevResizable && nextResizable && (
- // Prev is not collapsed and limit min size
- prevSize !== 0 || !prevMin) && (
- // Next is not collapsed and limit min size
- nextSize !== 0 || !nextMin);
- const prevEndCollapsible = !!prevCollapsible.end && prevSize > 0;
- const nextStartExpandable = !!nextCollapsible.start && nextSize === 0 && prevSize > 0;
- const startCollapsible = prevEndCollapsible || nextStartExpandable;
- const nextStartCollapsible = !!nextCollapsible.start && nextSize > 0;
- const prevEndExpandable = !!prevCollapsible.end && prevSize === 0 && nextSize > 0;
- const endCollapsible = nextStartCollapsible || prevEndExpandable;
- const showStartCollapsibleIcon = getShowCollapsibleIcon({
- collapsible: prevEndCollapsible,
- showCollapsibleIcon: prevCollapsible.showCollapsibleIcon
- }, {
- collapsible: nextStartExpandable,
- showCollapsibleIcon: nextCollapsible.showCollapsibleIcon
- });
- const showEndCollapsibleIcon = getShowCollapsibleIcon({
- collapsible: nextStartCollapsible,
- showCollapsibleIcon: nextCollapsible.showCollapsibleIcon
- }, {
- collapsible: prevEndExpandable,
- showCollapsibleIcon: prevCollapsible.showCollapsibleIcon
- });
- resizeInfos[i] = {
- resizable: mergedResizable,
- startCollapsible: !!(isRTL ? endCollapsible : startCollapsible),
- endCollapsible: !!(isRTL ? startCollapsible : endCollapsible),
- showStartCollapsibleIcon: isRTL ? showEndCollapsibleIcon : showStartCollapsibleIcon,
- showEndCollapsibleIcon: isRTL ? showStartCollapsibleIcon : showEndCollapsibleIcon
- };
- }
- return resizeInfos;
- }, [pxSizes, items]);
- }
- ;// ./components/splitter/hooks/sizeUtil.ts
- function autoPtgSizes(ptgSizes, minPtgSizes, maxPtgSizes) {
- // Static current data
- let currentTotalPtg = 0;
- const undefinedIndexes = [];
- ptgSizes.forEach((size, index) => {
- if (size === undefined) {
- undefinedIndexes.push(index);
- } else {
- currentTotalPtg += size;
- }
- });
- const restPtg = 1 - currentTotalPtg;
- const undefinedCount = undefinedIndexes.length;
- // Fill if exceed
- if (restPtg < 0) {
- const scale = 1 / currentTotalPtg;
- return ptgSizes.map(size => size === undefined ? 0 : size * scale);
- }
- // Check if limit exists
- let sumMin = 0;
- let sumMax = 0;
- let limitMin = 0;
- let limitMax = 1;
- for (const index of undefinedIndexes) {
- const min = minPtgSizes[index] || 0;
- const max = maxPtgSizes[index] || 1;
- sumMin += min;
- sumMax += max;
- limitMin = Math.max(limitMin, min);
- limitMax = Math.min(limitMax, max);
- }
- // Impossible case, just average fill
- if (sumMin > 1 && sumMax < 1) {
- const avg = 1 / undefinedCount;
- return ptgSizes.map(size => size === undefined ? avg : size);
- }
- // Quickly fill if can
- const restAvg = restPtg / undefinedCount;
- if (limitMin <= restAvg && restAvg <= limitMax) {
- return ptgSizes.map(size => size === undefined ? restAvg : size);
- }
- // Greedy algorithm
- const result = (0,toConsumableArray["default"])(ptgSizes);
- let remain = restPtg - sumMin;
- for (let i = 0; i < undefinedCount; i += 1) {
- const index = undefinedIndexes[i];
- const min = minPtgSizes[index] || 0;
- const max = maxPtgSizes[index] || 1;
- result[index] = min;
- const canAdd = max - min;
- const add = Math.min(canAdd, remain);
- result[index] += add;
- remain -= add;
- }
- return result;
- }
- ;// ./components/splitter/hooks/useSizes.ts
- function getPtg(str) {
- return Number(str.slice(0, -1)) / 100;
- }
- function isPtg(itemSize) {
- return typeof itemSize === 'string' && itemSize.endsWith('%');
- }
- /**
- * Save the size state.
- * Align the size into flex percentage base.
- */
- function useSizes(items, containerSize) {
- const propSizes = items.map(item => item.size);
- const itemsCount = items.length;
- const mergedContainerSize = containerSize || 0;
- const ptg2px = ptg => ptg * mergedContainerSize;
- // We do not need care the size state match the `items` length in `useState`.
- // It will calculate later.
- const [innerSizes, setInnerSizes] = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(() => items.map(item => item.defaultSize));
- const sizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- var _a;
- const mergedSizes = [];
- for (let i = 0; i < itemsCount; i += 1) {
- mergedSizes[i] = (_a = propSizes[i]) !== null && _a !== void 0 ? _a : innerSizes[i];
- }
- return mergedSizes;
- }, [itemsCount, innerSizes, propSizes]);
- const postPercentMinSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => items.map(item => {
- if (isPtg(item.min)) {
- return getPtg(item.min);
- }
- return (item.min || 0) / mergedContainerSize;
- }), [items, mergedContainerSize]);
- const postPercentMaxSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => items.map(item => {
- if (isPtg(item.max)) {
- return getPtg(item.max);
- }
- return (item.max || mergedContainerSize) / mergedContainerSize;
- }), [items, mergedContainerSize]);
- // Post handle the size. Will do:
- // 1. Convert all the px into percentage if not empty.
- // 2. Get rest percentage for exist percentage.
- // 3. Fill the rest percentage into empty item.
- const postPercentSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- const ptgList = [];
- // Fill default percentage
- for (let i = 0; i < itemsCount; i += 1) {
- const itemSize = sizes[i];
- if (isPtg(itemSize)) {
- ptgList[i] = getPtg(itemSize);
- } else if (itemSize || itemSize === 0) {
- const num = Number(itemSize);
- if (!Number.isNaN(num)) {
- ptgList[i] = num / mergedContainerSize;
- }
- } else {
- ptgList[i] = undefined;
- }
- }
- // Use autoPtgSizes to handle the undefined sizes
- return autoPtgSizes(ptgList, postPercentMinSizes, postPercentMaxSizes);
- }, [sizes, mergedContainerSize, postPercentMinSizes, postPercentMaxSizes]);
- const postPxSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => postPercentSizes.map(ptg2px), [postPercentSizes, mergedContainerSize]);
- // If ssr, we will use the size from developer config first.
- const panelSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => containerSize ? postPxSizes : sizes, [postPxSizes, containerSize]);
- return [panelSizes, postPxSizes, postPercentSizes, postPercentMinSizes, postPercentMaxSizes, setInnerSizes];
- }
- ;// ./components/splitter/hooks/useResize.ts
- /**
- * Handle user drag resize logic.
- */
- function useResize(items, resizableInfos, percentSizes, containerSize, updateSizes, isRTL) {
- const limitSizes = items.map(item => [item.min, item.max]);
- const mergedContainerSize = containerSize || 0;
- const ptg2px = ptg => ptg * mergedContainerSize;
- // ======================== Resize ========================
- function getLimitSize(str, defaultLimit) {
- if (typeof str === 'string') {
- return ptg2px(getPtg(str));
- }
- return str !== null && str !== void 0 ? str : defaultLimit;
- }
- // Real px sizes
- const [cacheSizes, setCacheSizes] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState([]);
- const cacheCollapsedSize = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef([]);
- /**
- * When start drag, check the direct is `start` or `end`.
- * This will handle when 2 splitter bar are in the same position.
- */
- const [movingIndex, setMovingIndex] = external_root_React_commonjs2_react_commonjs_react_amd_react_.useState(null);
- const getPxSizes = () => percentSizes.map(ptg2px);
- const onOffsetStart = index => {
- setCacheSizes(getPxSizes());
- setMovingIndex({
- index,
- confirmed: false
- });
- };
- const onOffsetUpdate = (index, offset) => {
- var _a;
- // First time trigger move index update is not sync in the state
- let confirmedIndex = null;
- // We need to know what the real index is.
- if ((!movingIndex || !movingIndex.confirmed) && offset !== 0) {
- // Search for the real index
- if (offset > 0) {
- confirmedIndex = index;
- setMovingIndex({
- index,
- confirmed: true
- });
- } else {
- for (let i = index; i >= 0; i -= 1) {
- if (cacheSizes[i] > 0 && resizableInfos[i].resizable) {
- confirmedIndex = i;
- setMovingIndex({
- index: i,
- confirmed: true
- });
- break;
- }
- }
- }
- }
- const mergedIndex = (_a = confirmedIndex !== null && confirmedIndex !== void 0 ? confirmedIndex : movingIndex === null || movingIndex === void 0 ? void 0 : movingIndex.index) !== null && _a !== void 0 ? _a : index;
- const numSizes = (0,toConsumableArray["default"])(cacheSizes);
- const nextIndex = mergedIndex + 1;
- // Get boundary
- const startMinSize = getLimitSize(limitSizes[mergedIndex][0], 0);
- const endMinSize = getLimitSize(limitSizes[nextIndex][0], 0);
- const startMaxSize = getLimitSize(limitSizes[mergedIndex][1], mergedContainerSize);
- const endMaxSize = getLimitSize(limitSizes[nextIndex][1], mergedContainerSize);
- let mergedOffset = offset;
- // Align with the boundary
- if (numSizes[mergedIndex] + mergedOffset < startMinSize) {
- mergedOffset = startMinSize - numSizes[mergedIndex];
- }
- if (numSizes[nextIndex] - mergedOffset < endMinSize) {
- mergedOffset = numSizes[nextIndex] - endMinSize;
- }
- if (numSizes[mergedIndex] + mergedOffset > startMaxSize) {
- mergedOffset = startMaxSize - numSizes[mergedIndex];
- }
- if (numSizes[nextIndex] - mergedOffset > endMaxSize) {
- mergedOffset = numSizes[nextIndex] - endMaxSize;
- }
- // Do offset
- numSizes[mergedIndex] += mergedOffset;
- numSizes[nextIndex] -= mergedOffset;
- updateSizes(numSizes);
- return numSizes;
- };
- const onOffsetEnd = () => {
- setMovingIndex(null);
- };
- // ======================= Collapse =======================
- const onCollapse = (index, type) => {
- const currentSizes = getPxSizes();
- const adjustedType = isRTL ? type === 'start' ? 'end' : 'start' : type;
- const currentIndex = adjustedType === 'start' ? index : index + 1;
- const targetIndex = adjustedType === 'start' ? index + 1 : index;
- const currentSize = currentSizes[currentIndex];
- const targetSize = currentSizes[targetIndex];
- if (currentSize !== 0 && targetSize !== 0) {
- // Collapse directly
- currentSizes[currentIndex] = 0;
- currentSizes[targetIndex] += currentSize;
- cacheCollapsedSize.current[index] = currentSize;
- } else {
- const totalSize = currentSize + targetSize;
- const currentSizeMin = getLimitSize(limitSizes[currentIndex][0], 0);
- const currentSizeMax = getLimitSize(limitSizes[currentIndex][1], mergedContainerSize);
- const targetSizeMin = getLimitSize(limitSizes[targetIndex][0], 0);
- const targetSizeMax = getLimitSize(limitSizes[targetIndex][1], mergedContainerSize);
- const limitStart = Math.max(currentSizeMin, totalSize - targetSizeMax);
- const limitEnd = Math.min(currentSizeMax, totalSize - targetSizeMin);
- const halfOffset = targetSizeMin || (limitEnd - limitStart) / 2;
- const targetCacheCollapsedSize = cacheCollapsedSize.current[index];
- const currentCacheCollapsedSize = totalSize - targetCacheCollapsedSize;
- const shouldUseCache = targetCacheCollapsedSize && targetCacheCollapsedSize <= targetSizeMax && targetCacheCollapsedSize >= targetSizeMin && currentCacheCollapsedSize <= currentSizeMax && currentCacheCollapsedSize >= currentSizeMin;
- if (shouldUseCache) {
- currentSizes[targetIndex] = targetCacheCollapsedSize;
- currentSizes[currentIndex] = currentCacheCollapsedSize;
- } else {
- currentSizes[currentIndex] -= halfOffset;
- currentSizes[targetIndex] += halfOffset;
- }
- }
- updateSizes(currentSizes);
- return currentSizes;
- };
- return [onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, movingIndex === null || movingIndex === void 0 ? void 0 : movingIndex.index];
- }
- ;// ./components/splitter/SplitBar.tsx
- function getValidNumber(num) {
- return typeof num === 'number' && !Number.isNaN(num) && Number.isFinite(num) ? Math.round(num) : 0;
- }
- const SplitBar = props => {
- const {
- prefixCls,
- vertical,
- index,
- active,
- ariaNow,
- ariaMin,
- ariaMax,
- resizable,
- startCollapsible,
- endCollapsible,
- onOffsetStart,
- onOffsetUpdate,
- onOffsetEnd,
- onCollapse,
- lazy,
- containerSize,
- showStartCollapsibleIcon,
- showEndCollapsibleIcon
- } = props;
- const splitBarPrefixCls = `${prefixCls}-bar`;
- // ======================== Resize ========================
- const [startPos, setStartPos] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(null);
- const [constrainedOffset, setConstrainedOffset] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0);
- const constrainedOffsetX = vertical ? 0 : constrainedOffset;
- const constrainedOffsetY = vertical ? constrainedOffset : 0;
- const onMouseDown = e => {
- if (resizable && e.currentTarget) {
- setStartPos([e.pageX, e.pageY]);
- onOffsetStart(index);
- }
- };
- const onTouchStart = e => {
- if (resizable && e.touches.length === 1) {
- const touch = e.touches[0];
- setStartPos([touch.pageX, touch.pageY]);
- onOffsetStart(index);
- }
- };
- // Updated constraint calculation
- const getConstrainedOffset = rawOffset => {
- const currentPos = containerSize * ariaNow / 100;
- const newPos = currentPos + rawOffset;
- // Calculate available space
- const minAllowed = Math.max(0, containerSize * ariaMin / 100);
- const maxAllowed = Math.min(containerSize, containerSize * ariaMax / 100);
- // Constrain new position within bounds
- const clampedPos = Math.max(minAllowed, Math.min(maxAllowed, newPos));
- return clampedPos - currentPos;
- };
- const handleLazyMove = (0,useEvent["default"])((offsetX, offsetY) => {
- const constrainedOffsetValue = getConstrainedOffset(vertical ? offsetY : offsetX);
- setConstrainedOffset(constrainedOffsetValue);
- });
- const handleLazyEnd = (0,useEvent["default"])(() => {
- onOffsetUpdate(index, constrainedOffsetX, constrainedOffsetY, true);
- setConstrainedOffset(0);
- onOffsetEnd(true);
- });
- const getVisibilityClass = mode => {
- switch (mode) {
- case true:
- return `${splitBarPrefixCls}-collapse-bar-always-visible`;
- case false:
- return `${splitBarPrefixCls}-collapse-bar-always-hidden`;
- case 'auto':
- return `${splitBarPrefixCls}-collapse-bar-hover-only`;
- }
- };
- (0,useLayoutEffect["default"])(() => {
- if (!startPos) {
- return;
- }
- const onMouseMove = e => {
- const {
- pageX,
- pageY
- } = e;
- const offsetX = pageX - startPos[0];
- const offsetY = pageY - startPos[1];
- if (lazy) {
- handleLazyMove(offsetX, offsetY);
- } else {
- onOffsetUpdate(index, offsetX, offsetY);
- }
- };
- const onMouseUp = () => {
- if (lazy) {
- handleLazyEnd();
- } else {
- onOffsetEnd();
- }
- setStartPos(null);
- };
- const handleTouchMove = e => {
- if (e.touches.length === 1) {
- const touch = e.touches[0];
- const offsetX = touch.pageX - startPos[0];
- const offsetY = touch.pageY - startPos[1];
- if (lazy) {
- handleLazyMove(offsetX, offsetY);
- } else {
- onOffsetUpdate(index, offsetX, offsetY);
- }
- }
- };
- const handleTouchEnd = () => {
- if (lazy) {
- handleLazyEnd();
- } else {
- onOffsetEnd();
- }
- setStartPos(null);
- };
- const eventHandlerMap = {
- mousemove: onMouseMove,
- mouseup: onMouseUp,
- touchmove: handleTouchMove,
- touchend: handleTouchEnd
- };
- for (const [event, handler] of Object.entries(eventHandlerMap)) {
- // eslint-disable-next-line react-web-api/no-leaked-event-listener
- window.addEventListener(event, handler);
- }
- return () => {
- for (const [event, handler] of Object.entries(eventHandlerMap)) {
- window.removeEventListener(event, handler);
- }
- };
- }, [startPos, index, lazy]);
- const transformStyle = {
- [`--${splitBarPrefixCls}-preview-offset`]: `${constrainedOffset}px`
- };
- // ======================== Render ========================
- const StartIcon = vertical ? icons_UpOutlined : icons_LeftOutlined;
- const EndIcon = vertical ? icons_DownOutlined : RightOutlined["default"];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: splitBarPrefixCls,
- role: "separator",
- "aria-valuenow": getValidNumber(ariaNow),
- "aria-valuemin": getValidNumber(ariaMin),
- "aria-valuemax": getValidNumber(ariaMax)
- }, lazy && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${splitBarPrefixCls}-preview`, {
- [`${splitBarPrefixCls}-preview-active`]: !!constrainedOffset
- }),
- style: transformStyle
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${splitBarPrefixCls}-dragger`, {
- [`${splitBarPrefixCls}-dragger-disabled`]: !resizable,
- [`${splitBarPrefixCls}-dragger-active`]: active
- }),
- onMouseDown: onMouseDown,
- onTouchStart: onTouchStart
- }), startCollapsible && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${splitBarPrefixCls}-collapse-bar`, `${splitBarPrefixCls}-collapse-bar-start`, getVisibilityClass(showStartCollapsibleIcon)),
- onClick: () => onCollapse(index, 'start')
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(StartIcon, {
- className: classnames_default()(`${splitBarPrefixCls}-collapse-icon`, `${splitBarPrefixCls}-collapse-start`)
- }))), endCollapsible && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(`${splitBarPrefixCls}-collapse-bar`, `${splitBarPrefixCls}-collapse-bar-end`, getVisibilityClass(showEndCollapsibleIcon)),
- onClick: () => onCollapse(index, 'end')
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(EndIcon, {
- className: classnames_default()(`${splitBarPrefixCls}-collapse-icon`, `${splitBarPrefixCls}-collapse-end`)
- }))));
- };
- /* harmony default export */ var splitter_SplitBar = (SplitBar);
- // EXTERNAL MODULE: ./components/splitter/style/index.ts
- var splitter_style = __webpack_require__("./components/splitter/style/index.ts");
- ;// ./components/splitter/Splitter.tsx
- /* eslint-disable react/no-array-index-key */
- const Splitter = props => {
- const {
- prefixCls: customizePrefixCls,
- className,
- style,
- layout = 'horizontal',
- children,
- rootClassName,
- onResizeStart,
- onResize,
- onResizeEnd,
- lazy
- } = props;
- const {
- getPrefixCls,
- direction,
- className: contextClassName,
- style: contextStyle
- } = (0,config_provider_context.useComponentConfig)('splitter');
- const prefixCls = getPrefixCls('splitter', customizePrefixCls);
- const rootCls = hooks_useCSSVarCls(prefixCls);
- const [wrapCSSVar, hashId, cssVarCls] = (0,splitter_style["default"])(prefixCls, rootCls);
- // ======================== Direct ========================
- const isVertical = layout === 'vertical';
- const isRTL = direction === 'rtl';
- const reverse = !isVertical && isRTL;
- // ====================== Items Data ======================
- const items = hooks_useItems(children);
- // >>> Warning for uncontrolled
- if (true) {
- const warning = (0,_util_warning.devUseWarning)('Splitter');
- const existSize = items.some(item => item.size !== undefined);
- const existUndefinedSize = items.some(item => item.size === undefined);
- if (existSize && existUndefinedSize && !onResize) {
- true ? warning(false, 'usage', 'When part of `Splitter.Panel` has `size`, `onResize` is required or change `size` to `defaultSize`.') : 0;
- }
- }
- // ====================== Container =======================
- const [containerSize, setContainerSize] = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)();
- const onContainerResize = size => {
- const {
- offsetWidth,
- offsetHeight
- } = size;
- const containerSize = isVertical ? offsetHeight : offsetWidth;
- // Skip when container has no size, Such as nested in a hidden tab panel
- // to fix: https://github.com/ant-design/ant-design/issues/51106
- if (containerSize === 0) {
- return;
- }
- setContainerSize(containerSize);
- };
- // ========================= Size =========================
- const [panelSizes, itemPxSizes, itemPtgSizes, itemPtgMinSizes, itemPtgMaxSizes, updateSizes] = useSizes(items, containerSize);
- // ====================== Resizable =======================
- const resizableInfos = useResizable(items, itemPxSizes, isRTL);
- const [onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, movingIndex] = useResize(items, resizableInfos, itemPtgSizes, containerSize, updateSizes, isRTL);
- // ======================== Events ========================
- const onInternalResizeStart = (0,useEvent["default"])(index => {
- onOffsetStart(index);
- onResizeStart === null || onResizeStart === void 0 ? void 0 : onResizeStart(itemPxSizes);
- });
- const onInternalResizeUpdate = (0,useEvent["default"])((index, offset, lazyEnd) => {
- const nextSizes = onOffsetUpdate(index, offset);
- if (lazyEnd) {
- onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd(nextSizes);
- } else {
- onResize === null || onResize === void 0 ? void 0 : onResize(nextSizes);
- }
- });
- const onInternalResizeEnd = (0,useEvent["default"])(lazyEnd => {
- onOffsetEnd();
- if (!lazyEnd) {
- onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd(itemPxSizes);
- }
- });
- const onInternalCollapse = (0,useEvent["default"])((index, type) => {
- const nextSizes = onCollapse(index, type);
- onResize === null || onResize === void 0 ? void 0 : onResize(nextSizes);
- onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd(nextSizes);
- });
- // ======================== Styles ========================
- const containerClassName = classnames_default()(prefixCls, className, `${prefixCls}-${layout}`, {
- [`${prefixCls}-rtl`]: isRTL
- }, rootClassName, contextClassName, cssVarCls, rootCls, hashId);
- // ======================== Render ========================
- const maskCls = `${prefixCls}-mask`;
- const stackSizes = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(() => {
- const mergedSizes = [];
- let stack = 0;
- for (let i = 0; i < items.length; i += 1) {
- stack += itemPtgSizes[i];
- mergedSizes.push(stack);
- }
- return mergedSizes;
- }, [itemPtgSizes]);
- const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);
- return wrapCSSVar(/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(es, {
- onResize: onContainerResize
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- style: mergedStyle,
- className: containerClassName
- }, items.map((item, idx) => {
- // Panel
- const panel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(InternalPanel, Object.assign({}, item, {
- prefixCls: prefixCls,
- size: panelSizes[idx]
- }));
- // Split Bar
- let splitBar = null;
- const resizableInfo = resizableInfos[idx];
- if (resizableInfo) {
- const ariaMinStart = (stackSizes[idx - 1] || 0) + itemPtgMinSizes[idx];
- const ariaMinEnd = (stackSizes[idx + 1] || 100) - itemPtgMaxSizes[idx + 1];
- const ariaMaxStart = (stackSizes[idx - 1] || 0) + itemPtgMaxSizes[idx];
- const ariaMaxEnd = (stackSizes[idx + 1] || 100) - itemPtgMinSizes[idx + 1];
- splitBar = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(splitter_SplitBar, {
- lazy: lazy,
- index: idx,
- active: movingIndex === idx,
- prefixCls: prefixCls,
- vertical: isVertical,
- resizable: resizableInfo.resizable,
- ariaNow: stackSizes[idx] * 100,
- ariaMin: Math.max(ariaMinStart, ariaMinEnd) * 100,
- ariaMax: Math.min(ariaMaxStart, ariaMaxEnd) * 100,
- startCollapsible: resizableInfo.startCollapsible,
- endCollapsible: resizableInfo.endCollapsible,
- showStartCollapsibleIcon: resizableInfo.showStartCollapsibleIcon,
- showEndCollapsibleIcon: resizableInfo.showEndCollapsibleIcon,
- onOffsetStart: onInternalResizeStart,
- onOffsetUpdate: (index, offsetX, offsetY, lazyEnd) => {
- let offset = isVertical ? offsetY : offsetX;
- if (reverse) {
- offset = -offset;
- }
- onInternalResizeUpdate(index, offset, lazyEnd);
- },
- onOffsetEnd: onInternalResizeEnd,
- onCollapse: onInternalCollapse,
- containerSize: containerSize || 0
- });
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, {
- key: `split-panel-${idx}`
- }, panel, splitBar);
- }), typeof movingIndex === 'number' && (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- "aria-hidden": true,
- className: classnames_default()(maskCls, `${maskCls}-${layout}`)
- })))));
- };
- if (true) {
- Splitter.displayName = 'Splitter';
- }
- /* harmony default export */ var splitter_Splitter = (Splitter);
- ;// ./components/splitter/index.tsx
- const components_splitter_Splitter = splitter_Splitter;
- components_splitter_Splitter.Panel = splitter_Panel;
- /* harmony default export */ var splitter = (components_splitter_Splitter);
- ;// ./components/index.ts
- // TODO: Remove in v6
- /***/ }),
- /***/ "./components/input-number/style/index.ts":
- /*!************************************************************!*\
- !*** ./components/input-number/style/index.ts + 1 modules ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ input_number_style; },
- genRadiusStyle: function() { return /* binding */ genRadiusStyle; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/input/style/index.ts
- var style = __webpack_require__("./components/input/style/index.ts");
- // EXTERNAL MODULE: ./components/input/style/token.ts
- var style_token = __webpack_require__("./components/input/style/token.ts");
- // EXTERNAL MODULE: ./components/input/style/variants.ts
- var variants = __webpack_require__("./components/input/style/variants.ts");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var components_style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/compact-item.ts
- var compact_item = __webpack_require__("./components/style/compact-item.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var fast_color_es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- ;// ./components/input-number/style/token.ts
- const prepareComponentToken = token => {
- var _a;
- const handleVisible = (_a = token.handleVisible) !== null && _a !== void 0 ? _a : 'auto';
- const handleWidth = token.controlHeightSM - token.lineWidth * 2;
- return Object.assign(Object.assign({}, (0,style_token.initComponentToken)(token)), {
- controlWidth: 90,
- handleWidth,
- handleFontSize: token.fontSize / 2,
- handleVisible,
- handleActiveBg: token.colorFillAlter,
- handleBg: token.colorBgContainer,
- filledHandleBg: new fast_color_es.FastColor(token.colorFillSecondary).onBackground(token.colorBgContainer).toHexString(),
- handleHoverColor: token.colorPrimary,
- handleBorderColor: token.colorBorder,
- handleOpacity: handleVisible === true ? 1 : 0,
- handleVisibleWidth: handleVisible === true ? handleWidth : 0
- });
- };
- ;// ./components/input-number/style/index.ts
- const genRadiusStyle = ({
- componentCls,
- borderRadiusSM,
- borderRadiusLG
- }, size) => {
- const borderRadius = size === 'lg' ? borderRadiusLG : borderRadiusSM;
- return {
- [`&-${size}`]: {
- [`${componentCls}-handler-wrap`]: {
- borderStartEndRadius: borderRadius,
- borderEndEndRadius: borderRadius
- },
- [`${componentCls}-handler-up`]: {
- borderStartEndRadius: borderRadius
- },
- [`${componentCls}-handler-down`]: {
- borderEndEndRadius: borderRadius
- }
- }
- };
- };
- const genInputNumberStyles = token => {
- const {
- componentCls,
- lineWidth,
- lineType,
- borderRadius,
- inputFontSizeSM,
- inputFontSizeLG,
- controlHeightLG,
- controlHeightSM,
- colorError,
- paddingInlineSM,
- paddingBlockSM,
- paddingBlockLG,
- paddingInlineLG,
- colorIcon,
- motionDurationMid,
- handleHoverColor,
- handleOpacity,
- paddingInline,
- paddingBlock,
- handleBg,
- handleActiveBg,
- colorTextDisabled,
- borderRadiusSM,
- borderRadiusLG,
- controlWidth,
- handleBorderColor,
- filledHandleBg,
- lineHeightLG,
- calc
- } = token;
- return [{
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), (0,style.genBasicInputStyle)(token)), {
- display: 'inline-block',
- width: controlWidth,
- margin: 0,
- padding: 0,
- borderRadius
- }), (0,variants.genOutlinedStyle)(token, {
- [`${componentCls}-handler-wrap`]: {
- background: handleBg,
- [`${componentCls}-handler-down`]: {
- borderBlockStart: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${handleBorderColor}`
- }
- }
- })), (0,variants.genFilledStyle)(token, {
- [`${componentCls}-handler-wrap`]: {
- background: filledHandleBg,
- [`${componentCls}-handler-down`]: {
- borderBlockStart: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${handleBorderColor}`
- }
- },
- '&:focus-within': {
- [`${componentCls}-handler-wrap`]: {
- background: handleBg
- }
- }
- })), (0,variants.genUnderlinedStyle)(token, {
- [`${componentCls}-handler-wrap`]: {
- background: handleBg,
- [`${componentCls}-handler-down`]: {
- borderBlockStart: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${handleBorderColor}`
- }
- }
- })), (0,variants.genBorderlessStyle)(token)), {
- '&-rtl': {
- direction: 'rtl',
- [`${componentCls}-input`]: {
- direction: 'rtl'
- }
- },
- '&-lg': {
- padding: 0,
- fontSize: inputFontSizeLG,
- lineHeight: lineHeightLG,
- borderRadius: borderRadiusLG,
- [`input${componentCls}-input`]: {
- height: calc(controlHeightLG).sub(calc(lineWidth).mul(2)).equal(),
- padding: `${(0,cssinjs.unit)(paddingBlockLG)} ${(0,cssinjs.unit)(paddingInlineLG)}`
- }
- },
- '&-sm': {
- padding: 0,
- fontSize: inputFontSizeSM,
- borderRadius: borderRadiusSM,
- [`input${componentCls}-input`]: {
- height: calc(controlHeightSM).sub(calc(lineWidth).mul(2)).equal(),
- padding: `${(0,cssinjs.unit)(paddingBlockSM)} ${(0,cssinjs.unit)(paddingInlineSM)}`
- }
- },
- // ===================== Out Of Range =====================
- '&-out-of-range': {
- [`${componentCls}-input-wrap`]: {
- input: {
- color: colorError
- }
- }
- },
- // Style for input-group: input with label, with button or dropdown...
- '&-group': Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), (0,style.genInputGroupStyle)(token)), {
- '&-wrapper': Object.assign(Object.assign(Object.assign({
- display: 'inline-block',
- textAlign: 'start',
- verticalAlign: 'top',
- [`${componentCls}-affix-wrapper`]: {
- width: '100%'
- },
- // Size
- '&-lg': {
- [`${componentCls}-group-addon`]: {
- borderRadius: borderRadiusLG,
- fontSize: token.fontSizeLG
- }
- },
- '&-sm': {
- [`${componentCls}-group-addon`]: {
- borderRadius: borderRadiusSM
- }
- }
- }, (0,variants.genOutlinedGroupStyle)(token)), (0,variants.genFilledGroupStyle)(token)), {
- // Fix the issue of using icons in Space Compact mode
- // https://github.com/ant-design/ant-design/issues/45764
- [`&:not(${componentCls}-compact-first-item):not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderRadius: 0
- }
- },
- [`&:not(${componentCls}-compact-last-item)${componentCls}-compact-first-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- [`&:not(${componentCls}-compact-first-item)${componentCls}-compact-last-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- }
- })
- }),
- [`&-disabled ${componentCls}-input`]: {
- cursor: 'not-allowed'
- },
- [componentCls]: {
- '&-input': Object.assign(Object.assign(Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), {
- width: '100%',
- padding: `${(0,cssinjs.unit)(paddingBlock)} ${(0,cssinjs.unit)(paddingInline)}`,
- textAlign: 'start',
- backgroundColor: 'transparent',
- border: 0,
- borderRadius,
- outline: 0,
- transition: `all ${motionDurationMid} linear`,
- appearance: 'textfield',
- fontSize: 'inherit'
- }), (0,style.genPlaceholderStyle)(token.colorTextPlaceholder)), {
- '&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': {
- margin: 0,
- appearance: 'none'
- }
- })
- },
- [`&:hover ${componentCls}-handler-wrap, &-focused ${componentCls}-handler-wrap`]: {
- width: token.handleWidth,
- opacity: 1
- }
- })
- },
- // Handler
- {
- [componentCls]: Object.assign(Object.assign(Object.assign({
- [`${componentCls}-handler-wrap`]: {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineEnd: 0,
- width: token.handleVisibleWidth,
- opacity: handleOpacity,
- height: '100%',
- borderStartStartRadius: 0,
- borderStartEndRadius: borderRadius,
- borderEndEndRadius: borderRadius,
- borderEndStartRadius: 0,
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'stretch',
- transition: `all ${motionDurationMid}`,
- overflow: 'hidden',
- // Fix input number inside Menu makes icon too large
- // We arise the selector priority by nest selector here
- // https://github.com/ant-design/ant-design/issues/14367
- [`${componentCls}-handler`]: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- flex: 'auto',
- height: '40%',
- [`
- ${componentCls}-handler-up-inner,
- ${componentCls}-handler-down-inner
- `]: {
- marginInlineEnd: 0,
- fontSize: token.handleFontSize
- }
- }
- },
- [`${componentCls}-handler`]: {
- height: '50%',
- overflow: 'hidden',
- color: colorIcon,
- fontWeight: 'bold',
- lineHeight: 0,
- textAlign: 'center',
- cursor: 'pointer',
- borderInlineStart: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${handleBorderColor}`,
- transition: `all ${motionDurationMid} linear`,
- '&:active': {
- background: handleActiveBg
- },
- // Hover
- '&:hover': {
- height: `60%`,
- [`
- ${componentCls}-handler-up-inner,
- ${componentCls}-handler-down-inner
- `]: {
- color: handleHoverColor
- }
- },
- '&-up-inner, &-down-inner': Object.assign(Object.assign({}, (0,components_style.resetIcon)()), {
- color: colorIcon,
- transition: `all ${motionDurationMid} linear`,
- userSelect: 'none'
- })
- },
- [`${componentCls}-handler-up`]: {
- borderStartEndRadius: borderRadius
- },
- [`${componentCls}-handler-down`]: {
- borderEndEndRadius: borderRadius
- }
- }, genRadiusStyle(token, 'lg')), genRadiusStyle(token, 'sm')), {
- // Disabled
- '&-disabled, &-readonly': {
- [`${componentCls}-handler-wrap`]: {
- display: 'none'
- },
- [`${componentCls}-input`]: {
- color: 'inherit'
- }
- },
- [`
- ${componentCls}-handler-up-disabled,
- ${componentCls}-handler-down-disabled
- `]: {
- cursor: 'not-allowed'
- },
- [`
- ${componentCls}-handler-up-disabled:hover &-handler-up-inner,
- ${componentCls}-handler-down-disabled:hover &-handler-down-inner
- `]: {
- color: colorTextDisabled
- }
- })
- }];
- };
- const genAffixWrapperStyles = token => {
- const {
- componentCls,
- paddingBlock,
- paddingInline,
- inputAffixPadding,
- controlWidth,
- borderRadiusLG,
- borderRadiusSM,
- paddingInlineLG,
- paddingInlineSM,
- paddingBlockLG,
- paddingBlockSM,
- motionDurationMid
- } = token;
- return {
- [`${componentCls}-affix-wrapper`]: Object.assign(Object.assign({
- [`input${componentCls}-input`]: {
- padding: `${(0,cssinjs.unit)(paddingBlock)} 0`
- }
- }, (0,style.genBasicInputStyle)(token)), {
- // or number handler will cover form status
- position: 'relative',
- display: 'inline-flex',
- alignItems: 'center',
- width: controlWidth,
- padding: 0,
- paddingInlineStart: paddingInline,
- '&-lg': {
- borderRadius: borderRadiusLG,
- paddingInlineStart: paddingInlineLG,
- [`input${componentCls}-input`]: {
- padding: `${(0,cssinjs.unit)(paddingBlockLG)} 0`
- }
- },
- '&-sm': {
- borderRadius: borderRadiusSM,
- paddingInlineStart: paddingInlineSM,
- [`input${componentCls}-input`]: {
- padding: `${(0,cssinjs.unit)(paddingBlockSM)} 0`
- }
- },
- [`&:not(${componentCls}-disabled):hover`]: {
- zIndex: 1
- },
- '&-focused, &:focus': {
- zIndex: 1
- },
- [`&-disabled > ${componentCls}-disabled`]: {
- background: 'transparent'
- },
- [`> div${componentCls}`]: {
- width: '100%',
- border: 'none',
- outline: 'none',
- [`&${componentCls}-focused`]: {
- boxShadow: 'none !important'
- }
- },
- '&::before': {
- display: 'inline-block',
- width: 0,
- visibility: 'hidden',
- content: '"\\a0"'
- },
- [`${componentCls}-handler-wrap`]: {
- zIndex: 2
- },
- [componentCls]: {
- position: 'static',
- color: 'inherit',
- '&-prefix, &-suffix': {
- display: 'flex',
- flex: 'none',
- alignItems: 'center',
- pointerEvents: 'none'
- },
- '&-prefix': {
- marginInlineEnd: inputAffixPadding
- },
- '&-suffix': {
- insetBlockStart: 0,
- insetInlineEnd: 0,
- height: '100%',
- marginInlineEnd: paddingInline,
- marginInlineStart: inputAffixPadding,
- transition: `margin ${motionDurationMid}`
- }
- },
- [`&:hover ${componentCls}-handler-wrap, &-focused ${componentCls}-handler-wrap`]: {
- width: token.handleWidth,
- opacity: 1
- },
- [`&:not(${componentCls}-affix-wrapper-without-controls):hover ${componentCls}-suffix`]: {
- marginInlineEnd: token.calc(token.handleWidth).add(paddingInline).equal()
- }
- }),
- // 覆盖 affix-wrapper borderRadius!
- [`${componentCls}-underlined`]: {
- borderRadius: 0
- }
- };
- };
- /* harmony default export */ var input_number_style = ((0,genStyleUtils.genStyleHooks)('InputNumber', token => {
- const inputNumberToken = (0,es.mergeToken)(token, (0,style_token.initInputToken)(token));
- return [genInputNumberStyles(inputNumberToken), genAffixWrapperStyles(inputNumberToken),
- // =====================================================
- // == Space Compact ==
- // =====================================================
- (0,compact_item.genCompactItemStyle)(inputNumberToken)];
- }, prepareComponentToken, {
- unitless: {
- handleOpacity: true
- },
- resetFont: false
- }));
- /***/ }),
- /***/ "./components/input/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/input/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genActiveStyle: function() { return /* binding */ genActiveStyle; },
- /* harmony export */ genAffixStyle: function() { return /* binding */ genAffixStyle; },
- /* harmony export */ genBasicInputStyle: function() { return /* binding */ genBasicInputStyle; },
- /* harmony export */ genInputGroupStyle: function() { return /* binding */ genInputGroupStyle; },
- /* harmony export */ genInputSmallStyle: function() { return /* binding */ genInputSmallStyle; },
- /* harmony export */ genInputStyle: function() { return /* binding */ genInputStyle; },
- /* harmony export */ genPlaceholderStyle: function() { return /* binding */ genPlaceholderStyle; },
- /* harmony export */ initComponentToken: function() { return /* reexport safe */ _token__WEBPACK_IMPORTED_MODULE_5__.initComponentToken; },
- /* harmony export */ initInputToken: function() { return /* reexport safe */ _token__WEBPACK_IMPORTED_MODULE_5__.initInputToken; },
- /* harmony export */ useSharedStyle: function() { return /* binding */ useSharedStyle; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_compact_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/compact-item */ "./components/style/compact-item.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./token */ "./components/input/style/token.ts");
- /* harmony import */ var _variants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./variants */ "./components/input/style/variants.ts");
- const genPlaceholderStyle = color => ({
- // Firefox
- '&::-moz-placeholder': {
- opacity: 1
- },
- '&::placeholder': {
- color,
- userSelect: 'none' // https://github.com/ant-design/ant-design/pull/32639
- },
- '&:placeholder-shown': {
- textOverflow: 'ellipsis'
- }
- });
- const genActiveStyle = token => ({
- borderColor: token.activeBorderColor,
- boxShadow: token.activeShadow,
- outline: 0,
- backgroundColor: token.activeBg
- });
- const genInputLargeStyle = token => {
- const {
- paddingBlockLG,
- lineHeightLG,
- borderRadiusLG,
- paddingInlineLG
- } = token;
- return {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingBlockLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingInlineLG)}`,
- fontSize: token.inputFontSizeLG,
- lineHeight: lineHeightLG,
- borderRadius: borderRadiusLG
- };
- };
- const genInputSmallStyle = token => ({
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingBlockSM)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingInlineSM)}`,
- fontSize: token.inputFontSizeSM,
- borderRadius: token.borderRadiusSM
- });
- const genBasicInputStyle = token => Object.assign(Object.assign({
- position: 'relative',
- display: 'inline-block',
- width: '100%',
- minWidth: 0,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingBlock)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingInline)}`,
- color: token.colorText,
- fontSize: token.inputFontSize,
- lineHeight: token.lineHeight,
- borderRadius: token.borderRadius,
- transition: `all ${token.motionDurationMid}`
- }, genPlaceholderStyle(token.colorTextPlaceholder)), {
- // Size
- '&-lg': Object.assign({}, genInputLargeStyle(token)),
- '&-sm': Object.assign({}, genInputSmallStyle(token)),
- // RTL
- '&-rtl, &-textarea-rtl': {
- direction: 'rtl'
- }
- });
- const genInputGroupStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- return {
- position: 'relative',
- display: 'table',
- width: '100%',
- borderCollapse: 'separate',
- borderSpacing: 0,
- // Undo padding and float of grid classes
- "&[class*='col-']": {
- paddingInlineEnd: token.paddingXS,
- '&:last-child': {
- paddingInlineEnd: 0
- }
- },
- // Sizing options
- [`&-lg ${componentCls}, &-lg > ${componentCls}-group-addon`]: Object.assign({}, genInputLargeStyle(token)),
- [`&-sm ${componentCls}, &-sm > ${componentCls}-group-addon`]: Object.assign({}, genInputSmallStyle(token)),
- // Fix https://github.com/ant-design/ant-design/issues/5754
- [`&-lg ${antCls}-select-single ${antCls}-select-selector`]: {
- height: token.controlHeightLG
- },
- [`&-sm ${antCls}-select-single ${antCls}-select-selector`]: {
- height: token.controlHeightSM
- },
- [`> ${componentCls}`]: {
- display: 'table-cell',
- '&:not(:first-child):not(:last-child)': {
- borderRadius: 0
- }
- },
- [`${componentCls}-group`]: {
- '&-addon, &-wrap': {
- display: 'table-cell',
- width: 1,
- whiteSpace: 'nowrap',
- verticalAlign: 'middle',
- '&:not(:first-child):not(:last-child)': {
- borderRadius: 0
- }
- },
- '&-wrap > *': {
- display: 'block !important'
- },
- '&-addon': {
- position: 'relative',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingInline)}`,
- color: token.colorText,
- fontWeight: 'normal',
- fontSize: token.inputFontSize,
- textAlign: 'center',
- borderRadius: token.borderRadius,
- transition: `all ${token.motionDurationSlow}`,
- lineHeight: 1,
- // Reset Select's style in addon
- [`${antCls}-select`]: {
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.paddingBlock).add(1).mul(-1).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.paddingInline).mul(-1).equal())}`,
- [`&${antCls}-select-single:not(${antCls}-select-customize-input):not(${antCls}-pagination-size-changer)`]: {
- [`${antCls}-select-selector`]: {
- backgroundColor: 'inherit',
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} transparent`,
- boxShadow: 'none'
- }
- }
- },
- // https://github.com/ant-design/ant-design/issues/31333
- [`${antCls}-cascader-picker`]: {
- margin: `-9px ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.paddingInline).mul(-1).equal())}`,
- backgroundColor: 'transparent',
- [`${antCls}-cascader-input`]: {
- textAlign: 'start',
- border: 0,
- boxShadow: 'none'
- }
- }
- }
- },
- [componentCls]: {
- width: '100%',
- marginBottom: 0,
- textAlign: 'inherit',
- '&:focus': {
- zIndex: 1,
- // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png
- borderInlineEndWidth: 1
- },
- '&:hover': {
- zIndex: 1,
- borderInlineEndWidth: 1,
- [`${componentCls}-search-with-button &`]: {
- zIndex: 0
- }
- }
- },
- // Reset rounded corners
- [`> ${componentCls}:first-child, ${componentCls}-group-addon:first-child`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0,
- // Reset Select's style in addon
- [`${antCls}-select ${antCls}-select-selector`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- [`> ${componentCls}-affix-wrapper`]: {
- [`&:not(:first-child) ${componentCls}`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- },
- [`&:not(:last-child) ${componentCls}`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- [`> ${componentCls}:last-child, ${componentCls}-group-addon:last-child`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0,
- // Reset Select's style in addon
- [`${antCls}-select ${antCls}-select-selector`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- },
- [`${componentCls}-affix-wrapper`]: {
- '&:not(:last-child)': {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0,
- [`${componentCls}-search &`]: {
- borderStartStartRadius: token.borderRadius,
- borderEndStartRadius: token.borderRadius
- }
- },
- [`&:not(:first-child), ${componentCls}-search &:not(:first-child)`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- },
- [`&${componentCls}-group-compact`]: Object.assign(Object.assign({
- display: 'block'
- }, (0,_style__WEBPACK_IMPORTED_MODULE_1__.clearFix)()), {
- [`${componentCls}-group-addon, ${componentCls}-group-wrap, > ${componentCls}`]: {
- '&:not(:first-child):not(:last-child)': {
- borderInlineEndWidth: token.lineWidth,
- '&:hover, &:focus': {
- zIndex: 1
- }
- }
- },
- '& > *': {
- display: 'inline-flex',
- float: 'none',
- verticalAlign: 'top',
- // https://github.com/ant-design/ant-design-pro/issues/139
- borderRadius: 0
- },
- [`
- & > ${componentCls}-affix-wrapper,
- & > ${componentCls}-number-affix-wrapper,
- & > ${antCls}-picker-range
- `]: {
- display: 'inline-flex'
- },
- '& > *:not(:last-child)': {
- marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal(),
- borderInlineEndWidth: token.lineWidth
- },
- // Undo float for .ant-input-group .ant-input
- [componentCls]: {
- float: 'none'
- },
- // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
- [`& > ${antCls}-select > ${antCls}-select-selector,
- & > ${antCls}-select-auto-complete ${componentCls},
- & > ${antCls}-cascader-picker ${componentCls},
- & > ${componentCls}-group-wrapper ${componentCls}`]: {
- borderInlineEndWidth: token.lineWidth,
- borderRadius: 0,
- '&:hover, &:focus': {
- zIndex: 1
- }
- },
- [`& > ${antCls}-select-focused`]: {
- zIndex: 1
- },
- // update z-index for arrow icon
- [`& > ${antCls}-select > ${antCls}-select-arrow`]: {
- zIndex: 1 // https://github.com/ant-design/ant-design/issues/20371
- },
- [`& > *:first-child,
- & > ${antCls}-select:first-child > ${antCls}-select-selector,
- & > ${antCls}-select-auto-complete:first-child ${componentCls},
- & > ${antCls}-cascader-picker:first-child ${componentCls}`]: {
- borderStartStartRadius: token.borderRadius,
- borderEndStartRadius: token.borderRadius
- },
- [`& > *:last-child,
- & > ${antCls}-select:last-child > ${antCls}-select-selector,
- & > ${antCls}-cascader-picker:last-child ${componentCls},
- & > ${antCls}-cascader-picker-focused:last-child ${componentCls}`]: {
- borderInlineEndWidth: token.lineWidth,
- borderStartEndRadius: token.borderRadius,
- borderEndEndRadius: token.borderRadius
- },
- // https://github.com/ant-design/ant-design/issues/12493
- [`& > ${antCls}-select-auto-complete ${componentCls}`]: {
- verticalAlign: 'top'
- },
- [`${componentCls}-group-wrapper + ${componentCls}-group-wrapper`]: {
- marginInlineStart: token.calc(token.lineWidth).mul(-1).equal(),
- [`${componentCls}-affix-wrapper`]: {
- borderRadius: 0
- }
- },
- [`${componentCls}-group-wrapper:not(:last-child)`]: {
- [`&${componentCls}-search > ${componentCls}-group`]: {
- [`& > ${componentCls}-group-addon > ${componentCls}-search-button`]: {
- borderRadius: 0
- },
- [`& > ${componentCls}`]: {
- borderStartStartRadius: token.borderRadius,
- borderStartEndRadius: 0,
- borderEndEndRadius: 0,
- borderEndStartRadius: token.borderRadius
- }
- }
- }
- })
- };
- };
- const genInputStyle = token => {
- const {
- componentCls,
- controlHeightSM,
- lineWidth,
- calc
- } = token;
- const FIXED_CHROME_COLOR_HEIGHT = 16;
- const colorSmallPadding = calc(controlHeightSM).sub(calc(lineWidth).mul(2)).sub(FIXED_CHROME_COLOR_HEIGHT).div(2).equal();
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), genBasicInputStyle(token)), (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genOutlinedStyle)(token)), (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genFilledStyle)(token)), (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genBorderlessStyle)(token)), (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genUnderlinedStyle)(token)), {
- '&[type="color"]': {
- height: token.controlHeight,
- [`&${componentCls}-lg`]: {
- height: token.controlHeightLG
- },
- [`&${componentCls}-sm`]: {
- height: controlHeightSM,
- paddingTop: colorSmallPadding,
- paddingBottom: colorSmallPadding
- }
- },
- '&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration': {
- appearance: 'none'
- }
- })
- };
- };
- const genAllowClearStyle = token => {
- const {
- componentCls
- } = token;
- return {
- // ========================= Input =========================
- [`${componentCls}-clear-icon`]: {
- margin: 0,
- padding: 0,
- lineHeight: 0,
- color: token.colorTextQuaternary,
- fontSize: token.fontSizeIcon,
- verticalAlign: -1,
- // https://github.com/ant-design/ant-design/pull/18151
- // https://codesandbox.io/s/wizardly-sun-u10br
- cursor: 'pointer',
- transition: `color ${token.motionDurationSlow}`,
- border: 'none',
- outline: 'none',
- backgroundColor: 'transparent',
- '&:hover': {
- color: token.colorIcon
- },
- '&:active': {
- color: token.colorText
- },
- '&-hidden': {
- visibility: 'hidden'
- },
- '&-has-suffix': {
- margin: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.inputAffixPadding)}`
- }
- }
- };
- };
- const genAffixStyle = token => {
- const {
- componentCls,
- inputAffixPadding,
- colorTextDescription,
- motionDurationSlow,
- colorIcon,
- colorIconHover,
- iconCls
- } = token;
- const affixCls = `${componentCls}-affix-wrapper`;
- const affixClsDisabled = `${componentCls}-affix-wrapper-disabled`;
- return {
- [affixCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, genBasicInputStyle(token)), {
- display: 'inline-flex',
- [`&:not(${componentCls}-disabled):hover`]: {
- zIndex: 1,
- [`${componentCls}-search-with-button &`]: {
- zIndex: 0
- }
- },
- '&-focused, &:focus': {
- zIndex: 1
- },
- [`> input${componentCls}`]: {
- padding: 0
- },
- [`> input${componentCls}, > textarea${componentCls}`]: {
- fontSize: 'inherit',
- border: 'none',
- borderRadius: 0,
- outline: 'none',
- background: 'transparent',
- color: 'inherit',
- '&::-ms-reveal': {
- display: 'none'
- },
- '&:focus': {
- boxShadow: 'none !important'
- }
- },
- '&::before': {
- display: 'inline-block',
- width: 0,
- visibility: 'hidden',
- content: '"\\a0"'
- },
- [componentCls]: {
- '&-prefix, &-suffix': {
- display: 'flex',
- flex: 'none',
- alignItems: 'center',
- '> *:not(:last-child)': {
- marginInlineEnd: token.paddingXS
- }
- },
- '&-show-count-suffix': {
- color: colorTextDescription,
- direction: 'ltr'
- },
- '&-show-count-has-suffix': {
- marginInlineEnd: token.paddingXXS
- },
- '&-prefix': {
- marginInlineEnd: inputAffixPadding
- },
- '&-suffix': {
- marginInlineStart: inputAffixPadding
- }
- }
- }), genAllowClearStyle(token)), {
- // password
- [`${iconCls}${componentCls}-password-icon`]: {
- color: colorIcon,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- '&:hover': {
- color: colorIconHover
- }
- }
- }),
- // 覆盖 affix-wrapper borderRadius!
- [`${componentCls}-underlined`]: {
- borderRadius: 0
- },
- [affixClsDisabled]: {
- // password disabled
- [`${iconCls}${componentCls}-password-icon`]: {
- color: colorIcon,
- cursor: 'not-allowed',
- '&:hover': {
- color: colorIcon
- }
- }
- }
- };
- };
- const genGroupStyle = token => {
- const {
- componentCls,
- borderRadiusLG,
- borderRadiusSM
- } = token;
- return {
- [`${componentCls}-group`]: Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), genInputGroupStyle(token)), {
- '&-rtl': {
- direction: 'rtl'
- },
- '&-wrapper': Object.assign(Object.assign(Object.assign({
- display: 'inline-block',
- width: '100%',
- textAlign: 'start',
- verticalAlign: 'top',
- '&-rtl': {
- direction: 'rtl'
- },
- // Size
- '&-lg': {
- [`${componentCls}-group-addon`]: {
- borderRadius: borderRadiusLG,
- fontSize: token.inputFontSizeLG
- }
- },
- '&-sm': {
- [`${componentCls}-group-addon`]: {
- borderRadius: borderRadiusSM
- }
- }
- }, (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genOutlinedGroupStyle)(token)), (0,_variants__WEBPACK_IMPORTED_MODULE_6__.genFilledGroupStyle)(token)), {
- // '&-disabled': {
- // [`${componentCls}-group-addon`]: {
- // ...genDisabledStyle(token),
- // },
- // },
- // Fix the issue of using icons in Space Compact mode
- // https://github.com/ant-design/ant-design/issues/42122
- [`&:not(${componentCls}-compact-first-item):not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderRadius: 0
- }
- },
- [`&:not(${componentCls}-compact-last-item)${componentCls}-compact-first-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- [`&:not(${componentCls}-compact-first-item)${componentCls}-compact-last-item`]: {
- [`${componentCls}, ${componentCls}-group-addon`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- },
- // Fix the issue of input use show-count param in space compact mode
- // https://github.com/ant-design/ant-design/issues/46872
- [`&:not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: {
- [`${componentCls}-affix-wrapper`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- // Fix the issue of input use `addonAfter` param in space compact mode
- // https://github.com/ant-design/ant-design/issues/52483
- [`&:not(${componentCls}-compact-first-item)${componentCls}-compact-item`]: {
- [`${componentCls}-affix-wrapper`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- }
- })
- })
- };
- };
- const genSearchInputStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- const searchPrefixCls = `${componentCls}-search`;
- return {
- [searchPrefixCls]: {
- [componentCls]: {
- '&:not([disabled]):hover, &:not([disabled]):focus': {
- [`+ ${componentCls}-group-addon ${searchPrefixCls}-button:not(${antCls}-btn-color-primary):not(${antCls}-btn-variant-text)`]: {
- borderInlineStartColor: token.colorPrimaryHover
- }
- }
- },
- [`${componentCls}-affix-wrapper`]: {
- height: token.controlHeight,
- borderRadius: 0
- },
- // fix slight height diff in Firefox:
- // https://ant.design/components/auto-complete-cn/#auto-complete-demo-certain-category
- [`${componentCls}-lg`]: {
- lineHeight: token.calc(token.lineHeightLG).sub(0.0002).equal()
- },
- [`> ${componentCls}-group`]: {
- [`> ${componentCls}-group-addon:last-child`]: {
- insetInlineStart: -1,
- padding: 0,
- border: 0,
- [`${searchPrefixCls}-button`]: {
- // Fix https://github.com/ant-design/ant-design/issues/47150
- marginInlineEnd: -1,
- borderStartStartRadius: 0,
- borderEndStartRadius: 0,
- boxShadow: 'none'
- },
- [`${searchPrefixCls}-button:not(${antCls}-btn-color-primary)`]: {
- color: token.colorTextDescription,
- '&:not([disabled]):hover': {
- color: token.colorPrimaryHover
- },
- '&:active': {
- color: token.colorPrimaryActive
- },
- [`&${antCls}-btn-loading::before`]: {
- inset: 0
- }
- }
- }
- },
- [`${searchPrefixCls}-button`]: {
- height: token.controlHeight,
- '&:hover, &:focus': {
- zIndex: 1
- }
- },
- '&-large': {
- [`${componentCls}-affix-wrapper, ${searchPrefixCls}-button`]: {
- height: token.controlHeightLG
- }
- },
- '&-small': {
- [`${componentCls}-affix-wrapper, ${searchPrefixCls}-button`]: {
- height: token.controlHeightSM
- }
- },
- '&-rtl': {
- direction: 'rtl'
- },
- // ===================== Compact Item Customized Styles =====================
- [`&${componentCls}-compact-item`]: {
- [`&:not(${componentCls}-compact-last-item)`]: {
- [`${componentCls}-group-addon`]: {
- [`${componentCls}-search-button`]: {
- marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal(),
- borderRadius: 0
- }
- }
- },
- [`&:not(${componentCls}-compact-first-item)`]: {
- [`${componentCls},${componentCls}-affix-wrapper`]: {
- borderRadius: 0
- }
- },
- [`> ${componentCls}-group-addon ${componentCls}-search-button,
- > ${componentCls},
- ${componentCls}-affix-wrapper`]: {
- '&:hover, &:focus, &:active': {
- zIndex: 2
- }
- },
- [`> ${componentCls}-affix-wrapper-focused`]: {
- zIndex: 2
- }
- }
- }
- };
- };
- // ============================== Range ===============================
- const genRangeStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-out-of-range`]: {
- [`&, & input, & textarea, ${componentCls}-show-count-suffix, ${componentCls}-data-count`]: {
- color: token.colorError
- }
- }
- };
- };
- // ============================== Export ==============================
- const useSharedStyle = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)(['Input', 'Shared'], token => {
- const inputToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, (0,_token__WEBPACK_IMPORTED_MODULE_5__.initInputToken)(token));
- return [genInputStyle(inputToken), genAffixStyle(inputToken)];
- }, _token__WEBPACK_IMPORTED_MODULE_5__.initComponentToken, {
- resetFont: false
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)(['Input', 'Component'], token => {
- const inputToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, (0,_token__WEBPACK_IMPORTED_MODULE_5__.initInputToken)(token));
- return [genGroupStyle(inputToken), genSearchInputStyle(inputToken), genRangeStyle(inputToken),
- // =====================================================
- // == Space Compact ==
- // =====================================================
- (0,_style_compact_item__WEBPACK_IMPORTED_MODULE_2__.genCompactItemStyle)(inputToken)];
- }, _token__WEBPACK_IMPORTED_MODULE_5__.initComponentToken, {
- resetFont: false
- }));
- /***/ }),
- /***/ "./components/input/style/token.ts":
- /*!*****************************************!*\
- !*** ./components/input/style/token.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initComponentToken: function() { return /* binding */ initComponentToken; },
- /* harmony export */ initInputToken: function() { return /* binding */ initInputToken; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- function initInputToken(token) {
- return (0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.mergeToken)(token, {
- inputAffixPadding: token.paddingXXS
- });
- }
- const initComponentToken = token => {
- const {
- controlHeight,
- fontSize,
- lineHeight,
- lineWidth,
- controlHeightSM,
- controlHeightLG,
- fontSizeLG,
- lineHeightLG,
- paddingSM,
- controlPaddingHorizontalSM,
- controlPaddingHorizontal,
- colorFillAlter,
- colorPrimaryHover,
- colorPrimary,
- controlOutlineWidth,
- controlOutline,
- colorErrorOutline,
- colorWarningOutline,
- colorBgContainer,
- inputFontSize,
- inputFontSizeLG,
- inputFontSizeSM
- } = token;
- const mergedFontSize = inputFontSize || fontSize;
- const mergedFontSizeSM = inputFontSizeSM || mergedFontSize;
- const mergedFontSizeLG = inputFontSizeLG || fontSizeLG;
- const paddingBlock = Math.round((controlHeight - mergedFontSize * lineHeight) / 2 * 10) / 10 - lineWidth;
- const paddingBlockSM = Math.round((controlHeightSM - mergedFontSizeSM * lineHeight) / 2 * 10) / 10 - lineWidth;
- const paddingBlockLG = Math.ceil((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2 * 10) / 10 - lineWidth;
- return {
- paddingBlock: Math.max(paddingBlock, 0),
- paddingBlockSM: Math.max(paddingBlockSM, 0),
- paddingBlockLG: Math.max(paddingBlockLG, 0),
- paddingInline: paddingSM - lineWidth,
- paddingInlineSM: controlPaddingHorizontalSM - lineWidth,
- paddingInlineLG: controlPaddingHorizontal - lineWidth,
- addonBg: colorFillAlter,
- activeBorderColor: colorPrimary,
- hoverBorderColor: colorPrimaryHover,
- activeShadow: `0 0 0 ${controlOutlineWidth}px ${controlOutline}`,
- errorActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorErrorOutline}`,
- warningActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorWarningOutline}`,
- hoverBg: colorBgContainer,
- activeBg: colorBgContainer,
- inputFontSize: mergedFontSize,
- inputFontSizeLG: mergedFontSizeLG,
- inputFontSizeSM: mergedFontSizeSM
- };
- };
- /***/ }),
- /***/ "./components/input/style/variants.ts":
- /*!********************************************!*\
- !*** ./components/input/style/variants.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genBaseOutlinedStyle: function() { return /* binding */ genBaseOutlinedStyle; },
- /* harmony export */ genBorderlessStyle: function() { return /* binding */ genBorderlessStyle; },
- /* harmony export */ genDisabledStyle: function() { return /* binding */ genDisabledStyle; },
- /* harmony export */ genFilledGroupStyle: function() { return /* binding */ genFilledGroupStyle; },
- /* harmony export */ genFilledStyle: function() { return /* binding */ genFilledStyle; },
- /* harmony export */ genOutlinedGroupStyle: function() { return /* binding */ genOutlinedGroupStyle; },
- /* harmony export */ genOutlinedStyle: function() { return /* binding */ genOutlinedStyle; },
- /* harmony export */ genUnderlinedStyle: function() { return /* binding */ genUnderlinedStyle; }
- /* harmony export */ });
- /* unused harmony exports genHoverStyle, genBaseUnderlinedStyle */
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- const genHoverStyle = token => ({
- borderColor: token.hoverBorderColor,
- backgroundColor: token.hoverBg
- });
- const genDisabledStyle = token => ({
- color: token.colorTextDisabled,
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- boxShadow: 'none',
- cursor: 'not-allowed',
- opacity: 1,
- 'input[disabled], textarea[disabled]': {
- cursor: 'not-allowed'
- },
- '&:hover:not([disabled])': Object.assign({}, genHoverStyle((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.mergeToken)(token, {
- hoverBorderColor: token.colorBorder,
- hoverBg: token.colorBgContainerDisabled
- })))
- });
- /* ============== Outlined ============== */
- const genBaseOutlinedStyle = (token, options) => ({
- background: token.colorBgContainer,
- borderWidth: token.lineWidth,
- borderStyle: token.lineType,
- borderColor: options.borderColor,
- '&:hover': {
- borderColor: options.hoverBorderColor,
- backgroundColor: token.hoverBg
- },
- '&:focus, &:focus-within': {
- borderColor: options.activeBorderColor,
- boxShadow: options.activeShadow,
- outline: 0,
- backgroundColor: token.activeBg
- }
- });
- const genOutlinedStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseOutlinedStyle(token, options)), {
- [`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
- color: options.affixColor
- }
- }),
- [`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: {
- borderColor: options.borderColor
- }
- });
- const genOutlinedStyle = (token, extraStyles) => ({
- '&-outlined': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseOutlinedStyle(token, {
- borderColor: token.colorBorder,
- hoverBorderColor: token.hoverBorderColor,
- activeBorderColor: token.activeBorderColor,
- activeShadow: token.activeShadow
- })), {
- [`&${token.componentCls}-disabled, &[disabled]`]: Object.assign({}, genDisabledStyle(token))
- }), genOutlinedStatusStyle(token, {
- status: 'error',
- borderColor: token.colorError,
- hoverBorderColor: token.colorErrorBorderHover,
- activeBorderColor: token.colorError,
- activeShadow: token.errorActiveShadow,
- affixColor: token.colorError
- })), genOutlinedStatusStyle(token, {
- status: 'warning',
- borderColor: token.colorWarning,
- hoverBorderColor: token.colorWarningBorderHover,
- activeBorderColor: token.colorWarning,
- activeShadow: token.warningActiveShadow,
- affixColor: token.colorWarning
- })), extraStyles)
- });
- const genOutlinedGroupStatusStyle = (token, options) => ({
- [`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
- [`${token.componentCls}-group-addon`]: {
- borderColor: options.addonBorderColor,
- color: options.addonColor
- }
- }
- });
- const genOutlinedGroupStyle = token => ({
- '&-outlined': Object.assign(Object.assign(Object.assign({
- [`${token.componentCls}-group`]: {
- '&-addon': {
- background: token.addonBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- },
- '&-addon:first-child': {
- borderInlineEnd: 0
- },
- '&-addon:last-child': {
- borderInlineStart: 0
- }
- }
- }, genOutlinedGroupStatusStyle(token, {
- status: 'error',
- addonBorderColor: token.colorError,
- addonColor: token.colorErrorText
- })), genOutlinedGroupStatusStyle(token, {
- status: 'warning',
- addonBorderColor: token.colorWarning,
- addonColor: token.colorWarningText
- })), {
- [`&${token.componentCls}-group-wrapper-disabled`]: {
- [`${token.componentCls}-group-addon`]: Object.assign({}, genDisabledStyle(token))
- }
- })
- });
- /* ============ Borderless ============ */
- const genBorderlessStyle = (token, extraStyles) => {
- const {
- componentCls
- } = token;
- return {
- '&-borderless': Object.assign({
- background: 'transparent',
- border: 'none',
- '&:focus, &:focus-within': {
- outline: 'none'
- },
- // >>>>> Disabled
- [`&${componentCls}-disabled, &[disabled]`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- },
- // >>>>> Status
- [`&${componentCls}-status-error`]: {
- '&, & input, & textarea': {
- color: token.colorError
- }
- },
- [`&${componentCls}-status-warning`]: {
- '&, & input, & textarea': {
- color: token.colorWarning
- }
- }
- }, extraStyles)
- };
- };
- /* ============== Filled ============== */
- const genBaseFilledStyle = (token, options) => {
- var _a;
- return {
- background: options.bg,
- borderWidth: token.lineWidth,
- borderStyle: token.lineType,
- borderColor: 'transparent',
- 'input&, & input, textarea&, & textarea': {
- color: (_a = options === null || options === void 0 ? void 0 : options.inputColor) !== null && _a !== void 0 ? _a : 'unset'
- },
- '&:hover': {
- background: options.hoverBg
- },
- '&:focus, &:focus-within': {
- outline: 0,
- borderColor: options.activeBorderColor,
- backgroundColor: token.activeBg
- }
- };
- };
- const genFilledStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseFilledStyle(token, options)), {
- [`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
- color: options.affixColor
- }
- })
- });
- const genFilledStyle = (token, extraStyles) => ({
- '&-filled': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseFilledStyle(token, {
- bg: token.colorFillTertiary,
- hoverBg: token.colorFillSecondary,
- activeBorderColor: token.activeBorderColor
- })), {
- [`&${token.componentCls}-disabled, &[disabled]`]: Object.assign({}, genDisabledStyle(token))
- }), genFilledStatusStyle(token, {
- status: 'error',
- bg: token.colorErrorBg,
- hoverBg: token.colorErrorBgHover,
- activeBorderColor: token.colorError,
- inputColor: token.colorErrorText,
- affixColor: token.colorError
- })), genFilledStatusStyle(token, {
- status: 'warning',
- bg: token.colorWarningBg,
- hoverBg: token.colorWarningBgHover,
- activeBorderColor: token.colorWarning,
- inputColor: token.colorWarningText,
- affixColor: token.colorWarning
- })), extraStyles)
- });
- const genFilledGroupStatusStyle = (token, options) => ({
- [`&${token.componentCls}-group-wrapper-status-${options.status}`]: {
- [`${token.componentCls}-group-addon`]: {
- background: options.addonBg,
- color: options.addonColor
- }
- }
- });
- const genFilledGroupStyle = token => ({
- '&-filled': Object.assign(Object.assign(Object.assign({
- [`${token.componentCls}-group-addon`]: {
- background: token.colorFillTertiary,
- '&:last-child': {
- position: 'static'
- }
- }
- }, genFilledGroupStatusStyle(token, {
- status: 'error',
- addonBg: token.colorErrorBg,
- addonColor: token.colorErrorText
- })), genFilledGroupStatusStyle(token, {
- status: 'warning',
- addonBg: token.colorWarningBg,
- addonColor: token.colorWarningText
- })), {
- [`&${token.componentCls}-group-wrapper-disabled`]: {
- [`${token.componentCls}-group`]: {
- '&-addon': {
- background: token.colorFillTertiary,
- color: token.colorTextDisabled
- },
- '&-addon:first-child': {
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- },
- '&-addon:last-child': {
- borderInlineEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- }
- }
- }
- })
- });
- /* ============== Underlined ============== */
- // https://github.com/ant-design/ant-design/issues/51379
- const genBaseUnderlinedStyle = (token, options) => ({
- background: token.colorBgContainer,
- borderWidth: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} 0`,
- borderStyle: `${token.lineType} none`,
- borderColor: `transparent transparent ${options.borderColor} transparent`,
- borderRadius: 0,
- '&:hover': {
- borderColor: `transparent transparent ${options.borderColor} transparent`,
- backgroundColor: token.hoverBg
- },
- '&:focus, &:focus-within': {
- borderColor: `transparent transparent ${options.activeBorderColor} transparent`,
- outline: 0,
- backgroundColor: token.activeBg
- }
- });
- const genUnderlinedStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, options)), {
- [`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: {
- color: options.affixColor
- }
- }),
- [`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: {
- borderColor: `transparent transparent ${options.borderColor} transparent`
- }
- });
- const genUnderlinedStyle = (token, extraStyles) => ({
- '&-underlined': Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, {
- borderColor: token.colorBorder,
- hoverBorderColor: token.hoverBorderColor,
- activeBorderColor: token.activeBorderColor,
- activeShadow: token.activeShadow
- })), {
- // >>>>> Disabled
- [`&${token.componentCls}-disabled, &[disabled]`]: {
- color: token.colorTextDisabled,
- boxShadow: 'none',
- cursor: 'not-allowed',
- '&:hover': {
- borderColor: `transparent transparent ${token.colorBorder} transparent`
- }
- },
- 'input[disabled], textarea[disabled]': {
- cursor: 'not-allowed'
- }
- }), genUnderlinedStatusStyle(token, {
- status: 'error',
- borderColor: token.colorError,
- hoverBorderColor: token.colorErrorBorderHover,
- activeBorderColor: token.colorError,
- activeShadow: token.errorActiveShadow,
- affixColor: token.colorError
- })), genUnderlinedStatusStyle(token, {
- status: 'warning',
- borderColor: token.colorWarning,
- hoverBorderColor: token.colorWarningBorderHover,
- activeBorderColor: token.colorWarning,
- activeShadow: token.warningActiveShadow,
- affixColor: token.colorWarning
- })), extraStyles)
- });
- /***/ }),
- /***/ "./components/layout/style/index.ts":
- /*!******************************************!*\
- !*** ./components/layout/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ DEPRECATED_TOKENS: function() { return /* binding */ DEPRECATED_TOKENS; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genLayoutStyle = token => {
- const {
- antCls,
- // .ant
- componentCls,
- // .ant-layout
- colorText,
- footerBg,
- headerHeight,
- headerPadding,
- headerColor,
- footerPadding,
- fontSize,
- bodyBg,
- headerBg
- } = token;
- return {
- [componentCls]: {
- display: 'flex',
- flex: 'auto',
- flexDirection: 'column',
- /* fix firefox can't set height smaller than content on flex item */
- minHeight: 0,
- background: bodyBg,
- '&, *': {
- boxSizing: 'border-box'
- },
- [`&${componentCls}-has-sider`]: {
- flexDirection: 'row',
- [`> ${componentCls}, > ${componentCls}-content`]: {
- // https://segmentfault.com/a/1190000019498300
- width: 0
- }
- },
- [`${componentCls}-header, &${componentCls}-footer`]: {
- flex: '0 0 auto'
- },
- // RTL
- '&-rtl': {
- direction: 'rtl'
- }
- },
- // ==================== Header ====================
- [`${componentCls}-header`]: {
- height: headerHeight,
- padding: headerPadding,
- color: headerColor,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(headerHeight),
- background: headerBg,
- // Other components/menu/style/index.less line:686
- // Integration with header element so menu items have the same height
- [`${antCls}-menu`]: {
- lineHeight: 'inherit'
- }
- },
- // ==================== Footer ====================
- [`${componentCls}-footer`]: {
- padding: footerPadding,
- color: colorText,
- fontSize,
- background: footerBg
- },
- // =================== Content ====================
- [`${componentCls}-content`]: {
- flex: 'auto',
- color: colorText,
- // fix firefox can't set height smaller than content on flex item
- minHeight: 0
- }
- };
- };
- const prepareComponentToken = token => {
- const {
- colorBgLayout,
- controlHeight,
- controlHeightLG,
- colorText,
- controlHeightSM,
- marginXXS,
- colorTextLightSolid,
- colorBgContainer
- } = token;
- const paddingInline = controlHeightLG * 1.25;
- return {
- // Deprecated
- colorBgHeader: '#001529',
- colorBgBody: colorBgLayout,
- colorBgTrigger: '#002140',
- bodyBg: colorBgLayout,
- headerBg: '#001529',
- headerHeight: controlHeight * 2,
- headerPadding: `0 ${paddingInline}px`,
- headerColor: colorText,
- footerPadding: `${controlHeightSM}px ${paddingInline}px`,
- footerBg: colorBgLayout,
- siderBg: '#001529',
- triggerHeight: controlHeightLG + marginXXS * 2,
- triggerBg: '#002140',
- triggerColor: colorTextLightSolid,
- zeroTriggerWidth: controlHeightLG,
- zeroTriggerHeight: controlHeightLG,
- lightSiderBg: colorBgContainer,
- lightTriggerBg: colorBgContainer,
- lightTriggerColor: colorText
- };
- };
- // ============================== Export ==============================
- const DEPRECATED_TOKENS = [['colorBgBody', 'bodyBg'], ['colorBgHeader', 'headerBg'], ['colorBgTrigger', 'triggerBg']];
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.genStyleHooks)('Layout', genLayoutStyle, prepareComponentToken, {
- deprecatedTokens: DEPRECATED_TOKENS
- }));
- /***/ }),
- /***/ "./components/list/style/index.ts":
- /*!****************************************!*\
- !*** ./components/list/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBorderedStyle = token => {
- const {
- listBorderedCls,
- componentCls,
- paddingLG,
- margin,
- itemPaddingSM,
- itemPaddingLG,
- marginLG,
- borderRadiusLG
- } = token;
- return {
- [listBorderedCls]: {
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderRadius: borderRadiusLG,
- [`${componentCls}-header,${componentCls}-footer,${componentCls}-item`]: {
- paddingInline: paddingLG
- },
- [`${componentCls}-pagination`]: {
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(margin)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginLG)}`
- }
- },
- [`${listBorderedCls}${componentCls}-sm`]: {
- [`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: {
- padding: itemPaddingSM
- }
- },
- [`${listBorderedCls}${componentCls}-lg`]: {
- [`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: {
- padding: itemPaddingLG
- }
- }
- };
- };
- const genResponsiveStyle = token => {
- const {
- componentCls,
- screenSM,
- screenMD,
- marginLG,
- marginSM,
- margin
- } = token;
- return {
- [`@media screen and (max-width:${screenMD}px)`]: {
- [componentCls]: {
- [`${componentCls}-item`]: {
- [`${componentCls}-item-action`]: {
- marginInlineStart: marginLG
- }
- }
- },
- [`${componentCls}-vertical`]: {
- [`${componentCls}-item`]: {
- [`${componentCls}-item-extra`]: {
- marginInlineStart: marginLG
- }
- }
- }
- },
- [`@media screen and (max-width: ${screenSM}px)`]: {
- [componentCls]: {
- [`${componentCls}-item`]: {
- flexWrap: 'wrap',
- [`${componentCls}-action`]: {
- marginInlineStart: marginSM
- }
- }
- },
- [`${componentCls}-vertical`]: {
- [`${componentCls}-item`]: {
- flexWrap: 'wrap-reverse',
- [`${componentCls}-item-main`]: {
- minWidth: token.contentWidth
- },
- [`${componentCls}-item-extra`]: {
- margin: `auto auto ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(margin)}`
- }
- }
- }
- }
- };
- };
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- antCls,
- controlHeight,
- minHeight,
- paddingSM,
- marginLG,
- padding,
- itemPadding,
- colorPrimary,
- itemPaddingSM,
- itemPaddingLG,
- paddingXS,
- margin,
- colorText,
- colorTextDescription,
- motionDurationSlow,
- lineWidth,
- headerBg,
- footerBg,
- emptyTextPadding,
- metaMarginBottom,
- avatarMarginRight,
- titleMarginBottom,
- descriptionFontSize
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- // fix https://github.com/ant-design/ant-design/issues/46177
- ['--rc-virtual-list-scrollbar-bg']: token.colorSplit,
- '*': {
- outline: 'none'
- },
- [`${componentCls}-header`]: {
- background: headerBg
- },
- [`${componentCls}-footer`]: {
- background: footerBg
- },
- [`${componentCls}-header, ${componentCls}-footer`]: {
- paddingBlock: paddingSM
- },
- [`${componentCls}-pagination`]: {
- marginBlockStart: marginLG,
- // https://github.com/ant-design/ant-design/issues/20037
- [`${antCls}-pagination-options`]: {
- textAlign: 'start'
- }
- },
- [`${componentCls}-spin`]: {
- minHeight,
- textAlign: 'center'
- },
- [`${componentCls}-items`]: {
- margin: 0,
- padding: 0,
- listStyle: 'none'
- },
- [`${componentCls}-item`]: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- padding: itemPadding,
- color: colorText,
- [`${componentCls}-item-meta`]: {
- display: 'flex',
- flex: 1,
- alignItems: 'flex-start',
- maxWidth: '100%',
- [`${componentCls}-item-meta-avatar`]: {
- marginInlineEnd: avatarMarginRight
- },
- [`${componentCls}-item-meta-content`]: {
- flex: '1 0',
- width: 0,
- color: colorText
- },
- [`${componentCls}-item-meta-title`]: {
- margin: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginXXS)} 0`,
- color: colorText,
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- '> a': {
- color: colorText,
- transition: `all ${motionDurationSlow}`,
- '&:hover': {
- color: colorPrimary
- }
- }
- },
- [`${componentCls}-item-meta-description`]: {
- color: colorTextDescription,
- fontSize: descriptionFontSize,
- lineHeight: token.lineHeight
- }
- },
- [`${componentCls}-item-action`]: {
- flex: '0 0 auto',
- marginInlineStart: token.marginXXL,
- padding: 0,
- fontSize: 0,
- listStyle: 'none',
- '& > li': {
- position: 'relative',
- display: 'inline-block',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`,
- color: colorTextDescription,
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- textAlign: 'center',
- '&:first-child': {
- paddingInlineStart: 0
- }
- },
- [`${componentCls}-item-action-split`]: {
- position: 'absolute',
- insetBlockStart: '50%',
- insetInlineEnd: 0,
- width: lineWidth,
- height: token.calc(token.fontHeight).sub(token.calc(token.marginXXS).mul(2)).equal(),
- transform: 'translateY(-50%)',
- backgroundColor: token.colorSplit
- }
- }
- },
- [`${componentCls}-empty`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)} 0`,
- color: colorTextDescription,
- fontSize: token.fontSizeSM,
- textAlign: 'center'
- },
- [`${componentCls}-empty-text`]: {
- padding: emptyTextPadding,
- color: token.colorTextDisabled,
- fontSize: token.fontSize,
- textAlign: 'center'
- },
- // ============================ without flex ============================
- [`${componentCls}-item-no-flex`]: {
- display: 'block'
- }
- }),
- [`${componentCls}-grid ${antCls}-col > ${componentCls}-item`]: {
- display: 'block',
- maxWidth: '100%',
- marginBlockEnd: margin,
- paddingBlock: 0,
- borderBlockEnd: 'none'
- },
- [`${componentCls}-vertical ${componentCls}-item`]: {
- alignItems: 'initial',
- [`${componentCls}-item-main`]: {
- display: 'block',
- flex: 1
- },
- [`${componentCls}-item-extra`]: {
- marginInlineStart: marginLG
- },
- [`${componentCls}-item-meta`]: {
- marginBlockEnd: metaMarginBottom,
- [`${componentCls}-item-meta-title`]: {
- marginBlockStart: 0,
- marginBlockEnd: titleMarginBottom,
- color: colorText,
- fontSize: token.fontSizeLG,
- lineHeight: token.lineHeightLG
- }
- },
- [`${componentCls}-item-action`]: {
- marginBlockStart: padding,
- marginInlineStart: 'auto',
- '> li': {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)}`,
- '&:first-child': {
- paddingInlineStart: 0
- }
- }
- }
- },
- [`${componentCls}-split ${componentCls}-item`]: {
- borderBlockEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
- '&:last-child': {
- borderBlockEnd: 'none'
- }
- },
- [`${componentCls}-split ${componentCls}-header`]: {
- borderBlockEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- },
- [`${componentCls}-split${componentCls}-empty ${componentCls}-footer`]: {
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- },
- [`${componentCls}-loading ${componentCls}-spin-nested-loading`]: {
- minHeight: controlHeight
- },
- [`${componentCls}-split${componentCls}-something-after-last-item ${antCls}-spin-container > ${componentCls}-items > ${componentCls}-item:last-child`]: {
- borderBlockEnd: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- },
- [`${componentCls}-lg ${componentCls}-item`]: {
- padding: itemPaddingLG
- },
- [`${componentCls}-sm ${componentCls}-item`]: {
- padding: itemPaddingSM
- },
- // Horizontal
- [`${componentCls}:not(${componentCls}-vertical)`]: {
- [`${componentCls}-item-no-flex`]: {
- [`${componentCls}-item-action`]: {
- float: 'right'
- }
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- contentWidth: 220,
- itemPadding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingContentVertical)} 0`,
- itemPaddingSM: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingContentVerticalSM)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingContentHorizontal)}`,
- itemPaddingLG: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingContentVerticalLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingContentHorizontalLG)}`,
- headerBg: 'transparent',
- footerBg: 'transparent',
- emptyTextPadding: token.padding,
- metaMarginBottom: token.padding,
- avatarMarginRight: token.padding,
- titleMarginBottom: token.paddingSM,
- descriptionFontSize: token.fontSize
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('List', token => {
- const listToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- listBorderedCls: `${token.componentCls}-bordered`,
- minHeight: token.controlHeightLG
- });
- return [genBaseStyle(listToken), genBorderedStyle(listToken), genResponsiveStyle(listToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/locale/context.ts":
- /*!**************************************!*\
- !*** ./components/locale/context.ts ***!
- \**************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- const LocaleContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(undefined);
- /* harmony default export */ __webpack_exports__["default"] = (LocaleContext);
- /***/ }),
- /***/ "./components/locale/en_US.ts":
- /*!************************************!*\
- !*** ./components/locale/en_US.ts ***!
- \************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var rc_pagination_es_locale_en_US__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rc-pagination/es/locale/en_US */ "./node_modules/rc-pagination/es/locale/en_US.js");
- /* harmony import */ var _calendar_locale_en_US__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../calendar/locale/en_US */ "./components/calendar/locale/en_US.ts");
- /* harmony import */ var _date_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../date-picker/locale/en_US */ "./components/date-picker/locale/en_US.ts");
- /* harmony import */ var _time_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../time-picker/locale/en_US */ "./components/time-picker/locale/en_US.ts");
- const typeTemplate = '${label} is not a valid ${type}';
- const localeValues = {
- locale: 'en',
- Pagination: rc_pagination_es_locale_en_US__WEBPACK_IMPORTED_MODULE_0__["default"],
- DatePicker: _date_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_2__["default"],
- TimePicker: _time_picker_locale_en_US__WEBPACK_IMPORTED_MODULE_3__["default"],
- Calendar: _calendar_locale_en_US__WEBPACK_IMPORTED_MODULE_1__["default"],
- global: {
- placeholder: 'Please select',
- close: 'Close'
- },
- Table: {
- filterTitle: 'Filter menu',
- filterConfirm: 'OK',
- filterReset: 'Reset',
- filterEmptyText: 'No filters',
- filterCheckAll: 'Select all items',
- filterSearchPlaceholder: 'Search in filters',
- emptyText: 'No data',
- selectAll: 'Select current page',
- selectInvert: 'Invert current page',
- selectNone: 'Clear all data',
- selectionAll: 'Select all data',
- sortTitle: 'Sort',
- expand: 'Expand row',
- collapse: 'Collapse row',
- triggerDesc: 'Click to sort descending',
- triggerAsc: 'Click to sort ascending',
- cancelSort: 'Click to cancel sorting'
- },
- Tour: {
- Next: 'Next',
- Previous: 'Previous',
- Finish: 'Finish'
- },
- Modal: {
- okText: 'OK',
- cancelText: 'Cancel',
- justOkText: 'OK'
- },
- Popconfirm: {
- okText: 'OK',
- cancelText: 'Cancel'
- },
- Transfer: {
- titles: ['', ''],
- searchPlaceholder: 'Search here',
- itemUnit: 'item',
- itemsUnit: 'items',
- remove: 'Remove',
- selectCurrent: 'Select current page',
- removeCurrent: 'Remove current page',
- selectAll: 'Select all data',
- deselectAll: 'Deselect all data',
- removeAll: 'Remove all data',
- selectInvert: 'Invert current page'
- },
- Upload: {
- uploading: 'Uploading...',
- removeFile: 'Remove file',
- uploadError: 'Upload error',
- previewFile: 'Preview file',
- downloadFile: 'Download file'
- },
- Empty: {
- description: 'No data'
- },
- Icon: {
- icon: 'icon'
- },
- Text: {
- edit: 'Edit',
- copy: 'Copy',
- copied: 'Copied',
- expand: 'Expand',
- collapse: 'Collapse'
- },
- Form: {
- optional: '(optional)',
- defaultValidateMessages: {
- default: 'Field validation error for ${label}',
- required: 'Please enter ${label}',
- enum: '${label} must be one of [${enum}]',
- whitespace: '${label} cannot be a blank character',
- date: {
- format: '${label} date format is invalid',
- parse: '${label} cannot be converted to a date',
- invalid: '${label} is an invalid date'
- },
- types: {
- string: typeTemplate,
- method: typeTemplate,
- array: typeTemplate,
- object: typeTemplate,
- number: typeTemplate,
- date: typeTemplate,
- boolean: typeTemplate,
- integer: typeTemplate,
- float: typeTemplate,
- regexp: typeTemplate,
- email: typeTemplate,
- url: typeTemplate,
- hex: typeTemplate
- },
- string: {
- len: '${label} must be ${len} characters',
- min: '${label} must be at least ${min} characters',
- max: '${label} must be up to ${max} characters',
- range: '${label} must be between ${min}-${max} characters'
- },
- number: {
- len: '${label} must be equal to ${len}',
- min: '${label} must be minimum ${min}',
- max: '${label} must be maximum ${max}',
- range: '${label} must be between ${min}-${max}'
- },
- array: {
- len: 'Must be ${len} ${label}',
- min: 'At least ${min} ${label}',
- max: 'At most ${max} ${label}',
- range: 'The amount of ${label} must be between ${min}-${max}'
- },
- pattern: {
- mismatch: '${label} does not match the pattern ${pattern}'
- }
- }
- },
- Image: {
- preview: 'Preview'
- },
- QRCode: {
- expired: 'QR code expired',
- refresh: 'Refresh',
- scanned: 'Scanned'
- },
- ColorPicker: {
- presetEmpty: 'Empty',
- transparent: 'Transparent',
- singleColor: 'Single',
- gradientColor: 'Gradient'
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (localeValues);
- /***/ }),
- /***/ "./components/locale/useLocale.ts":
- /*!****************************************!*\
- !*** ./components/locale/useLocale.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ "./components/locale/context.ts");
- /* harmony import */ var _en_US__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./en_US */ "./components/locale/en_US.ts");
- const useLocale = (componentName, defaultLocale) => {
- const fullLocale = react__WEBPACK_IMPORTED_MODULE_0__.useContext(_context__WEBPACK_IMPORTED_MODULE_1__["default"]);
- const getLocale = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
- var _a;
- const locale = defaultLocale || _en_US__WEBPACK_IMPORTED_MODULE_2__["default"][componentName];
- const localeFromContext = (_a = fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale[componentName]) !== null && _a !== void 0 ? _a : {};
- return Object.assign(Object.assign({}, typeof locale === 'function' ? locale() : locale), localeFromContext || {});
- }, [componentName, defaultLocale, fullLocale]);
- const getLocaleCode = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
- const localeCode = fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale.locale;
- // Had use LocaleProvide but didn't set locale
- if ((fullLocale === null || fullLocale === void 0 ? void 0 : fullLocale.exist) && !localeCode) {
- return _en_US__WEBPACK_IMPORTED_MODULE_2__["default"].locale;
- }
- return localeCode;
- }, [fullLocale]);
- return [getLocale, getLocaleCode];
- };
- /* harmony default export */ __webpack_exports__["default"] = (useLocale);
- /***/ }),
- /***/ "./components/mentions/style/index.ts":
- /*!********************************************!*\
- !*** ./components/mentions/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _input_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../input/style */ "./components/input/style/index.ts");
- /* harmony import */ var _input_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../input/style */ "./components/input/style/token.ts");
- /* harmony import */ var _input_style_variants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../input/style/variants */ "./components/input/style/variants.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genMentionsStyle = token => {
- const {
- componentCls,
- antCls,
- colorTextDisabled,
- controlItemBgHover,
- controlPaddingHorizontal,
- colorText,
- motionDurationSlow,
- lineHeight,
- controlHeight,
- paddingInline,
- paddingBlock,
- fontSize,
- fontSizeIcon,
- colorIcon,
- colorTextQuaternary,
- colorBgElevated,
- paddingXXS,
- borderRadius,
- borderRadiusLG,
- boxShadowSecondary,
- itemPaddingVertical,
- calc
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_4__.resetComponent)(token)), (0,_input_style__WEBPACK_IMPORTED_MODULE_1__.genBasicInputStyle)(token)), {
- position: 'relative',
- display: 'inline-block',
- height: 'auto',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingInline)}`,
- overflow: 'hidden',
- lineHeight,
- whiteSpace: 'pre-wrap',
- verticalAlign: 'bottom'
- }), (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genOutlinedStyle)(token)), (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genFilledStyle)(token)), (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genBorderlessStyle)(token)), {
- '&-affix-wrapper': Object.assign(Object.assign({}, (0,_input_style__WEBPACK_IMPORTED_MODULE_1__.genBasicInputStyle)(token)), {
- display: 'inline-flex',
- paddingBlock: 0,
- paddingInlineStart: 0,
- paddingInlineEnd: token.paddingInline,
- '&::before': {
- display: 'inline-block',
- width: 0,
- visibility: 'hidden',
- content: '"\\a0"'
- },
- [`${componentCls}-suffix`]: {
- display: 'inline-flex',
- alignItems: 'center',
- // 当页面中存在 feedback-icon 时,给 clear-icon 添加右边距
- [`&:has(${antCls}-form-item-feedback-icon) ${componentCls}-clear-icon`]: {
- marginInlineEnd: token.marginXS
- },
- [`${antCls}-form-item-feedback-icon`]: {
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center'
- }
- },
- [`${componentCls}-clear-icon`]: {
- insetInlineEnd: 0,
- insetBlockStart: calc(fontSize).mul(lineHeight).mul(0.5).add(paddingBlock).equal(),
- padding: 0,
- lineHeight: 0,
- color: colorTextQuaternary,
- fontSize: fontSizeIcon,
- verticalAlign: -1,
- // https://github.com/ant-design/ant-design/pull/18151
- // https://codesandbox.io/s/wizardly-sun-u10br
- cursor: 'pointer',
- transition: `color ${motionDurationSlow}`,
- border: 'none',
- outline: 'none',
- backgroundColor: 'transparent',
- '&:hover': {
- color: colorIcon
- },
- '&:active': {
- color: colorText
- },
- '&-hidden': {
- visibility: 'hidden'
- }
- }
- })
- }), (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genUnderlinedStyle)(token)), {
- '&-disabled': {
- '> textarea': Object.assign({}, (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genDisabledStyle)(token))
- },
- // ================= Input Area =================
- [`&, &-affix-wrapper > ${componentCls}`]: {
- [`> textarea, ${componentCls}-measure`]: {
- color: colorText,
- boxSizing: 'border-box',
- minHeight: token.calc(controlHeight).sub(2).equal(),
- margin: 0,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingBlock)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingInline)}`,
- overflow: 'inherit',
- overflowX: 'hidden',
- overflowY: 'auto',
- fontWeight: 'inherit',
- fontSize: 'inherit',
- fontFamily: 'inherit',
- fontStyle: 'inherit',
- fontVariant: 'inherit',
- fontSizeAdjust: 'inherit',
- fontStretch: 'inherit',
- lineHeight: 'inherit',
- direction: 'inherit',
- letterSpacing: 'inherit',
- whiteSpace: 'inherit',
- textAlign: 'inherit',
- verticalAlign: 'top',
- wordWrap: 'break-word',
- wordBreak: 'inherit',
- tabSize: 'inherit'
- },
- '> textarea': Object.assign(Object.assign({
- width: '100%',
- border: 'none',
- outline: 'none',
- resize: 'none',
- backgroundColor: 'transparent'
- }, (0,_input_style__WEBPACK_IMPORTED_MODULE_1__.genPlaceholderStyle)(token.colorTextPlaceholder)), {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingBlock)} 0`
- }),
- [`${componentCls}-measure`]: {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- zIndex: -1,
- color: 'transparent',
- pointerEvents: 'none',
- '> span': {
- display: 'inline-block',
- minHeight: '1em'
- }
- }
- },
- // ================== Dropdown ==================
- '&-dropdown': Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_4__.resetComponent)(token)), {
- position: 'absolute',
- top: -9999,
- insetInlineStart: -9999,
- zIndex: token.zIndexPopup,
- boxSizing: 'border-box',
- fontSize,
- fontVariant: 'initial',
- padding: paddingXXS,
- backgroundColor: colorBgElevated,
- borderRadius: borderRadiusLG,
- outline: 'none',
- boxShadow: boxShadowSecondary,
- '&-hidden': {
- display: 'none'
- },
- [`${componentCls}-dropdown-menu`]: {
- maxHeight: token.dropdownHeight,
- margin: 0,
- paddingInlineStart: 0,
- // Override default ul/ol
- overflow: 'auto',
- listStyle: 'none',
- outline: 'none',
- '&-item': Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_4__.textEllipsis), {
- position: 'relative',
- display: 'block',
- minWidth: token.controlItemWidth,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(itemPaddingVertical)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(controlPaddingHorizontal)}`,
- color: colorText,
- borderRadius,
- fontWeight: 'normal',
- lineHeight,
- cursor: 'pointer',
- transition: `background ${motionDurationSlow} ease`,
- '&:hover': {
- backgroundColor: controlItemBgHover
- },
- '&-disabled': {
- color: colorTextDisabled,
- cursor: 'not-allowed',
- '&:hover': {
- color: colorTextDisabled,
- backgroundColor: controlItemBgHover,
- cursor: 'not-allowed'
- }
- },
- '&-selected': {
- color: colorText,
- fontWeight: token.fontWeightStrong,
- backgroundColor: controlItemBgHover
- },
- '&-active': {
- backgroundColor: controlItemBgHover
- }
- })
- }
- })
- })
- };
- };
- const prepareComponentToken = token => Object.assign(Object.assign({}, (0,_input_style__WEBPACK_IMPORTED_MODULE_2__.initComponentToken)(token)), {
- dropdownHeight: 250,
- controlItemWidth: 100,
- zIndexPopup: token.zIndexPopupBase + 50,
- itemPaddingVertical: (token.controlHeight - token.fontHeight) / 2
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.genStyleHooks)('Mentions', token => {
- const mentionsToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, (0,_input_style__WEBPACK_IMPORTED_MODULE_2__.initInputToken)(token));
- return genMentionsStyle(mentionsToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/menu/style/index.ts":
- /*!****************************************************!*\
- !*** ./components/menu/style/index.ts + 4 modules ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ menu_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/collapse.ts
- var collapse = __webpack_require__("./components/style/motion/collapse.ts");
- // EXTERNAL MODULE: ./components/style/motion/slide.ts
- var slide = __webpack_require__("./components/style/motion/slide.ts");
- // EXTERNAL MODULE: ./components/style/motion/zoom.ts
- var zoom = __webpack_require__("./components/style/motion/zoom.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var cssinjs_utils_es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/menu/style/horizontal.ts
- const getHorizontalStyle = token => {
- const {
- componentCls,
- motionDurationSlow,
- horizontalLineHeight,
- colorSplit,
- lineWidth,
- lineType,
- itemPaddingInline
- } = token;
- return {
- [`${componentCls}-horizontal`]: {
- lineHeight: horizontalLineHeight,
- border: 0,
- borderBottom: `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- boxShadow: 'none',
- '&::after': {
- display: 'block',
- clear: 'both',
- height: 0,
- content: '"\\20"'
- },
- // ======================= Item =======================
- [`${componentCls}-item, ${componentCls}-submenu`]: {
- position: 'relative',
- display: 'inline-block',
- verticalAlign: 'bottom',
- paddingInline: itemPaddingInline
- },
- [`> ${componentCls}-item:hover,
- > ${componentCls}-item-active,
- > ${componentCls}-submenu ${componentCls}-submenu-title:hover`]: {
- backgroundColor: 'transparent'
- },
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`].join(',')
- },
- // ===================== Sub Menu =====================
- [`${componentCls}-submenu-arrow`]: {
- display: 'none'
- }
- }
- };
- };
- /* harmony default export */ var horizontal = (getHorizontalStyle);
- ;// ./components/menu/style/rtl.ts
- const getRTLStyle = ({
- componentCls,
- menuArrowOffset,
- calc
- }) => ({
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- },
- [`${componentCls}-submenu-rtl`]: {
- transformOrigin: '100% 0'
- },
- // Vertical Arrow
- [`${componentCls}-rtl${componentCls}-vertical,
- ${componentCls}-submenu-rtl ${componentCls}-vertical`]: {
- [`${componentCls}-submenu-arrow`]: {
- '&::before': {
- transform: `rotate(-45deg) translateY(${(0,cssinjs.unit)(calc(menuArrowOffset).mul(-1).equal())})`
- },
- '&::after': {
- transform: `rotate(45deg) translateY(${(0,cssinjs.unit)(menuArrowOffset)})`
- }
- }
- }
- });
- /* harmony default export */ var rtl = (getRTLStyle);
- ;// ./components/menu/style/theme.ts
- const accessibilityFocus = token => (0,style.genFocusOutline)(token);
- const getThemeStyle = (token, themeSuffix) => {
- const {
- componentCls,
- itemColor,
- itemSelectedColor,
- subMenuItemSelectedColor,
- groupTitleColor,
- itemBg,
- subMenuItemBg,
- itemSelectedBg,
- activeBarHeight,
- activeBarWidth,
- activeBarBorderWidth,
- motionDurationSlow,
- motionEaseInOut,
- motionEaseOut,
- itemPaddingInline,
- motionDurationMid,
- itemHoverColor,
- lineType,
- colorSplit,
- // Disabled
- itemDisabledColor,
- // Danger
- dangerItemColor,
- dangerItemHoverColor,
- dangerItemSelectedColor,
- dangerItemActiveBg,
- dangerItemSelectedBg,
- // Bg
- popupBg,
- itemHoverBg,
- itemActiveBg,
- menuSubMenuBg,
- // Horizontal
- horizontalItemSelectedColor,
- horizontalItemSelectedBg,
- horizontalItemBorderRadius,
- horizontalItemHoverBg
- } = token;
- return {
- [`${componentCls}-${themeSuffix}, ${componentCls}-${themeSuffix} > ${componentCls}`]: {
- color: itemColor,
- background: itemBg,
- [`&${componentCls}-root:focus-visible`]: Object.assign({}, accessibilityFocus(token)),
- // ======================== Item ========================
- [`${componentCls}-item`]: {
- '&-group-title, &-extra': {
- color: groupTitleColor
- }
- },
- [`${componentCls}-submenu-selected > ${componentCls}-submenu-title`]: {
- color: subMenuItemSelectedColor
- },
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- color: itemColor,
- [`&:not(${componentCls}-item-disabled):focus-visible`]: Object.assign({}, accessibilityFocus(token))
- },
- // Disabled
- [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
- color: `${itemDisabledColor} !important`
- },
- // Hover
- [`${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: {
- [`&:hover, > ${componentCls}-submenu-title:hover`]: {
- color: itemHoverColor
- }
- },
- [`&:not(${componentCls}-horizontal)`]: {
- [`${componentCls}-item:not(${componentCls}-item-selected)`]: {
- '&:hover': {
- backgroundColor: itemHoverBg
- },
- '&:active': {
- backgroundColor: itemActiveBg
- }
- },
- [`${componentCls}-submenu-title`]: {
- '&:hover': {
- backgroundColor: itemHoverBg
- },
- '&:active': {
- backgroundColor: itemActiveBg
- }
- }
- },
- // Danger - only Item has
- [`${componentCls}-item-danger`]: {
- color: dangerItemColor,
- [`&${componentCls}-item:hover`]: {
- [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: {
- color: dangerItemHoverColor
- }
- },
- [`&${componentCls}-item:active`]: {
- background: dangerItemActiveBg
- }
- },
- [`${componentCls}-item a`]: {
- '&, &:hover': {
- color: 'inherit'
- }
- },
- [`${componentCls}-item-selected`]: {
- color: itemSelectedColor,
- // Danger
- [`&${componentCls}-item-danger`]: {
- color: dangerItemSelectedColor
- },
- 'a, a:hover': {
- color: 'inherit'
- }
- },
- [`& ${componentCls}-item-selected`]: {
- backgroundColor: itemSelectedBg,
- // Danger
- [`&${componentCls}-item-danger`]: {
- backgroundColor: dangerItemSelectedBg
- }
- },
- [`&${componentCls}-submenu > ${componentCls}`]: {
- backgroundColor: menuSubMenuBg
- },
- // ===== 设置浮层的颜色 =======
- // !dark 模式会被popupBg 会被rest 为 darkPopupBg
- [`&${componentCls}-popup > ${componentCls}`]: {
- backgroundColor: popupBg
- },
- [`&${componentCls}-submenu-popup > ${componentCls}`]: {
- backgroundColor: popupBg
- },
- // ===== 设置浮层的颜色 end =======
- // ====================== Horizontal ======================
- [`&${componentCls}-horizontal`]: Object.assign(Object.assign({}, themeSuffix === 'dark' ? {
- borderBottom: 0
- } : {}), {
- [`> ${componentCls}-item, > ${componentCls}-submenu`]: {
- top: activeBarBorderWidth,
- marginTop: token.calc(activeBarBorderWidth).mul(-1).equal(),
- marginBottom: 0,
- borderRadius: horizontalItemBorderRadius,
- '&::after': {
- position: 'absolute',
- insetInline: itemPaddingInline,
- bottom: 0,
- borderBottom: `${(0,cssinjs.unit)(activeBarHeight)} solid transparent`,
- transition: `border-color ${motionDurationSlow} ${motionEaseInOut}`,
- content: '""'
- },
- '&:hover, &-active, &-open': {
- background: horizontalItemHoverBg,
- '&::after': {
- borderBottomWidth: activeBarHeight,
- borderBottomColor: horizontalItemSelectedColor
- }
- },
- '&-selected': {
- color: horizontalItemSelectedColor,
- backgroundColor: horizontalItemSelectedBg,
- '&:hover': {
- backgroundColor: horizontalItemSelectedBg
- },
- '&::after': {
- borderBottomWidth: activeBarHeight,
- borderBottomColor: horizontalItemSelectedColor
- }
- }
- }
- }),
- // ================== Inline & Vertical ===================
- //
- [`&${componentCls}-root`]: {
- [`&${componentCls}-inline, &${componentCls}-vertical`]: {
- borderInlineEnd: `${(0,cssinjs.unit)(activeBarBorderWidth)} ${lineType} ${colorSplit}`
- }
- },
- // ======================== Inline ========================
- [`&${componentCls}-inline`]: {
- // Sub
- [`${componentCls}-sub${componentCls}-inline`]: {
- background: subMenuItemBg
- },
- [`${componentCls}-item`]: {
- position: 'relative',
- '&::after': {
- position: 'absolute',
- insetBlock: 0,
- insetInlineEnd: 0,
- borderInlineEnd: `${(0,cssinjs.unit)(activeBarWidth)} solid ${itemSelectedColor}`,
- transform: 'scaleY(0.0001)',
- opacity: 0,
- transition: [`transform ${motionDurationMid} ${motionEaseOut}`, `opacity ${motionDurationMid} ${motionEaseOut}`].join(','),
- content: '""'
- },
- // Danger
- [`&${componentCls}-item-danger`]: {
- '&::after': {
- borderInlineEndColor: dangerItemSelectedColor
- }
- }
- },
- [`${componentCls}-selected, ${componentCls}-item-selected`]: {
- '&::after': {
- transform: 'scaleY(1)',
- opacity: 1,
- transition: [`transform ${motionDurationMid} ${motionEaseInOut}`, `opacity ${motionDurationMid} ${motionEaseInOut}`].join(',')
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var theme = (getThemeStyle);
- ;// ./components/menu/style/vertical.ts
- const getVerticalInlineStyle = token => {
- const {
- componentCls,
- itemHeight,
- itemMarginInline,
- padding,
- menuArrowSize,
- marginXS,
- itemMarginBlock,
- itemWidth,
- itemPaddingInline
- } = token;
- const paddingWithArrow = token.calc(menuArrowSize).add(padding).add(marginXS).equal();
- return {
- [`${componentCls}-item`]: {
- position: 'relative',
- overflow: 'hidden'
- },
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- height: itemHeight,
- lineHeight: (0,cssinjs.unit)(itemHeight),
- paddingInline: itemPaddingInline,
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- marginInline: itemMarginInline,
- marginBlock: itemMarginBlock,
- width: itemWidth
- },
- [`> ${componentCls}-item,
- > ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
- height: itemHeight,
- lineHeight: (0,cssinjs.unit)(itemHeight)
- },
- [`${componentCls}-item-group-list ${componentCls}-submenu-title,
- ${componentCls}-submenu-title`]: {
- paddingInlineEnd: paddingWithArrow
- }
- };
- };
- const getVerticalStyle = token => {
- const {
- componentCls,
- iconCls,
- itemHeight,
- colorTextLightSolid,
- dropdownWidth,
- controlHeightLG,
- motionEaseOut,
- paddingXL,
- itemMarginInline,
- fontSizeLG,
- motionDurationFast,
- motionDurationSlow,
- paddingXS,
- boxShadowSecondary,
- collapsedWidth,
- collapsedIconSize
- } = token;
- const inlineItemStyle = {
- height: itemHeight,
- lineHeight: (0,cssinjs.unit)(itemHeight),
- listStylePosition: 'inside',
- listStyleType: 'disc'
- };
- return [{
- [componentCls]: {
- '&-inline, &-vertical': Object.assign({
- [`&${componentCls}-root`]: {
- boxShadow: 'none'
- }
- }, getVerticalInlineStyle(token))
- },
- [`${componentCls}-submenu-popup`]: {
- [`${componentCls}-vertical`]: Object.assign(Object.assign({}, getVerticalInlineStyle(token)), {
- boxShadow: boxShadowSecondary
- })
- }
- },
- // Vertical only
- {
- [`${componentCls}-submenu-popup ${componentCls}-vertical${componentCls}-sub`]: {
- minWidth: dropdownWidth,
- maxHeight: `calc(100vh - ${(0,cssinjs.unit)(token.calc(controlHeightLG).mul(2.5).equal())})`,
- padding: '0',
- overflow: 'hidden',
- borderInlineEnd: 0,
- // https://github.com/ant-design/ant-design/issues/22244
- // https://github.com/ant-design/ant-design/issues/26812
- "&:not([class*='-active'])": {
- overflowX: 'hidden',
- overflowY: 'auto'
- }
- }
- },
- // Inline Only
- {
- [`${componentCls}-inline`]: {
- width: '100%',
- // Motion enhance for first level
- [`&${componentCls}-root`]: {
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- display: 'flex',
- alignItems: 'center',
- transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding ${motionDurationFast} ${motionEaseOut}`].join(','),
- [`> ${componentCls}-title-content`]: {
- flex: 'auto',
- minWidth: 0,
- overflow: 'hidden',
- textOverflow: 'ellipsis'
- },
- '> *': {
- flex: 'none'
- }
- }
- },
- // >>>>> Sub
- [`${componentCls}-sub${componentCls}-inline`]: {
- padding: 0,
- border: 0,
- borderRadius: 0,
- boxShadow: 'none',
- [`& > ${componentCls}-submenu > ${componentCls}-submenu-title`]: inlineItemStyle,
- [`& ${componentCls}-item-group-title`]: {
- paddingInlineStart: paddingXL
- }
- },
- // >>>>> Item
- [`${componentCls}-item`]: inlineItemStyle
- }
- },
- // Inline Collapse Only
- {
- [`${componentCls}-inline-collapsed`]: {
- width: collapsedWidth,
- [`&${componentCls}-root`]: {
- [`${componentCls}-item, ${componentCls}-submenu ${componentCls}-submenu-title`]: {
- [`> ${componentCls}-inline-collapsed-noicon`]: {
- fontSize: fontSizeLG,
- textAlign: 'center'
- }
- }
- },
- [`> ${componentCls}-item,
- > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-item,
- > ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-submenu > ${componentCls}-submenu-title,
- > ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
- insetInlineStart: 0,
- paddingInline: `calc(50% - ${(0,cssinjs.unit)(token.calc(collapsedIconSize).div(2).equal())} - ${(0,cssinjs.unit)(itemMarginInline)})`,
- textOverflow: 'clip',
- [`
- ${componentCls}-submenu-arrow,
- ${componentCls}-submenu-expand-icon
- `]: {
- opacity: 0
- },
- [`${componentCls}-item-icon, ${iconCls}`]: {
- margin: 0,
- fontSize: collapsedIconSize,
- lineHeight: (0,cssinjs.unit)(itemHeight),
- '+ span': {
- display: 'inline-block',
- opacity: 0
- }
- }
- },
- [`${componentCls}-item-icon, ${iconCls}`]: {
- display: 'inline-block'
- },
- '&-tooltip': {
- pointerEvents: 'none',
- [`${componentCls}-item-icon, ${iconCls}`]: {
- display: 'none'
- },
- 'a, a:hover': {
- color: colorTextLightSolid
- }
- },
- [`${componentCls}-item-group-title`]: Object.assign(Object.assign({}, style.textEllipsis), {
- paddingInline: paddingXS
- })
- }
- }];
- };
- /* harmony default export */ var vertical = (getVerticalStyle);
- ;// ./components/menu/style/index.ts
- const genMenuItemStyle = token => {
- const {
- componentCls,
- motionDurationSlow,
- motionDurationMid,
- motionEaseInOut,
- motionEaseOut,
- iconCls,
- iconSize,
- iconMarginInlineEnd
- } = token;
- return {
- // >>>>> Item
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- position: 'relative',
- display: 'block',
- margin: 0,
- whiteSpace: 'nowrap',
- cursor: 'pointer',
- transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`, `padding calc(${motionDurationSlow} + 0.1s) ${motionEaseInOut}`].join(','),
- [`${componentCls}-item-icon, ${iconCls}`]: {
- minWidth: iconSize,
- fontSize: iconSize,
- transition: [`font-size ${motionDurationMid} ${motionEaseOut}`, `margin ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow}`].join(','),
- '+ span': {
- marginInlineStart: iconMarginInlineEnd,
- opacity: 1,
- transition: [`opacity ${motionDurationSlow} ${motionEaseInOut}`, `margin ${motionDurationSlow}`, `color ${motionDurationSlow}`].join(',')
- }
- },
- [`${componentCls}-item-icon`]: Object.assign({}, (0,style.resetIcon)()),
- [`&${componentCls}-item-only-child`]: {
- [`> ${iconCls}, > ${componentCls}-item-icon`]: {
- marginInlineEnd: 0
- }
- }
- },
- // Disabled state sets text to gray and nukes hover/tab effects
- [`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
- background: 'none !important',
- cursor: 'not-allowed',
- '&::after': {
- borderColor: 'transparent !important'
- },
- a: {
- color: 'inherit !important',
- cursor: 'not-allowed',
- pointerEvents: 'none'
- },
- [`> ${componentCls}-submenu-title`]: {
- color: 'inherit !important',
- cursor: 'not-allowed'
- }
- }
- };
- };
- const genSubMenuArrowStyle = token => {
- const {
- componentCls,
- motionDurationSlow,
- motionEaseInOut,
- borderRadius,
- menuArrowSize,
- menuArrowOffset
- } = token;
- return {
- [`${componentCls}-submenu`]: {
- '&-expand-icon, &-arrow': {
- position: 'absolute',
- top: '50%',
- insetInlineEnd: token.margin,
- width: menuArrowSize,
- color: 'currentcolor',
- transform: 'translateY(-50%)',
- transition: `transform ${motionDurationSlow} ${motionEaseInOut}, opacity ${motionDurationSlow}`
- },
- '&-arrow': {
- // →
- '&::before, &::after': {
- position: 'absolute',
- width: token.calc(menuArrowSize).mul(0.6).equal(),
- height: token.calc(menuArrowSize).mul(0.15).equal(),
- backgroundColor: 'currentcolor',
- borderRadius,
- transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `transform ${motionDurationSlow} ${motionEaseInOut}`, `top ${motionDurationSlow} ${motionEaseInOut}`, `color ${motionDurationSlow} ${motionEaseInOut}`].join(','),
- content: '""'
- },
- '&::before': {
- transform: `rotate(45deg) translateY(${(0,cssinjs.unit)(token.calc(menuArrowOffset).mul(-1).equal())})`
- },
- '&::after': {
- transform: `rotate(-45deg) translateY(${(0,cssinjs.unit)(menuArrowOffset)})`
- }
- }
- }
- };
- };
- // =============================== Base ===============================
- const getBaseStyle = token => {
- const {
- antCls,
- componentCls,
- fontSize,
- motionDurationSlow,
- motionDurationMid,
- motionEaseInOut,
- paddingXS,
- padding,
- colorSplit,
- lineWidth,
- zIndexPopup,
- borderRadiusLG,
- subMenuItemBorderRadius,
- menuArrowSize,
- menuArrowOffset,
- lineType,
- groupTitleLineHeight,
- groupTitleFontSize
- } = token;
- return [
- // Misc
- {
- '': {
- [componentCls]: Object.assign(Object.assign({}, (0,style.clearFix)()), {
- // Hidden
- '&-hidden': {
- display: 'none'
- }
- })
- },
- [`${componentCls}-submenu-hidden`]: {
- display: 'none'
- }
- }, {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style.resetComponent)(token)), (0,style.clearFix)()), {
- marginBottom: 0,
- paddingInlineStart: 0,
- // Override default ul/ol
- fontSize,
- lineHeight: 0,
- listStyle: 'none',
- outline: 'none',
- // Magic cubic here but smooth transition
- transition: `width ${motionDurationSlow} cubic-bezier(0.2, 0, 0, 1) 0s`,
- 'ul, ol': {
- margin: 0,
- padding: 0,
- listStyle: 'none'
- },
- // Overflow ellipsis
- '&-overflow': {
- display: 'flex',
- [`${componentCls}-item`]: {
- flex: 'none'
- }
- },
- [`${componentCls}-item, ${componentCls}-submenu, ${componentCls}-submenu-title`]: {
- borderRadius: token.itemBorderRadius
- },
- [`${componentCls}-item-group-title`]: {
- padding: `${(0,cssinjs.unit)(paddingXS)} ${(0,cssinjs.unit)(padding)}`,
- fontSize: groupTitleFontSize,
- lineHeight: groupTitleLineHeight,
- transition: `all ${motionDurationSlow}`
- },
- [`&-horizontal ${componentCls}-submenu`]: {
- transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`].join(',')
- },
- [`${componentCls}-submenu, ${componentCls}-submenu-inline`]: {
- transition: [`border-color ${motionDurationSlow} ${motionEaseInOut}`, `background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationMid} ${motionEaseInOut}`].join(',')
- },
- [`${componentCls}-submenu ${componentCls}-sub`]: {
- cursor: 'initial',
- transition: [`background ${motionDurationSlow} ${motionEaseInOut}`, `padding ${motionDurationSlow} ${motionEaseInOut}`].join(',')
- },
- [`${componentCls}-title-content`]: {
- transition: `color ${motionDurationSlow}`,
- '&-with-extra': {
- display: 'inline-flex',
- alignItems: 'center',
- width: '100%'
- },
- // https://github.com/ant-design/ant-design/issues/41143
- [`> ${antCls}-typography-ellipsis-single-line`]: {
- display: 'inline',
- verticalAlign: 'unset'
- },
- [`${componentCls}-item-extra`]: {
- marginInlineStart: 'auto',
- paddingInlineStart: token.padding
- }
- },
- [`${componentCls}-item a`]: {
- '&::before': {
- position: 'absolute',
- inset: 0,
- backgroundColor: 'transparent',
- content: '""'
- }
- },
- // Removed a Badge related style seems it's safe
- // https://github.com/ant-design/ant-design/issues/19809
- // >>>>> Divider
- [`${componentCls}-item-divider`]: {
- overflow: 'hidden',
- lineHeight: 0,
- borderColor: colorSplit,
- borderStyle: lineType,
- borderWidth: 0,
- borderTopWidth: lineWidth,
- marginBlock: lineWidth,
- padding: 0,
- '&-dashed': {
- borderStyle: 'dashed'
- }
- }
- }), genMenuItemStyle(token)), {
- [`${componentCls}-item-group`]: {
- [`${componentCls}-item-group-list`]: {
- margin: 0,
- padding: 0,
- [`${componentCls}-item, ${componentCls}-submenu-title`]: {
- paddingInline: `${(0,cssinjs.unit)(token.calc(fontSize).mul(2).equal())} ${(0,cssinjs.unit)(padding)}`
- }
- }
- },
- // ======================= Sub Menu =======================
- '&-submenu': {
- '&-popup': {
- position: 'absolute',
- zIndex: zIndexPopup,
- borderRadius: borderRadiusLG,
- boxShadow: 'none',
- transformOrigin: '0 0',
- [`&${componentCls}-submenu`]: {
- background: 'transparent'
- },
- // https://github.com/ant-design/ant-design/issues/13955
- '&::before': {
- position: 'absolute',
- inset: 0,
- zIndex: -1,
- width: '100%',
- height: '100%',
- opacity: 0,
- content: '""'
- },
- [`> ${componentCls}`]: Object.assign(Object.assign(Object.assign({
- borderRadius: borderRadiusLG
- }, genMenuItemStyle(token)), genSubMenuArrowStyle(token)), {
- [`${componentCls}-item, ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
- borderRadius: subMenuItemBorderRadius
- },
- [`${componentCls}-submenu-title::after`]: {
- transition: `transform ${motionDurationSlow} ${motionEaseInOut}`
- }
- })
- },
- [`
- &-placement-leftTop,
- &-placement-bottomRight,
- `]: {
- transformOrigin: '100% 0'
- },
- [`
- &-placement-leftBottom,
- &-placement-topRight,
- `]: {
- transformOrigin: '100% 100%'
- },
- [`
- &-placement-rightBottom,
- &-placement-topLeft,
- `]: {
- transformOrigin: '0 100%'
- },
- [`
- &-placement-bottomLeft,
- &-placement-rightTop,
- `]: {
- transformOrigin: '0 0'
- },
- [`
- &-placement-leftTop,
- &-placement-leftBottom
- `]: {
- paddingInlineEnd: token.paddingXS
- },
- [`
- &-placement-rightTop,
- &-placement-rightBottom
- `]: {
- paddingInlineStart: token.paddingXS
- },
- [`
- &-placement-topRight,
- &-placement-topLeft
- `]: {
- paddingBottom: token.paddingXS
- },
- [`
- &-placement-bottomRight,
- &-placement-bottomLeft
- `]: {
- paddingTop: token.paddingXS
- }
- }
- }), genSubMenuArrowStyle(token)), {
- [`&-inline-collapsed ${componentCls}-submenu-arrow,
- &-inline ${componentCls}-submenu-arrow`]: {
- // ↓
- '&::before': {
- transform: `rotate(-45deg) translateX(${(0,cssinjs.unit)(menuArrowOffset)})`
- },
- '&::after': {
- transform: `rotate(45deg) translateX(${(0,cssinjs.unit)(token.calc(menuArrowOffset).mul(-1).equal())})`
- }
- },
- [`${componentCls}-submenu-open${componentCls}-submenu-inline > ${componentCls}-submenu-title > ${componentCls}-submenu-arrow`]: {
- // ↑
- transform: `translateY(${(0,cssinjs.unit)(token.calc(menuArrowSize).mul(0.2).mul(-1).equal())})`,
- '&::after': {
- transform: `rotate(-45deg) translateX(${(0,cssinjs.unit)(token.calc(menuArrowOffset).mul(-1).equal())})`
- },
- '&::before': {
- transform: `rotate(45deg) translateX(${(0,cssinjs.unit)(menuArrowOffset)})`
- }
- }
- })
- },
- // Integration with header element so menu items have the same height
- {
- [`${antCls}-layout-header`]: {
- [componentCls]: {
- lineHeight: 'inherit'
- }
- }
- }];
- };
- const prepareComponentToken = token => {
- var _a, _b, _c;
- const {
- colorPrimary,
- colorError,
- colorTextDisabled,
- colorErrorBg,
- colorText,
- colorTextDescription,
- colorBgContainer,
- colorFillAlter,
- colorFillContent,
- lineWidth,
- lineWidthBold,
- controlItemBgActive,
- colorBgTextHover,
- controlHeightLG,
- lineHeight,
- colorBgElevated,
- marginXXS,
- padding,
- fontSize,
- controlHeightSM,
- fontSizeLG,
- colorTextLightSolid,
- colorErrorHover
- } = token;
- const activeBarWidth = (_a = token.activeBarWidth) !== null && _a !== void 0 ? _a : 0;
- const activeBarBorderWidth = (_b = token.activeBarBorderWidth) !== null && _b !== void 0 ? _b : lineWidth;
- const itemMarginInline = (_c = token.itemMarginInline) !== null && _c !== void 0 ? _c : token.marginXXS;
- const colorTextDark = new es.FastColor(colorTextLightSolid).setA(0.65).toRgbString();
- return {
- dropdownWidth: 160,
- zIndexPopup: token.zIndexPopupBase + 50,
- radiusItem: token.borderRadiusLG,
- itemBorderRadius: token.borderRadiusLG,
- radiusSubMenuItem: token.borderRadiusSM,
- subMenuItemBorderRadius: token.borderRadiusSM,
- colorItemText: colorText,
- itemColor: colorText,
- colorItemTextHover: colorText,
- itemHoverColor: colorText,
- colorItemTextHoverHorizontal: colorPrimary,
- horizontalItemHoverColor: colorPrimary,
- colorGroupTitle: colorTextDescription,
- groupTitleColor: colorTextDescription,
- colorItemTextSelected: colorPrimary,
- itemSelectedColor: colorPrimary,
- subMenuItemSelectedColor: colorPrimary,
- colorItemTextSelectedHorizontal: colorPrimary,
- horizontalItemSelectedColor: colorPrimary,
- colorItemBg: colorBgContainer,
- itemBg: colorBgContainer,
- colorItemBgHover: colorBgTextHover,
- itemHoverBg: colorBgTextHover,
- colorItemBgActive: colorFillContent,
- itemActiveBg: controlItemBgActive,
- colorSubItemBg: colorFillAlter,
- subMenuItemBg: colorFillAlter,
- colorItemBgSelected: controlItemBgActive,
- itemSelectedBg: controlItemBgActive,
- colorItemBgSelectedHorizontal: 'transparent',
- horizontalItemSelectedBg: 'transparent',
- colorActiveBarWidth: 0,
- activeBarWidth,
- colorActiveBarHeight: lineWidthBold,
- activeBarHeight: lineWidthBold,
- colorActiveBarBorderSize: lineWidth,
- activeBarBorderWidth,
- // Disabled
- colorItemTextDisabled: colorTextDisabled,
- itemDisabledColor: colorTextDisabled,
- // Danger
- colorDangerItemText: colorError,
- dangerItemColor: colorError,
- colorDangerItemTextHover: colorError,
- dangerItemHoverColor: colorError,
- colorDangerItemTextSelected: colorError,
- dangerItemSelectedColor: colorError,
- colorDangerItemBgActive: colorErrorBg,
- dangerItemActiveBg: colorErrorBg,
- colorDangerItemBgSelected: colorErrorBg,
- dangerItemSelectedBg: colorErrorBg,
- itemMarginInline,
- horizontalItemBorderRadius: 0,
- horizontalItemHoverBg: 'transparent',
- itemHeight: controlHeightLG,
- groupTitleLineHeight: lineHeight,
- collapsedWidth: controlHeightLG * 2,
- popupBg: colorBgElevated,
- itemMarginBlock: marginXXS,
- itemPaddingInline: padding,
- horizontalLineHeight: `${controlHeightLG * 1.15}px`,
- iconSize: fontSize,
- iconMarginInlineEnd: controlHeightSM - fontSize,
- collapsedIconSize: fontSizeLG,
- groupTitleFontSize: fontSize,
- // Disabled
- darkItemDisabledColor: new es.FastColor(colorTextLightSolid).setA(0.25).toRgbString(),
- // Dark
- darkItemColor: colorTextDark,
- darkDangerItemColor: colorError,
- darkItemBg: '#001529',
- darkPopupBg: '#001529',
- darkSubMenuItemBg: '#000c17',
- darkItemSelectedColor: colorTextLightSolid,
- darkItemSelectedBg: colorPrimary,
- darkDangerItemSelectedBg: colorError,
- darkItemHoverBg: 'transparent',
- darkGroupTitleColor: colorTextDark,
- darkItemHoverColor: colorTextLightSolid,
- darkDangerItemHoverColor: colorErrorHover,
- darkDangerItemSelectedColor: colorTextLightSolid,
- darkDangerItemActiveBg: colorError,
- // internal
- itemWidth: activeBarWidth ? `calc(100% + ${activeBarBorderWidth}px)` : `calc(100% - ${itemMarginInline * 2}px)`
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var menu_style = ((prefixCls, rootCls = prefixCls, injectStyle = true) => {
- const useStyle = (0,genStyleUtils.genStyleHooks)('Menu', token => {
- const {
- colorBgElevated,
- controlHeightLG,
- fontSize,
- darkItemColor,
- darkDangerItemColor,
- darkItemBg,
- darkSubMenuItemBg,
- darkItemSelectedColor,
- darkItemSelectedBg,
- darkDangerItemSelectedBg,
- darkItemHoverBg,
- darkGroupTitleColor,
- darkItemHoverColor,
- darkItemDisabledColor,
- darkDangerItemHoverColor,
- darkDangerItemSelectedColor,
- darkDangerItemActiveBg,
- popupBg,
- darkPopupBg
- } = token;
- const menuArrowSize = token.calc(fontSize).div(7).mul(5).equal();
- // Menu Token
- const menuToken = (0,cssinjs_utils_es.mergeToken)(token, {
- menuArrowSize,
- menuHorizontalHeight: token.calc(controlHeightLG).mul(1.15).equal(),
- menuArrowOffset: token.calc(menuArrowSize).mul(0.25).equal(),
- menuSubMenuBg: colorBgElevated,
- calc: token.calc,
- popupBg
- });
- const menuDarkToken = (0,cssinjs_utils_es.mergeToken)(menuToken, {
- itemColor: darkItemColor,
- itemHoverColor: darkItemHoverColor,
- groupTitleColor: darkGroupTitleColor,
- itemSelectedColor: darkItemSelectedColor,
- subMenuItemSelectedColor: darkItemSelectedColor,
- itemBg: darkItemBg,
- popupBg: darkPopupBg,
- subMenuItemBg: darkSubMenuItemBg,
- itemActiveBg: 'transparent',
- itemSelectedBg: darkItemSelectedBg,
- activeBarHeight: 0,
- activeBarBorderWidth: 0,
- itemHoverBg: darkItemHoverBg,
- // Disabled
- itemDisabledColor: darkItemDisabledColor,
- // Danger
- dangerItemColor: darkDangerItemColor,
- dangerItemHoverColor: darkDangerItemHoverColor,
- dangerItemSelectedColor: darkDangerItemSelectedColor,
- dangerItemActiveBg: darkDangerItemActiveBg,
- dangerItemSelectedBg: darkDangerItemSelectedBg,
- menuSubMenuBg: darkSubMenuItemBg,
- // Horizontal
- horizontalItemSelectedColor: darkItemSelectedColor,
- horizontalItemSelectedBg: darkItemSelectedBg
- });
- return [
- // Basic
- getBaseStyle(menuToken),
- // Horizontal
- horizontal(menuToken),
- // Hard code for some light style
- // Vertical
- vertical(menuToken),
- // Hard code for some light style
- // Theme
- theme(menuToken, 'light'), theme(menuDarkToken, 'dark'),
- // RTL
- rtl(menuToken),
- // Motion
- (0,collapse["default"])(menuToken), (0,slide.initSlideMotion)(menuToken, 'slide-up'), (0,slide.initSlideMotion)(menuToken, 'slide-down'), (0,zoom.initZoomMotion)(menuToken, 'zoom-big')];
- }, prepareComponentToken, {
- deprecatedTokens: [['colorGroupTitle', 'groupTitleColor'], ['radiusItem', 'itemBorderRadius'], ['radiusSubMenuItem', 'subMenuItemBorderRadius'], ['colorItemText', 'itemColor'], ['colorItemTextHover', 'itemHoverColor'], ['colorItemTextHoverHorizontal', 'horizontalItemHoverColor'], ['colorItemTextSelected', 'itemSelectedColor'], ['colorItemTextSelectedHorizontal', 'horizontalItemSelectedColor'], ['colorItemTextDisabled', 'itemDisabledColor'], ['colorDangerItemText', 'dangerItemColor'], ['colorDangerItemTextHover', 'dangerItemHoverColor'], ['colorDangerItemTextSelected', 'dangerItemSelectedColor'], ['colorDangerItemBgActive', 'dangerItemActiveBg'], ['colorDangerItemBgSelected', 'dangerItemSelectedBg'], ['colorItemBg', 'itemBg'], ['colorItemBgHover', 'itemHoverBg'], ['colorSubItemBg', 'subMenuItemBg'], ['colorItemBgActive', 'itemActiveBg'], ['colorItemBgSelectedHorizontal', 'horizontalItemSelectedBg'], ['colorActiveBarWidth', 'activeBarWidth'], ['colorActiveBarHeight', 'activeBarHeight'], ['colorActiveBarBorderSize', 'activeBarBorderWidth'], ['colorItemBgSelected', 'itemSelectedBg']],
- // Dropdown will handle menu style self. We do not need to handle this.
- injectStyle,
- unitless: {
- groupTitleLineHeight: true
- }
- });
- return useStyle(prefixCls, rootCls);
- });
- /***/ }),
- /***/ "./components/message/style/index.ts":
- /*!*******************************************!*\
- !*** ./components/message/style/index.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _util_hooks_useZIndex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_util/hooks/useZIndex */ "./components/_util/hooks/useZIndex.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genMessageStyle = token => {
- const {
- componentCls,
- iconCls,
- boxShadow,
- colorText,
- colorSuccess,
- colorError,
- colorWarning,
- colorInfo,
- fontSizeLG,
- motionEaseInOutCirc,
- motionDurationSlow,
- marginXS,
- paddingXS,
- borderRadiusLG,
- zIndexPopup,
- // Custom token
- contentPadding,
- contentBg
- } = token;
- const noticeCls = `${componentCls}-notice`;
- const messageMoveIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('MessageMoveIn', {
- '0%': {
- padding: 0,
- transform: 'translateY(-100%)',
- opacity: 0
- },
- '100%': {
- padding: paddingXS,
- transform: 'translateY(0)',
- opacity: 1
- }
- });
- const messageMoveOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('MessageMoveOut', {
- '0%': {
- maxHeight: token.height,
- padding: paddingXS,
- opacity: 1
- },
- '100%': {
- maxHeight: 0,
- padding: 0,
- opacity: 0
- }
- });
- const noticeStyle = {
- padding: paddingXS,
- textAlign: 'center',
- [`${componentCls}-custom-content`]: {
- display: 'flex',
- alignItems: 'center'
- },
- [`${componentCls}-custom-content > ${iconCls}`]: {
- marginInlineEnd: marginXS,
- // affected by ltr or rtl
- fontSize: fontSizeLG
- },
- [`${noticeCls}-content`]: {
- display: 'inline-block',
- padding: contentPadding,
- background: contentBg,
- borderRadius: borderRadiusLG,
- boxShadow,
- pointerEvents: 'all'
- },
- [`${componentCls}-success > ${iconCls}`]: {
- color: colorSuccess
- },
- [`${componentCls}-error > ${iconCls}`]: {
- color: colorError
- },
- [`${componentCls}-warning > ${iconCls}`]: {
- color: colorWarning
- },
- [`${componentCls}-info > ${iconCls},
- ${componentCls}-loading > ${iconCls}`]: {
- color: colorInfo
- }
- };
- return [
- // ============================ Holder ============================
- {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- color: colorText,
- position: 'fixed',
- top: marginXS,
- width: '100%',
- pointerEvents: 'none',
- zIndex: zIndexPopup,
- [`${componentCls}-move-up`]: {
- animationFillMode: 'forwards'
- },
- [`
- ${componentCls}-move-up-appear,
- ${componentCls}-move-up-enter
- `]: {
- animationName: messageMoveIn,
- animationDuration: motionDurationSlow,
- animationPlayState: 'paused',
- animationTimingFunction: motionEaseInOutCirc
- },
- [`
- ${componentCls}-move-up-appear${componentCls}-move-up-appear-active,
- ${componentCls}-move-up-enter${componentCls}-move-up-enter-active
- `]: {
- animationPlayState: 'running'
- },
- [`${componentCls}-move-up-leave`]: {
- animationName: messageMoveOut,
- animationDuration: motionDurationSlow,
- animationPlayState: 'paused',
- animationTimingFunction: motionEaseInOutCirc
- },
- [`${componentCls}-move-up-leave${componentCls}-move-up-leave-active`]: {
- animationPlayState: 'running'
- },
- '&-rtl': {
- direction: 'rtl',
- span: {
- direction: 'rtl'
- }
- }
- })
- },
- // ============================ Notice ============================
- {
- [componentCls]: {
- [`${noticeCls}-wrapper`]: Object.assign({}, noticeStyle)
- }
- },
- // ============================= Pure =============================
- {
- [`${componentCls}-notice-pure-panel`]: Object.assign(Object.assign({}, noticeStyle), {
- padding: 0,
- textAlign: 'start'
- })
- }];
- };
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexPopupBase + _util_hooks_useZIndex__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_MAX_OFFSET + 10,
- contentBg: token.colorBgElevated,
- contentPadding: `${(token.controlHeightLG - token.fontSize * token.lineHeight) / 2}px ${token.paddingSM}px`
- });
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('Message', token => {
- // Gen-style functions here
- const combinedToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- height: 150
- });
- return genMessageStyle(combinedToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/modal/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/modal/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genModalMaskStyle: function() { return /* binding */ genModalMaskStyle; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- /* harmony export */ prepareToken: function() { return /* binding */ prepareToken; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _grid_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../grid/style */ "./components/grid/style/index.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/fade.ts");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/zoom.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- function box(position) {
- return {
- position,
- inset: 0
- };
- }
- const genModalMaskStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- return [{
- [`${componentCls}-root`]: {
- [`${componentCls}${antCls}-zoom-enter, ${componentCls}${antCls}-zoom-appear`]: {
- // reset scale avoid mousePosition bug
- transform: 'none',
- opacity: 0,
- animationDuration: token.motionDurationSlow,
- // https://github.com/ant-design/ant-design/issues/11777
- userSelect: 'none'
- },
- // https://github.com/ant-design/ant-design/issues/37329
- // https://github.com/ant-design/ant-design/issues/40272
- [`${componentCls}${antCls}-zoom-leave ${componentCls}-content`]: {
- pointerEvents: 'none'
- },
- [`${componentCls}-mask`]: Object.assign(Object.assign({}, box('fixed')), {
- zIndex: token.zIndexPopupBase,
- height: '100%',
- backgroundColor: token.colorBgMask,
- pointerEvents: 'none',
- [`${componentCls}-hidden`]: {
- display: 'none'
- }
- }),
- [`${componentCls}-wrap`]: Object.assign(Object.assign({}, box('fixed')), {
- zIndex: token.zIndexPopupBase,
- overflow: 'auto',
- outline: 0,
- WebkitOverflowScrolling: 'touch'
- })
- }
- }, {
- [`${componentCls}-root`]: (0,_style_motion__WEBPACK_IMPORTED_MODULE_4__.initFadeMotion)(token)
- }];
- };
- const genModalStyle = token => {
- const {
- componentCls
- } = token;
- return [
- // ======================== Root =========================
- {
- [`${componentCls}-root`]: {
- [`${componentCls}-wrap-rtl`]: {
- direction: 'rtl'
- },
- [`${componentCls}-centered`]: {
- textAlign: 'center',
- '&::before': {
- display: 'inline-block',
- width: 0,
- height: '100%',
- verticalAlign: 'middle',
- content: '""'
- },
- [componentCls]: {
- top: 0,
- display: 'inline-block',
- paddingBottom: 0,
- textAlign: 'start',
- verticalAlign: 'middle'
- }
- },
- [`@media (max-width: ${token.screenSMMax}px)`]: {
- [componentCls]: {
- maxWidth: 'calc(100vw - 16px)',
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.marginXS)} auto`
- },
- [`${componentCls}-centered`]: {
- [componentCls]: {
- flex: 1
- }
- }
- }
- }
- },
- // ======================== Modal ========================
- {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_3__.resetComponent)(token)), {
- pointerEvents: 'none',
- position: 'relative',
- top: 100,
- width: 'auto',
- maxWidth: `calc(100vw - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.calc(token.margin).mul(2).equal())})`,
- margin: '0 auto',
- paddingBottom: token.paddingLG,
- [`${componentCls}-title`]: {
- margin: 0,
- color: token.titleColor,
- fontWeight: token.fontWeightStrong,
- fontSize: token.titleFontSize,
- lineHeight: token.titleLineHeight,
- wordWrap: 'break-word'
- },
- [`${componentCls}-content`]: {
- position: 'relative',
- backgroundColor: token.contentBg,
- backgroundClip: 'padding-box',
- border: 0,
- borderRadius: token.borderRadiusLG,
- boxShadow: token.boxShadow,
- pointerEvents: 'auto',
- padding: token.contentPadding
- },
- [`${componentCls}-close`]: Object.assign({
- position: 'absolute',
- top: token.calc(token.modalHeaderHeight).sub(token.modalCloseBtnSize).div(2).equal(),
- insetInlineEnd: token.calc(token.modalHeaderHeight).sub(token.modalCloseBtnSize).div(2).equal(),
- zIndex: token.calc(token.zIndexPopupBase).add(10).equal(),
- padding: 0,
- color: token.modalCloseIconColor,
- fontWeight: token.fontWeightStrong,
- lineHeight: 1,
- textDecoration: 'none',
- background: 'transparent',
- borderRadius: token.borderRadiusSM,
- width: token.modalCloseBtnSize,
- height: token.modalCloseBtnSize,
- border: 0,
- outline: 0,
- cursor: 'pointer',
- transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
- '&-x': {
- display: 'flex',
- fontSize: token.fontSizeLG,
- fontStyle: 'normal',
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.modalCloseBtnSize),
- justifyContent: 'center',
- textTransform: 'none',
- textRendering: 'auto'
- },
- '&:disabled': {
- pointerEvents: 'none'
- },
- '&:hover': {
- color: token.modalCloseIconHoverColor,
- backgroundColor: token.colorBgTextHover,
- textDecoration: 'none'
- },
- '&:active': {
- backgroundColor: token.colorBgTextActive
- }
- }, (0,_style__WEBPACK_IMPORTED_MODULE_3__.genFocusStyle)(token)),
- [`${componentCls}-header`]: {
- color: token.colorText,
- background: token.headerBg,
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.borderRadiusLG)} 0 0`,
- marginBottom: token.headerMarginBottom,
- padding: token.headerPadding,
- borderBottom: token.headerBorderBottom
- },
- [`${componentCls}-body`]: {
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- wordWrap: 'break-word',
- padding: token.bodyPadding,
- [`${componentCls}-body-skeleton`]: {
- width: '100%',
- height: '100%',
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.margin)} auto`
- }
- },
- [`${componentCls}-footer`]: {
- textAlign: 'end',
- background: token.footerBg,
- marginTop: token.footerMarginTop,
- padding: token.footerPadding,
- borderTop: token.footerBorderTop,
- borderRadius: token.footerBorderRadius,
- [`> ${token.antCls}-btn + ${token.antCls}-btn`]: {
- marginInlineStart: token.marginXS
- }
- },
- [`${componentCls}-open`]: {
- overflow: 'hidden'
- }
- })
- },
- // ======================== Pure =========================
- {
- [`${componentCls}-pure-panel`]: {
- top: 'auto',
- padding: 0,
- display: 'flex',
- flexDirection: 'column',
- [`${componentCls}-content,
- ${componentCls}-body,
- ${componentCls}-confirm-body-wrapper`]: {
- display: 'flex',
- flexDirection: 'column',
- flex: 'auto'
- },
- [`${componentCls}-confirm-body`]: {
- marginBottom: 'auto'
- }
- }
- }];
- };
- const genRTLStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-root`]: {
- [`${componentCls}-wrap-rtl`]: {
- direction: 'rtl',
- [`${componentCls}-confirm-body`]: {
- direction: 'rtl'
- }
- }
- }
- };
- };
- const genResponsiveWidthStyle = token => {
- const {
- componentCls
- } = token;
- const oriGridMediaSizesMap = (0,_grid_style__WEBPACK_IMPORTED_MODULE_2__.getMediaSize)(token);
- const gridMediaSizesMap = Object.assign({}, oriGridMediaSizesMap);
- delete gridMediaSizesMap.xs;
- const cssVarPrefix = `--${componentCls.replace('.', '')}-`;
- const responsiveStyles = Object.keys(gridMediaSizesMap).map(key => ({
- [`@media (min-width: ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(gridMediaSizesMap[key])})`]: {
- width: `var(${cssVarPrefix}${key}-width)`
- }
- }));
- return {
- [`${componentCls}-root`]: {
- [componentCls]: [].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys(oriGridMediaSizesMap).map((currentKey, index) => {
- const previousKey = Object.keys(oriGridMediaSizesMap)[index - 1];
- return previousKey ? {
- [`${cssVarPrefix}${currentKey}-width`]: `var(${cssVarPrefix}${previousKey}-width)`
- } : null;
- })), [{
- width: `var(${cssVarPrefix}xs-width)`
- }], (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["default"])(responsiveStyles))
- }
- };
- };
- // ============================== Export ==============================
- const prepareToken = token => {
- const headerPaddingVertical = token.padding;
- const headerFontSize = token.fontSizeHeading5;
- const headerLineHeight = token.lineHeightHeading5;
- const modalToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.mergeToken)(token, {
- modalHeaderHeight: token.calc(token.calc(headerLineHeight).mul(headerFontSize).equal()).add(token.calc(headerPaddingVertical).mul(2).equal()).equal(),
- modalFooterBorderColorSplit: token.colorSplit,
- modalFooterBorderStyle: token.lineType,
- modalFooterBorderWidth: token.lineWidth,
- modalCloseIconColor: token.colorIcon,
- modalCloseIconHoverColor: token.colorIconHover,
- modalCloseBtnSize: token.controlHeight,
- modalConfirmIconSize: token.fontHeight,
- modalTitleHeight: token.calc(token.titleFontSize).mul(token.titleLineHeight).equal()
- });
- return modalToken;
- };
- const prepareComponentToken = token => ({
- footerBg: 'transparent',
- headerBg: token.colorBgElevated,
- titleLineHeight: token.lineHeightHeading5,
- titleFontSize: token.fontSizeHeading5,
- contentBg: token.colorBgElevated,
- titleColor: token.colorTextHeading,
- // internal
- contentPadding: token.wireframe ? 0 : `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.paddingMD)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.paddingContentHorizontalLG)}`,
- headerPadding: token.wireframe ? `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.paddingLG)}` : 0,
- headerBorderBottom: token.wireframe ? `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}` : 'none',
- headerMarginBottom: token.wireframe ? 0 : token.marginXS,
- bodyPadding: token.wireframe ? token.paddingLG : 0,
- footerPadding: token.wireframe ? `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.padding)}` : 0,
- footerBorderTop: token.wireframe ? `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}` : 'none',
- footerBorderRadius: token.wireframe ? `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.borderRadiusLG)}` : 0,
- footerMarginTop: token.wireframe ? 0 : token.marginSM,
- confirmBodyPadding: token.wireframe ? `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.padding * 2)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.padding * 2)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.unit)(token.paddingLG)}` : 0,
- confirmIconMarginInlineEnd: token.wireframe ? token.margin : token.marginSM,
- confirmBtnsMarginTop: token.wireframe ? token.marginLG : token.marginSM
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_7__.genStyleHooks)('Modal', token => {
- const modalToken = prepareToken(token);
- return [genModalStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__.initZoomMotion)(modalToken, 'zoom'), genResponsiveWidthStyle(modalToken)];
- }, prepareComponentToken, {
- unitless: {
- titleLineHeight: true
- }
- }));
- /***/ }),
- /***/ "./components/notification/style/index.ts":
- /*!************************************************************!*\
- !*** ./components/notification/style/index.ts + 3 modules ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ notification_style; },
- genNoticeStyle: function() { return /* binding */ genNoticeStyle; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- prepareNotificationToken: function() { return /* binding */ prepareNotificationToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/_util/hooks/useZIndex.ts
- var useZIndex = __webpack_require__("./components/_util/hooks/useZIndex.ts");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- ;// ./components/notification/style/placement.ts
- const genNotificationPlacementStyle = token => {
- const {
- componentCls,
- notificationMarginEdge,
- animationMaxHeight
- } = token;
- const noticeCls = `${componentCls}-notice`;
- const rightFadeIn = new cssinjs.Keyframes('antNotificationFadeIn', {
- '0%': {
- transform: `translate3d(100%, 0, 0)`,
- opacity: 0
- },
- '100%': {
- transform: `translate3d(0, 0, 0)`,
- opacity: 1
- }
- });
- const topFadeIn = new cssinjs.Keyframes('antNotificationTopFadeIn', {
- '0%': {
- top: -animationMaxHeight,
- opacity: 0
- },
- '100%': {
- top: 0,
- opacity: 1
- }
- });
- const bottomFadeIn = new cssinjs.Keyframes('antNotificationBottomFadeIn', {
- '0%': {
- bottom: token.calc(animationMaxHeight).mul(-1).equal(),
- opacity: 0
- },
- '100%': {
- bottom: 0,
- opacity: 1
- }
- });
- const leftFadeIn = new cssinjs.Keyframes('antNotificationLeftFadeIn', {
- '0%': {
- transform: `translate3d(-100%, 0, 0)`,
- opacity: 0
- },
- '100%': {
- transform: `translate3d(0, 0, 0)`,
- opacity: 1
- }
- });
- return {
- [componentCls]: {
- [`&${componentCls}-top, &${componentCls}-bottom`]: {
- marginInline: 0,
- [noticeCls]: {
- marginInline: 'auto auto'
- }
- },
- [`&${componentCls}-top`]: {
- [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
- animationName: topFadeIn
- }
- },
- [`&${componentCls}-bottom`]: {
- [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
- animationName: bottomFadeIn
- }
- },
- [`&${componentCls}-topRight, &${componentCls}-bottomRight`]: {
- [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
- animationName: rightFadeIn
- }
- },
- [`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {
- marginRight: {
- value: 0,
- _skip_check_: true
- },
- marginLeft: {
- value: notificationMarginEdge,
- _skip_check_: true
- },
- [noticeCls]: {
- marginInlineEnd: 'auto',
- marginInlineStart: 0
- },
- [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
- animationName: leftFadeIn
- }
- }
- }
- };
- };
- /* harmony default export */ var placement = (genNotificationPlacementStyle);
- ;// ./components/notification/interface.ts
- const NotificationPlacements = ['top', 'topLeft', 'topRight', 'bottom', 'bottomLeft', 'bottomRight'];
- ;// ./components/notification/style/stack.ts
- const placementAlignProperty = {
- topLeft: 'left',
- topRight: 'right',
- bottomLeft: 'left',
- bottomRight: 'right',
- top: 'left',
- bottom: 'left'
- };
- const genPlacementStackStyle = (token, placement) => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-${placement}`]: {
- [`&${componentCls}-stack > ${componentCls}-notice-wrapper`]: {
- [placement.startsWith('top') ? 'top' : 'bottom']: 0,
- [placementAlignProperty[placement]]: {
- value: 0,
- _skip_check_: true
- }
- }
- }
- };
- };
- const genStackChildrenStyle = token => {
- const childrenStyle = {};
- for (let i = 1; i < token.notificationStackLayer; i++) {
- childrenStyle[`&:nth-last-child(${i + 1})`] = {
- overflow: 'hidden',
- [`& > ${token.componentCls}-notice`]: {
- opacity: 0,
- transition: `opacity ${token.motionDurationMid}`
- }
- };
- }
- return Object.assign({
- [`&:not(:nth-last-child(-n+${token.notificationStackLayer}))`]: {
- opacity: 0,
- overflow: 'hidden',
- color: 'transparent',
- pointerEvents: 'none'
- }
- }, childrenStyle);
- };
- const genStackedNoticeStyle = token => {
- const childrenStyle = {};
- for (let i = 1; i < token.notificationStackLayer; i++) {
- childrenStyle[`&:nth-last-child(${i + 1})`] = {
- background: token.colorBgBlur,
- backdropFilter: 'blur(10px)',
- '-webkit-backdrop-filter': 'blur(10px)'
- };
- }
- return Object.assign({}, childrenStyle);
- };
- const genStackStyle = token => {
- const {
- componentCls
- } = token;
- return Object.assign({
- [`${componentCls}-stack`]: {
- [`& > ${componentCls}-notice-wrapper`]: Object.assign({
- transition: `transform ${token.motionDurationSlow}, backdrop-filter 0s`,
- willChange: 'transform, opacity',
- position: 'absolute'
- }, genStackChildrenStyle(token))
- },
- [`${componentCls}-stack:not(${componentCls}-stack-expanded)`]: {
- [`& > ${componentCls}-notice-wrapper`]: Object.assign({}, genStackedNoticeStyle(token))
- },
- [`${componentCls}-stack${componentCls}-stack-expanded`]: {
- [`& > ${componentCls}-notice-wrapper`]: {
- '&:not(:nth-last-child(-n + 1))': {
- opacity: 1,
- overflow: 'unset',
- color: 'inherit',
- pointerEvents: 'auto',
- [`& > ${token.componentCls}-notice`]: {
- opacity: 1
- }
- },
- '&:after': {
- content: '""',
- position: 'absolute',
- height: token.margin,
- width: '100%',
- insetInline: 0,
- bottom: token.calc(token.margin).mul(-1).equal(),
- background: 'transparent',
- pointerEvents: 'auto'
- }
- }
- }
- }, NotificationPlacements.map(placement => genPlacementStackStyle(token, placement)).reduce((acc, cur) => Object.assign(Object.assign({}, acc), cur), {}));
- };
- /* harmony default export */ var stack = (genStackStyle);
- ;// ./components/notification/style/index.ts
- const genNoticeStyle = token => {
- const {
- iconCls,
- componentCls,
- // .ant-notification
- boxShadow,
- fontSizeLG,
- notificationMarginBottom,
- borderRadiusLG,
- colorSuccess,
- colorInfo,
- colorWarning,
- colorError,
- colorTextHeading,
- notificationBg,
- notificationPadding,
- notificationMarginEdge,
- notificationProgressBg,
- notificationProgressHeight,
- fontSize,
- lineHeight,
- width,
- notificationIconSize,
- colorText
- } = token;
- const noticeCls = `${componentCls}-notice`;
- return {
- position: 'relative',
- marginBottom: notificationMarginBottom,
- marginInlineStart: 'auto',
- background: notificationBg,
- borderRadius: borderRadiusLG,
- boxShadow,
- [noticeCls]: {
- padding: notificationPadding,
- width,
- maxWidth: `calc(100vw - ${(0,cssinjs.unit)(token.calc(notificationMarginEdge).mul(2).equal())})`,
- overflow: 'hidden',
- lineHeight,
- wordWrap: 'break-word'
- },
- [`${noticeCls}-message`]: {
- color: colorTextHeading,
- fontSize: fontSizeLG,
- lineHeight: token.lineHeightLG
- },
- [`${noticeCls}-description`]: {
- fontSize,
- color: colorText,
- marginTop: token.marginXS
- },
- [`${noticeCls}-closable ${noticeCls}-message`]: {
- paddingInlineEnd: token.paddingLG
- },
- [`${noticeCls}-with-icon ${noticeCls}-message`]: {
- marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
- fontSize: fontSizeLG
- },
- [`${noticeCls}-with-icon ${noticeCls}-description`]: {
- marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
- fontSize
- },
- // Icon & color style in different selector level
- // https://github.com/ant-design/ant-design/issues/16503
- // https://github.com/ant-design/ant-design/issues/15512
- [`${noticeCls}-icon`]: {
- position: 'absolute',
- fontSize: notificationIconSize,
- lineHeight: 1,
- // icon-font
- [`&-success${iconCls}`]: {
- color: colorSuccess
- },
- [`&-info${iconCls}`]: {
- color: colorInfo
- },
- [`&-warning${iconCls}`]: {
- color: colorWarning
- },
- [`&-error${iconCls}`]: {
- color: colorError
- }
- },
- [`${noticeCls}-close`]: Object.assign({
- position: 'absolute',
- top: token.notificationPaddingVertical,
- insetInlineEnd: token.notificationPaddingHorizontal,
- color: token.colorIcon,
- outline: 'none',
- width: token.notificationCloseButtonSize,
- height: token.notificationCloseButtonSize,
- borderRadius: token.borderRadiusSM,
- transition: `background-color ${token.motionDurationMid}, color ${token.motionDurationMid}`,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- background: 'none',
- border: 'none',
- '&:hover': {
- color: token.colorIconHover,
- backgroundColor: token.colorBgTextHover
- },
- '&:active': {
- backgroundColor: token.colorBgTextActive
- }
- }, (0,style.genFocusStyle)(token)),
- [`${noticeCls}-progress`]: {
- position: 'absolute',
- display: 'block',
- appearance: 'none',
- inlineSize: `calc(100% - ${(0,cssinjs.unit)(borderRadiusLG)} * 2)`,
- left: {
- _skip_check_: true,
- value: borderRadiusLG
- },
- right: {
- _skip_check_: true,
- value: borderRadiusLG
- },
- bottom: 0,
- blockSize: notificationProgressHeight,
- border: 0,
- '&, &::-webkit-progress-bar': {
- borderRadius: borderRadiusLG,
- backgroundColor: `rgba(0, 0, 0, 0.04)`
- },
- '&::-moz-progress-bar': {
- background: notificationProgressBg
- },
- '&::-webkit-progress-value': {
- borderRadius: borderRadiusLG,
- background: notificationProgressBg
- }
- },
- [`${noticeCls}-actions`]: {
- float: 'right',
- marginTop: token.marginSM
- }
- };
- };
- const genNotificationStyle = token => {
- const {
- componentCls,
- // .ant-notification
- notificationMarginBottom,
- notificationMarginEdge,
- motionDurationMid,
- motionEaseInOut
- } = token;
- const noticeCls = `${componentCls}-notice`;
- const fadeOut = new cssinjs.Keyframes('antNotificationFadeOut', {
- '0%': {
- maxHeight: token.animationMaxHeight,
- marginBottom: notificationMarginBottom
- },
- '100%': {
- maxHeight: 0,
- marginBottom: 0,
- paddingTop: 0,
- paddingBottom: 0,
- opacity: 0
- }
- });
- return [
- // ============================ Holder ============================
- {
- [componentCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- position: 'fixed',
- zIndex: token.zIndexPopup,
- marginRight: {
- value: notificationMarginEdge,
- _skip_check_: true
- },
- [`${componentCls}-hook-holder`]: {
- position: 'relative'
- },
- // animation
- [`${componentCls}-fade-appear-prepare`]: {
- opacity: '0 !important'
- },
- [`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: {
- animationDuration: token.motionDurationMid,
- animationTimingFunction: motionEaseInOut,
- animationFillMode: 'both',
- opacity: 0,
- animationPlayState: 'paused'
- },
- [`${componentCls}-fade-leave`]: {
- animationTimingFunction: motionEaseInOut,
- animationFillMode: 'both',
- animationDuration: motionDurationMid,
- animationPlayState: 'paused'
- },
- [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
- animationPlayState: 'running'
- },
- [`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: {
- animationName: fadeOut,
- animationPlayState: 'running'
- },
- // RTL
- '&-rtl': {
- direction: 'rtl',
- [`${noticeCls}-actions`]: {
- float: 'left'
- }
- }
- })
- },
- // ============================ Notice ============================
- {
- [componentCls]: {
- [`${noticeCls}-wrapper`]: Object.assign({}, genNoticeStyle(token))
- }
- }];
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- zIndexPopup: token.zIndexPopupBase + useZIndex.CONTAINER_MAX_OFFSET + 50,
- width: 384
- });
- const prepareNotificationToken = token => {
- const notificationPaddingVertical = token.paddingMD;
- const notificationPaddingHorizontal = token.paddingLG;
- const notificationToken = (0,es.mergeToken)(token, {
- notificationBg: token.colorBgElevated,
- notificationPaddingVertical,
- notificationPaddingHorizontal,
- notificationIconSize: token.calc(token.fontSizeLG).mul(token.lineHeightLG).equal(),
- notificationCloseButtonSize: token.calc(token.controlHeightLG).mul(0.55).equal(),
- notificationMarginBottom: token.margin,
- notificationPadding: `${(0,cssinjs.unit)(token.paddingMD)} ${(0,cssinjs.unit)(token.paddingContentHorizontalLG)}`,
- notificationMarginEdge: token.marginLG,
- animationMaxHeight: 150,
- notificationStackLayer: 3,
- notificationProgressHeight: 2,
- notificationProgressBg: `linear-gradient(90deg, ${token.colorPrimaryBorderHover}, ${token.colorPrimary})`
- });
- return notificationToken;
- };
- /* harmony default export */ var notification_style = ((0,genStyleUtils.genStyleHooks)('Notification', token => {
- const notificationToken = prepareNotificationToken(token);
- return [genNotificationStyle(notificationToken), placement(notificationToken), stack(notificationToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/pagination/style/index.ts":
- /*!**********************************************!*\
- !*** ./components/pagination/style/index.ts ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- /* harmony export */ prepareToken: function() { return /* binding */ prepareToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _input_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../input/style */ "./components/input/style/index.ts");
- /* harmony import */ var _input_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../input/style */ "./components/input/style/token.ts");
- /* harmony import */ var _input_style_variants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../input/style/variants */ "./components/input/style/variants.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genPaginationDisabledStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-disabled`]: {
- '&, &:hover': {
- cursor: 'not-allowed',
- [`${componentCls}-item-link`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- }
- },
- '&:focus-visible': {
- cursor: 'not-allowed',
- [`${componentCls}-item-link`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- }
- }
- },
- [`&${componentCls}-disabled`]: {
- cursor: 'not-allowed',
- [`${componentCls}-item`]: {
- cursor: 'not-allowed',
- backgroundColor: 'transparent',
- '&:hover, &:active': {
- backgroundColor: 'transparent'
- },
- a: {
- color: token.colorTextDisabled,
- backgroundColor: 'transparent',
- border: 'none',
- cursor: 'not-allowed'
- },
- '&-active': {
- borderColor: token.colorBorder,
- backgroundColor: token.itemActiveBgDisabled,
- '&:hover, &:active': {
- backgroundColor: token.itemActiveBgDisabled
- },
- a: {
- color: token.itemActiveColorDisabled
- }
- }
- },
- [`${componentCls}-item-link`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed',
- '&:hover, &:active': {
- backgroundColor: 'transparent'
- },
- [`${componentCls}-simple&`]: {
- backgroundColor: 'transparent',
- '&:hover, &:active': {
- backgroundColor: 'transparent'
- }
- }
- },
- [`${componentCls}-simple-pager`]: {
- color: token.colorTextDisabled
- },
- [`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
- [`${componentCls}-item-link-icon`]: {
- opacity: 0
- },
- [`${componentCls}-item-ellipsis`]: {
- opacity: 1
- }
- }
- }
- };
- };
- const genPaginationMiniStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`&${componentCls}-mini ${componentCls}-total-text, &${componentCls}-mini ${componentCls}-simple-pager`]: {
- height: token.itemSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM)
- },
- [`&${componentCls}-mini ${componentCls}-item`]: {
- minWidth: token.itemSizeSM,
- height: token.itemSizeSM,
- margin: 0,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.itemSizeSM).sub(2).equal())
- },
- [`&${componentCls}-mini ${componentCls}-prev, &${componentCls}-mini ${componentCls}-next`]: {
- minWidth: token.itemSizeSM,
- height: token.itemSizeSM,
- margin: 0,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM)
- },
- [`&${componentCls}-mini:not(${componentCls}-disabled)`]: {
- [`${componentCls}-prev, ${componentCls}-next`]: {
- [`&:hover ${componentCls}-item-link`]: {
- backgroundColor: token.colorBgTextHover
- },
- [`&:active ${componentCls}-item-link`]: {
- backgroundColor: token.colorBgTextActive
- },
- [`&${componentCls}-disabled:hover ${componentCls}-item-link`]: {
- backgroundColor: 'transparent'
- }
- }
- },
- [`
- &${componentCls}-mini ${componentCls}-prev ${componentCls}-item-link,
- &${componentCls}-mini ${componentCls}-next ${componentCls}-item-link
- `]: {
- backgroundColor: 'transparent',
- borderColor: 'transparent',
- '&::after': {
- height: token.itemSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM)
- }
- },
- [`&${componentCls}-mini ${componentCls}-jump-prev, &${componentCls}-mini ${componentCls}-jump-next`]: {
- height: token.itemSizeSM,
- marginInlineEnd: 0,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM)
- },
- [`&${componentCls}-mini ${componentCls}-options`]: {
- marginInlineStart: token.paginationMiniOptionsMarginInlineStart,
- '&-size-changer': {
- top: token.miniOptionsSizeChangerTop
- },
- '&-quick-jumper': {
- height: token.itemSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM),
- input: Object.assign(Object.assign({}, (0,_input_style__WEBPACK_IMPORTED_MODULE_1__.genInputSmallStyle)(token)), {
- width: token.paginationMiniQuickJumperInputWidth,
- height: token.controlHeightSM
- })
- }
- }
- };
- };
- const genPaginationSimpleStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`&${componentCls}-simple`]: {
- [`${componentCls}-prev, ${componentCls}-next`]: {
- height: token.itemSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSize),
- verticalAlign: 'top',
- [`${componentCls}-item-link`]: {
- height: token.itemSize,
- backgroundColor: 'transparent',
- border: 0,
- '&:hover': {
- backgroundColor: token.colorBgTextHover
- },
- '&:active': {
- backgroundColor: token.colorBgTextActive
- },
- '&::after': {
- height: token.itemSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSize)
- }
- }
- },
- [`${componentCls}-simple-pager`]: {
- display: 'inline-flex',
- alignItems: 'center',
- height: token.itemSize,
- marginInlineEnd: token.marginXS,
- input: {
- boxSizing: 'border-box',
- height: '100%',
- width: token.quickJumperInputWidth,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paginationItemPaddingInline)}`,
- textAlign: 'center',
- backgroundColor: token.itemInputBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderRadius: token.borderRadius,
- outline: 'none',
- transition: `border-color ${token.motionDurationMid}`,
- color: 'inherit',
- '&:hover': {
- borderColor: token.colorPrimary
- },
- '&:focus': {
- borderColor: token.colorPrimaryHover,
- boxShadow: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.inputOutlineOffset)} 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.controlOutlineWidth)} ${token.controlOutline}`
- },
- '&[disabled]': {
- color: token.colorTextDisabled,
- backgroundColor: token.colorBgContainerDisabled,
- borderColor: token.colorBorder,
- cursor: 'not-allowed'
- }
- }
- },
- [`&${componentCls}-disabled`]: {
- [`${componentCls}-prev, ${componentCls}-next`]: {
- [`${componentCls}-item-link`]: {
- '&:hover, &:active': {
- backgroundColor: 'transparent'
- }
- }
- }
- },
- [`&${componentCls}-mini`]: {
- [`${componentCls}-prev, ${componentCls}-next`]: {
- height: token.itemSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM),
- [`${componentCls}-item-link`]: {
- height: token.itemSizeSM,
- '&::after': {
- height: token.itemSizeSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSizeSM)
- }
- }
- },
- [`${componentCls}-simple-pager`]: {
- height: token.itemSizeSM,
- input: {
- width: token.paginationMiniQuickJumperInputWidth
- }
- }
- }
- }
- };
- };
- const genPaginationJumpStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
- outline: 0,
- [`${componentCls}-item-container`]: {
- position: 'relative',
- [`${componentCls}-item-link-icon`]: {
- color: token.colorPrimary,
- fontSize: token.fontSizeSM,
- opacity: 0,
- transition: `all ${token.motionDurationMid}`,
- '&-svg': {
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- margin: 'auto'
- }
- },
- [`${componentCls}-item-ellipsis`]: {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- display: 'block',
- margin: 'auto',
- color: token.colorTextDisabled,
- letterSpacing: token.paginationEllipsisLetterSpacing,
- textAlign: 'center',
- textIndent: token.paginationEllipsisTextIndent,
- opacity: 1,
- transition: `all ${token.motionDurationMid}`
- }
- },
- '&:hover': {
- [`${componentCls}-item-link-icon`]: {
- opacity: 1
- },
- [`${componentCls}-item-ellipsis`]: {
- opacity: 0
- }
- }
- },
- [`
- ${componentCls}-prev,
- ${componentCls}-jump-prev,
- ${componentCls}-jump-next
- `]: {
- marginInlineEnd: token.marginXS
- },
- [`
- ${componentCls}-prev,
- ${componentCls}-next,
- ${componentCls}-jump-prev,
- ${componentCls}-jump-next
- `]: {
- display: 'inline-block',
- minWidth: token.itemSize,
- height: token.itemSize,
- color: token.colorText,
- fontFamily: token.fontFamily,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemSize),
- textAlign: 'center',
- verticalAlign: 'middle',
- listStyle: 'none',
- borderRadius: token.borderRadius,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid}`
- },
- [`${componentCls}-prev, ${componentCls}-next`]: {
- outline: 0,
- button: {
- color: token.colorText,
- cursor: 'pointer',
- userSelect: 'none'
- },
- [`${componentCls}-item-link`]: {
- display: 'block',
- width: '100%',
- height: '100%',
- padding: 0,
- fontSize: token.fontSizeSM,
- textAlign: 'center',
- backgroundColor: 'transparent',
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} transparent`,
- borderRadius: token.borderRadius,
- outline: 'none',
- transition: `all ${token.motionDurationMid}`
- },
- [`&:hover ${componentCls}-item-link`]: {
- backgroundColor: token.colorBgTextHover
- },
- [`&:active ${componentCls}-item-link`]: {
- backgroundColor: token.colorBgTextActive
- },
- [`&${componentCls}-disabled:hover`]: {
- [`${componentCls}-item-link`]: {
- backgroundColor: 'transparent'
- }
- }
- },
- [`${componentCls}-slash`]: {
- marginInlineEnd: token.paginationSlashMarginInlineEnd,
- marginInlineStart: token.paginationSlashMarginInlineStart
- },
- [`${componentCls}-options`]: {
- display: 'inline-block',
- marginInlineStart: token.margin,
- verticalAlign: 'middle',
- '&-size-changer': {
- display: 'inline-block',
- width: 'auto'
- },
- '&-quick-jumper': {
- display: 'inline-block',
- height: token.controlHeight,
- marginInlineStart: token.marginXS,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.controlHeight),
- verticalAlign: 'top',
- input: Object.assign(Object.assign(Object.assign({}, (0,_input_style__WEBPACK_IMPORTED_MODULE_1__.genBasicInputStyle)(token)), (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genBaseOutlinedStyle)(token, {
- borderColor: token.colorBorder,
- hoverBorderColor: token.colorPrimaryHover,
- activeBorderColor: token.colorPrimary,
- activeShadow: token.activeShadow
- })), {
- '&[disabled]': Object.assign({}, (0,_input_style_variants__WEBPACK_IMPORTED_MODULE_3__.genDisabledStyle)(token)),
- width: token.quickJumperInputWidth,
- height: token.controlHeight,
- boxSizing: 'border-box',
- margin: 0,
- marginInlineStart: token.marginXS,
- marginInlineEnd: token.marginXS
- })
- }
- }
- };
- };
- const genPaginationItemStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-item`]: {
- display: 'inline-block',
- minWidth: token.itemSize,
- height: token.itemSize,
- marginInlineEnd: token.marginXS,
- fontFamily: token.fontFamily,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.itemSize).sub(2).equal()),
- textAlign: 'center',
- verticalAlign: 'middle',
- listStyle: 'none',
- backgroundColor: token.itemBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} transparent`,
- borderRadius: token.borderRadius,
- outline: 0,
- cursor: 'pointer',
- userSelect: 'none',
- a: {
- display: 'block',
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paginationItemPaddingInline)}`,
- color: token.colorText,
- '&:hover': {
- textDecoration: 'none'
- }
- },
- [`&:not(${componentCls}-item-active)`]: {
- '&:hover': {
- transition: `all ${token.motionDurationMid}`,
- backgroundColor: token.colorBgTextHover
- },
- '&:active': {
- backgroundColor: token.colorBgTextActive
- }
- },
- '&-active': {
- fontWeight: token.fontWeightStrong,
- backgroundColor: token.itemActiveBg,
- borderColor: token.colorPrimary,
- a: {
- color: token.colorPrimary
- },
- '&:hover': {
- borderColor: token.colorPrimaryHover
- },
- '&:hover a': {
- color: token.colorPrimaryHover
- }
- }
- }
- };
- };
- const genPaginationStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_4__.resetComponent)(token)), {
- display: 'flex',
- '&-start': {
- justifyContent: 'start'
- },
- '&-center': {
- justifyContent: 'center'
- },
- '&-end': {
- justifyContent: 'end'
- },
- 'ul, ol': {
- margin: 0,
- padding: 0,
- listStyle: 'none'
- },
- '&::after': {
- display: 'block',
- clear: 'both',
- height: 0,
- overflow: 'hidden',
- visibility: 'hidden',
- content: '""'
- },
- [`${componentCls}-total-text`]: {
- display: 'inline-block',
- height: token.itemSize,
- marginInlineEnd: token.marginXS,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.itemSize).sub(2).equal()),
- verticalAlign: 'middle'
- }
- }), genPaginationItemStyle(token)), genPaginationJumpStyle(token)), genPaginationSimpleStyle(token)), genPaginationMiniStyle(token)), genPaginationDisabledStyle(token)), {
- // media query style
- [`@media only screen and (max-width: ${token.screenLG}px)`]: {
- [`${componentCls}-item`]: {
- '&-after-jump-prev, &-before-jump-next': {
- display: 'none'
- }
- }
- },
- [`@media only screen and (max-width: ${token.screenSM}px)`]: {
- [`${componentCls}-options`]: {
- display: 'none'
- }
- }
- }),
- // rtl style
- [`&${token.componentCls}-rtl`]: {
- direction: 'rtl'
- }
- };
- };
- const genPaginationFocusStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}:not(${componentCls}-disabled)`]: {
- [`${componentCls}-item`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_4__.genFocusStyle)(token)),
- [`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
- '&:focus-visible': Object.assign({
- [`${componentCls}-item-link-icon`]: {
- opacity: 1
- },
- [`${componentCls}-item-ellipsis`]: {
- opacity: 0
- }
- }, (0,_style__WEBPACK_IMPORTED_MODULE_4__.genFocusOutline)(token))
- },
- [`${componentCls}-prev, ${componentCls}-next`]: {
- [`&:focus-visible ${componentCls}-item-link`]: (0,_style__WEBPACK_IMPORTED_MODULE_4__.genFocusOutline)(token)
- }
- }
- };
- };
- const prepareComponentToken = token => Object.assign({
- itemBg: token.colorBgContainer,
- itemSize: token.controlHeight,
- itemSizeSM: token.controlHeightSM,
- itemActiveBg: token.colorBgContainer,
- itemLinkBg: token.colorBgContainer,
- itemActiveColorDisabled: token.colorTextDisabled,
- itemActiveBgDisabled: token.controlItemBgActiveDisabled,
- itemInputBg: token.colorBgContainer,
- miniOptionsSizeChangerTop: 0
- }, (0,_input_style__WEBPACK_IMPORTED_MODULE_2__.initComponentToken)(token));
- const prepareToken = token => (0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, {
- inputOutlineOffset: 0,
- quickJumperInputWidth: token.calc(token.controlHeightLG).mul(1.25).equal(),
- paginationMiniOptionsMarginInlineStart: token.calc(token.marginXXS).div(2).equal(),
- paginationMiniQuickJumperInputWidth: token.calc(token.controlHeightLG).mul(1.1).equal(),
- paginationItemPaddingInline: token.calc(token.marginXXS).mul(1.5).equal(),
- paginationEllipsisLetterSpacing: token.calc(token.marginXXS).div(2).equal(),
- paginationSlashMarginInlineStart: token.marginSM,
- paginationSlashMarginInlineEnd: token.marginSM,
- paginationEllipsisTextIndent: '0.13em' // magic for ui experience
- }, (0,_input_style__WEBPACK_IMPORTED_MODULE_2__.initInputToken)(token));
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.genStyleHooks)('Pagination', token => {
- const paginationToken = prepareToken(token);
- return [genPaginationStyle(paginationToken), genPaginationFocusStyle(paginationToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/popconfirm/style/index.ts":
- /*!**********************************************!*\
- !*** ./components/popconfirm/style/index.ts ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- iconCls,
- antCls,
- zIndexPopup,
- colorText,
- colorWarning,
- marginXXS,
- marginXS,
- fontSize,
- fontWeightStrong,
- colorTextHeading
- } = token;
- return {
- [componentCls]: {
- zIndex: zIndexPopup,
- [`&${antCls}-popover`]: {
- fontSize
- },
- [`${componentCls}-message`]: {
- marginBottom: marginXS,
- display: 'flex',
- flexWrap: 'nowrap',
- alignItems: 'start',
- [`> ${componentCls}-message-icon ${iconCls}`]: {
- color: colorWarning,
- fontSize,
- lineHeight: 1,
- marginInlineEnd: marginXS
- },
- [`${componentCls}-title`]: {
- fontWeight: fontWeightStrong,
- color: colorTextHeading,
- '&:only-child': {
- fontWeight: 'normal'
- }
- },
- [`${componentCls}-description`]: {
- marginTop: marginXXS,
- color: colorText
- }
- },
- [`${componentCls}-buttons`]: {
- textAlign: 'end',
- whiteSpace: 'nowrap',
- button: {
- marginInlineStart: marginXS
- }
- }
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- zIndexPopupBase
- } = token;
- return {
- zIndexPopup: zIndexPopupBase + 60
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_0__.genStyleHooks)('Popconfirm', token => genBaseStyle(token), prepareComponentToken, {
- resetStyle: false
- }));
- /***/ }),
- /***/ "./components/popover/style/index.ts":
- /*!*******************************************!*\
- !*** ./components/popover/style/index.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/zoom.ts");
- /* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/placementArrow */ "./components/style/placementArrow.ts");
- /* harmony import */ var _style_roundedArrow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style/roundedArrow */ "./components/style/roundedArrow.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/interface/presetColors.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genBaseStyle = token => {
- const {
- componentCls,
- popoverColor,
- titleMinWidth,
- fontWeightStrong,
- innerPadding,
- boxShadowSecondary,
- colorTextHeading,
- borderRadiusLG,
- zIndexPopup,
- titleMarginBottom,
- colorBgElevated,
- popoverBg,
- titleBorderBottom,
- innerContentPadding,
- titlePadding
- } = token;
- return [{
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__.resetComponent)(token)), {
- position: 'absolute',
- top: 0,
- // use `left` to fix https://github.com/ant-design/ant-design/issues/39195
- left: {
- _skip_check_: true,
- value: 0
- },
- zIndex: zIndexPopup,
- fontWeight: 'normal',
- whiteSpace: 'normal',
- textAlign: 'start',
- cursor: 'auto',
- userSelect: 'text',
- // When use `autoArrow`, origin will follow the arrow position
- '--valid-offset-x': 'var(--arrow-offset-horizontal, var(--arrow-x))',
- transformOrigin: [`var(--valid-offset-x, 50%)`, `var(--arrow-y, 50%)`].join(' '),
- '--antd-arrow-background-color': colorBgElevated,
- width: 'max-content',
- maxWidth: '100vw',
- '&-rtl': {
- direction: 'rtl'
- },
- '&-hidden': {
- display: 'none'
- },
- [`${componentCls}-content`]: {
- position: 'relative'
- },
- [`${componentCls}-inner`]: {
- backgroundColor: popoverBg,
- backgroundClip: 'padding-box',
- borderRadius: borderRadiusLG,
- boxShadow: boxShadowSecondary,
- padding: innerPadding
- },
- [`${componentCls}-title`]: {
- minWidth: titleMinWidth,
- marginBottom: titleMarginBottom,
- color: colorTextHeading,
- fontWeight: fontWeightStrong,
- borderBottom: titleBorderBottom,
- padding: titlePadding
- },
- [`${componentCls}-inner-content`]: {
- color: popoverColor,
- padding: innerContentPadding
- }
- })
- },
- // Arrow Style
- (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_2__["default"])(token, 'var(--antd-arrow-background-color)'),
- // Pure Render
- {
- [`${componentCls}-pure`]: {
- position: 'relative',
- maxWidth: 'none',
- margin: token.sizePopupArrow,
- display: 'inline-block',
- [`${componentCls}-content`]: {
- display: 'inline-block'
- }
- }
- }];
- };
- const genColorStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: _theme_internal__WEBPACK_IMPORTED_MODULE_4__.PresetColors.map(colorKey => {
- const lightColor = token[`${colorKey}6`];
- return {
- [`&${componentCls}-${colorKey}`]: {
- '--antd-arrow-background-color': lightColor,
- [`${componentCls}-inner`]: {
- backgroundColor: lightColor
- },
- [`${componentCls}-arrow`]: {
- background: 'transparent'
- }
- }
- };
- })
- };
- };
- const prepareComponentToken = token => {
- const {
- lineWidth,
- controlHeight,
- fontHeight,
- padding,
- wireframe,
- zIndexPopupBase,
- borderRadiusLG,
- marginXS,
- lineType,
- colorSplit,
- paddingSM
- } = token;
- const titlePaddingBlockDist = controlHeight - fontHeight;
- const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
- const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
- const popoverPaddingHorizontal = padding;
- return Object.assign(Object.assign(Object.assign({
- titleMinWidth: 177,
- zIndexPopup: zIndexPopupBase + 30
- }, (0,_style_roundedArrow__WEBPACK_IMPORTED_MODULE_3__.getArrowToken)(token)), (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_2__.getArrowOffsetToken)({
- contentRadius: borderRadiusLG,
- limitVerticalRadius: true
- })), {
- // internal
- innerPadding: wireframe ? 0 : 12,
- titleMarginBottom: wireframe ? 0 : marginXS,
- titlePadding: wireframe ? `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px` : 0,
- titleBorderBottom: wireframe ? `${lineWidth}px ${lineType} ${colorSplit}` : 'none',
- innerContentPadding: wireframe ? `${paddingSM}px ${popoverPaddingHorizontal}px` : 0
- });
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.genStyleHooks)('Popover', token => {
- const {
- colorBgElevated,
- colorText
- } = token;
- const popoverToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, {
- popoverBg: colorBgElevated,
- popoverColor: colorText
- });
- return [genBaseStyle(popoverToken), genColorStyle(popoverToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_1__.initZoomMotion)(popoverToken, 'zoom-big')];
- }, prepareComponentToken, {
- resetStyle: false,
- deprecatedTokens: [['width', 'titleMinWidth'], ['minWidth', 'titleMinWidth']]
- }));
- /***/ }),
- /***/ "./components/progress/style/index.ts":
- /*!********************************************!*\
- !*** ./components/progress/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ LineStrokeColorVar: function() { return /* binding */ LineStrokeColorVar; },
- /* harmony export */ Percent: function() { return /* binding */ Percent; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const LineStrokeColorVar = '--progress-line-stroke-color';
- const Percent = '--progress-percent';
- const genAntProgressActive = isRtl => {
- const direction = isRtl ? '100%' : '-100%';
- return new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes(`antProgress${isRtl ? 'RTL' : 'LTR'}Active`, {
- '0%': {
- transform: `translateX(${direction}) scaleX(0)`,
- opacity: 0.1
- },
- '20%': {
- transform: `translateX(${direction}) scaleX(0)`,
- opacity: 0.5
- },
- to: {
- transform: 'translateX(0) scaleX(1)',
- opacity: 0
- }
- });
- };
- const genBaseStyle = token => {
- const {
- componentCls: progressCls,
- iconCls: iconPrefixCls
- } = token;
- return {
- [progressCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-block',
- '&-rtl': {
- direction: 'rtl'
- },
- '&-line': {
- position: 'relative',
- width: '100%',
- fontSize: token.fontSize
- },
- [`${progressCls}-outer`]: {
- display: 'inline-flex',
- alignItems: 'center',
- width: '100%'
- },
- [`${progressCls}-inner`]: {
- position: 'relative',
- display: 'inline-block',
- width: '100%',
- flex: 1,
- overflow: 'hidden',
- verticalAlign: 'middle',
- backgroundColor: token.remainingColor,
- borderRadius: token.lineBorderRadius
- },
- [`${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
- [`${progressCls}-circle-path`]: {
- stroke: token.defaultColor
- }
- },
- [`${progressCls}-success-bg, ${progressCls}-bg`]: {
- position: 'relative',
- background: token.defaultColor,
- borderRadius: token.lineBorderRadius,
- transition: `all ${token.motionDurationSlow} ${token.motionEaseInOutCirc}`
- },
- [`${progressCls}-layout-bottom`]: {
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- justifyContent: 'center',
- [`${progressCls}-text`]: {
- width: 'max-content',
- marginInlineStart: 0,
- marginTop: token.marginXXS
- }
- },
- [`${progressCls}-bg`]: {
- overflow: 'hidden',
- '&::after': {
- content: '""',
- background: {
- _multi_value_: true,
- value: ['inherit', `var(${LineStrokeColorVar})`]
- },
- height: '100%',
- width: `calc(1 / var(${Percent}) * 100%)`,
- display: 'block'
- },
- [`&${progressCls}-bg-inner`]: {
- minWidth: 'max-content',
- '&::after': {
- content: 'none'
- },
- [`${progressCls}-text-inner`]: {
- color: token.colorWhite,
- [`&${progressCls}-text-bright`]: {
- color: 'rgba(0, 0, 0, 0.45)'
- }
- }
- }
- },
- [`${progressCls}-success-bg`]: {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- backgroundColor: token.colorSuccess
- },
- [`${progressCls}-text`]: {
- display: 'inline-block',
- marginInlineStart: token.marginXS,
- color: token.colorText,
- lineHeight: 1,
- width: '2em',
- whiteSpace: 'nowrap',
- textAlign: 'start',
- verticalAlign: 'middle',
- wordBreak: 'normal',
- [iconPrefixCls]: {
- fontSize: token.fontSize
- },
- [`&${progressCls}-text-outer`]: {
- width: 'max-content'
- },
- [`&${progressCls}-text-outer${progressCls}-text-start`]: {
- width: 'max-content',
- marginInlineStart: 0,
- marginInlineEnd: token.marginXS
- }
- },
- [`${progressCls}-text-inner`]: {
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- width: '100%',
- height: '100%',
- marginInlineStart: 0,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXXS)}`,
- [`&${progressCls}-text-start`]: {
- justifyContent: 'start'
- },
- [`&${progressCls}-text-end`]: {
- justifyContent: 'end'
- }
- },
- [`&${progressCls}-status-active`]: {
- [`${progressCls}-bg::before`]: {
- position: 'absolute',
- inset: 0,
- backgroundColor: token.colorBgContainer,
- borderRadius: token.lineBorderRadius,
- opacity: 0,
- animationName: genAntProgressActive(),
- animationDuration: token.progressActiveMotionDuration,
- animationTimingFunction: token.motionEaseOutQuint,
- animationIterationCount: 'infinite',
- content: '""'
- }
- },
- [`&${progressCls}-rtl${progressCls}-status-active`]: {
- [`${progressCls}-bg::before`]: {
- animationName: genAntProgressActive(true)
- }
- },
- [`&${progressCls}-status-exception`]: {
- [`${progressCls}-bg`]: {
- backgroundColor: token.colorError
- },
- [`${progressCls}-text`]: {
- color: token.colorError
- }
- },
- [`&${progressCls}-status-exception ${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
- [`${progressCls}-circle-path`]: {
- stroke: token.colorError
- }
- },
- [`&${progressCls}-status-success`]: {
- [`${progressCls}-bg`]: {
- backgroundColor: token.colorSuccess
- },
- [`${progressCls}-text`]: {
- color: token.colorSuccess
- }
- },
- [`&${progressCls}-status-success ${progressCls}-inner:not(${progressCls}-circle-gradient)`]: {
- [`${progressCls}-circle-path`]: {
- stroke: token.colorSuccess
- }
- }
- })
- };
- };
- const genCircleStyle = token => {
- const {
- componentCls: progressCls,
- iconCls: iconPrefixCls
- } = token;
- return {
- [progressCls]: {
- [`${progressCls}-circle-trail`]: {
- stroke: token.remainingColor
- },
- [`&${progressCls}-circle ${progressCls}-inner`]: {
- position: 'relative',
- lineHeight: 1,
- backgroundColor: 'transparent'
- },
- [`&${progressCls}-circle ${progressCls}-text`]: {
- position: 'absolute',
- insetBlockStart: '50%',
- insetInlineStart: 0,
- width: '100%',
- margin: 0,
- padding: 0,
- color: token.circleTextColor,
- fontSize: token.circleTextFontSize,
- lineHeight: 1,
- whiteSpace: 'normal',
- textAlign: 'center',
- transform: 'translateY(-50%)',
- [iconPrefixCls]: {
- fontSize: token.circleIconFontSize
- }
- },
- [`${progressCls}-circle&-status-exception`]: {
- [`${progressCls}-text`]: {
- color: token.colorError
- }
- },
- [`${progressCls}-circle&-status-success`]: {
- [`${progressCls}-text`]: {
- color: token.colorSuccess
- }
- }
- },
- [`${progressCls}-inline-circle`]: {
- lineHeight: 1,
- [`${progressCls}-inner`]: {
- verticalAlign: 'bottom'
- }
- }
- };
- };
- const genStepStyle = token => {
- const {
- componentCls: progressCls
- } = token;
- return {
- [progressCls]: {
- [`${progressCls}-steps`]: {
- display: 'inline-block',
- '&-outer': {
- display: 'flex',
- flexDirection: 'row',
- alignItems: 'center'
- },
- '&-item': {
- flexShrink: 0,
- minWidth: token.progressStepMinWidth,
- marginInlineEnd: token.progressStepMarginInlineEnd,
- backgroundColor: token.remainingColor,
- transition: `all ${token.motionDurationSlow}`,
- '&-active': {
- backgroundColor: token.defaultColor
- }
- }
- }
- }
- };
- };
- const genSmallLine = token => {
- const {
- componentCls: progressCls,
- iconCls: iconPrefixCls
- } = token;
- return {
- [progressCls]: {
- [`${progressCls}-small&-line, ${progressCls}-small&-line ${progressCls}-text ${iconPrefixCls}`]: {
- fontSize: token.fontSizeSM
- }
- }
- };
- };
- const prepareComponentToken = token => ({
- circleTextColor: token.colorText,
- defaultColor: token.colorInfo,
- remainingColor: token.colorFillSecondary,
- lineBorderRadius: 100,
- // magic for capsule shape, should be a very large number
- circleTextFontSize: '1em',
- circleIconFontSize: `${token.fontSize / token.fontSizeSM}em`
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Progress', token => {
- const progressStepMarginInlineEnd = token.calc(token.marginXXS).div(2).equal();
- const progressToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- progressStepMarginInlineEnd,
- progressStepMinWidth: progressStepMarginInlineEnd,
- progressActiveMotionDuration: '2.4s'
- });
- return [genBaseStyle(progressToken), genCircleStyle(progressToken), genStepStyle(progressToken), genSmallLine(progressToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/qr-code/style/index.ts":
- /*!*******************************************!*\
- !*** ./components/qr-code/style/index.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genQRCodeStyle = token => {
- const {
- componentCls,
- lineWidth,
- lineType,
- colorSplit
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- padding: token.paddingSM,
- backgroundColor: token.colorWhite,
- borderRadius: token.borderRadiusLG,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- position: 'relative',
- overflow: 'hidden',
- [`& > ${componentCls}-mask`]: {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- zIndex: 10,
- display: 'flex',
- flexDirection: 'column',
- justifyContent: 'center',
- alignItems: 'center',
- width: '100%',
- height: '100%',
- color: token.colorText,
- lineHeight: token.lineHeight,
- background: token.QRCodeMaskBackgroundColor,
- textAlign: 'center',
- [`& > ${componentCls}-expired, & > ${componentCls}-scanned`]: {
- color: token.QRCodeTextColor
- }
- },
- '> canvas': {
- alignSelf: 'stretch',
- flex: 'auto',
- minWidth: 0
- },
- '&-icon': {
- marginBlockEnd: token.marginXS,
- fontSize: token.controlHeight
- }
- }),
- [`${componentCls}-borderless`]: {
- borderColor: 'transparent',
- padding: 0,
- borderRadius: 0
- }
- };
- };
- const prepareComponentToken = token => ({
- QRCodeMaskBackgroundColor: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorBgContainer).setA(0.96).toRgbString()
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('QRCode', token => {
- const mergedToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- QRCodeTextColor: token.colorText
- });
- return genQRCodeStyle(mergedToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/qrcode/style/index.ts":
- /*!******************************************!*\
- !*** ./components/qrcode/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* reexport safe */ _qr_code_style__WEBPACK_IMPORTED_MODULE_0__.prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _qr_code_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../qr-code/style */ "./components/qr-code/style/index.ts");
- // Legacy path. Please use `qr-code` instead.
- // Keep file here in case developer import directly from the old path.
- /***/ }),
- /***/ "./components/radio/style/index.ts":
- /*!*****************************************!*\
- !*** ./components/radio/style/index.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Styles ==============================
- // styles from RadioGroup only
- const getGroupRadioStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- const groupPrefixCls = `${componentCls}-group`;
- return {
- [groupPrefixCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-block',
- fontSize: 0,
- // RTL
- [`&${groupPrefixCls}-rtl`]: {
- direction: 'rtl'
- },
- [`&${groupPrefixCls}-block`]: {
- display: 'flex'
- },
- [`${antCls}-badge ${antCls}-badge-count`]: {
- zIndex: 1
- },
- [`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: {
- borderInlineStart: 'none'
- }
- })
- };
- };
- // Styles from radio-wrapper
- const getRadioBasicStyle = token => {
- const {
- componentCls,
- wrapperMarginInlineEnd,
- colorPrimary,
- radioSize,
- motionDurationSlow,
- motionDurationMid,
- motionEaseInOutCirc,
- colorBgContainer,
- colorBorder,
- lineWidth,
- colorBgContainerDisabled,
- colorTextDisabled,
- paddingXS,
- dotColorDisabled,
- lineType,
- radioColor,
- radioBgColor,
- calc
- } = token;
- const radioInnerPrefixCls = `${componentCls}-inner`;
- const dotPadding = 4;
- const radioDotDisabledSize = calc(radioSize).sub(calc(dotPadding).mul(2));
- const radioSizeCalc = calc(1).mul(radioSize).equal({
- unit: true
- });
- return {
- [`${componentCls}-wrapper`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-flex',
- alignItems: 'baseline',
- marginInlineStart: 0,
- marginInlineEnd: wrapperMarginInlineEnd,
- cursor: 'pointer',
- '&:last-child': {
- marginInlineEnd: 0
- },
- // RTL
- [`&${componentCls}-wrapper-rtl`]: {
- direction: 'rtl'
- },
- '&-disabled': {
- cursor: 'not-allowed',
- color: token.colorTextDisabled
- },
- '&::after': {
- display: 'inline-block',
- width: 0,
- overflow: 'hidden',
- content: '"\\a0"'
- },
- '&-block': {
- flex: 1,
- justifyContent: 'center'
- },
- // hashId 在 wrapper 上,只能铺平
- [`${componentCls}-checked::after`]: {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- width: '100%',
- height: '100%',
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorPrimary}`,
- borderRadius: '50%',
- visibility: 'hidden',
- opacity: 0,
- content: '""'
- },
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- display: 'inline-block',
- outline: 'none',
- cursor: 'pointer',
- alignSelf: 'center',
- borderRadius: '50%'
- }),
- [`${componentCls}-wrapper:hover &,
- &:hover ${radioInnerPrefixCls}`]: {
- borderColor: colorPrimary
- },
- [`${componentCls}-input:focus-visible + ${radioInnerPrefixCls}`]: (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusOutline)(token),
- [`${componentCls}:hover::after, ${componentCls}-wrapper:hover &::after`]: {
- visibility: 'visible'
- },
- [`${componentCls}-inner`]: {
- '&::after': {
- boxSizing: 'border-box',
- position: 'absolute',
- insetBlockStart: '50%',
- insetInlineStart: '50%',
- display: 'block',
- width: radioSizeCalc,
- height: radioSizeCalc,
- marginBlockStart: calc(1).mul(radioSize).div(-2).equal({
- unit: true
- }),
- marginInlineStart: calc(1).mul(radioSize).div(-2).equal({
- unit: true
- }),
- backgroundColor: radioColor,
- borderBlockStart: 0,
- borderInlineStart: 0,
- borderRadius: radioSizeCalc,
- transform: 'scale(0)',
- opacity: 0,
- transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`,
- content: '""'
- },
- boxSizing: 'border-box',
- position: 'relative',
- insetBlockStart: 0,
- insetInlineStart: 0,
- display: 'block',
- width: radioSizeCalc,
- height: radioSizeCalc,
- backgroundColor: colorBgContainer,
- borderColor: colorBorder,
- borderStyle: 'solid',
- borderWidth: lineWidth,
- borderRadius: '50%',
- transition: `all ${motionDurationMid}`
- },
- [`${componentCls}-input`]: {
- position: 'absolute',
- inset: 0,
- zIndex: 1,
- cursor: 'pointer',
- opacity: 0
- },
- // 选中状态
- [`${componentCls}-checked`]: {
- [radioInnerPrefixCls]: {
- borderColor: colorPrimary,
- backgroundColor: radioBgColor,
- '&::after': {
- transform: `scale(${token.calc(token.dotSize).div(radioSize).equal()})`,
- opacity: 1,
- transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
- }
- }
- },
- [`${componentCls}-disabled`]: {
- cursor: 'not-allowed',
- [radioInnerPrefixCls]: {
- backgroundColor: colorBgContainerDisabled,
- borderColor: colorBorder,
- cursor: 'not-allowed',
- '&::after': {
- backgroundColor: dotColorDisabled
- }
- },
- [`${componentCls}-input`]: {
- cursor: 'not-allowed'
- },
- [`${componentCls}-disabled + span`]: {
- color: colorTextDisabled,
- cursor: 'not-allowed'
- },
- [`&${componentCls}-checked`]: {
- [radioInnerPrefixCls]: {
- '&::after': {
- transform: `scale(${calc(radioDotDisabledSize).div(radioSize).equal()})`
- }
- }
- }
- },
- [`span${componentCls} + *`]: {
- paddingInlineStart: paddingXS,
- paddingInlineEnd: paddingXS
- }
- })
- };
- };
- // Styles from radio-button
- const getRadioButtonStyle = token => {
- const {
- buttonColor,
- controlHeight,
- componentCls,
- lineWidth,
- lineType,
- colorBorder,
- motionDurationMid,
- buttonPaddingInline,
- fontSize,
- buttonBg,
- fontSizeLG,
- controlHeightLG,
- controlHeightSM,
- paddingXS,
- borderRadius,
- borderRadiusSM,
- borderRadiusLG,
- buttonCheckedBg,
- buttonSolidCheckedColor,
- colorTextDisabled,
- colorBgContainerDisabled,
- buttonCheckedBgDisabled,
- buttonCheckedColorDisabled,
- colorPrimary,
- colorPrimaryHover,
- colorPrimaryActive,
- buttonSolidCheckedBg,
- buttonSolidCheckedHoverBg,
- buttonSolidCheckedActiveBg,
- calc
- } = token;
- return {
- [`${componentCls}-button-wrapper`]: {
- position: 'relative',
- display: 'inline-block',
- height: controlHeight,
- margin: 0,
- paddingInline: buttonPaddingInline,
- paddingBlock: 0,
- color: buttonColor,
- fontSize,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(controlHeight).sub(calc(lineWidth).mul(2)).equal()),
- background: buttonBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorBorder}`,
- // strange align fix for chrome but works
- // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
- borderBlockStartWidth: calc(lineWidth).add(0.02).equal(),
- borderInlineEndWidth: lineWidth,
- cursor: 'pointer',
- transition: [`color ${motionDurationMid}`, `background ${motionDurationMid}`, `box-shadow ${motionDurationMid}`].join(','),
- a: {
- color: buttonColor
- },
- [`> ${componentCls}-button`]: {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- zIndex: -1,
- width: '100%',
- height: '100%'
- },
- '&:not(:last-child)': {
- marginInlineEnd: calc(lineWidth).mul(-1).equal()
- },
- '&:first-child': {
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorBorder}`,
- borderStartStartRadius: borderRadius,
- borderEndStartRadius: borderRadius
- },
- '&:last-child': {
- borderStartEndRadius: borderRadius,
- borderEndEndRadius: borderRadius
- },
- '&:first-child:last-child': {
- borderRadius
- },
- [`${componentCls}-group-large &`]: {
- height: controlHeightLG,
- fontSize: fontSizeLG,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(controlHeightLG).sub(calc(lineWidth).mul(2)).equal()),
- '&:first-child': {
- borderStartStartRadius: borderRadiusLG,
- borderEndStartRadius: borderRadiusLG
- },
- '&:last-child': {
- borderStartEndRadius: borderRadiusLG,
- borderEndEndRadius: borderRadiusLG
- }
- },
- [`${componentCls}-group-small &`]: {
- height: controlHeightSM,
- paddingInline: calc(paddingXS).sub(lineWidth).equal(),
- paddingBlock: 0,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(controlHeightSM).sub(calc(lineWidth).mul(2)).equal()),
- '&:first-child': {
- borderStartStartRadius: borderRadiusSM,
- borderEndStartRadius: borderRadiusSM
- },
- '&:last-child': {
- borderStartEndRadius: borderRadiusSM,
- borderEndEndRadius: borderRadiusSM
- }
- },
- '&:hover': {
- position: 'relative',
- color: colorPrimary
- },
- '&:has(:focus-visible)': (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusOutline)(token),
- [`${componentCls}-inner, input[type='checkbox'], input[type='radio']`]: {
- width: 0,
- height: 0,
- opacity: 0,
- pointerEvents: 'none'
- },
- [`&-checked:not(${componentCls}-button-wrapper-disabled)`]: {
- zIndex: 1,
- color: colorPrimary,
- background: buttonCheckedBg,
- borderColor: colorPrimary,
- '&::before': {
- backgroundColor: colorPrimary
- },
- '&:first-child': {
- borderColor: colorPrimary
- },
- '&:hover': {
- color: colorPrimaryHover,
- borderColor: colorPrimaryHover,
- '&::before': {
- backgroundColor: colorPrimaryHover
- }
- },
- '&:active': {
- color: colorPrimaryActive,
- borderColor: colorPrimaryActive,
- '&::before': {
- backgroundColor: colorPrimaryActive
- }
- }
- },
- [`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: {
- color: buttonSolidCheckedColor,
- background: buttonSolidCheckedBg,
- borderColor: buttonSolidCheckedBg,
- '&:hover': {
- color: buttonSolidCheckedColor,
- background: buttonSolidCheckedHoverBg,
- borderColor: buttonSolidCheckedHoverBg
- },
- '&:active': {
- color: buttonSolidCheckedColor,
- background: buttonSolidCheckedActiveBg,
- borderColor: buttonSolidCheckedActiveBg
- }
- },
- '&-disabled': {
- color: colorTextDisabled,
- backgroundColor: colorBgContainerDisabled,
- borderColor: colorBorder,
- cursor: 'not-allowed',
- '&:first-child, &:hover': {
- color: colorTextDisabled,
- backgroundColor: colorBgContainerDisabled,
- borderColor: colorBorder
- }
- },
- [`&-disabled${componentCls}-button-wrapper-checked`]: {
- color: buttonCheckedColorDisabled,
- backgroundColor: buttonCheckedBgDisabled,
- borderColor: colorBorder,
- boxShadow: 'none'
- },
- '&-block': {
- flex: 1,
- textAlign: 'center'
- }
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- wireframe,
- padding,
- marginXS,
- lineWidth,
- fontSizeLG,
- colorText,
- colorBgContainer,
- colorTextDisabled,
- controlItemBgActiveDisabled,
- colorTextLightSolid,
- colorPrimary,
- colorPrimaryHover,
- colorPrimaryActive,
- colorWhite
- } = token;
- const dotPadding = 4; // Fixed value
- const radioSize = fontSizeLG;
- const radioDotSize = wireframe ? radioSize - dotPadding * 2 : radioSize - (dotPadding + lineWidth) * 2;
- return {
- // Radio
- radioSize,
- dotSize: radioDotSize,
- dotColorDisabled: colorTextDisabled,
- // Radio buttons
- buttonSolidCheckedColor: colorTextLightSolid,
- buttonSolidCheckedBg: colorPrimary,
- buttonSolidCheckedHoverBg: colorPrimaryHover,
- buttonSolidCheckedActiveBg: colorPrimaryActive,
- buttonBg: colorBgContainer,
- buttonCheckedBg: colorBgContainer,
- buttonColor: colorText,
- buttonCheckedBgDisabled: controlItemBgActiveDisabled,
- buttonCheckedColorDisabled: colorTextDisabled,
- buttonPaddingInline: padding - lineWidth,
- wrapperMarginInlineEnd: marginXS,
- // internal
- radioColor: wireframe ? colorPrimary : colorWhite,
- radioBgColor: wireframe ? colorBgContainer : colorPrimary
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Radio', token => {
- const {
- controlOutline,
- controlOutlineWidth
- } = token;
- const radioFocusShadow = `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(controlOutlineWidth)} ${controlOutline}`;
- const radioButtonFocusShadow = radioFocusShadow;
- const radioToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- radioFocusShadow,
- radioButtonFocusShadow
- });
- return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
- }, prepareComponentToken, {
- unitless: {
- radioSize: true,
- dotSize: true
- }
- }));
- /***/ }),
- /***/ "./components/rate/style/index.ts":
- /*!****************************************!*\
- !*** ./components/rate/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genRateStarStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-star`]: {
- position: 'relative',
- display: 'inline-block',
- color: 'inherit',
- cursor: 'pointer',
- '&:not(:last-child)': {
- marginInlineEnd: token.marginXS
- },
- '> div': {
- transition: `all ${token.motionDurationMid}, outline 0s`,
- '&:hover': {
- transform: token.starHoverScale
- },
- '&:focus': {
- outline: 0
- },
- '&:focus-visible': {
- outline: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} dashed ${token.starColor}`,
- transform: token.starHoverScale
- }
- },
- '&-first, &-second': {
- color: token.starBg,
- transition: `all ${token.motionDurationMid}`,
- userSelect: 'none'
- },
- '&-first': {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- width: '50%',
- height: '100%',
- overflow: 'hidden',
- opacity: 0
- },
- [`&-half ${componentCls}-star-first, &-half ${componentCls}-star-second`]: {
- opacity: 1
- },
- [`&-half ${componentCls}-star-first, &-full ${componentCls}-star-second`]: {
- color: 'inherit'
- }
- }
- };
- };
- const genRateRtlStyle = token => ({
- [`&-rtl${token.componentCls}`]: {
- direction: 'rtl'
- }
- });
- const genRateStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-block',
- margin: 0,
- padding: 0,
- color: token.starColor,
- fontSize: token.starSize,
- lineHeight: 1,
- listStyle: 'none',
- outline: 'none',
- // disable styles
- [`&-disabled${componentCls} ${componentCls}-star`]: {
- cursor: 'default',
- '> div:hover': {
- transform: 'scale(1)'
- }
- }
- }), genRateStarStyle(token)), genRateRtlStyle(token))
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- starColor: token.yellow6,
- starSize: token.controlHeightLG * 0.5,
- starHoverScale: 'scale(1.1)',
- starBg: token.colorFillContent
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Rate', token => {
- const rateToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {});
- return genRateStyle(rateToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/result/style/index.ts":
- /*!******************************************!*\
- !*** ./components/result/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Styles ==============================
- const genBaseStyle = token => {
- const {
- componentCls,
- lineHeightHeading3,
- iconCls,
- padding,
- paddingXL,
- paddingXS,
- paddingLG,
- marginXS,
- lineHeight
- } = token;
- return {
- // Result
- [componentCls]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(paddingLG).mul(2).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXL)}`,
- // RTL
- '&-rtl': {
- direction: 'rtl'
- }
- },
- // Exception Status image
- [`${componentCls} ${componentCls}-image`]: {
- width: token.imageWidth,
- height: token.imageHeight,
- margin: 'auto'
- },
- [`${componentCls} ${componentCls}-icon`]: {
- marginBottom: paddingLG,
- textAlign: 'center',
- [`& > ${iconCls}`]: {
- fontSize: token.iconFontSize
- }
- },
- [`${componentCls} ${componentCls}-title`]: {
- color: token.colorTextHeading,
- fontSize: token.titleFontSize,
- lineHeight: lineHeightHeading3,
- marginBlock: marginXS,
- textAlign: 'center'
- },
- [`${componentCls} ${componentCls}-subtitle`]: {
- color: token.colorTextDescription,
- fontSize: token.subtitleFontSize,
- lineHeight,
- textAlign: 'center'
- },
- [`${componentCls} ${componentCls}-content`]: {
- marginTop: paddingLG,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(padding).mul(2.5).equal())}`,
- backgroundColor: token.colorFillAlter
- },
- [`${componentCls} ${componentCls}-extra`]: {
- margin: token.extraMargin,
- textAlign: 'center',
- '& > *': {
- marginInlineEnd: paddingXS,
- '&:last-child': {
- marginInlineEnd: 0
- }
- }
- }
- };
- };
- const genStatusIconStyle = token => {
- const {
- componentCls,
- iconCls
- } = token;
- return {
- [`${componentCls}-success ${componentCls}-icon > ${iconCls}`]: {
- color: token.resultSuccessIconColor
- },
- [`${componentCls}-error ${componentCls}-icon > ${iconCls}`]: {
- color: token.resultErrorIconColor
- },
- [`${componentCls}-info ${componentCls}-icon > ${iconCls}`]: {
- color: token.resultInfoIconColor
- },
- [`${componentCls}-warning ${componentCls}-icon > ${iconCls}`]: {
- color: token.resultWarningIconColor
- }
- };
- };
- const genResultStyle = token => [genBaseStyle(token), genStatusIconStyle(token)];
- const getStyle = token => genResultStyle(token);
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- titleFontSize: token.fontSizeHeading3,
- subtitleFontSize: token.fontSize,
- iconFontSize: token.fontSizeHeading3 * 3,
- extraMargin: `${token.paddingLG}px 0 0 0`
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Result', token => {
- const resultInfoIconColor = token.colorInfo;
- const resultErrorIconColor = token.colorError;
- const resultSuccessIconColor = token.colorSuccess;
- const resultWarningIconColor = token.colorWarning;
- const resultToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.mergeToken)(token, {
- resultInfoIconColor,
- resultErrorIconColor,
- resultSuccessIconColor,
- resultWarningIconColor,
- imageWidth: 250,
- imageHeight: 295
- });
- return [getStyle(resultToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/row/style/index.ts":
- /*!***************************************!*\
- !*** ./components/row/style/index.ts ***!
- \***************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- // Compatible for babel-plugin-import
- /* istanbul ignore next */
- /* harmony default export */ __webpack_exports__["default"] = ({});
- /***/ }),
- /***/ "./components/segmented/style/index.ts":
- /*!*********************************************!*\
- !*** ./components/segmented/style/index.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Mixins ==============================
- function getItemDisabledStyle(cls, token) {
- return {
- [`${cls}, ${cls}:hover, ${cls}:focus`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- }
- };
- }
- function getItemSelectedStyle(token) {
- return {
- backgroundColor: token.itemSelectedBg,
- boxShadow: token.boxShadowTertiary
- };
- }
- const segmentedTextEllipsisCss = Object.assign({
- overflow: 'hidden'
- }, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis);
- // ============================== Styles ==============================
- const genSegmentedStyle = token => {
- const {
- componentCls
- } = token;
- const labelHeight = token.calc(token.controlHeight).sub(token.calc(token.trackPadding).mul(2)).equal();
- const labelHeightLG = token.calc(token.controlHeightLG).sub(token.calc(token.trackPadding).mul(2)).equal();
- const labelHeightSM = token.calc(token.controlHeightSM).sub(token.calc(token.trackPadding).mul(2)).equal();
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- display: 'inline-block',
- padding: token.trackPadding,
- color: token.itemColor,
- background: token.trackBg,
- borderRadius: token.borderRadius,
- transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`
- }), (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusStyle)(token)), {
- [`${componentCls}-group`]: {
- position: 'relative',
- display: 'flex',
- alignItems: 'stretch',
- justifyItems: 'flex-start',
- flexDirection: 'row',
- width: '100%'
- },
- // RTL styles
- [`&${componentCls}-rtl`]: {
- direction: 'rtl'
- },
- [`&${componentCls}-vertical`]: {
- [`${componentCls}-group`]: {
- flexDirection: 'column'
- },
- [`${componentCls}-thumb`]: {
- width: '100%',
- height: 0,
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXXS)}`
- }
- },
- // block styles
- [`&${componentCls}-block`]: {
- display: 'flex'
- },
- [`&${componentCls}-block ${componentCls}-item`]: {
- flex: 1,
- minWidth: 0
- },
- // item styles
- [`${componentCls}-item`]: {
- position: 'relative',
- textAlign: 'center',
- cursor: 'pointer',
- transition: `color ${token.motionDurationMid} ${token.motionEaseInOut}`,
- borderRadius: token.borderRadiusSM,
- // Fix Safari render bug
- // https://github.com/ant-design/ant-design/issues/45250
- transform: 'translateZ(0)',
- '&-selected': Object.assign(Object.assign({}, getItemSelectedStyle(token)), {
- color: token.itemSelectedColor
- }),
- '&-focused': (0,_style__WEBPACK_IMPORTED_MODULE_1__.genFocusOutline)(token),
- '&::after': {
- content: '""',
- position: 'absolute',
- zIndex: -1,
- width: '100%',
- height: '100%',
- top: 0,
- insetInlineStart: 0,
- borderRadius: 'inherit',
- opacity: 0,
- transition: `opacity ${token.motionDurationMid}`,
- // This is mandatory to make it not clickable or hoverable
- // Ref: https://github.com/ant-design/ant-design/issues/40888
- pointerEvents: 'none'
- },
- [`&:hover:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
- color: token.itemHoverColor,
- '&::after': {
- opacity: 1,
- backgroundColor: token.itemHoverBg
- }
- },
- [`&:active:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
- color: token.itemHoverColor,
- '&::after': {
- opacity: 1,
- backgroundColor: token.itemActiveBg
- }
- },
- '&-label': Object.assign({
- minHeight: labelHeight,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(labelHeight),
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.segmentedPaddingHorizontal)}`
- }, segmentedTextEllipsisCss),
- // syntactic sugar to add `icon` for Segmented Item
- '&-icon + *': {
- marginInlineStart: token.calc(token.marginSM).div(2).equal()
- },
- '&-input': {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- width: 0,
- height: 0,
- opacity: 0,
- pointerEvents: 'none'
- }
- },
- // thumb styles
- [`${componentCls}-thumb`]: Object.assign(Object.assign({}, getItemSelectedStyle(token)), {
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- width: 0,
- height: '100%',
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXXS)} 0`,
- borderRadius: token.borderRadiusSM,
- transition: `transform ${token.motionDurationSlow} ${token.motionEaseInOut}, height ${token.motionDurationSlow} ${token.motionEaseInOut}`,
- [`& ~ ${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)::after`]: {
- backgroundColor: 'transparent'
- }
- }),
- // size styles
- [`&${componentCls}-lg`]: {
- borderRadius: token.borderRadiusLG,
- [`${componentCls}-item-label`]: {
- minHeight: labelHeightLG,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(labelHeightLG),
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.segmentedPaddingHorizontal)}`,
- fontSize: token.fontSizeLG
- },
- [`${componentCls}-item, ${componentCls}-thumb`]: {
- borderRadius: token.borderRadius
- }
- },
- [`&${componentCls}-sm`]: {
- borderRadius: token.borderRadiusSM,
- [`${componentCls}-item-label`]: {
- minHeight: labelHeightSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(labelHeightSM),
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.segmentedPaddingHorizontalSM)}`
- },
- [`${componentCls}-item, ${componentCls}-thumb`]: {
- borderRadius: token.borderRadiusXS
- }
- }
- }), getItemDisabledStyle(`&-disabled ${componentCls}-item`, token)), getItemDisabledStyle(`${componentCls}-item-disabled`, token)), {
- // transition effect when `appear-active`
- [`${componentCls}-thumb-motion-appear-active`]: {
- transition: `transform ${token.motionDurationSlow} ${token.motionEaseInOut}, width ${token.motionDurationSlow} ${token.motionEaseInOut}`,
- willChange: 'transform, width'
- },
- [`&${componentCls}-shape-round`]: {
- borderRadius: 9999,
- [`${componentCls}-item, ${componentCls}-thumb`]: {
- borderRadius: 9999
- }
- }
- })
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- colorTextLabel,
- colorText,
- colorFillSecondary,
- colorBgElevated,
- colorFill,
- lineWidthBold,
- colorBgLayout
- } = token;
- return {
- trackPadding: lineWidthBold,
- trackBg: colorBgLayout,
- itemColor: colorTextLabel,
- itemHoverColor: colorText,
- itemHoverBg: colorFillSecondary,
- itemSelectedBg: colorBgElevated,
- itemActiveBg: colorFill,
- itemSelectedColor: colorText
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Segmented', token => {
- const {
- lineWidth,
- calc
- } = token;
- const segmentedToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- segmentedPaddingHorizontal: calc(token.controlPaddingHorizontal).sub(lineWidth).equal(),
- segmentedPaddingHorizontalSM: calc(token.controlPaddingHorizontalSM).sub(lineWidth).equal()
- });
- return genSegmentedStyle(segmentedToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/select/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/select/style/index.ts + 4 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ select_style; }
- });
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/compact-item.ts
- var compact_item = __webpack_require__("./components/style/compact-item.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/style/motion/slide.ts
- var slide = __webpack_require__("./components/style/motion/slide.ts");
- // EXTERNAL MODULE: ./components/style/motion/move.ts
- var move = __webpack_require__("./components/style/motion/move.ts");
- ;// ./components/select/style/dropdown.ts
- const genItemStyle = token => {
- const {
- optionHeight,
- optionFontSize,
- optionLineHeight,
- optionPadding
- } = token;
- return {
- position: 'relative',
- display: 'block',
- minHeight: optionHeight,
- padding: optionPadding,
- color: token.colorText,
- fontWeight: 'normal',
- fontSize: optionFontSize,
- lineHeight: optionLineHeight,
- boxSizing: 'border-box'
- };
- };
- const genSingleStyle = token => {
- const {
- antCls,
- componentCls
- } = token;
- const selectItemCls = `${componentCls}-item`;
- const slideUpEnterActive = `&${antCls}-slide-up-enter${antCls}-slide-up-enter-active`;
- const slideUpAppearActive = `&${antCls}-slide-up-appear${antCls}-slide-up-appear-active`;
- const slideUpLeaveActive = `&${antCls}-slide-up-leave${antCls}-slide-up-leave-active`;
- const dropdownPlacementCls = `${componentCls}-dropdown-placement-`;
- const selectedItemCls = `${selectItemCls}-option-selected`;
- return [{
- [`${componentCls}-dropdown`]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- position: 'absolute',
- top: -9999,
- zIndex: token.zIndexPopup,
- boxSizing: 'border-box',
- padding: token.paddingXXS,
- overflow: 'hidden',
- fontSize: token.fontSize,
- // Fix select render lag of long text in chrome
- // https://github.com/ant-design/ant-design/issues/11456
- // https://github.com/ant-design/ant-design/issues/11843
- fontVariant: 'initial',
- backgroundColor: token.colorBgElevated,
- borderRadius: token.borderRadiusLG,
- outline: 'none',
- boxShadow: token.boxShadowSecondary,
- [`
- ${slideUpEnterActive}${dropdownPlacementCls}bottomLeft,
- ${slideUpAppearActive}${dropdownPlacementCls}bottomLeft
- `]: {
- animationName: slide.slideUpIn
- },
- [`
- ${slideUpEnterActive}${dropdownPlacementCls}topLeft,
- ${slideUpAppearActive}${dropdownPlacementCls}topLeft,
- ${slideUpEnterActive}${dropdownPlacementCls}topRight,
- ${slideUpAppearActive}${dropdownPlacementCls}topRight
- `]: {
- animationName: slide.slideDownIn
- },
- [`${slideUpLeaveActive}${dropdownPlacementCls}bottomLeft`]: {
- animationName: slide.slideUpOut
- },
- [`
- ${slideUpLeaveActive}${dropdownPlacementCls}topLeft,
- ${slideUpLeaveActive}${dropdownPlacementCls}topRight
- `]: {
- animationName: slide.slideDownOut
- },
- '&-hidden': {
- display: 'none'
- },
- [selectItemCls]: Object.assign(Object.assign({}, genItemStyle(token)), {
- cursor: 'pointer',
- transition: `background ${token.motionDurationSlow} ease`,
- borderRadius: token.borderRadiusSM,
- // =========== Group ============
- '&-group': {
- color: token.colorTextDescription,
- fontSize: token.fontSizeSM,
- cursor: 'default'
- },
- // =========== Option ===========
- '&-option': {
- display: 'flex',
- '&-content': Object.assign({
- flex: 'auto'
- }, style.textEllipsis),
- '&-state': {
- flex: 'none',
- display: 'flex',
- alignItems: 'center'
- },
- [`&-active:not(${selectItemCls}-option-disabled)`]: {
- backgroundColor: token.optionActiveBg
- },
- [`&-selected:not(${selectItemCls}-option-disabled)`]: {
- color: token.optionSelectedColor,
- fontWeight: token.optionSelectedFontWeight,
- backgroundColor: token.optionSelectedBg,
- [`${selectItemCls}-option-state`]: {
- color: token.colorPrimary
- }
- },
- '&-disabled': {
- [`&${selectItemCls}-option-selected`]: {
- backgroundColor: token.colorBgContainerDisabled
- },
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- },
- '&-grouped': {
- paddingInlineStart: token.calc(token.controlPaddingHorizontal).mul(2).equal()
- }
- },
- '&-empty': Object.assign(Object.assign({}, genItemStyle(token)), {
- color: token.colorTextDisabled
- })
- }),
- // https://github.com/ant-design/ant-design/pull/46646
- [`${selectedItemCls}:has(+ ${selectedItemCls})`]: {
- borderEndStartRadius: 0,
- borderEndEndRadius: 0,
- [`& + ${selectedItemCls}`]: {
- borderStartStartRadius: 0,
- borderStartEndRadius: 0
- }
- },
- // =========================== RTL ===========================
- '&-rtl': {
- direction: 'rtl'
- }
- })
- },
- // Follow code may reuse in other components
- (0,slide.initSlideMotion)(token, 'slide-up'), (0,slide.initSlideMotion)(token, 'slide-down'), (0,move.initMoveMotion)(token, 'move-up'), (0,move.initMoveMotion)(token, 'move-down')];
- };
- /* harmony default export */ var dropdown = (genSingleStyle);
- // EXTERNAL MODULE: ./components/select/style/multiple.ts
- var multiple = __webpack_require__("./components/select/style/multiple.ts");
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- ;// ./components/select/style/single.ts
- function genSizeStyle(token, suffix) {
- const {
- componentCls,
- inputPaddingHorizontalBase,
- borderRadius
- } = token;
- const selectHeightWithoutBorder = token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal();
- const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
- return {
- [`${componentCls}-single${suffixCls}`]: {
- fontSize: token.fontSize,
- height: token.controlHeight,
- // ========================= Selector =========================
- [`${componentCls}-selector`]: Object.assign(Object.assign({}, (0,style.resetComponent)(token, true)), {
- display: 'flex',
- borderRadius,
- flex: '1 1 auto',
- [`${componentCls}-selection-wrap:after`]: {
- lineHeight: (0,cssinjs.unit)(selectHeightWithoutBorder)
- },
- [`${componentCls}-selection-search`]: {
- position: 'absolute',
- inset: 0,
- width: '100%',
- '&-input': {
- width: '100%',
- WebkitAppearance: 'textfield'
- }
- },
- [`
- ${componentCls}-selection-item,
- ${componentCls}-selection-placeholder
- `]: {
- display: 'block',
- padding: 0,
- lineHeight: (0,cssinjs.unit)(selectHeightWithoutBorder),
- transition: `all ${token.motionDurationSlow}, visibility 0s`,
- alignSelf: 'center'
- },
- [`${componentCls}-selection-placeholder`]: {
- transition: 'none',
- pointerEvents: 'none'
- },
- // For common baseline align
- [['&:after', /* For '' value baseline align */
- `${componentCls}-selection-item:empty:after`, /* For undefined value baseline align */
- `${componentCls}-selection-placeholder:empty:after`].join(',')]: {
- display: 'inline-block',
- width: 0,
- visibility: 'hidden',
- content: '"\\a0"'
- }
- }),
- [`
- &${componentCls}-show-arrow ${componentCls}-selection-item,
- &${componentCls}-show-arrow ${componentCls}-selection-search,
- &${componentCls}-show-arrow ${componentCls}-selection-placeholder
- `]: {
- paddingInlineEnd: token.showArrowPaddingInlineEnd
- },
- // Opacity selection if open
- [`&${componentCls}-open ${componentCls}-selection-item`]: {
- color: token.colorTextPlaceholder
- },
- // ========================== Input ==========================
- // We only change the style of non-customize input which is only support by `combobox` mode.
- // Not customize
- [`&:not(${componentCls}-customize-input)`]: {
- [`${componentCls}-selector`]: {
- width: '100%',
- height: '100%',
- alignItems: 'center',
- padding: `0 ${(0,cssinjs.unit)(inputPaddingHorizontalBase)}`,
- [`${componentCls}-selection-search-input`]: {
- height: selectHeightWithoutBorder,
- fontSize: token.fontSize
- },
- '&:after': {
- lineHeight: (0,cssinjs.unit)(selectHeightWithoutBorder)
- }
- }
- },
- [`&${componentCls}-customize-input`]: {
- [`${componentCls}-selector`]: {
- '&:after': {
- display: 'none'
- },
- [`${componentCls}-selection-search`]: {
- position: 'static',
- width: '100%'
- },
- [`${componentCls}-selection-placeholder`]: {
- position: 'absolute',
- insetInlineStart: 0,
- insetInlineEnd: 0,
- padding: `0 ${(0,cssinjs.unit)(inputPaddingHorizontalBase)}`,
- '&:after': {
- display: 'none'
- }
- }
- }
- }
- }
- };
- }
- function single_genSingleStyle(token) {
- const {
- componentCls
- } = token;
- const inputPaddingHorizontalSM = token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal();
- return [genSizeStyle(token),
- // ======================== Small ========================
- // Shared
- genSizeStyle((0,es.mergeToken)(token, {
- controlHeight: token.controlHeightSM,
- borderRadius: token.borderRadiusSM
- }), 'sm'),
- // padding
- {
- [`${componentCls}-single${componentCls}-sm`]: {
- [`&:not(${componentCls}-customize-input)`]: {
- [`${componentCls}-selector`]: {
- padding: `0 ${(0,cssinjs.unit)(inputPaddingHorizontalSM)}`
- },
- // With arrow should provides `padding-right` to show the arrow
- [`&${componentCls}-show-arrow ${componentCls}-selection-search`]: {
- insetInlineEnd: token.calc(inputPaddingHorizontalSM).add(token.calc(token.fontSize).mul(1.5)).equal()
- },
- [`
- &${componentCls}-show-arrow ${componentCls}-selection-item,
- &${componentCls}-show-arrow ${componentCls}-selection-placeholder
- `]: {
- paddingInlineEnd: token.calc(token.fontSize).mul(1.5).equal()
- }
- }
- }
- },
- // ======================== Large ========================
- // Shared
- genSizeStyle((0,es.mergeToken)(token, {
- controlHeight: token.singleItemHeightLG,
- fontSize: token.fontSizeLG,
- borderRadius: token.borderRadiusLG
- }), 'lg')];
- }
- ;// ./components/select/style/token.ts
- const prepareComponentToken = token => {
- const {
- fontSize,
- lineHeight,
- lineWidth,
- controlHeight,
- controlHeightSM,
- controlHeightLG,
- paddingXXS,
- controlPaddingHorizontal,
- zIndexPopupBase,
- colorText,
- fontWeightStrong,
- controlItemBgActive,
- controlItemBgHover,
- colorBgContainer,
- colorFillSecondary,
- colorBgContainerDisabled,
- colorTextDisabled,
- colorPrimaryHover,
- colorPrimary,
- controlOutline
- } = token;
- // Item height default use `controlHeight - 2 * paddingXXS`,
- // but some case `paddingXXS=0`.
- // Let's fallback it.
- const dblPaddingXXS = paddingXXS * 2;
- const dblLineWidth = lineWidth * 2;
- const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);
- const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);
- const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);
- // FIXED_ITEM_MARGIN is a hardcode calculation since calc not support rounding
- const INTERNAL_FIXED_ITEM_MARGIN = Math.floor(paddingXXS / 2);
- return {
- INTERNAL_FIXED_ITEM_MARGIN,
- zIndexPopup: zIndexPopupBase + 50,
- optionSelectedColor: colorText,
- optionSelectedFontWeight: fontWeightStrong,
- optionSelectedBg: controlItemBgActive,
- optionActiveBg: controlItemBgHover,
- optionPadding: `${(controlHeight - fontSize * lineHeight) / 2}px ${controlPaddingHorizontal}px`,
- optionFontSize: fontSize,
- optionLineHeight: lineHeight,
- optionHeight: controlHeight,
- selectorBg: colorBgContainer,
- clearBg: colorBgContainer,
- singleItemHeightLG: controlHeightLG,
- multipleItemBg: colorFillSecondary,
- multipleItemBorderColor: 'transparent',
- multipleItemHeight,
- multipleItemHeightSM,
- multipleItemHeightLG,
- multipleSelectorBgDisabled: colorBgContainerDisabled,
- multipleItemColorDisabled: colorTextDisabled,
- multipleItemBorderColorDisabled: 'transparent',
- showArrowPaddingInlineEnd: Math.ceil(token.fontSize * 1.25),
- hoverBorderColor: colorPrimaryHover,
- activeBorderColor: colorPrimary,
- activeOutlineColor: controlOutline,
- selectAffixPadding: paddingXXS
- };
- };
- ;// ./components/select/style/variants.ts
- // =====================================================
- // == Outlined ==
- // =====================================================
- const genBaseOutlinedStyle = (token, options) => {
- const {
- componentCls,
- antCls,
- controlOutlineWidth
- } = token;
- return {
- [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${options.borderColor}`,
- background: token.selectorBg
- },
- [`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
- [`&:hover ${componentCls}-selector`]: {
- borderColor: options.hoverBorderHover
- },
- [`${componentCls}-focused& ${componentCls}-selector`]: {
- borderColor: options.activeBorderColor,
- boxShadow: `0 0 0 ${(0,cssinjs.unit)(controlOutlineWidth)} ${options.activeOutlineColor}`,
- outline: 0
- },
- [`${componentCls}-prefix`]: {
- color: options.color
- }
- }
- };
- };
- const genOutlinedStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseOutlinedStyle(token, options))
- });
- const genOutlinedStyle = token => ({
- '&-outlined': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseOutlinedStyle(token, {
- borderColor: token.colorBorder,
- hoverBorderHover: token.hoverBorderColor,
- activeBorderColor: token.activeBorderColor,
- activeOutlineColor: token.activeOutlineColor,
- color: token.colorText
- })), genOutlinedStatusStyle(token, {
- status: 'error',
- borderColor: token.colorError,
- hoverBorderHover: token.colorErrorHover,
- activeBorderColor: token.colorError,
- activeOutlineColor: token.colorErrorOutline,
- color: token.colorError
- })), genOutlinedStatusStyle(token, {
- status: 'warning',
- borderColor: token.colorWarning,
- hoverBorderHover: token.colorWarningHover,
- activeBorderColor: token.colorWarning,
- activeOutlineColor: token.colorWarningOutline,
- color: token.colorWarning
- })), {
- [`&${token.componentCls}-disabled`]: {
- [`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
- background: token.colorBgContainerDisabled,
- color: token.colorTextDisabled
- }
- },
- [`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- }
- })
- });
- // =====================================================
- // == Filled ==
- // =====================================================
- const genBaseFilledStyle = (token, options) => {
- const {
- componentCls,
- antCls
- } = token;
- return {
- [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
- background: options.bg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} transparent`,
- color: options.color
- },
- [`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
- [`&:hover ${componentCls}-selector`]: {
- background: options.hoverBg
- },
- [`${componentCls}-focused& ${componentCls}-selector`]: {
- background: token.selectorBg,
- borderColor: options.activeBorderColor,
- outline: 0
- }
- }
- };
- };
- const genFilledStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseFilledStyle(token, options))
- });
- const genFilledStyle = token => ({
- '&-filled': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseFilledStyle(token, {
- bg: token.colorFillTertiary,
- hoverBg: token.colorFillSecondary,
- activeBorderColor: token.activeBorderColor,
- color: token.colorText
- })), genFilledStatusStyle(token, {
- status: 'error',
- bg: token.colorErrorBg,
- hoverBg: token.colorErrorBgHover,
- activeBorderColor: token.colorError,
- color: token.colorError
- })), genFilledStatusStyle(token, {
- status: 'warning',
- bg: token.colorWarningBg,
- hoverBg: token.colorWarningBgHover,
- activeBorderColor: token.colorWarning,
- color: token.colorWarning
- })), {
- [`&${token.componentCls}-disabled`]: {
- [`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
- borderColor: token.colorBorder,
- background: token.colorBgContainerDisabled,
- color: token.colorTextDisabled
- }
- },
- [`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
- background: token.colorBgContainer,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
- }
- })
- });
- // =====================================================
- // == Borderless ==
- // =====================================================
- const genBorderlessStyle = token => ({
- '&-borderless': {
- [`${token.componentCls}-selector`]: {
- background: 'transparent',
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} transparent`
- },
- [`&${token.componentCls}-disabled`]: {
- [`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
- color: token.colorTextDisabled
- }
- },
- [`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- },
- // Status
- [`&${token.componentCls}-status-error`]: {
- [`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: {
- color: token.colorError
- }
- },
- [`&${token.componentCls}-status-warning`]: {
- [`${token.componentCls}-prefix, ${token.componentCls}-selection-item`]: {
- color: token.colorWarning
- }
- }
- }
- });
- // =====================================================
- // == Underlined ==
- // =====================================================
- const genBaseUnderlinedStyle = (token, options) => {
- const {
- componentCls,
- antCls
- } = token;
- return {
- [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: {
- borderWidth: `0 0 ${(0,cssinjs.unit)(token.lineWidth)} 0`,
- borderStyle: `none none ${token.lineType} none`,
- borderColor: options.borderColor,
- background: token.selectorBg,
- borderRadius: 0
- },
- [`&:not(${componentCls}-disabled):not(${componentCls}-customize-input):not(${antCls}-pagination-size-changer)`]: {
- [`&:hover ${componentCls}-selector`]: {
- borderColor: options.hoverBorderHover
- },
- [`${componentCls}-focused& ${componentCls}-selector`]: {
- borderColor: options.activeBorderColor,
- outline: 0
- },
- [`${componentCls}-prefix`]: {
- color: options.color
- }
- }
- };
- };
- const genUnderlinedStatusStyle = (token, options) => ({
- [`&${token.componentCls}-status-${options.status}`]: Object.assign({}, genBaseUnderlinedStyle(token, options))
- });
- const genUnderlinedStyle = token => ({
- '&-underlined': Object.assign(Object.assign(Object.assign(Object.assign({}, genBaseUnderlinedStyle(token, {
- borderColor: token.colorBorder,
- hoverBorderHover: token.hoverBorderColor,
- activeBorderColor: token.activeBorderColor,
- activeOutlineColor: token.activeOutlineColor,
- color: token.colorText
- })), genUnderlinedStatusStyle(token, {
- status: 'error',
- borderColor: token.colorError,
- hoverBorderHover: token.colorErrorHover,
- activeBorderColor: token.colorError,
- activeOutlineColor: token.colorErrorOutline,
- color: token.colorError
- })), genUnderlinedStatusStyle(token, {
- status: 'warning',
- borderColor: token.colorWarning,
- hoverBorderHover: token.colorWarningHover,
- activeBorderColor: token.colorWarning,
- activeOutlineColor: token.colorWarningOutline,
- color: token.colorWarning
- })), {
- [`&${token.componentCls}-disabled`]: {
- [`&:not(${token.componentCls}-customize-input) ${token.componentCls}-selector`]: {
- color: token.colorTextDisabled
- }
- },
- [`&${token.componentCls}-multiple ${token.componentCls}-selection-item`]: {
- background: token.multipleItemBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
- }
- })
- });
- const genVariantsStyle = token => ({
- [token.componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), genUnderlinedStyle(token))
- });
- /* harmony default export */ var variants = (genVariantsStyle);
- ;// ./components/select/style/index.ts
- // ============================= Selector =============================
- const genSelectorStyle = token => {
- const {
- componentCls
- } = token;
- return {
- position: 'relative',
- transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
- input: {
- cursor: 'pointer'
- },
- [`${componentCls}-show-search&`]: {
- cursor: 'text',
- input: {
- cursor: 'auto',
- color: 'inherit',
- height: '100%'
- }
- },
- [`${componentCls}-disabled&`]: {
- cursor: 'not-allowed',
- input: {
- cursor: 'not-allowed'
- }
- }
- };
- };
- // ============================== Styles ==============================
- // /* Reset search input style */
- const getSearchInputWithoutBorderStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-selection-search-input`]: {
- margin: 0,
- padding: 0,
- background: 'transparent',
- border: 'none',
- outline: 'none',
- appearance: 'none',
- fontFamily: 'inherit',
- '&::-webkit-search-cancel-button': {
- display: 'none',
- appearance: 'none'
- }
- }
- };
- };
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- antCls,
- componentCls,
- inputPaddingHorizontalBase,
- iconCls
- } = token;
- const hoverShowClearStyle = {
- [`${componentCls}-clear`]: {
- opacity: 1,
- background: token.colorBgBase,
- borderRadius: '50%'
- }
- };
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- position: 'relative',
- display: 'inline-flex',
- cursor: 'pointer',
- [`&:not(${componentCls}-customize-input) ${componentCls}-selector`]: Object.assign(Object.assign({}, genSelectorStyle(token)), getSearchInputWithoutBorderStyle(token)),
- // ======================== Selection ========================
- [`${componentCls}-selection-item`]: Object.assign(Object.assign({
- flex: 1,
- fontWeight: 'normal',
- position: 'relative',
- userSelect: 'none'
- }, style.textEllipsis), {
- // https://github.com/ant-design/ant-design/issues/40421
- [`> ${antCls}-typography`]: {
- display: 'inline'
- }
- }),
- // ======================= Placeholder =======================
- [`${componentCls}-selection-placeholder`]: Object.assign(Object.assign({}, style.textEllipsis), {
- flex: 1,
- color: token.colorTextPlaceholder,
- pointerEvents: 'none'
- }),
- // ========================== Arrow ==========================
- [`${componentCls}-arrow`]: Object.assign(Object.assign({}, (0,style.resetIcon)()), {
- position: 'absolute',
- top: '50%',
- insetInlineStart: 'auto',
- insetInlineEnd: inputPaddingHorizontalBase,
- height: token.fontSizeIcon,
- marginTop: token.calc(token.fontSizeIcon).mul(-1).div(2).equal(),
- color: token.colorTextQuaternary,
- fontSize: token.fontSizeIcon,
- lineHeight: 1,
- textAlign: 'center',
- pointerEvents: 'none',
- display: 'flex',
- alignItems: 'center',
- transition: `opacity ${token.motionDurationSlow} ease`,
- [iconCls]: {
- verticalAlign: 'top',
- transition: `transform ${token.motionDurationSlow}`,
- '> svg': {
- verticalAlign: 'top'
- },
- [`&:not(${componentCls}-suffix)`]: {
- pointerEvents: 'auto'
- }
- },
- [`${componentCls}-disabled &`]: {
- cursor: 'not-allowed'
- },
- '> *:not(:last-child)': {
- marginInlineEnd: 8 // FIXME: magic
- }
- }),
- // ========================== Wrap ===========================
- [`${componentCls}-selection-wrap`]: {
- display: 'flex',
- width: '100%',
- position: 'relative',
- minWidth: 0,
- // https://github.com/ant-design/ant-design/issues/51669
- '&:after': {
- content: '"\\a0"',
- width: 0,
- overflow: 'hidden'
- }
- },
- // ========================= Prefix ==========================
- [`${componentCls}-prefix`]: {
- flex: 'none',
- marginInlineEnd: token.selectAffixPadding
- },
- // ========================== Clear ==========================
- [`${componentCls}-clear`]: {
- position: 'absolute',
- top: '50%',
- insetInlineStart: 'auto',
- insetInlineEnd: inputPaddingHorizontalBase,
- zIndex: 1,
- display: 'inline-block',
- width: token.fontSizeIcon,
- height: token.fontSizeIcon,
- marginTop: token.calc(token.fontSizeIcon).mul(-1).div(2).equal(),
- color: token.colorTextQuaternary,
- fontSize: token.fontSizeIcon,
- fontStyle: 'normal',
- lineHeight: 1,
- textAlign: 'center',
- textTransform: 'none',
- cursor: 'pointer',
- opacity: 0,
- transition: `color ${token.motionDurationMid} ease, opacity ${token.motionDurationSlow} ease`,
- textRendering: 'auto',
- // https://github.com/ant-design/ant-design/issues/54205
- // Force GPU compositing on Safari to prevent flickering on opacity/transform transitions
- transform: 'translateZ(0)',
- '&:before': {
- display: 'block'
- },
- '&:hover': {
- color: token.colorIcon
- }
- },
- '@media(hover:none)': hoverShowClearStyle,
- '&:hover': hoverShowClearStyle
- }),
- // ========================= Feedback ==========================
- [`${componentCls}-status`]: {
- '&-error, &-warning, &-success, &-validating': {
- [`&${componentCls}-has-feedback`]: {
- [`${componentCls}-clear`]: {
- insetInlineEnd: token.calc(inputPaddingHorizontalBase).add(token.fontSize).add(token.paddingXS).equal()
- }
- }
- }
- }
- };
- };
- // ============================== Styles ==============================
- const genSelectStyle = token => {
- const {
- componentCls
- } = token;
- return [{
- [componentCls]: {
- // ==================== In Form ====================
- [`&${componentCls}-in-form-item`]: {
- width: '100%'
- }
- }
- },
- // =====================================================
- // == LTR ==
- // =====================================================
- // Base
- genBaseStyle(token),
- // Single
- single_genSingleStyle(token),
- // Multiple
- (0,multiple["default"])(token),
- // Dropdown
- dropdown(token),
- // =====================================================
- // == RTL ==
- // =====================================================
- {
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- },
- // =====================================================
- // == Space Compact ==
- // =====================================================
- (0,compact_item.genCompactItemStyle)(token, {
- borderElCls: `${componentCls}-selector`,
- focusElCls: `${componentCls}-focused`
- })];
- };
- // ============================== Export ==============================
- /* harmony default export */ var select_style = ((0,genStyleUtils.genStyleHooks)('Select', (token, {
- rootPrefixCls
- }) => {
- const selectToken = (0,es.mergeToken)(token, {
- rootPrefixCls,
- inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(1).equal(),
- multipleSelectItemHeight: token.multipleItemHeight,
- selectHeight: token.controlHeight
- });
- return [genSelectStyle(selectToken), variants(selectToken)];
- }, prepareComponentToken, {
- unitless: {
- optionLineHeight: true,
- optionSelectedFontWeight: true
- }
- }));
- /***/ }),
- /***/ "./components/select/style/multiple.ts":
- /*!*********************************************!*\
- !*** ./components/select/style/multiple.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genOverflowStyle: function() { return /* binding */ genOverflowStyle; },
- /* harmony export */ getMultipleSelectorUnit: function() { return /* binding */ getMultipleSelectorUnit; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /**
- * Get multiple selector needed style. The calculation:
- *
- * ContainerPadding = BasePadding - ItemMargin
- *
- * Border: ╔═══════════════════════════╗ ┬
- * ContainerPadding: ║ ║ │
- * ╟───────────────────────────╢ ┬ │
- * Item Margin: ║ ║ │ │
- * ║ ┌──────────┐ ║ │ │
- * Item(multipleItemHeight): ║ BasePadding │ Item │ ║ Overflow Container(ControlHeight)
- * ║ └──────────┘ ║ │ │
- * Item Margin: ║ ║ │ │
- * ╟───────────────────────────╢ ┴ │
- * ContainerPadding: ║ ║ │
- * Border: ╚═══════════════════════════╝ ┴
- */
- const getMultipleSelectorUnit = token => {
- const {
- multipleSelectItemHeight,
- paddingXXS,
- lineWidth,
- INTERNAL_FIXED_ITEM_MARGIN
- } = token;
- const basePadding = token.max(token.calc(paddingXXS).sub(lineWidth).equal(), 0);
- const containerPadding = token.max(token.calc(basePadding).sub(INTERNAL_FIXED_ITEM_MARGIN).equal(), 0);
- return {
- basePadding,
- containerPadding,
- itemHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(multipleSelectItemHeight),
- itemLineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(multipleSelectItemHeight).sub(token.calc(token.lineWidth).mul(2)).equal())
- };
- };
- const getSelectItemStyle = token => {
- const {
- multipleSelectItemHeight,
- selectHeight,
- lineWidth
- } = token;
- const selectItemDist = token.calc(selectHeight).sub(multipleSelectItemHeight).div(2).sub(lineWidth).equal();
- return selectItemDist;
- };
- /**
- * Get the `rc-overflow` needed style.
- * It's a share style which means not affected by `size`.
- */
- const genOverflowStyle = token => {
- const {
- componentCls,
- iconCls,
- borderRadiusSM,
- motionDurationSlow,
- paddingXS,
- multipleItemColorDisabled,
- multipleItemBorderColorDisabled,
- colorIcon,
- colorIconHover,
- INTERNAL_FIXED_ITEM_MARGIN
- } = token;
- const selectOverflowPrefixCls = `${componentCls}-selection-overflow`;
- return {
- /**
- * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
- * may update to redesign with its align logic.
- */
- // =========================== Overflow ===========================
- [selectOverflowPrefixCls]: {
- position: 'relative',
- display: 'flex',
- flex: 'auto',
- flexWrap: 'wrap',
- maxWidth: '100%',
- '&-item': {
- flex: 'none',
- alignSelf: 'center',
- // https://github.com/ant-design/ant-design/issues/54179
- maxWidth: 'calc(100% - 4px)',
- display: 'inline-flex'
- },
- // ======================== Selections ==========================
- [`${componentCls}-selection-item`]: {
- display: 'flex',
- alignSelf: 'center',
- flex: 'none',
- boxSizing: 'border-box',
- maxWidth: '100%',
- marginBlock: INTERNAL_FIXED_ITEM_MARGIN,
- borderRadius: borderRadiusSM,
- cursor: 'default',
- transition: `font-size ${motionDurationSlow}, line-height ${motionDurationSlow}, height ${motionDurationSlow}`,
- marginInlineEnd: token.calc(INTERNAL_FIXED_ITEM_MARGIN).mul(2).equal(),
- paddingInlineStart: paddingXS,
- paddingInlineEnd: token.calc(paddingXS).div(2).equal(),
- [`${componentCls}-disabled&`]: {
- color: multipleItemColorDisabled,
- borderColor: multipleItemBorderColorDisabled,
- cursor: 'not-allowed'
- },
- // It's ok not to do this, but 24px makes bottom narrow in view should adjust
- '&-content': {
- display: 'inline-block',
- marginInlineEnd: token.calc(paddingXS).div(2).equal(),
- overflow: 'hidden',
- whiteSpace: 'pre',
- // fix whitespace wrapping. custom tags display all whitespace within.
- textOverflow: 'ellipsis'
- },
- '&-remove': Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetIcon)()), {
- display: 'inline-flex',
- alignItems: 'center',
- color: colorIcon,
- fontWeight: 'bold',
- fontSize: 10,
- lineHeight: 'inherit',
- cursor: 'pointer',
- [`> ${iconCls}`]: {
- verticalAlign: '-0.2em'
- },
- '&:hover': {
- color: colorIconHover
- }
- })
- }
- }
- };
- };
- const genSelectionStyle = (token, suffix) => {
- const {
- componentCls,
- INTERNAL_FIXED_ITEM_MARGIN
- } = token;
- const selectOverflowPrefixCls = `${componentCls}-selection-overflow`;
- const selectItemHeight = token.multipleSelectItemHeight;
- const selectItemDist = getSelectItemStyle(token);
- const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
- const multipleSelectorUnit = getMultipleSelectorUnit(token);
- return {
- [`${componentCls}-multiple${suffixCls}`]: Object.assign(Object.assign({}, genOverflowStyle(token)), {
- // ========================= Selector =========================
- [`${componentCls}-selector`]: {
- display: 'flex',
- alignItems: 'center',
- width: '100%',
- height: '100%',
- // Multiple is little different that horizontal is follow the vertical
- paddingInline: multipleSelectorUnit.basePadding,
- paddingBlock: multipleSelectorUnit.containerPadding,
- borderRadius: token.borderRadius,
- [`${componentCls}-disabled&`]: {
- background: token.multipleSelectorBgDisabled,
- cursor: 'not-allowed'
- },
- '&:after': {
- display: 'inline-block',
- width: 0,
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(INTERNAL_FIXED_ITEM_MARGIN)} 0`,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(selectItemHeight),
- visibility: 'hidden',
- content: '"\\a0"'
- }
- },
- // ======================== Selections ========================
- [`${componentCls}-selection-item`]: {
- height: multipleSelectorUnit.itemHeight,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(multipleSelectorUnit.itemLineHeight)
- },
- // ========================== Wrap ===========================
- [`${componentCls}-selection-wrap`]: {
- alignSelf: 'flex-start',
- '&:after': {
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(selectItemHeight),
- marginBlock: INTERNAL_FIXED_ITEM_MARGIN
- }
- },
- // ========================== Input ==========================
- [`${componentCls}-prefix`]: {
- marginInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(multipleSelectorUnit.basePadding).equal()
- },
- [`${selectOverflowPrefixCls}-item + ${selectOverflowPrefixCls}-item,
- ${componentCls}-prefix + ${componentCls}-selection-wrap
- `]: {
- [`${componentCls}-selection-search`]: {
- marginInlineStart: 0
- },
- [`${componentCls}-selection-placeholder`]: {
- insetInlineStart: 0
- }
- },
- // https://github.com/ant-design/ant-design/issues/44754
- // Same as `wrap:after`
- [`${selectOverflowPrefixCls}-item-suffix`]: {
- minHeight: multipleSelectorUnit.itemHeight,
- marginBlock: INTERNAL_FIXED_ITEM_MARGIN
- },
- [`${componentCls}-selection-search`]: {
- display: 'inline-flex',
- position: 'relative',
- maxWidth: '100%',
- marginInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(selectItemDist).equal(),
- [`
- &-input,
- &-mirror
- `]: {
- height: selectItemHeight,
- fontFamily: token.fontFamily,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(selectItemHeight),
- transition: `all ${token.motionDurationSlow}`
- },
- '&-input': {
- width: '100%',
- minWidth: 4.1 // fix search cursor missing
- },
- '&-mirror': {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- insetInlineEnd: 'auto',
- zIndex: 999,
- whiteSpace: 'pre',
- // fix whitespace wrapping caused width calculation bug
- visibility: 'hidden'
- }
- },
- // ======================= Placeholder =======================
- [`${componentCls}-selection-placeholder`]: {
- position: 'absolute',
- top: '50%',
- insetInlineStart: token.calc(token.inputPaddingHorizontalBase).sub(multipleSelectorUnit.basePadding).equal(),
- insetInlineEnd: token.inputPaddingHorizontalBase,
- transform: 'translateY(-50%)',
- transition: `all ${token.motionDurationSlow}`
- }
- })
- };
- };
- function genSizeStyle(token, suffix) {
- const {
- componentCls
- } = token;
- const suffixCls = suffix ? `${componentCls}-${suffix}` : '';
- const rawStyle = {
- [`${componentCls}-multiple${suffixCls}`]: {
- fontSize: token.fontSize,
- // ========================= Selector =========================
- [`${componentCls}-selector`]: {
- [`${componentCls}-show-search&`]: {
- cursor: 'text'
- }
- },
- [`
- &${componentCls}-show-arrow ${componentCls}-selector,
- &${componentCls}-allow-clear ${componentCls}-selector
- `]: {
- paddingInlineEnd: token.calc(token.fontSizeIcon).add(token.controlPaddingHorizontal).equal()
- }
- }
- };
- return [genSelectionStyle(token, suffix), rawStyle];
- }
- const genMultipleStyle = token => {
- const {
- componentCls
- } = token;
- const smallToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- selectHeight: token.controlHeightSM,
- multipleSelectItemHeight: token.multipleItemHeightSM,
- borderRadius: token.borderRadiusSM,
- borderRadiusSM: token.borderRadiusXS
- });
- const largeToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- fontSize: token.fontSizeLG,
- selectHeight: token.controlHeightLG,
- multipleSelectItemHeight: token.multipleItemHeightLG,
- borderRadius: token.borderRadiusLG,
- borderRadiusSM: token.borderRadius
- });
- return [genSizeStyle(token),
- // ======================== Small ========================
- genSizeStyle(smallToken, 'sm'),
- // Padding
- {
- [`${componentCls}-multiple${componentCls}-sm`]: {
- [`${componentCls}-selection-placeholder`]: {
- insetInline: token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal()
- },
- // https://github.com/ant-design/ant-design/issues/29559
- [`${componentCls}-selection-search`]: {
- marginInlineStart: 2 // Magic Number
- }
- }
- },
- // ======================== Large ========================
- genSizeStyle(largeToken, 'lg')];
- };
- /* harmony default export */ __webpack_exports__["default"] = (genMultipleStyle);
- /***/ }),
- /***/ "./components/skeleton/style/index.ts":
- /*!********************************************!*\
- !*** ./components/skeleton/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const skeletonClsLoading = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes(`ant-skeleton-loading`, {
- '0%': {
- backgroundPosition: '100% 50%'
- },
- '100%': {
- backgroundPosition: '0 50%'
- }
- });
- const genSkeletonElementCommonSize = size => ({
- height: size,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(size)
- });
- const genSkeletonElementAvatarSize = size => Object.assign({
- width: size
- }, genSkeletonElementCommonSize(size));
- const genSkeletonColor = token => ({
- background: token.skeletonLoadingBackground,
- backgroundSize: '400% 100%',
- animationName: skeletonClsLoading,
- animationDuration: token.skeletonLoadingMotionDuration,
- animationTimingFunction: 'ease',
- animationIterationCount: 'infinite'
- });
- const genSkeletonElementInputSize = (size, calc) => Object.assign({
- width: calc(size).mul(5).equal(),
- minWidth: calc(size).mul(5).equal()
- }, genSkeletonElementCommonSize(size));
- const genSkeletonElementAvatar = token => {
- const {
- skeletonAvatarCls,
- gradientFromColor,
- controlHeight,
- controlHeightLG,
- controlHeightSM
- } = token;
- return {
- [skeletonAvatarCls]: Object.assign({
- display: 'inline-block',
- verticalAlign: 'top',
- background: gradientFromColor
- }, genSkeletonElementAvatarSize(controlHeight)),
- [`${skeletonAvatarCls}${skeletonAvatarCls}-circle`]: {
- borderRadius: '50%'
- },
- [`${skeletonAvatarCls}${skeletonAvatarCls}-lg`]: Object.assign({}, genSkeletonElementAvatarSize(controlHeightLG)),
- [`${skeletonAvatarCls}${skeletonAvatarCls}-sm`]: Object.assign({}, genSkeletonElementAvatarSize(controlHeightSM))
- };
- };
- const genSkeletonElementInput = token => {
- const {
- controlHeight,
- borderRadiusSM,
- skeletonInputCls,
- controlHeightLG,
- controlHeightSM,
- gradientFromColor,
- calc
- } = token;
- return {
- [skeletonInputCls]: Object.assign({
- display: 'inline-block',
- verticalAlign: 'top',
- background: gradientFromColor,
- borderRadius: borderRadiusSM
- }, genSkeletonElementInputSize(controlHeight, calc)),
- [`${skeletonInputCls}-lg`]: Object.assign({}, genSkeletonElementInputSize(controlHeightLG, calc)),
- [`${skeletonInputCls}-sm`]: Object.assign({}, genSkeletonElementInputSize(controlHeightSM, calc))
- };
- };
- const genSkeletonElementImageSize = size => Object.assign({
- width: size
- }, genSkeletonElementCommonSize(size));
- const genSkeletonElementImage = token => {
- const {
- skeletonImageCls,
- imageSizeBase,
- gradientFromColor,
- borderRadiusSM,
- calc
- } = token;
- return {
- [skeletonImageCls]: Object.assign(Object.assign({
- display: 'inline-flex',
- alignItems: 'center',
- justifyContent: 'center',
- verticalAlign: 'middle',
- background: gradientFromColor,
- borderRadius: borderRadiusSM
- }, genSkeletonElementImageSize(calc(imageSizeBase).mul(2).equal())), {
- [`${skeletonImageCls}-path`]: {
- fill: '#bfbfbf'
- },
- [`${skeletonImageCls}-svg`]: Object.assign(Object.assign({}, genSkeletonElementImageSize(imageSizeBase)), {
- maxWidth: calc(imageSizeBase).mul(4).equal(),
- maxHeight: calc(imageSizeBase).mul(4).equal()
- }),
- [`${skeletonImageCls}-svg${skeletonImageCls}-svg-circle`]: {
- borderRadius: '50%'
- }
- }),
- [`${skeletonImageCls}${skeletonImageCls}-circle`]: {
- borderRadius: '50%'
- }
- };
- };
- const genSkeletonElementButtonShape = (token, size, buttonCls) => {
- const {
- skeletonButtonCls
- } = token;
- return {
- [`${buttonCls}${skeletonButtonCls}-circle`]: {
- width: size,
- minWidth: size,
- borderRadius: '50%'
- },
- [`${buttonCls}${skeletonButtonCls}-round`]: {
- borderRadius: size
- }
- };
- };
- const genSkeletonElementButtonSize = (size, calc) => Object.assign({
- width: calc(size).mul(2).equal(),
- minWidth: calc(size).mul(2).equal()
- }, genSkeletonElementCommonSize(size));
- const genSkeletonElementButton = token => {
- const {
- borderRadiusSM,
- skeletonButtonCls,
- controlHeight,
- controlHeightLG,
- controlHeightSM,
- gradientFromColor,
- calc
- } = token;
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- [skeletonButtonCls]: Object.assign({
- display: 'inline-block',
- verticalAlign: 'top',
- background: gradientFromColor,
- borderRadius: borderRadiusSM,
- width: calc(controlHeight).mul(2).equal(),
- minWidth: calc(controlHeight).mul(2).equal()
- }, genSkeletonElementButtonSize(controlHeight, calc))
- }, genSkeletonElementButtonShape(token, controlHeight, skeletonButtonCls)), {
- [`${skeletonButtonCls}-lg`]: Object.assign({}, genSkeletonElementButtonSize(controlHeightLG, calc))
- }), genSkeletonElementButtonShape(token, controlHeightLG, `${skeletonButtonCls}-lg`)), {
- [`${skeletonButtonCls}-sm`]: Object.assign({}, genSkeletonElementButtonSize(controlHeightSM, calc))
- }), genSkeletonElementButtonShape(token, controlHeightSM, `${skeletonButtonCls}-sm`));
- };
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- skeletonAvatarCls,
- skeletonTitleCls,
- skeletonParagraphCls,
- skeletonButtonCls,
- skeletonInputCls,
- skeletonImageCls,
- controlHeight,
- controlHeightLG,
- controlHeightSM,
- gradientFromColor,
- padding,
- marginSM,
- borderRadius,
- titleHeight,
- blockRadius,
- paragraphLiHeight,
- controlHeightXS,
- paragraphMarginTop
- } = token;
- return {
- [componentCls]: {
- display: 'table',
- width: '100%',
- [`${componentCls}-header`]: {
- display: 'table-cell',
- paddingInlineEnd: padding,
- verticalAlign: 'top',
- // Avatar
- [skeletonAvatarCls]: Object.assign({
- display: 'inline-block',
- verticalAlign: 'top',
- background: gradientFromColor
- }, genSkeletonElementAvatarSize(controlHeight)),
- [`${skeletonAvatarCls}-circle`]: {
- borderRadius: '50%'
- },
- [`${skeletonAvatarCls}-lg`]: Object.assign({}, genSkeletonElementAvatarSize(controlHeightLG)),
- [`${skeletonAvatarCls}-sm`]: Object.assign({}, genSkeletonElementAvatarSize(controlHeightSM))
- },
- [`${componentCls}-content`]: {
- display: 'table-cell',
- width: '100%',
- verticalAlign: 'top',
- // Title
- [skeletonTitleCls]: {
- width: '100%',
- height: titleHeight,
- background: gradientFromColor,
- borderRadius: blockRadius,
- [`+ ${skeletonParagraphCls}`]: {
- marginBlockStart: controlHeightSM
- }
- },
- // paragraph
- [skeletonParagraphCls]: {
- padding: 0,
- '> li': {
- width: '100%',
- height: paragraphLiHeight,
- listStyle: 'none',
- background: gradientFromColor,
- borderRadius: blockRadius,
- '+ li': {
- marginBlockStart: controlHeightXS
- }
- }
- },
- [`${skeletonParagraphCls}> li:last-child:not(:first-child):not(:nth-child(2))`]: {
- width: '61%'
- }
- },
- [`&-round ${componentCls}-content`]: {
- [`${skeletonTitleCls}, ${skeletonParagraphCls} > li`]: {
- borderRadius
- }
- }
- },
- [`${componentCls}-with-avatar ${componentCls}-content`]: {
- // Title
- [skeletonTitleCls]: {
- marginBlockStart: marginSM,
- [`+ ${skeletonParagraphCls}`]: {
- marginBlockStart: paragraphMarginTop
- }
- }
- },
- // Skeleton element
- [`${componentCls}${componentCls}-element`]: Object.assign(Object.assign(Object.assign(Object.assign({
- display: 'inline-block',
- width: 'auto'
- }, genSkeletonElementButton(token)), genSkeletonElementAvatar(token)), genSkeletonElementInput(token)), genSkeletonElementImage(token)),
- // Skeleton Block Button, Input
- [`${componentCls}${componentCls}-block`]: {
- width: '100%',
- [skeletonButtonCls]: {
- width: '100%'
- },
- [skeletonInputCls]: {
- width: '100%'
- }
- },
- // With active animation
- [`${componentCls}${componentCls}-active`]: {
- [`
- ${skeletonTitleCls},
- ${skeletonParagraphCls} > li,
- ${skeletonAvatarCls},
- ${skeletonButtonCls},
- ${skeletonInputCls},
- ${skeletonImageCls}
- `]: Object.assign({}, genSkeletonColor(token))
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- colorFillContent,
- colorFill
- } = token;
- const gradientFromColor = colorFillContent;
- const gradientToColor = colorFill;
- return {
- color: gradientFromColor,
- colorGradientEnd: gradientToColor,
- gradientFromColor,
- gradientToColor,
- titleHeight: token.controlHeight / 2,
- blockRadius: token.borderRadiusSM,
- paragraphMarginTop: token.marginLG + token.marginXXS,
- paragraphLiHeight: token.controlHeight / 2
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Skeleton', token => {
- const {
- componentCls,
- calc
- } = token;
- const skeletonToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.mergeToken)(token, {
- skeletonAvatarCls: `${componentCls}-avatar`,
- skeletonTitleCls: `${componentCls}-title`,
- skeletonParagraphCls: `${componentCls}-paragraph`,
- skeletonButtonCls: `${componentCls}-button`,
- skeletonInputCls: `${componentCls}-input`,
- skeletonImageCls: `${componentCls}-image`,
- imageSizeBase: calc(token.controlHeight).mul(1.5).equal(),
- borderRadius: 100,
- // Large number to make capsule shape
- skeletonLoadingBackground: `linear-gradient(90deg, ${token.gradientFromColor} 25%, ${token.gradientToColor} 37%, ${token.gradientFromColor} 63%)`,
- skeletonLoadingMotionDuration: '1.4s'
- });
- return genBaseStyle(skeletonToken);
- }, prepareComponentToken, {
- deprecatedTokens: [['color', 'gradientFromColor'], ['colorGradientEnd', 'gradientToColor']]
- }));
- /***/ }),
- /***/ "./components/slider/style/index.ts":
- /*!******************************************!*\
- !*** ./components/slider/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- antCls,
- controlSize,
- dotSize,
- marginFull,
- marginPart,
- colorFillContentHover,
- handleColorDisabled,
- calc,
- handleSize,
- handleSizeHover,
- handleActiveColor,
- handleActiveOutlineColor,
- handleLineWidth,
- handleLineWidthHover,
- motionDurationMid
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- position: 'relative',
- height: controlSize,
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginPart)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginFull)}`,
- padding: 0,
- cursor: 'pointer',
- touchAction: 'none',
- '&-vertical': {
- margin: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginFull)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginPart)}`
- },
- [`${componentCls}-rail`]: {
- position: 'absolute',
- backgroundColor: token.railBg,
- borderRadius: token.borderRadiusXS,
- transition: `background-color ${motionDurationMid}`
- },
- [`${componentCls}-track,${componentCls}-tracks`]: {
- position: 'absolute',
- transition: `background-color ${motionDurationMid}`
- },
- [`${componentCls}-track`]: {
- backgroundColor: token.trackBg,
- borderRadius: token.borderRadiusXS
- },
- [`${componentCls}-track-draggable`]: {
- boxSizing: 'content-box',
- backgroundClip: 'content-box',
- border: 'solid rgba(0,0,0,0)'
- },
- '&:hover': {
- [`${componentCls}-rail`]: {
- backgroundColor: token.railHoverBg
- },
- [`${componentCls}-track`]: {
- backgroundColor: token.trackHoverBg
- },
- [`${componentCls}-dot`]: {
- borderColor: colorFillContentHover
- },
- [`${componentCls}-handle::after`]: {
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(handleLineWidth)} ${token.colorPrimaryBorderHover}`
- },
- [`${componentCls}-dot-active`]: {
- borderColor: token.dotActiveBorderColor
- }
- },
- [`${componentCls}-handle`]: {
- position: 'absolute',
- width: handleSize,
- height: handleSize,
- outline: 'none',
- userSelect: 'none',
- // Dragging status
- '&-dragging-delete': {
- opacity: 0
- },
- // 扩大选区
- '&::before': {
- content: '""',
- position: 'absolute',
- insetInlineStart: calc(handleLineWidth).mul(-1).equal(),
- insetBlockStart: calc(handleLineWidth).mul(-1).equal(),
- width: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),
- height: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),
- backgroundColor: 'transparent'
- },
- '&::after': {
- content: '""',
- position: 'absolute',
- insetBlockStart: 0,
- insetInlineStart: 0,
- width: handleSize,
- height: handleSize,
- backgroundColor: token.colorBgElevated,
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(handleLineWidth)} ${token.handleColor}`,
- outline: `0px solid transparent`,
- borderRadius: '50%',
- cursor: 'pointer',
- transition: `
- inset-inline-start ${motionDurationMid},
- inset-block-start ${motionDurationMid},
- width ${motionDurationMid},
- height ${motionDurationMid},
- box-shadow ${motionDurationMid},
- outline ${motionDurationMid}
- `
- },
- '&:hover, &:active, &:focus': {
- '&::before': {
- insetInlineStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).mul(-1).equal(),
- insetBlockStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).mul(-1).equal(),
- width: calc(handleSizeHover).add(calc(handleLineWidthHover).mul(2)).equal(),
- height: calc(handleSizeHover).add(calc(handleLineWidthHover).mul(2)).equal()
- },
- '&::after': {
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(handleLineWidthHover)} ${handleActiveColor}`,
- outline: `6px solid ${handleActiveOutlineColor}`,
- width: handleSizeHover,
- height: handleSizeHover,
- insetInlineStart: token.calc(handleSize).sub(handleSizeHover).div(2).equal(),
- insetBlockStart: token.calc(handleSize).sub(handleSizeHover).div(2).equal()
- }
- }
- },
- [`&-lock ${componentCls}-handle`]: {
- '&::before, &::after': {
- transition: 'none'
- }
- },
- [`${componentCls}-mark`]: {
- position: 'absolute',
- fontSize: token.fontSize
- },
- [`${componentCls}-mark-text`]: {
- position: 'absolute',
- display: 'inline-block',
- color: token.colorTextDescription,
- textAlign: 'center',
- wordBreak: 'keep-all',
- cursor: 'pointer',
- userSelect: 'none',
- '&-active': {
- color: token.colorText
- }
- },
- [`${componentCls}-step`]: {
- position: 'absolute',
- background: 'transparent',
- pointerEvents: 'none'
- },
- [`${componentCls}-dot`]: {
- position: 'absolute',
- width: dotSize,
- height: dotSize,
- backgroundColor: token.colorBgElevated,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(handleLineWidth)} solid ${token.dotBorderColor}`,
- borderRadius: '50%',
- cursor: 'pointer',
- transition: `border-color ${token.motionDurationSlow}`,
- pointerEvents: 'auto',
- '&-active': {
- borderColor: token.dotActiveBorderColor
- }
- },
- [`&${componentCls}-disabled`]: {
- cursor: 'not-allowed',
- [`${componentCls}-rail`]: {
- backgroundColor: `${token.railBg} !important`
- },
- [`${componentCls}-track`]: {
- backgroundColor: `${token.trackBgDisabled} !important`
- },
- [`
- ${componentCls}-dot
- `]: {
- backgroundColor: token.colorBgElevated,
- borderColor: token.trackBgDisabled,
- boxShadow: 'none',
- cursor: 'not-allowed'
- },
- [`${componentCls}-handle::after`]: {
- backgroundColor: token.colorBgElevated,
- cursor: 'not-allowed',
- width: handleSize,
- height: handleSize,
- boxShadow: `0 0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(handleLineWidth)} ${handleColorDisabled}`,
- insetInlineStart: 0,
- insetBlockStart: 0
- },
- [`
- ${componentCls}-mark-text,
- ${componentCls}-dot
- `]: {
- cursor: `not-allowed !important`
- }
- },
- [`&-tooltip ${antCls}-tooltip-inner`]: {
- minWidth: 'unset'
- }
- })
- };
- };
- // ============================ Horizontal ============================
- const genDirectionStyle = (token, horizontal) => {
- const {
- componentCls,
- railSize,
- handleSize,
- dotSize,
- marginFull,
- calc
- } = token;
- const railPadding = horizontal ? 'paddingBlock' : 'paddingInline';
- const full = horizontal ? 'width' : 'height';
- const part = horizontal ? 'height' : 'width';
- const handlePos = horizontal ? 'insetBlockStart' : 'insetInlineStart';
- const markInset = horizontal ? 'top' : 'insetInlineStart';
- const handlePosSize = calc(railSize).mul(3).sub(handleSize).div(2).equal();
- const draggableBorderSize = calc(handleSize).sub(railSize).div(2).equal();
- const draggableBorder = horizontal ? {
- borderWidth: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(draggableBorderSize)} 0`,
- transform: `translateY(${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(draggableBorderSize).mul(-1).equal())})`
- } : {
- borderWidth: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(draggableBorderSize)}`,
- transform: `translateX(${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(draggableBorderSize).mul(-1).equal())})`
- };
- return {
- [railPadding]: railSize,
- [part]: calc(railSize).mul(3).equal(),
- [`${componentCls}-rail`]: {
- [full]: '100%',
- [part]: railSize
- },
- [`${componentCls}-track,${componentCls}-tracks`]: {
- [part]: railSize
- },
- [`${componentCls}-track-draggable`]: Object.assign({}, draggableBorder),
- [`${componentCls}-handle`]: {
- [handlePos]: handlePosSize
- },
- [`${componentCls}-mark`]: {
- // Reset all
- insetInlineStart: 0,
- top: 0,
- // https://github.com/ant-design/ant-design/issues/43731
- [markInset]: calc(railSize).mul(3).add(horizontal ? 0 : marginFull).equal(),
- [full]: '100%'
- },
- [`${componentCls}-step`]: {
- // Reset all
- insetInlineStart: 0,
- top: 0,
- [markInset]: railSize,
- [full]: '100%',
- [part]: railSize
- },
- [`${componentCls}-dot`]: {
- position: 'absolute',
- [handlePos]: calc(railSize).sub(dotSize).div(2).equal()
- }
- };
- };
- // ============================ Horizontal ============================
- const genHorizontalStyle = token => {
- const {
- componentCls,
- marginPartWithMark
- } = token;
- return {
- [`${componentCls}-horizontal`]: Object.assign(Object.assign({}, genDirectionStyle(token, true)), {
- [`&${componentCls}-with-marks`]: {
- marginBottom: marginPartWithMark
- }
- })
- };
- };
- // ============================= Vertical =============================
- const genVerticalStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-vertical`]: Object.assign(Object.assign({}, genDirectionStyle(token, false)), {
- height: '100%'
- })
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- // Handle line width is always width-er 1px
- const increaseHandleWidth = 1;
- const controlSize = token.controlHeightLG / 4;
- const controlSizeHover = token.controlHeightSM / 2;
- const handleLineWidth = token.lineWidth + increaseHandleWidth;
- const handleLineWidthHover = token.lineWidth + increaseHandleWidth * 1.5;
- const handleActiveColor = token.colorPrimary;
- const handleActiveOutlineColor = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(handleActiveColor).setA(0.2).toRgbString();
- return {
- controlSize,
- railSize: 4,
- handleSize: controlSize,
- handleSizeHover: controlSizeHover,
- dotSize: 8,
- handleLineWidth,
- handleLineWidthHover,
- railBg: token.colorFillTertiary,
- railHoverBg: token.colorFillSecondary,
- trackBg: token.colorPrimaryBorder,
- trackHoverBg: token.colorPrimaryBorderHover,
- handleColor: token.colorPrimaryBorder,
- handleActiveColor,
- handleActiveOutlineColor,
- handleColorDisabled: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorTextDisabled).onBackground(token.colorBgContainer).toHexString(),
- dotBorderColor: token.colorBorderSecondary,
- dotActiveBorderColor: token.colorPrimaryBorder,
- trackBgDisabled: token.colorBgContainerDisabled
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('Slider', token => {
- const sliderToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- marginPart: token.calc(token.controlHeight).sub(token.controlSize).div(2).equal(),
- marginFull: token.calc(token.controlSize).div(2).equal(),
- marginPartWithMark: token.calc(token.controlHeightLG).sub(token.controlSize).equal()
- });
- return [genBaseStyle(sliderToken), genHorizontalStyle(sliderToken), genVerticalStyle(sliderToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/space/style/index.ts":
- /*!*****************************************************!*\
- !*** ./components/space/style/index.ts + 1 modules ***!
- \*****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/space/style/compact.ts
- const genSpaceCompactStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- '&-block': {
- display: 'flex',
- width: '100%'
- },
- '&-vertical': {
- flexDirection: 'column'
- }
- }
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var compact = (genSpaceCompactStyle);
- ;// ./components/space/style/index.ts
- const genSpaceStyle = token => {
- const {
- componentCls,
- antCls
- } = token;
- return {
- [componentCls]: {
- display: 'inline-flex',
- '&-rtl': {
- direction: 'rtl'
- },
- '&-vertical': {
- flexDirection: 'column'
- },
- '&-align': {
- flexDirection: 'column',
- '&-center': {
- alignItems: 'center'
- },
- '&-start': {
- alignItems: 'flex-start'
- },
- '&-end': {
- alignItems: 'flex-end'
- },
- '&-baseline': {
- alignItems: 'baseline'
- }
- },
- [`${componentCls}-item:empty`]: {
- display: 'none'
- },
- // https://github.com/ant-design/ant-design/issues/47875
- [`${componentCls}-item > ${antCls}-badge-not-a-wrapper:only-child`]: {
- display: 'block'
- }
- }
- };
- };
- const genSpaceGapStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [componentCls]: {
- '&-gap-row-small': {
- rowGap: token.spaceGapSmallSize
- },
- '&-gap-row-middle': {
- rowGap: token.spaceGapMiddleSize
- },
- '&-gap-row-large': {
- rowGap: token.spaceGapLargeSize
- },
- '&-gap-col-small': {
- columnGap: token.spaceGapSmallSize
- },
- '&-gap-col-middle': {
- columnGap: token.spaceGapMiddleSize
- },
- '&-gap-col-large': {
- columnGap: token.spaceGapLargeSize
- }
- }
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = () => ({});
- /* harmony default export */ var style = ((0,genStyleUtils.genStyleHooks)('Space', token => {
- const spaceToken = (0,es.mergeToken)(token, {
- spaceGapSmallSize: token.paddingXS,
- spaceGapMiddleSize: token.padding,
- spaceGapLargeSize: token.paddingLG
- });
- return [genSpaceStyle(spaceToken), genSpaceGapStyle(spaceToken), compact(spaceToken)];
- }, () => ({}), {
- // Space component don't apply extra font style
- // https://github.com/ant-design/ant-design/issues/40315
- resetStyle: false
- }));
- /***/ }),
- /***/ "./components/spin/style/index.ts":
- /*!****************************************!*\
- !*** ./components/spin/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const antSpinMove = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSpinMove', {
- to: {
- opacity: 1
- }
- });
- const antRotate = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antRotate', {
- to: {
- transform: 'rotate(405deg)'
- }
- });
- const genSpinStyle = token => {
- const {
- componentCls,
- calc
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'absolute',
- display: 'none',
- color: token.colorPrimary,
- fontSize: 0,
- textAlign: 'center',
- verticalAlign: 'middle',
- opacity: 0,
- transition: `transform ${token.motionDurationSlow} ${token.motionEaseInOutCirc}`,
- '&-spinning': {
- position: 'relative',
- display: 'inline-block',
- opacity: 1
- },
- [`${componentCls}-text`]: {
- fontSize: token.fontSize,
- paddingTop: calc(calc(token.dotSize).sub(token.fontSize)).div(2).add(2).equal()
- },
- '&-fullscreen': {
- position: 'fixed',
- width: '100vw',
- height: '100vh',
- backgroundColor: token.colorBgMask,
- zIndex: token.zIndexPopupBase,
- inset: 0,
- display: 'flex',
- alignItems: 'center',
- flexDirection: 'column',
- justifyContent: 'center',
- opacity: 0,
- visibility: 'hidden',
- transition: `all ${token.motionDurationMid}`,
- '&-show': {
- opacity: 1,
- visibility: 'visible'
- },
- [componentCls]: {
- [`${componentCls}-dot-holder`]: {
- color: token.colorWhite
- },
- [`${componentCls}-text`]: {
- color: token.colorTextLightSolid
- }
- }
- },
- '&-nested-loading': {
- position: 'relative',
- [`> div > ${componentCls}`]: {
- position: 'absolute',
- top: 0,
- insetInlineStart: 0,
- zIndex: 4,
- display: 'block',
- width: '100%',
- height: '100%',
- maxHeight: token.contentHeight,
- [`${componentCls}-dot`]: {
- position: 'absolute',
- top: '50%',
- insetInlineStart: '50%',
- margin: calc(token.dotSize).mul(-1).div(2).equal()
- },
- [`${componentCls}-text`]: {
- position: 'absolute',
- top: '50%',
- width: '100%',
- textShadow: `0 1px 2px ${token.colorBgContainer}` // FIXME: shadow
- },
- [`&${componentCls}-show-text ${componentCls}-dot`]: {
- marginTop: calc(token.dotSize).div(2).mul(-1).sub(10).equal()
- },
- '&-sm': {
- [`${componentCls}-dot`]: {
- margin: calc(token.dotSizeSM).mul(-1).div(2).equal()
- },
- [`${componentCls}-text`]: {
- paddingTop: calc(calc(token.dotSizeSM).sub(token.fontSize)).div(2).add(2).equal()
- },
- [`&${componentCls}-show-text ${componentCls}-dot`]: {
- marginTop: calc(token.dotSizeSM).div(2).mul(-1).sub(10).equal()
- }
- },
- '&-lg': {
- [`${componentCls}-dot`]: {
- margin: calc(token.dotSizeLG).mul(-1).div(2).equal()
- },
- [`${componentCls}-text`]: {
- paddingTop: calc(calc(token.dotSizeLG).sub(token.fontSize)).div(2).add(2).equal()
- },
- [`&${componentCls}-show-text ${componentCls}-dot`]: {
- marginTop: calc(token.dotSizeLG).div(2).mul(-1).sub(10).equal()
- }
- }
- },
- [`${componentCls}-container`]: {
- position: 'relative',
- transition: `opacity ${token.motionDurationSlow}`,
- '&::after': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- zIndex: 10,
- width: '100%',
- height: '100%',
- background: token.colorBgContainer,
- opacity: 0,
- transition: `all ${token.motionDurationSlow}`,
- content: '""',
- pointerEvents: 'none'
- }
- },
- [`${componentCls}-blur`]: {
- clear: 'both',
- opacity: 0.5,
- userSelect: 'none',
- pointerEvents: 'none',
- '&::after': {
- opacity: 0.4,
- pointerEvents: 'auto'
- }
- }
- },
- // tip
- // ------------------------------
- '&-tip': {
- color: token.spinDotDefault
- },
- // holder
- // ------------------------------
- [`${componentCls}-dot-holder`]: {
- width: '1em',
- height: '1em',
- fontSize: token.dotSize,
- display: 'inline-block',
- transition: `transform ${token.motionDurationSlow} ease, opacity ${token.motionDurationSlow} ease`,
- transformOrigin: '50% 50%',
- lineHeight: 1,
- color: token.colorPrimary,
- '&-hidden': {
- transform: 'scale(0.3)',
- opacity: 0
- }
- },
- // progress
- // ------------------------------
- [`${componentCls}-dot-progress`]: {
- position: 'absolute',
- inset: 0
- },
- // dots
- // ------------------------------
- [`${componentCls}-dot`]: {
- position: 'relative',
- display: 'inline-block',
- fontSize: token.dotSize,
- width: '1em',
- height: '1em',
- '&-item': {
- position: 'absolute',
- display: 'block',
- width: calc(token.dotSize).sub(calc(token.marginXXS).div(2)).div(2).equal(),
- height: calc(token.dotSize).sub(calc(token.marginXXS).div(2)).div(2).equal(),
- background: 'currentColor',
- borderRadius: '100%',
- transform: 'scale(0.75)',
- transformOrigin: '50% 50%',
- opacity: 0.3,
- animationName: antSpinMove,
- animationDuration: '1s',
- animationIterationCount: 'infinite',
- animationTimingFunction: 'linear',
- animationDirection: 'alternate',
- '&:nth-child(1)': {
- top: 0,
- insetInlineStart: 0,
- animationDelay: '0s'
- },
- '&:nth-child(2)': {
- top: 0,
- insetInlineEnd: 0,
- animationDelay: '0.4s'
- },
- '&:nth-child(3)': {
- insetInlineEnd: 0,
- bottom: 0,
- animationDelay: '0.8s'
- },
- '&:nth-child(4)': {
- bottom: 0,
- insetInlineStart: 0,
- animationDelay: '1.2s'
- }
- },
- '&-spin': {
- transform: 'rotate(45deg)',
- animationName: antRotate,
- animationDuration: '1.2s',
- animationIterationCount: 'infinite',
- animationTimingFunction: 'linear'
- },
- '&-circle': {
- strokeLinecap: 'round',
- transition: ['stroke-dashoffset', 'stroke-dasharray', 'stroke', 'stroke-width', 'opacity'].map(item => `${item} ${token.motionDurationSlow} ease`).join(','),
- fillOpacity: 0,
- stroke: 'currentcolor'
- },
- '&-circle-bg': {
- stroke: token.colorFillSecondary
- }
- },
- // small
- [`&-sm ${componentCls}-dot`]: {
- '&, &-holder': {
- fontSize: token.dotSizeSM
- }
- },
- [`&-sm ${componentCls}-dot-holder`]: {
- i: {
- width: calc(calc(token.dotSizeSM).sub(calc(token.marginXXS).div(2))).div(2).equal(),
- height: calc(calc(token.dotSizeSM).sub(calc(token.marginXXS).div(2))).div(2).equal()
- }
- },
- // large
- [`&-lg ${componentCls}-dot`]: {
- '&, &-holder': {
- fontSize: token.dotSizeLG
- }
- },
- [`&-lg ${componentCls}-dot-holder`]: {
- i: {
- width: calc(calc(token.dotSizeLG).sub(token.marginXXS)).div(2).equal(),
- height: calc(calc(token.dotSizeLG).sub(token.marginXXS)).div(2).equal()
- }
- },
- [`&${componentCls}-show-text ${componentCls}-text`]: {
- display: 'block'
- }
- })
- };
- };
- const prepareComponentToken = token => {
- const {
- controlHeightLG,
- controlHeight
- } = token;
- return {
- contentHeight: 400,
- dotSize: controlHeightLG / 2,
- dotSizeSM: controlHeightLG * 0.35,
- dotSizeLG: controlHeight
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Spin', token => {
- const spinToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- spinDotDefault: token.colorTextDescription
- });
- return genSpinStyle(spinToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/splitter/style/index.ts":
- /*!********************************************!*\
- !*** ./components/splitter/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genRtlStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`&-rtl${componentCls}-horizontal`]: {
- [`> ${componentCls}-bar`]: {
- [`${componentCls}-bar-collapse-previous`]: {
- insetInlineEnd: 0,
- insetInlineStart: 'unset'
- },
- [`${componentCls}-bar-collapse-next`]: {
- insetInlineEnd: 'unset',
- insetInlineStart: 0
- }
- }
- },
- [`&-rtl${componentCls}-vertical`]: {
- [`> ${componentCls}-bar`]: {
- [`${componentCls}-bar-collapse-previous`]: {
- insetInlineEnd: '50%',
- insetInlineStart: 'unset'
- },
- [`${componentCls}-bar-collapse-next`]: {
- insetInlineEnd: '50%',
- insetInlineStart: 'unset'
- }
- }
- }
- };
- };
- const centerStyle = {
- position: 'absolute',
- top: '50%',
- left: {
- _skip_check_: true,
- value: '50%'
- },
- transform: 'translate(-50%, -50%)'
- };
- const genSplitterStyle = token => {
- const {
- componentCls,
- colorFill,
- splitBarDraggableSize,
- splitBarSize,
- splitTriggerSize,
- controlItemBgHover,
- controlItemBgActive,
- controlItemBgActiveHover,
- prefixCls
- } = token;
- const splitBarCls = `${componentCls}-bar`;
- const splitMaskCls = `${componentCls}-mask`;
- const splitPanelCls = `${componentCls}-panel`;
- const halfTriggerSize = token.calc(splitTriggerSize).div(2).equal();
- const splitterBarPreviewOffsetVar = `${prefixCls}-bar-preview-offset`;
- const splitterBarPreviewStyle = {
- position: 'absolute',
- background: token.colorPrimary,
- opacity: 0.2,
- pointerEvents: 'none',
- transition: 'none',
- zIndex: 1,
- display: 'none'
- };
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__.resetComponent)(token)), {
- display: 'flex',
- width: '100%',
- height: '100%',
- alignItems: 'stretch',
- // ======================== SplitBar ========================
- // Use `>` to avoid conflict with mix layout
- [`> ${splitBarCls}`]: {
- flex: 'none',
- position: 'relative',
- userSelect: 'none',
- // ======================= Dragger =======================
- [`${splitBarCls}-dragger`]: Object.assign(Object.assign({}, centerStyle), {
- zIndex: 1,
- // Hover background
- '&::before': Object.assign({
- content: '""',
- background: controlItemBgHover
- }, centerStyle),
- // Spinner
- '&::after': Object.assign({
- content: '""',
- background: colorFill
- }, centerStyle),
- // Hover
- [`&:hover:not(${splitBarCls}-dragger-active)`]: {
- '&::before': {
- background: controlItemBgActive
- }
- },
- // Active
- '&-active': {
- zIndex: 2,
- '&::before': {
- background: controlItemBgActiveHover
- }
- },
- // Disabled, not use `pointer-events: none` since still need trigger collapse
- [`&-disabled${splitBarCls}-dragger`]: {
- zIndex: 0,
- '&, &:hover, &-active': {
- cursor: 'default',
- '&::before': {
- background: controlItemBgHover
- }
- },
- '&::after': {
- display: 'none'
- }
- }
- }),
- // ======================= Collapse =======================
- [`${splitBarCls}-collapse-bar`]: Object.assign(Object.assign({}, centerStyle), {
- zIndex: token.zIndexPopupBase,
- background: controlItemBgHover,
- fontSize: token.fontSizeSM,
- borderRadius: token.borderRadiusXS,
- color: token.colorText,
- cursor: 'pointer',
- opacity: 0,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- // Hover
- '&:hover': {
- background: controlItemBgActive
- },
- // Active
- '&:active': {
- background: controlItemBgActiveHover
- }
- }),
- '&:hover, &:active': {
- [`${splitBarCls}-collapse-bar-hover-only`]: {
- opacity: 1
- }
- },
- [`${splitBarCls}-collapse-bar-hover-only`]: {
- '@media(hover:none)': {
- opacity: 1
- }
- },
- [`${splitBarCls}-collapse-bar-always-hidden`]: {
- display: 'none'
- },
- [`${splitBarCls}-collapse-bar-always-visible`]: {
- opacity: 1
- }
- },
- // =========================== Mask =========================
- // Util dom for handle cursor
- [splitMaskCls]: {
- position: 'fixed',
- zIndex: token.zIndexPopupBase,
- inset: 0,
- '&-horizontal': {
- cursor: 'col-resize'
- },
- '&-vertical': {
- cursor: 'row-resize'
- }
- },
- // ==========================================================
- // == Layout ==
- // ==========================================================
- '&-horizontal': {
- flexDirection: 'row',
- [`> ${splitBarCls}`]: {
- width: 0,
- // ======================= Preview =======================
- [`${splitBarCls}-preview`]: Object.assign(Object.assign({
- height: '100%',
- width: splitBarSize
- }, splitterBarPreviewStyle), {
- [`&${splitBarCls}-preview-active`]: {
- display: 'block',
- transform: `translateX(var(--${splitterBarPreviewOffsetVar}))`
- }
- }),
- // ======================= Dragger =======================
- [`${splitBarCls}-dragger`]: {
- cursor: 'col-resize',
- height: '100%',
- width: splitTriggerSize,
- '&::before': {
- height: '100%',
- width: splitBarSize
- },
- '&::after': {
- height: splitBarDraggableSize,
- width: splitBarSize
- }
- },
- // ======================= Collapse =======================
- [`${splitBarCls}-collapse-bar`]: {
- width: token.fontSizeSM,
- height: token.controlHeightSM,
- '&-start': {
- left: {
- _skip_check_: true,
- value: 'auto'
- },
- right: {
- _skip_check_: true,
- value: halfTriggerSize
- },
- transform: 'translateY(-50%)'
- },
- '&-end': {
- left: {
- _skip_check_: true,
- value: halfTriggerSize
- },
- right: {
- _skip_check_: true,
- value: 'auto'
- },
- transform: 'translateY(-50%)'
- }
- }
- }
- },
- '&-vertical': {
- flexDirection: 'column',
- [`> ${splitBarCls}`]: {
- height: 0,
- // ======================= Preview =======================
- [`${splitBarCls}-preview`]: Object.assign(Object.assign({
- height: splitBarSize,
- width: '100%'
- }, splitterBarPreviewStyle), {
- [`&${splitBarCls}-preview-active`]: {
- display: 'block',
- transform: `translateY(var(--${splitterBarPreviewOffsetVar}))`
- }
- }),
- // ======================= Dragger =======================
- [`${splitBarCls}-dragger`]: {
- cursor: 'row-resize',
- width: '100%',
- height: splitTriggerSize,
- '&::before': {
- width: '100%',
- height: splitBarSize
- },
- '&::after': {
- width: splitBarDraggableSize,
- height: splitBarSize
- }
- },
- // ======================= Collapse =======================
- [`${splitBarCls}-collapse-bar`]: {
- height: token.fontSizeSM,
- width: token.controlHeightSM,
- '&-start': {
- top: 'auto',
- bottom: halfTriggerSize,
- transform: 'translateX(-50%)'
- },
- '&-end': {
- top: halfTriggerSize,
- bottom: 'auto',
- transform: 'translateX(-50%)'
- }
- }
- }
- },
- // ========================= Panels =========================
- [splitPanelCls]: {
- overflow: 'auto',
- padding: '0 1px',
- scrollbarWidth: 'thin',
- boxSizing: 'border-box',
- '&-hidden': {
- padding: 0,
- overflow: 'hidden'
- },
- [`&:has(${componentCls}:only-child)`]: {
- overflow: 'hidden'
- }
- }
- }), genRtlStyle(token))
- };
- };
- const prepareComponentToken = token => {
- var _a;
- const splitBarSize = token.splitBarSize || 2;
- const splitTriggerSize = token.splitTriggerSize || 6;
- // https://github.com/ant-design/ant-design/pull/51223
- const resizeSpinnerSize = token.resizeSpinnerSize || 20;
- const splitBarDraggableSize = (_a = token.splitBarDraggableSize) !== null && _a !== void 0 ? _a : resizeSpinnerSize;
- return {
- splitBarSize,
- splitTriggerSize,
- splitBarDraggableSize,
- resizeSpinnerSize
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.genStyleHooks)('Splitter', genSplitterStyle, prepareComponentToken));
- /***/ }),
- /***/ "./components/statistic/style/index.ts":
- /*!*********************************************!*\
- !*** ./components/statistic/style/index.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genStatisticStyle = token => {
- const {
- componentCls,
- marginXXS,
- padding,
- colorTextDescription,
- titleFontSize,
- colorTextHeading,
- contentFontSize,
- fontFamily
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__.resetComponent)(token)), {
- [`${componentCls}-title`]: {
- marginBottom: marginXXS,
- color: colorTextDescription,
- fontSize: titleFontSize
- },
- [`${componentCls}-skeleton`]: {
- paddingTop: padding
- },
- [`${componentCls}-content`]: {
- color: colorTextHeading,
- fontSize: contentFontSize,
- fontFamily,
- [`${componentCls}-content-value`]: {
- display: 'inline-block',
- direction: 'ltr'
- },
- [`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
- display: 'inline-block'
- },
- [`${componentCls}-content-prefix`]: {
- marginInlineEnd: marginXXS
- },
- [`${componentCls}-content-suffix`]: {
- marginInlineStart: marginXXS
- }
- }
- })
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- fontSizeHeading3,
- fontSize
- } = token;
- return {
- titleFontSize: fontSize,
- contentFontSize: fontSizeHeading3
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.genStyleHooks)('Statistic', token => {
- const statisticToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__.mergeToken)(token, {});
- return genStatisticStyle(statisticToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/steps/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/steps/style/index.ts + 10 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ steps_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/steps/style/custom-icon.ts
- const genStepsCustomIconStyle = token => {
- const {
- componentCls,
- customIconTop,
- customIconSize,
- customIconFontSize
- } = token;
- return {
- [`${componentCls}-item-custom`]: {
- [`> ${componentCls}-item-container > ${componentCls}-item-icon`]: {
- height: 'auto',
- background: 'none',
- border: 0,
- [`> ${componentCls}-icon`]: {
- top: customIconTop,
- width: customIconSize,
- height: customIconSize,
- fontSize: customIconFontSize,
- lineHeight: (0,cssinjs.unit)(customIconSize)
- }
- }
- },
- // Only adjust horizontal customize icon width
- [`&:not(${componentCls}-vertical)`]: {
- [`${componentCls}-item-custom`]: {
- [`${componentCls}-item-icon`]: {
- width: 'auto',
- background: 'none'
- }
- }
- }
- };
- };
- /* harmony default export */ var custom_icon = (genStepsCustomIconStyle);
- ;// ./components/steps/style/horizontal.ts
- const genHorizontalStyle = token => {
- const {
- componentCls
- } = token;
- const stepsItemCls = `${componentCls}-item`; // .ant-steps-item
- return {
- [`${componentCls}-horizontal`]: {
- [`${stepsItemCls}-tail`]: {
- transform: 'translateY(-50%)'
- }
- }
- };
- };
- /* harmony default export */ var horizontal = (genHorizontalStyle);
- ;// ./components/steps/style/inline.ts
- const genStepsInlineStyle = token => {
- const {
- componentCls,
- inlineDotSize,
- inlineTitleColor,
- inlineTailColor
- } = token;
- const containerPaddingTop = token.calc(token.paddingXS).add(token.lineWidth).equal();
- const titleStyle = {
- [`${componentCls}-item-container ${componentCls}-item-content ${componentCls}-item-title`]: {
- color: inlineTitleColor
- }
- };
- return {
- [`&${componentCls}-inline`]: {
- width: 'auto',
- display: 'inline-flex',
- [`${componentCls}-item`]: {
- flex: 'none',
- '&-container': {
- padding: `${(0,cssinjs.unit)(containerPaddingTop)} ${(0,cssinjs.unit)(token.paddingXXS)} 0`,
- margin: `0 ${(0,cssinjs.unit)(token.calc(token.marginXXS).div(2).equal())}`,
- borderRadius: token.borderRadiusSM,
- cursor: 'pointer',
- transition: `background-color ${token.motionDurationMid}`,
- '&:hover': {
- background: token.controlItemBgHover
- },
- "&[role='button']:hover": {
- opacity: 1
- }
- },
- '&-icon': {
- width: inlineDotSize,
- height: inlineDotSize,
- marginInlineStart: `calc(50% - ${(0,cssinjs.unit)(token.calc(inlineDotSize).div(2).equal())})`,
- [`> ${componentCls}-icon`]: {
- top: 0
- },
- [`${componentCls}-icon-dot`]: {
- borderRadius: token.calc(token.fontSizeSM).div(4).equal(),
- '&::after': {
- display: 'none'
- }
- }
- },
- '&-content': {
- width: 'auto',
- marginTop: token.calc(token.marginXS).sub(token.lineWidth).equal()
- },
- '&-title': {
- color: inlineTitleColor,
- fontSize: token.fontSizeSM,
- lineHeight: token.lineHeightSM,
- fontWeight: 'normal',
- marginBottom: token.calc(token.marginXXS).div(2).equal()
- },
- '&-description': {
- display: 'none'
- },
- '&-tail': {
- marginInlineStart: 0,
- top: token.calc(inlineDotSize).div(2).add(containerPaddingTop).equal(),
- transform: `translateY(-50%)`,
- '&:after': {
- width: '100%',
- height: token.lineWidth,
- borderRadius: 0,
- marginInlineStart: 0,
- background: inlineTailColor
- }
- },
- [`&:first-child ${componentCls}-item-tail`]: {
- width: '50%',
- marginInlineStart: '50%'
- },
- [`&:last-child ${componentCls}-item-tail`]: {
- display: 'block',
- width: '50%'
- },
- '&-wait': Object.assign({
- [`${componentCls}-item-icon ${componentCls}-icon ${componentCls}-icon-dot`]: {
- backgroundColor: token.colorBorderBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${inlineTailColor}`
- }
- }, titleStyle),
- '&-finish': Object.assign({
- [`${componentCls}-item-tail::after`]: {
- backgroundColor: inlineTailColor
- },
- [`${componentCls}-item-icon ${componentCls}-icon ${componentCls}-icon-dot`]: {
- backgroundColor: inlineTailColor,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${inlineTailColor}`
- }
- }, titleStyle),
- '&-error': titleStyle,
- '&-active, &-process': Object.assign({
- [`${componentCls}-item-icon`]: {
- width: inlineDotSize,
- height: inlineDotSize,
- marginInlineStart: `calc(50% - ${(0,cssinjs.unit)(token.calc(inlineDotSize).div(2).equal())})`,
- top: 0
- }
- }, titleStyle),
- [`&:not(${componentCls}-item-active) > ${componentCls}-item-container[role='button']:hover`]: {
- [`${componentCls}-item-title`]: {
- color: inlineTitleColor
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var inline = (genStepsInlineStyle);
- ;// ./components/steps/style/label-placement.ts
- const genStepsLabelPlacementStyle = token => {
- const {
- componentCls,
- iconSize,
- lineHeight,
- iconSizeSM
- } = token;
- return {
- [`&${componentCls}-label-vertical`]: {
- [`${componentCls}-item`]: {
- overflow: 'visible',
- '&-tail': {
- marginInlineStart: token.calc(iconSize).div(2).add(token.controlHeightLG).equal(),
- padding: `0 ${(0,cssinjs.unit)(token.paddingLG)}`
- },
- '&-content': {
- display: 'block',
- width: token.calc(iconSize).div(2).add(token.controlHeightLG).mul(2).equal(),
- marginTop: token.marginSM,
- textAlign: 'center'
- },
- '&-icon': {
- display: 'inline-block',
- marginInlineStart: token.controlHeightLG
- },
- '&-title': {
- paddingInlineEnd: 0,
- paddingInlineStart: 0,
- '&::after': {
- display: 'none'
- }
- },
- '&-subtitle': {
- display: 'block',
- marginBottom: token.marginXXS,
- marginInlineStart: 0,
- lineHeight
- }
- },
- [`&${componentCls}-small:not(${componentCls}-dot)`]: {
- [`${componentCls}-item`]: {
- '&-icon': {
- marginInlineStart: token.calc(iconSize).sub(iconSizeSM).div(2).add(token.controlHeightLG).equal()
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var label_placement = (genStepsLabelPlacementStyle);
- ;// ./components/steps/style/nav.ts
- const genStepsNavStyle = token => {
- const {
- componentCls,
- navContentMaxWidth,
- navArrowColor,
- stepsNavActiveColor,
- motionDurationSlow
- } = token;
- return {
- [`&${componentCls}-navigation`]: {
- paddingTop: token.paddingSM,
- [`&${componentCls}-small`]: {
- [`${componentCls}-item`]: {
- '&-container': {
- marginInlineStart: token.calc(token.marginSM).mul(-1).equal()
- }
- }
- },
- [`${componentCls}-item`]: {
- overflow: 'visible',
- textAlign: 'center',
- '&-container': {
- display: 'inline-block',
- height: '100%',
- marginInlineStart: token.calc(token.margin).mul(-1).equal(),
- paddingBottom: token.paddingSM,
- textAlign: 'start',
- transition: `opacity ${motionDurationSlow}`,
- [`${componentCls}-item-content`]: {
- maxWidth: navContentMaxWidth
- },
- [`${componentCls}-item-title`]: Object.assign(Object.assign({
- maxWidth: '100%',
- paddingInlineEnd: 0
- }, style.textEllipsis), {
- '&::after': {
- display: 'none'
- }
- })
- },
- [`&:not(${componentCls}-item-active)`]: {
- [`${componentCls}-item-container[role='button']`]: {
- cursor: 'pointer',
- '&:hover': {
- opacity: 0.85
- }
- }
- },
- '&:last-child': {
- flex: 1,
- '&::after': {
- display: 'none'
- }
- },
- '&::after': {
- position: 'absolute',
- top: `calc(50% - ${(0,cssinjs.unit)(token.calc(token.paddingSM).div(2).equal())})`,
- insetInlineStart: '100%',
- display: 'inline-block',
- width: token.fontSizeIcon,
- height: token.fontSizeIcon,
- borderTop: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${navArrowColor}`,
- borderBottom: 'none',
- borderInlineStart: 'none',
- borderInlineEnd: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${navArrowColor}`,
- transform: 'translateY(-50%) translateX(-50%) rotate(45deg)',
- content: '""'
- },
- '&::before': {
- position: 'absolute',
- bottom: 0,
- insetInlineStart: '50%',
- display: 'inline-block',
- width: 0,
- height: token.lineWidthBold,
- backgroundColor: stepsNavActiveColor,
- transition: `width ${motionDurationSlow}, inset-inline-start ${motionDurationSlow}`,
- transitionTimingFunction: 'ease-out',
- content: '""'
- }
- },
- [`${componentCls}-item${componentCls}-item-active::before`]: {
- insetInlineStart: 0,
- width: '100%'
- }
- },
- [`&${componentCls}-navigation${componentCls}-vertical`]: {
- [`> ${componentCls}-item`]: {
- marginInlineEnd: 0,
- '&::before': {
- display: 'none'
- },
- [`&${componentCls}-item-active::before`]: {
- top: 0,
- insetInlineEnd: 0,
- insetInlineStart: 'unset',
- display: 'block',
- width: token.calc(token.lineWidth).mul(3).equal(),
- height: `calc(100% - ${(0,cssinjs.unit)(token.marginLG)})`
- },
- '&::after': {
- position: 'relative',
- insetInlineStart: '50%',
- display: 'block',
- width: token.calc(token.controlHeight).mul(0.25).equal(),
- height: token.calc(token.controlHeight).mul(0.25).equal(),
- marginBottom: token.marginXS,
- textAlign: 'center',
- transform: 'translateY(-50%) translateX(-50%) rotate(135deg)'
- },
- '&:last-child': {
- '&::after': {
- display: 'none'
- }
- },
- [`> ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- visibility: 'hidden'
- }
- }
- },
- [`&${componentCls}-navigation${componentCls}-horizontal`]: {
- [`> ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- visibility: 'hidden'
- }
- }
- };
- };
- /* harmony default export */ var nav = (genStepsNavStyle);
- ;// ./components/steps/style/progress.ts
- const genStepsProgressStyle = token => {
- const {
- antCls,
- componentCls,
- iconSize,
- iconSizeSM,
- processIconColor,
- marginXXS,
- lineWidthBold,
- lineWidth,
- paddingXXS
- } = token;
- const progressSize = token.calc(iconSize).add(token.calc(lineWidthBold).mul(4).equal()).equal();
- const progressSizeSM = token.calc(iconSizeSM).add(token.calc(token.lineWidth).mul(4).equal()).equal();
- return {
- [`&${componentCls}-with-progress`]: {
- [`${componentCls}-item`]: {
- paddingTop: paddingXXS,
- [`&-process ${componentCls}-item-container ${componentCls}-item-icon ${componentCls}-icon`]: {
- color: processIconColor
- }
- },
- [`&${componentCls}-vertical > ${componentCls}-item `]: {
- paddingInlineStart: paddingXXS,
- [`> ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- top: marginXXS,
- insetInlineStart: token.calc(iconSize).div(2).sub(lineWidth).add(paddingXXS).equal()
- }
- },
- [`&, &${componentCls}-small`]: {
- [`&${componentCls}-horizontal ${componentCls}-item:first-child`]: {
- paddingBottom: paddingXXS,
- paddingInlineStart: paddingXXS
- }
- },
- [`&${componentCls}-small${componentCls}-vertical > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- insetInlineStart: token.calc(iconSizeSM).div(2).sub(lineWidth).add(paddingXXS).equal()
- },
- [`&${componentCls}-label-vertical ${componentCls}-item ${componentCls}-item-tail`]: {
- top: token.calc(iconSize).div(2).add(paddingXXS).equal()
- },
- [`${componentCls}-item-icon`]: {
- position: 'relative',
- [`${antCls}-progress`]: {
- position: 'absolute',
- insetInlineStart: '50%',
- top: '50%',
- transform: 'translate(-50%, -50%)',
- '&-inner': {
- width: `${(0,cssinjs.unit)(progressSize)} !important`,
- height: `${(0,cssinjs.unit)(progressSize)} !important`
- }
- }
- },
- // ============================== Small size ==============================
- [`&${componentCls}-small`]: {
- [`&${componentCls}-label-vertical ${componentCls}-item ${componentCls}-item-tail`]: {
- top: token.calc(iconSizeSM).div(2).add(paddingXXS).equal()
- },
- [`${componentCls}-item-icon ${antCls}-progress-inner`]: {
- width: `${(0,cssinjs.unit)(progressSizeSM)} !important`,
- height: `${(0,cssinjs.unit)(progressSizeSM)} !important`
- }
- }
- }
- };
- };
- /* harmony default export */ var progress = (genStepsProgressStyle);
- ;// ./components/steps/style/progress-dot.ts
- const genStepsProgressDotStyle = token => {
- const {
- componentCls,
- descriptionMaxWidth,
- lineHeight,
- dotCurrentSize,
- dotSize,
- motionDurationSlow
- } = token;
- return {
- [`&${componentCls}-dot, &${componentCls}-dot${componentCls}-small`]: {
- [`${componentCls}-item`]: {
- '&-title': {
- lineHeight
- },
- '&-tail': {
- // Math.floor((token.size - token.lineWidth * 3) / 2)
- top: token.calc(token.dotSize).sub(token.calc(token.lineWidth).mul(3).equal()).div(2).equal(),
- width: '100%',
- marginTop: 0,
- marginBottom: 0,
- marginInline: `${(0,cssinjs.unit)(token.calc(descriptionMaxWidth).div(2).equal())} 0`,
- padding: 0,
- '&::after': {
- width: `calc(100% - ${(0,cssinjs.unit)(token.calc(token.marginSM).mul(2).equal())})`,
- height: token.calc(token.lineWidth).mul(3).equal(),
- marginInlineStart: token.marginSM
- }
- },
- '&-icon': {
- width: dotSize,
- height: dotSize,
- marginInlineStart: token.calc(token.descriptionMaxWidth).sub(dotSize).div(2).equal(),
- paddingInlineEnd: 0,
- lineHeight: (0,cssinjs.unit)(dotSize),
- background: 'transparent',
- border: 0,
- [`${componentCls}-icon-dot`]: {
- position: 'relative',
- float: 'left',
- width: '100%',
- height: '100%',
- borderRadius: 100,
- // very large number
- transition: `all ${motionDurationSlow}`,
- /* expand hover area */
- '&::after': {
- position: 'absolute',
- top: token.calc(token.marginSM).mul(-1).equal(),
- insetInlineStart: token.calc(dotSize).sub(token.calc(token.controlHeightLG).mul(1.5).equal()).div(2).equal(),
- width: token.calc(token.controlHeightLG).mul(1.5).equal(),
- height: token.controlHeight,
- background: 'transparent',
- content: '""'
- }
- }
- },
- '&-content': {
- width: descriptionMaxWidth
- },
- [`&-process ${componentCls}-item-icon`]: {
- position: 'relative',
- top: token.calc(dotSize).sub(dotCurrentSize).div(2).equal(),
- width: dotCurrentSize,
- height: dotCurrentSize,
- lineHeight: (0,cssinjs.unit)(dotCurrentSize),
- background: 'none',
- marginInlineStart: token.calc(token.descriptionMaxWidth).sub(dotCurrentSize).div(2).equal()
- },
- [`&-process ${componentCls}-icon`]: {
- [`&:first-child ${componentCls}-icon-dot`]: {
- insetInlineStart: 0
- }
- }
- }
- },
- [`&${componentCls}-vertical${componentCls}-dot`]: {
- [`${componentCls}-item-icon`]: {
- marginTop: token.calc(token.controlHeight).sub(dotSize).div(2).equal(),
- marginInlineStart: 0,
- background: 'none'
- },
- [`${componentCls}-item-process ${componentCls}-item-icon`]: {
- marginTop: token.calc(token.controlHeight).sub(dotCurrentSize).div(2).equal(),
- top: 0,
- insetInlineStart: token.calc(dotSize).sub(dotCurrentSize).div(2).equal(),
- marginInlineStart: 0
- },
- // https://github.com/ant-design/ant-design/issues/18354
- [`${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- top: token.calc(token.controlHeight).sub(dotSize).div(2).equal(),
- insetInlineStart: 0,
- margin: 0,
- padding: `${(0,cssinjs.unit)(token.calc(dotSize).add(token.paddingXS).equal())} 0 ${(0,cssinjs.unit)(token.paddingXS)}`,
- '&::after': {
- marginInlineStart: token.calc(dotSize).sub(token.lineWidth).div(2).equal()
- }
- },
- [`&${componentCls}-small`]: {
- [`${componentCls}-item-icon`]: {
- marginTop: token.calc(token.controlHeightSM).sub(dotSize).div(2).equal()
- },
- [`${componentCls}-item-process ${componentCls}-item-icon`]: {
- marginTop: token.calc(token.controlHeightSM).sub(dotCurrentSize).div(2).equal()
- },
- [`${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- top: token.calc(token.controlHeightSM).sub(dotSize).div(2).equal()
- }
- },
- [`${componentCls}-item:first-child ${componentCls}-icon-dot`]: {
- insetInlineStart: 0
- },
- [`${componentCls}-item-content`]: {
- width: 'inherit'
- }
- }
- };
- };
- /* harmony default export */ var progress_dot = (genStepsProgressDotStyle);
- ;// ./components/steps/style/rtl.ts
- const genStepsRTLStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`&${componentCls}-rtl`]: {
- direction: 'rtl',
- [`${componentCls}-item`]: {
- '&-subtitle': {
- float: 'left'
- }
- },
- // nav
- [`&${componentCls}-navigation`]: {
- [`${componentCls}-item::after`]: {
- transform: 'rotate(-45deg)'
- }
- },
- // vertical
- [`&${componentCls}-vertical`]: {
- [`> ${componentCls}-item`]: {
- '&::after': {
- transform: 'rotate(225deg)'
- },
- [`${componentCls}-item-icon`]: {
- float: 'right'
- }
- }
- },
- // progress-dot
- [`&${componentCls}-dot`]: {
- [`${componentCls}-item-icon ${componentCls}-icon-dot, &${componentCls}-small ${componentCls}-item-icon ${componentCls}-icon-dot`]: {
- float: 'right'
- }
- }
- }
- };
- };
- /* harmony default export */ var rtl = (genStepsRTLStyle);
- ;// ./components/steps/style/small.ts
- const genStepsSmallStyle = token => {
- const {
- componentCls,
- iconSizeSM,
- // stepsSmallIconMargin,
- fontSizeSM,
- fontSize,
- colorTextDescription
- } = token;
- return {
- [`&${componentCls}-small`]: {
- [`&${componentCls}-horizontal:not(${componentCls}-label-vertical) ${componentCls}-item`]: {
- paddingInlineStart: token.paddingSM,
- '&:first-child': {
- paddingInlineStart: 0
- }
- },
- [`${componentCls}-item-icon`]: {
- width: iconSizeSM,
- height: iconSizeSM,
- // margin: stepsSmallIconMargin,
- marginTop: 0,
- marginBottom: 0,
- marginInline: `0 ${(0,cssinjs.unit)(token.marginXS)}`,
- fontSize: fontSizeSM,
- lineHeight: (0,cssinjs.unit)(iconSizeSM),
- textAlign: 'center',
- borderRadius: iconSizeSM
- },
- [`${componentCls}-item-title`]: {
- paddingInlineEnd: token.paddingSM,
- fontSize,
- lineHeight: (0,cssinjs.unit)(iconSizeSM),
- '&::after': {
- top: token.calc(iconSizeSM).div(2).equal()
- }
- },
- [`${componentCls}-item-description`]: {
- color: colorTextDescription,
- fontSize
- },
- [`${componentCls}-item-tail`]: {
- top: token.calc(iconSizeSM).div(2).sub(token.paddingXXS).equal()
- },
- [`${componentCls}-item-custom ${componentCls}-item-icon`]: {
- width: 'inherit',
- height: 'inherit',
- lineHeight: 'inherit',
- background: 'none',
- border: 0,
- borderRadius: 0,
- [`> ${componentCls}-icon`]: {
- fontSize: iconSizeSM,
- lineHeight: (0,cssinjs.unit)(iconSizeSM),
- transform: 'none'
- }
- }
- }
- };
- };
- /* harmony default export */ var small = (genStepsSmallStyle);
- ;// ./components/steps/style/vertical.ts
- const genStepsVerticalStyle = token => {
- const {
- componentCls,
- iconSizeSM,
- iconSize
- } = token;
- return {
- [`&${componentCls}-vertical`]: {
- display: 'flex',
- flexDirection: 'column',
- [`> ${componentCls}-item`]: {
- display: 'block',
- flex: '1 0 auto',
- paddingInlineStart: 0,
- overflow: 'visible',
- [`${componentCls}-item-icon`]: {
- float: 'left',
- marginInlineEnd: token.margin
- },
- [`${componentCls}-item-content`]: {
- display: 'block',
- minHeight: token.calc(token.controlHeight).mul(1.5).equal(),
- overflow: 'hidden'
- },
- [`${componentCls}-item-title`]: {
- lineHeight: (0,cssinjs.unit)(iconSize)
- },
- [`${componentCls}-item-description`]: {
- paddingBottom: token.paddingSM
- }
- },
- [`> ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- position: 'absolute',
- top: 0,
- insetInlineStart: token.calc(iconSize).div(2).sub(token.lineWidth).equal(),
- width: token.lineWidth,
- height: '100%',
- padding: `${(0,cssinjs.unit)(token.calc(token.marginXXS).mul(1.5).add(iconSize).equal())} 0 ${(0,cssinjs.unit)(token.calc(token.marginXXS).mul(1.5).equal())}`,
- '&::after': {
- width: token.lineWidth,
- height: '100%'
- }
- },
- [`> ${componentCls}-item:not(:last-child) > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
- display: 'block'
- },
- [` > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-content > ${componentCls}-item-title`]: {
- '&::after': {
- display: 'none'
- }
- },
- [`&${componentCls}-small ${componentCls}-item-container`]: {
- [`${componentCls}-item-tail`]: {
- position: 'absolute',
- top: 0,
- insetInlineStart: token.calc(iconSizeSM).div(2).sub(token.lineWidth).equal(),
- padding: `${(0,cssinjs.unit)(token.calc(token.marginXXS).mul(1.5).add(iconSizeSM).equal())} 0 ${(0,cssinjs.unit)(token.calc(token.marginXXS).mul(1.5).equal())}`
- },
- [`${componentCls}-item-title`]: {
- lineHeight: (0,cssinjs.unit)(iconSizeSM)
- }
- }
- }
- };
- };
- /* harmony default export */ var vertical = (genStepsVerticalStyle);
- ;// ./components/steps/style/index.ts
- const STEP_ITEM_STATUS_WAIT = 'wait';
- const STEP_ITEM_STATUS_PROCESS = 'process';
- const STEP_ITEM_STATUS_FINISH = 'finish';
- const STEP_ITEM_STATUS_ERROR = 'error';
- const genStepsItemStatusStyle = (status, token) => {
- const prefix = `${token.componentCls}-item`;
- const iconColorKey = `${status}IconColor`;
- const titleColorKey = `${status}TitleColor`;
- const descriptionColorKey = `${status}DescriptionColor`;
- const tailColorKey = `${status}TailColor`;
- const iconBgColorKey = `${status}IconBgColor`;
- const iconBorderColorKey = `${status}IconBorderColor`;
- const dotColorKey = `${status}DotColor`;
- return {
- [`${prefix}-${status} ${prefix}-icon`]: {
- backgroundColor: token[iconBgColorKey],
- borderColor: token[iconBorderColorKey],
- [`> ${token.componentCls}-icon`]: {
- color: token[iconColorKey],
- [`${token.componentCls}-icon-dot`]: {
- background: token[dotColorKey]
- }
- }
- },
- [`${prefix}-${status}${prefix}-custom ${prefix}-icon`]: {
- [`> ${token.componentCls}-icon`]: {
- color: token[dotColorKey]
- }
- },
- [`${prefix}-${status} > ${prefix}-container > ${prefix}-content > ${prefix}-title`]: {
- color: token[titleColorKey],
- '&::after': {
- backgroundColor: token[tailColorKey]
- }
- },
- [`${prefix}-${status} > ${prefix}-container > ${prefix}-content > ${prefix}-description`]: {
- color: token[descriptionColorKey]
- },
- [`${prefix}-${status} > ${prefix}-container > ${prefix}-tail::after`]: {
- backgroundColor: token[tailColorKey]
- }
- };
- };
- const genStepsItemStyle = token => {
- const {
- componentCls,
- motionDurationSlow
- } = token;
- const stepsItemCls = `${componentCls}-item`; // .ant-steps-item
- const stepItemIconCls = `${stepsItemCls}-icon`;
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- [stepsItemCls]: {
- position: 'relative',
- display: 'inline-block',
- flex: 1,
- overflow: 'hidden',
- verticalAlign: 'top',
- '&:last-child': {
- flex: 'none',
- [`> ${stepsItemCls}-container > ${stepsItemCls}-tail, > ${stepsItemCls}-container > ${stepsItemCls}-content > ${stepsItemCls}-title::after`]: {
- display: 'none'
- }
- }
- },
- [`${stepsItemCls}-container`]: {
- outline: 'none',
- [`&:focus-visible ${stepItemIconCls}`]: (0,style.genFocusOutline)(token)
- },
- [`${stepItemIconCls}, ${stepsItemCls}-content`]: {
- display: 'inline-block',
- verticalAlign: 'top'
- },
- [stepItemIconCls]: {
- width: token.iconSize,
- height: token.iconSize,
- marginTop: 0,
- marginBottom: 0,
- marginInlineStart: 0,
- marginInlineEnd: token.marginXS,
- fontSize: token.iconFontSize,
- fontFamily: token.fontFamily,
- lineHeight: (0,cssinjs.unit)(token.iconSize),
- textAlign: 'center',
- borderRadius: token.iconSize,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} transparent`,
- transition: `background-color ${motionDurationSlow}, border-color ${motionDurationSlow}`,
- [`${componentCls}-icon`]: {
- position: 'relative',
- top: token.iconTop,
- color: token.colorPrimary,
- lineHeight: 1
- }
- },
- [`${stepsItemCls}-tail`]: {
- position: 'absolute',
- top: token.calc(token.iconSize).div(2).equal(),
- insetInlineStart: 0,
- width: '100%',
- '&::after': {
- display: 'inline-block',
- width: '100%',
- height: token.lineWidth,
- background: token.colorSplit,
- borderRadius: token.lineWidth,
- transition: `background ${motionDurationSlow}`,
- content: '""'
- }
- },
- [`${stepsItemCls}-title`]: {
- position: 'relative',
- display: 'inline-block',
- paddingInlineEnd: token.padding,
- color: token.colorText,
- fontSize: token.fontSizeLG,
- lineHeight: (0,cssinjs.unit)(token.titleLineHeight),
- '&::after': {
- position: 'absolute',
- top: token.calc(token.titleLineHeight).div(2).equal(),
- insetInlineStart: '100%',
- display: 'block',
- width: 9999,
- height: token.lineWidth,
- background: token.processTailColor,
- content: '""'
- }
- },
- [`${stepsItemCls}-subtitle`]: {
- display: 'inline',
- marginInlineStart: token.marginXS,
- color: token.colorTextDescription,
- fontWeight: 'normal',
- fontSize: token.fontSize
- },
- [`${stepsItemCls}-description`]: {
- color: token.colorTextDescription,
- fontSize: token.fontSize
- }
- }, genStepsItemStatusStyle(STEP_ITEM_STATUS_WAIT, token)), genStepsItemStatusStyle(STEP_ITEM_STATUS_PROCESS, token)), {
- [`${stepsItemCls}-process > ${stepsItemCls}-container > ${stepsItemCls}-title`]: {
- fontWeight: token.fontWeightStrong
- }
- }), genStepsItemStatusStyle(STEP_ITEM_STATUS_FINISH, token)), genStepsItemStatusStyle(STEP_ITEM_STATUS_ERROR, token)), {
- [`${stepsItemCls}${componentCls}-next-error > ${componentCls}-item-title::after`]: {
- background: token.colorError
- },
- [`${stepsItemCls}-disabled`]: {
- cursor: 'not-allowed'
- }
- });
- };
- // ============================= Clickable ===========================
- const genStepsClickableStyle = token => {
- const {
- componentCls,
- motionDurationSlow
- } = token;
- return {
- [`& ${componentCls}-item`]: {
- [`&:not(${componentCls}-item-active)`]: {
- [`& > ${componentCls}-item-container[role='button']`]: {
- cursor: 'pointer',
- [`${componentCls}-item`]: {
- [`&-title, &-subtitle, &-description, &-icon ${componentCls}-icon`]: {
- transition: `color ${motionDurationSlow}`
- }
- },
- '&:hover': {
- [`${componentCls}-item`]: {
- '&-title, &-subtitle, &-description': {
- color: token.colorPrimary
- }
- }
- }
- },
- [`&:not(${componentCls}-item-process)`]: {
- [`& > ${componentCls}-item-container[role='button']:hover`]: {
- [`${componentCls}-item`]: {
- '&-icon': {
- borderColor: token.colorPrimary,
- [`${componentCls}-icon`]: {
- color: token.colorPrimary
- }
- }
- }
- }
- }
- }
- },
- [`&${componentCls}-horizontal:not(${componentCls}-label-vertical)`]: {
- [`${componentCls}-item`]: {
- paddingInlineStart: token.padding,
- whiteSpace: 'nowrap',
- '&:first-child': {
- paddingInlineStart: 0
- },
- [`&:last-child ${componentCls}-item-title`]: {
- paddingInlineEnd: 0
- },
- '&-tail': {
- display: 'none'
- },
- '&-description': {
- maxWidth: token.descriptionMaxWidth,
- whiteSpace: 'normal'
- }
- }
- }
- };
- };
- const genStepsStyle = token => {
- const {
- componentCls
- } = token; // .ant-steps
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- display: 'flex',
- width: '100%',
- fontSize: 0,
- textAlign: 'initial'
- }), genStepsItemStyle(token)), genStepsClickableStyle(token)), custom_icon(token)), small(token)), vertical(token)), horizontal(token)), label_placement(token)), progress_dot(token)), nav(token)), rtl(token)), progress(token)), inline(token))
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- titleLineHeight: token.controlHeight,
- customIconSize: token.controlHeight,
- customIconTop: 0,
- customIconFontSize: token.controlHeightSM,
- iconSize: token.controlHeight,
- iconTop: -0.5,
- // magic for ui experience
- iconFontSize: token.fontSize,
- iconSizeSM: token.fontSizeHeading3,
- dotSize: token.controlHeight / 4,
- dotCurrentSize: token.controlHeightLG / 4,
- navArrowColor: token.colorTextDisabled,
- navContentMaxWidth: 'unset',
- descriptionMaxWidth: 140,
- waitIconColor: token.wireframe ? token.colorTextDisabled : token.colorTextLabel,
- waitIconBgColor: token.wireframe ? token.colorBgContainer : token.colorFillContent,
- waitIconBorderColor: token.wireframe ? token.colorTextDisabled : 'transparent',
- finishIconBgColor: token.wireframe ? token.colorBgContainer : token.controlItemBgActive,
- finishIconBorderColor: token.wireframe ? token.colorPrimary : token.controlItemBgActive
- });
- /* harmony default export */ var steps_style = ((0,genStyleUtils.genStyleHooks)('Steps', token => {
- const {
- colorTextDisabled,
- controlHeightLG,
- colorTextLightSolid,
- colorText,
- colorPrimary,
- colorTextDescription,
- colorTextQuaternary,
- colorError,
- colorBorderSecondary,
- colorSplit
- } = token;
- const stepsToken = (0,es.mergeToken)(token, {
- // Steps component less variable
- processIconColor: colorTextLightSolid,
- processTitleColor: colorText,
- processDescriptionColor: colorText,
- processIconBgColor: colorPrimary,
- processIconBorderColor: colorPrimary,
- processDotColor: colorPrimary,
- processTailColor: colorSplit,
- waitTitleColor: colorTextDescription,
- waitDescriptionColor: colorTextDescription,
- waitTailColor: colorSplit,
- waitDotColor: colorTextDisabled,
- finishIconColor: colorPrimary,
- finishTitleColor: colorText,
- finishDescriptionColor: colorTextDescription,
- finishTailColor: colorPrimary,
- finishDotColor: colorPrimary,
- errorIconColor: colorTextLightSolid,
- errorTitleColor: colorError,
- errorDescriptionColor: colorError,
- errorTailColor: colorSplit,
- errorIconBgColor: colorError,
- errorIconBorderColor: colorError,
- errorDotColor: colorError,
- stepsNavActiveColor: colorPrimary,
- stepsProgressSize: controlHeightLG,
- // Steps inline variable
- inlineDotSize: 6,
- inlineTitleColor: colorTextQuaternary,
- inlineTailColor: colorBorderSecondary
- });
- return genStepsStyle(stepsToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/style/compact-item.ts":
- /*!******************************************!*\
- !*** ./components/style/compact-item.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genCompactItemStyle: function() { return /* binding */ genCompactItemStyle; }
- /* harmony export */ });
- // handle border collapse
- function compactItemBorder(token, parentCls, options, prefixCls) {
- const {
- focusElCls,
- focus,
- borderElCls
- } = options;
- const childCombinator = borderElCls ? '> *' : '';
- const hoverEffects = ['hover', focus ? 'focus' : null, 'active'].filter(Boolean).map(n => `&:${n} ${childCombinator}`).join(',');
- return {
- [`&-item:not(${parentCls}-last-item)`]: {
- marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()
- },
- [`&-item:not(${prefixCls}-status-success)`]: {
- zIndex: 2
- },
- '&-item': Object.assign(Object.assign({
- [hoverEffects]: {
- zIndex: 3
- }
- }, focusElCls ? {
- [`&${focusElCls}`]: {
- zIndex: 3
- }
- } : {}), {
- [`&[disabled] ${childCombinator}`]: {
- zIndex: 0
- }
- })
- };
- }
- // handle border-radius
- function compactItemBorderRadius(prefixCls, parentCls, options) {
- const {
- borderElCls
- } = options;
- const childCombinator = borderElCls ? `> ${borderElCls}` : '';
- return {
- [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {
- borderRadius: 0
- },
- [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {
- [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
- borderStartEndRadius: 0,
- borderEndEndRadius: 0
- }
- },
- [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {
- [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
- borderStartStartRadius: 0,
- borderEndStartRadius: 0
- }
- }
- };
- }
- function genCompactItemStyle(token, options = {
- focus: true
- }) {
- const {
- componentCls
- } = token;
- const compactCls = `${componentCls}-compact`;
- return {
- [compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options, componentCls)), compactItemBorderRadius(componentCls, compactCls, options))
- };
- }
- /***/ }),
- /***/ "./components/style/index.tsx":
- /*!************************************!*\
- !*** ./components/style/index.tsx ***!
- \************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ clearFix: function() { return /* binding */ clearFix; },
- /* harmony export */ genCommonStyle: function() { return /* binding */ genCommonStyle; },
- /* harmony export */ genFocusOutline: function() { return /* binding */ genFocusOutline; },
- /* harmony export */ genFocusStyle: function() { return /* binding */ genFocusStyle; },
- /* harmony export */ genIconStyle: function() { return /* binding */ genIconStyle; },
- /* harmony export */ genLinkStyle: function() { return /* binding */ genLinkStyle; },
- /* harmony export */ operationUnit: function() { return /* binding */ operationUnit; },
- /* harmony export */ resetComponent: function() { return /* binding */ resetComponent; },
- /* harmony export */ resetIcon: function() { return /* binding */ resetIcon; },
- /* harmony export */ textEllipsis: function() { return /* binding */ textEllipsis; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- const textEllipsis = {
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- textOverflow: 'ellipsis'
- };
- const resetComponent = (token, needInheritFontFamily = false) => ({
- boxSizing: 'border-box',
- margin: 0,
- padding: 0,
- color: token.colorText,
- fontSize: token.fontSize,
- // font-variant: @font-variant-base;
- lineHeight: token.lineHeight,
- listStyle: 'none',
- // font-feature-settings: @font-feature-settings-base;
- fontFamily: needInheritFontFamily ? 'inherit' : token.fontFamily
- });
- const resetIcon = () => ({
- display: 'inline-flex',
- alignItems: 'center',
- color: 'inherit',
- fontStyle: 'normal',
- lineHeight: 0,
- textAlign: 'center',
- textTransform: 'none',
- // for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
- verticalAlign: '-0.125em',
- textRendering: 'optimizeLegibility',
- '-webkit-font-smoothing': 'antialiased',
- '-moz-osx-font-smoothing': 'grayscale',
- '> *': {
- lineHeight: 1
- },
- svg: {
- display: 'inline-block'
- }
- });
- const clearFix = () => ({
- // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
- '&::before': {
- display: 'table',
- content: '""'
- },
- '&::after': {
- // https://github.com/ant-design/ant-design/issues/21864
- display: 'table',
- clear: 'both',
- content: '""'
- }
- });
- const genLinkStyle = token => ({
- a: {
- color: token.colorLink,
- textDecoration: token.linkDecoration,
- backgroundColor: 'transparent',
- // remove the gray background on active links in IE 10.
- outline: 'none',
- cursor: 'pointer',
- transition: `color ${token.motionDurationSlow}`,
- '-webkit-text-decoration-skip': 'objects',
- // remove gaps in links underline in iOS 8+ and Safari 8+.
- '&:hover': {
- color: token.colorLinkHover
- },
- '&:active': {
- color: token.colorLinkActive
- },
- '&:active, &:hover': {
- textDecoration: token.linkHoverDecoration,
- outline: 0
- },
- // https://github.com/ant-design/ant-design/issues/22503
- '&:focus': {
- textDecoration: token.linkFocusDecoration,
- outline: 0
- },
- '&[disabled]': {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- }
- }
- });
- const genCommonStyle = (token, componentPrefixCls, rootCls, resetFont) => {
- const prefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
- const rootPrefixSelector = rootCls ? `.${rootCls}` : prefixSelector;
- const resetStyle = {
- boxSizing: 'border-box',
- '&::before, &::after': {
- boxSizing: 'border-box'
- }
- };
- let resetFontStyle = {};
- if (resetFont !== false) {
- resetFontStyle = {
- fontFamily: token.fontFamily,
- fontSize: token.fontSize
- };
- }
- return {
- [rootPrefixSelector]: Object.assign(Object.assign(Object.assign({}, resetFontStyle), resetStyle), {
- [prefixSelector]: resetStyle
- })
- };
- };
- const genFocusOutline = (token, offset) => ({
- outline: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidthFocus)} solid ${token.colorPrimaryBorder}`,
- outlineOffset: offset !== null && offset !== void 0 ? offset : 1,
- transition: 'outline-offset 0s, outline 0s'
- });
- const genFocusStyle = (token, offset) => ({
- '&:focus-visible': genFocusOutline(token, offset)
- });
- const genIconStyle = iconPrefixCls => ({
- [`.${iconPrefixCls}`]: Object.assign(Object.assign({}, resetIcon()), {
- [`.${iconPrefixCls} .${iconPrefixCls}-icon`]: {
- display: 'block'
- }
- })
- });
- const operationUnit = token => Object.assign(Object.assign({
- // FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
- // And Typography use this to generate link style which should not do this.
- color: token.colorLink,
- textDecoration: token.linkDecoration,
- outline: 'none',
- cursor: 'pointer',
- transition: `all ${token.motionDurationSlow}`,
- border: 0,
- padding: 0,
- background: 'none',
- userSelect: 'none'
- }, genFocusStyle(token)), {
- '&:hover': {
- color: token.colorLinkHover,
- textDecoration: token.linkHoverDecoration
- },
- '&:focus': {
- color: token.colorLinkHover,
- textDecoration: token.linkFocusDecoration
- },
- '&:active': {
- color: token.colorLinkActive,
- textDecoration: token.linkHoverDecoration
- }
- });
- /***/ }),
- /***/ "./components/style/motion/collapse.ts":
- /*!*********************************************!*\
- !*** ./components/style/motion/collapse.ts ***!
- \*********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- const genCollapseMotion = token => ({
- [token.componentCls]: {
- // For common/openAnimation
- [`${token.antCls}-motion-collapse-legacy`]: {
- overflow: 'hidden',
- '&-active': {
- transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
- opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
- }
- },
- [`${token.antCls}-motion-collapse`]: {
- overflow: 'hidden',
- transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
- opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
- }
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (genCollapseMotion);
- /***/ }),
- /***/ "./components/style/motion/fade.ts":
- /*!*****************************************!*\
- !*** ./components/style/motion/fade.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initFadeMotion: function() { return /* binding */ initFadeMotion; }
- /* harmony export */ });
- /* unused harmony exports fadeIn, fadeOut */
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./motion */ "./components/style/motion/motion.ts");
- const fadeIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antFadeIn', {
- '0%': {
- opacity: 0
- },
- '100%': {
- opacity: 1
- }
- });
- const fadeOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antFadeOut', {
- '0%': {
- opacity: 1
- },
- '100%': {
- opacity: 0
- }
- });
- const initFadeMotion = (token, sameLevel = false) => {
- const {
- antCls
- } = token;
- const motionCls = `${antCls}-fade`;
- const sameLevelPrefix = sameLevel ? '&' : '';
- return [(0,_motion__WEBPACK_IMPORTED_MODULE_1__.initMotion)(motionCls, fadeIn, fadeOut, token.motionDurationMid, sameLevel), {
- [`
- ${sameLevelPrefix}${motionCls}-enter,
- ${sameLevelPrefix}${motionCls}-appear
- `]: {
- opacity: 0,
- animationTimingFunction: 'linear'
- },
- [`${sameLevelPrefix}${motionCls}-leave`]: {
- animationTimingFunction: 'linear'
- }
- }];
- };
- /***/ }),
- /***/ "./components/style/motion/motion.ts":
- /*!*******************************************!*\
- !*** ./components/style/motion/motion.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initMotion: function() { return /* binding */ initMotion; }
- /* harmony export */ });
- const initMotionCommon = duration => ({
- animationDuration: duration,
- animationFillMode: 'both'
- });
- // FIXME: origin less code seems same as initMotionCommon. Maybe we can safe remove
- const initMotionCommonLeave = duration => ({
- animationDuration: duration,
- animationFillMode: 'both'
- });
- const initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
- const sameLevelPrefix = sameLevel ? '&' : '';
- return {
- [`
- ${sameLevelPrefix}${motionCls}-enter,
- ${sameLevelPrefix}${motionCls}-appear
- `]: Object.assign(Object.assign({}, initMotionCommon(duration)), {
- animationPlayState: 'paused'
- }),
- [`${sameLevelPrefix}${motionCls}-leave`]: Object.assign(Object.assign({}, initMotionCommonLeave(duration)), {
- animationPlayState: 'paused'
- }),
- [`
- ${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
- ${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
- `]: {
- animationName: inKeyframes,
- animationPlayState: 'running'
- },
- [`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
- animationName: outKeyframes,
- animationPlayState: 'running',
- pointerEvents: 'none'
- }
- };
- };
- /***/ }),
- /***/ "./components/style/motion/move.ts":
- /*!*****************************************!*\
- !*** ./components/style/motion/move.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initMoveMotion: function() { return /* binding */ initMoveMotion; }
- /* harmony export */ });
- /* unused harmony exports moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut */
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./motion */ "./components/style/motion/motion.ts");
- const moveDownIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveDownIn', {
- '0%': {
- transform: 'translate3d(0, 100%, 0)',
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveDownOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveDownOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: 'translate3d(0, 100%, 0)',
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveLeftIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveLeftIn', {
- '0%': {
- transform: 'translate3d(-100%, 0, 0)',
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveLeftOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveLeftOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: 'translate3d(-100%, 0, 0)',
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveRightIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveRightIn', {
- '0%': {
- transform: 'translate3d(100%, 0, 0)',
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveRightOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveRightOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: 'translate3d(100%, 0, 0)',
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveUpIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveUpIn', {
- '0%': {
- transform: 'translate3d(0, -100%, 0)',
- transformOrigin: '0 0',
- opacity: 0
- },
- '100%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- }
- });
- const moveUpOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveUpOut', {
- '0%': {
- transform: 'translate3d(0, 0, 0)',
- transformOrigin: '0 0',
- opacity: 1
- },
- '100%': {
- transform: 'translate3d(0, -100%, 0)',
- transformOrigin: '0 0',
- opacity: 0
- }
- });
- const moveMotion = {
- 'move-up': {
- inKeyframes: moveUpIn,
- outKeyframes: moveUpOut
- },
- 'move-down': {
- inKeyframes: moveDownIn,
- outKeyframes: moveDownOut
- },
- 'move-left': {
- inKeyframes: moveLeftIn,
- outKeyframes: moveLeftOut
- },
- 'move-right': {
- inKeyframes: moveRightIn,
- outKeyframes: moveRightOut
- }
- };
- const initMoveMotion = (token, motionName) => {
- const {
- antCls
- } = token;
- const motionCls = `${antCls}-${motionName}`;
- const {
- inKeyframes,
- outKeyframes
- } = moveMotion[motionName];
- return [(0,_motion__WEBPACK_IMPORTED_MODULE_1__.initMotion)(motionCls, inKeyframes, outKeyframes, token.motionDurationMid), {
- [`
- ${motionCls}-enter,
- ${motionCls}-appear
- `]: {
- opacity: 0,
- animationTimingFunction: token.motionEaseOutCirc
- },
- [`${motionCls}-leave`]: {
- animationTimingFunction: token.motionEaseInOutCirc
- }
- }];
- };
- /***/ }),
- /***/ "./components/style/motion/slide.ts":
- /*!******************************************!*\
- !*** ./components/style/motion/slide.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initSlideMotion: function() { return /* binding */ initSlideMotion; },
- /* harmony export */ slideDownIn: function() { return /* binding */ slideDownIn; },
- /* harmony export */ slideDownOut: function() { return /* binding */ slideDownOut; },
- /* harmony export */ slideUpIn: function() { return /* binding */ slideUpIn; },
- /* harmony export */ slideUpOut: function() { return /* binding */ slideUpOut; }
- /* harmony export */ });
- /* unused harmony exports slideLeftIn, slideLeftOut, slideRightIn, slideRightOut */
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./motion */ "./components/style/motion/motion.ts");
- const slideUpIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideUpIn', {
- '0%': {
- transform: 'scaleY(0.8)',
- transformOrigin: '0% 0%',
- opacity: 0
- },
- '100%': {
- transform: 'scaleY(1)',
- transformOrigin: '0% 0%',
- opacity: 1
- }
- });
- const slideUpOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideUpOut', {
- '0%': {
- transform: 'scaleY(1)',
- transformOrigin: '0% 0%',
- opacity: 1
- },
- '100%': {
- transform: 'scaleY(0.8)',
- transformOrigin: '0% 0%',
- opacity: 0
- }
- });
- const slideDownIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideDownIn', {
- '0%': {
- transform: 'scaleY(0.8)',
- transformOrigin: '100% 100%',
- opacity: 0
- },
- '100%': {
- transform: 'scaleY(1)',
- transformOrigin: '100% 100%',
- opacity: 1
- }
- });
- const slideDownOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideDownOut', {
- '0%': {
- transform: 'scaleY(1)',
- transformOrigin: '100% 100%',
- opacity: 1
- },
- '100%': {
- transform: 'scaleY(0.8)',
- transformOrigin: '100% 100%',
- opacity: 0
- }
- });
- const slideLeftIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideLeftIn', {
- '0%': {
- transform: 'scaleX(0.8)',
- transformOrigin: '0% 0%',
- opacity: 0
- },
- '100%': {
- transform: 'scaleX(1)',
- transformOrigin: '0% 0%',
- opacity: 1
- }
- });
- const slideLeftOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideLeftOut', {
- '0%': {
- transform: 'scaleX(1)',
- transformOrigin: '0% 0%',
- opacity: 1
- },
- '100%': {
- transform: 'scaleX(0.8)',
- transformOrigin: '0% 0%',
- opacity: 0
- }
- });
- const slideRightIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideRightIn', {
- '0%': {
- transform: 'scaleX(0.8)',
- transformOrigin: '100% 0%',
- opacity: 0
- },
- '100%': {
- transform: 'scaleX(1)',
- transformOrigin: '100% 0%',
- opacity: 1
- }
- });
- const slideRightOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antSlideRightOut', {
- '0%': {
- transform: 'scaleX(1)',
- transformOrigin: '100% 0%',
- opacity: 1
- },
- '100%': {
- transform: 'scaleX(0.8)',
- transformOrigin: '100% 0%',
- opacity: 0
- }
- });
- const slideMotion = {
- 'slide-up': {
- inKeyframes: slideUpIn,
- outKeyframes: slideUpOut
- },
- 'slide-down': {
- inKeyframes: slideDownIn,
- outKeyframes: slideDownOut
- },
- 'slide-left': {
- inKeyframes: slideLeftIn,
- outKeyframes: slideLeftOut
- },
- 'slide-right': {
- inKeyframes: slideRightIn,
- outKeyframes: slideRightOut
- }
- };
- const initSlideMotion = (token, motionName) => {
- const {
- antCls
- } = token;
- const motionCls = `${antCls}-${motionName}`;
- const {
- inKeyframes,
- outKeyframes
- } = slideMotion[motionName];
- return [(0,_motion__WEBPACK_IMPORTED_MODULE_1__.initMotion)(motionCls, inKeyframes, outKeyframes, token.motionDurationMid), {
- [`
- ${motionCls}-enter,
- ${motionCls}-appear
- `]: {
- transform: 'scale(0)',
- transformOrigin: '0% 0%',
- opacity: 0,
- animationTimingFunction: token.motionEaseOutQuint,
- '&-prepare': {
- transform: 'scale(1)'
- }
- },
- [`${motionCls}-leave`]: {
- animationTimingFunction: token.motionEaseInQuint
- }
- }];
- };
- /***/ }),
- /***/ "./components/style/motion/zoom.ts":
- /*!*****************************************!*\
- !*** ./components/style/motion/zoom.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ initZoomMotion: function() { return /* binding */ initZoomMotion; },
- /* harmony export */ zoomIn: function() { return /* binding */ zoomIn; }
- /* harmony export */ });
- /* unused harmony exports zoomOut, zoomBigIn, zoomBigOut, zoomUpIn, zoomUpOut, zoomLeftIn, zoomLeftOut, zoomRightIn, zoomRightOut, zoomDownIn, zoomDownOut */
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./motion */ "./components/style/motion/motion.ts");
- const zoomIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomIn', {
- '0%': {
- transform: 'scale(0.2)',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- opacity: 1
- }
- });
- const zoomOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomOut', {
- '0%': {
- transform: 'scale(1)'
- },
- '100%': {
- transform: 'scale(0.2)',
- opacity: 0
- }
- });
- const zoomBigIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomBigIn', {
- '0%': {
- transform: 'scale(0.8)',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- opacity: 1
- }
- });
- const zoomBigOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomBigOut', {
- '0%': {
- transform: 'scale(1)'
- },
- '100%': {
- transform: 'scale(0.8)',
- opacity: 0
- }
- });
- const zoomUpIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomUpIn', {
- '0%': {
- transform: 'scale(0.8)',
- transformOrigin: '50% 0%',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- transformOrigin: '50% 0%'
- }
- });
- const zoomUpOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomUpOut', {
- '0%': {
- transform: 'scale(1)',
- transformOrigin: '50% 0%'
- },
- '100%': {
- transform: 'scale(0.8)',
- transformOrigin: '50% 0%',
- opacity: 0
- }
- });
- const zoomLeftIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomLeftIn', {
- '0%': {
- transform: 'scale(0.8)',
- transformOrigin: '0% 50%',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- transformOrigin: '0% 50%'
- }
- });
- const zoomLeftOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomLeftOut', {
- '0%': {
- transform: 'scale(1)',
- transformOrigin: '0% 50%'
- },
- '100%': {
- transform: 'scale(0.8)',
- transformOrigin: '0% 50%',
- opacity: 0
- }
- });
- const zoomRightIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomRightIn', {
- '0%': {
- transform: 'scale(0.8)',
- transformOrigin: '100% 50%',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- transformOrigin: '100% 50%'
- }
- });
- const zoomRightOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomRightOut', {
- '0%': {
- transform: 'scale(1)',
- transformOrigin: '100% 50%'
- },
- '100%': {
- transform: 'scale(0.8)',
- transformOrigin: '100% 50%',
- opacity: 0
- }
- });
- const zoomDownIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomDownIn', {
- '0%': {
- transform: 'scale(0.8)',
- transformOrigin: '50% 100%',
- opacity: 0
- },
- '100%': {
- transform: 'scale(1)',
- transformOrigin: '50% 100%'
- }
- });
- const zoomDownOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antZoomDownOut', {
- '0%': {
- transform: 'scale(1)',
- transformOrigin: '50% 100%'
- },
- '100%': {
- transform: 'scale(0.8)',
- transformOrigin: '50% 100%',
- opacity: 0
- }
- });
- const zoomMotion = {
- zoom: {
- inKeyframes: zoomIn,
- outKeyframes: zoomOut
- },
- 'zoom-big': {
- inKeyframes: zoomBigIn,
- outKeyframes: zoomBigOut
- },
- 'zoom-big-fast': {
- inKeyframes: zoomBigIn,
- outKeyframes: zoomBigOut
- },
- 'zoom-left': {
- inKeyframes: zoomLeftIn,
- outKeyframes: zoomLeftOut
- },
- 'zoom-right': {
- inKeyframes: zoomRightIn,
- outKeyframes: zoomRightOut
- },
- 'zoom-up': {
- inKeyframes: zoomUpIn,
- outKeyframes: zoomUpOut
- },
- 'zoom-down': {
- inKeyframes: zoomDownIn,
- outKeyframes: zoomDownOut
- }
- };
- const initZoomMotion = (token, motionName) => {
- const {
- antCls
- } = token;
- const motionCls = `${antCls}-${motionName}`;
- const {
- inKeyframes,
- outKeyframes
- } = zoomMotion[motionName];
- return [(0,_motion__WEBPACK_IMPORTED_MODULE_1__.initMotion)(motionCls, inKeyframes, outKeyframes, motionName === 'zoom-big-fast' ? token.motionDurationFast : token.motionDurationMid), {
- [`
- ${motionCls}-enter,
- ${motionCls}-appear
- `]: {
- transform: 'scale(0)',
- opacity: 0,
- animationTimingFunction: token.motionEaseOutCirc,
- '&-prepare': {
- transform: 'none'
- }
- },
- [`${motionCls}-leave`]: {
- animationTimingFunction: token.motionEaseInOutCirc
- }
- }];
- };
- /***/ }),
- /***/ "./components/style/placementArrow.ts":
- /*!********************************************!*\
- !*** ./components/style/placementArrow.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ MAX_VERTICAL_CONTENT_RADIUS: function() { return /* binding */ MAX_VERTICAL_CONTENT_RADIUS; },
- /* harmony export */ "default": function() { return /* binding */ getArrowStyle; },
- /* harmony export */ getArrowOffsetToken: function() { return /* binding */ getArrowOffsetToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _roundedArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./roundedArrow */ "./components/style/roundedArrow.ts");
- const MAX_VERTICAL_CONTENT_RADIUS = 8;
- function getArrowOffsetToken(options) {
- const {
- contentRadius,
- limitVerticalRadius
- } = options;
- const arrowOffset = contentRadius > 12 ? contentRadius + 2 : 12;
- const arrowOffsetVertical = limitVerticalRadius ? MAX_VERTICAL_CONTENT_RADIUS : arrowOffset;
- return {
- arrowOffsetHorizontal: arrowOffset,
- arrowOffsetVertical
- };
- }
- function isInject(valid, code) {
- if (!valid) {
- return {};
- }
- return code;
- }
- function getArrowStyle(token, colorBg, options) {
- const {
- componentCls,
- boxShadowPopoverArrow,
- arrowOffsetVertical,
- arrowOffsetHorizontal
- } = token;
- const {
- arrowDistance = 0,
- arrowPlacement = {
- left: true,
- right: true,
- top: true,
- bottom: true
- }
- } = options || {};
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({
- // ============================ Basic ============================
- [`${componentCls}-arrow`]: [Object.assign(Object.assign({
- position: 'absolute',
- zIndex: 1,
- display: 'block'
- }, (0,_roundedArrow__WEBPACK_IMPORTED_MODULE_1__.genRoundedArrow)(token, colorBg, boxShadowPopoverArrow)), {
- '&:before': {
- background: colorBg
- }
- })]
- }, isInject(!!arrowPlacement.top, {
- [[`&-placement-top > ${componentCls}-arrow`, `&-placement-topLeft > ${componentCls}-arrow`, `&-placement-topRight > ${componentCls}-arrow`].join(',')]: {
- bottom: arrowDistance,
- transform: 'translateY(100%) rotate(180deg)'
- },
- [`&-placement-top > ${componentCls}-arrow`]: {
- left: {
- _skip_check_: true,
- value: '50%'
- },
- transform: 'translateX(-50%) translateY(100%) rotate(180deg)'
- },
- '&-placement-topLeft': {
- '--arrow-offset-horizontal': arrowOffsetHorizontal,
- [`> ${componentCls}-arrow`]: {
- left: {
- _skip_check_: true,
- value: arrowOffsetHorizontal
- }
- }
- },
- '&-placement-topRight': {
- '--arrow-offset-horizontal': `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(arrowOffsetHorizontal)})`,
- [`> ${componentCls}-arrow`]: {
- right: {
- _skip_check_: true,
- value: arrowOffsetHorizontal
- }
- }
- }
- })), isInject(!!arrowPlacement.bottom, {
- [[`&-placement-bottom > ${componentCls}-arrow`, `&-placement-bottomLeft > ${componentCls}-arrow`, `&-placement-bottomRight > ${componentCls}-arrow`].join(',')]: {
- top: arrowDistance,
- transform: `translateY(-100%)`
- },
- [`&-placement-bottom > ${componentCls}-arrow`]: {
- left: {
- _skip_check_: true,
- value: '50%'
- },
- transform: `translateX(-50%) translateY(-100%)`
- },
- '&-placement-bottomLeft': {
- '--arrow-offset-horizontal': arrowOffsetHorizontal,
- [`> ${componentCls}-arrow`]: {
- left: {
- _skip_check_: true,
- value: arrowOffsetHorizontal
- }
- }
- },
- '&-placement-bottomRight': {
- '--arrow-offset-horizontal': `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(arrowOffsetHorizontal)})`,
- [`> ${componentCls}-arrow`]: {
- right: {
- _skip_check_: true,
- value: arrowOffsetHorizontal
- }
- }
- }
- })), isInject(!!arrowPlacement.left, {
- [[`&-placement-left > ${componentCls}-arrow`, `&-placement-leftTop > ${componentCls}-arrow`, `&-placement-leftBottom > ${componentCls}-arrow`].join(',')]: {
- right: {
- _skip_check_: true,
- value: arrowDistance
- },
- transform: 'translateX(100%) rotate(90deg)'
- },
- [`&-placement-left > ${componentCls}-arrow`]: {
- top: {
- _skip_check_: true,
- value: '50%'
- },
- transform: 'translateY(-50%) translateX(100%) rotate(90deg)'
- },
- [`&-placement-leftTop > ${componentCls}-arrow`]: {
- top: arrowOffsetVertical
- },
- [`&-placement-leftBottom > ${componentCls}-arrow`]: {
- bottom: arrowOffsetVertical
- }
- })), isInject(!!arrowPlacement.right, {
- [[`&-placement-right > ${componentCls}-arrow`, `&-placement-rightTop > ${componentCls}-arrow`, `&-placement-rightBottom > ${componentCls}-arrow`].join(',')]: {
- left: {
- _skip_check_: true,
- value: arrowDistance
- },
- transform: 'translateX(-100%) rotate(-90deg)'
- },
- [`&-placement-right > ${componentCls}-arrow`]: {
- top: {
- _skip_check_: true,
- value: '50%'
- },
- transform: 'translateY(-50%) translateX(-100%) rotate(-90deg)'
- },
- [`&-placement-rightTop > ${componentCls}-arrow`]: {
- top: arrowOffsetVertical
- },
- [`&-placement-rightBottom > ${componentCls}-arrow`]: {
- bottom: arrowOffsetVertical
- }
- }))
- };
- }
- /***/ }),
- /***/ "./components/style/roundedArrow.ts":
- /*!******************************************!*\
- !*** ./components/style/roundedArrow.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genRoundedArrow: function() { return /* binding */ genRoundedArrow; },
- /* harmony export */ getArrowToken: function() { return /* binding */ getArrowToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- function getArrowToken(token) {
- const {
- sizePopupArrow,
- borderRadiusXS,
- borderRadiusOuter
- } = token;
- const unitWidth = sizePopupArrow / 2;
- const ax = 0;
- const ay = unitWidth;
- const bx = borderRadiusOuter * 1 / Math.sqrt(2);
- const by = unitWidth - borderRadiusOuter * (1 - 1 / Math.sqrt(2));
- const cx = unitWidth - borderRadiusXS * (1 / Math.sqrt(2));
- const cy = borderRadiusOuter * (Math.sqrt(2) - 1) + borderRadiusXS * (1 / Math.sqrt(2));
- const dx = 2 * unitWidth - cx;
- const dy = cy;
- const ex = 2 * unitWidth - bx;
- const ey = by;
- const fx = 2 * unitWidth - ax;
- const fy = ay;
- const shadowWidth = unitWidth * Math.sqrt(2) + borderRadiusOuter * (Math.sqrt(2) - 2);
- const polygonOffset = borderRadiusOuter * (Math.sqrt(2) - 1);
- const arrowPolygon = `polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`;
- const arrowPath = `path('M ${ax} ${ay} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${borderRadiusXS} ${borderRadiusXS} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${fx} ${fy} Z')`;
- return {
- arrowShadowWidth: shadowWidth,
- arrowPath,
- arrowPolygon
- };
- }
- const genRoundedArrow = (token, bgColor, boxShadow) => {
- const {
- sizePopupArrow,
- arrowPolygon,
- arrowPath,
- arrowShadowWidth,
- borderRadiusXS,
- calc
- } = token;
- return {
- pointerEvents: 'none',
- width: sizePopupArrow,
- height: sizePopupArrow,
- overflow: 'hidden',
- '&::before': {
- position: 'absolute',
- bottom: 0,
- insetInlineStart: 0,
- width: sizePopupArrow,
- height: calc(sizePopupArrow).div(2).equal(),
- background: bgColor,
- clipPath: {
- _multi_value_: true,
- value: [arrowPolygon, arrowPath]
- },
- content: '""'
- },
- '&::after': {
- content: '""',
- position: 'absolute',
- width: arrowShadowWidth,
- height: arrowShadowWidth,
- bottom: 0,
- insetInline: 0,
- margin: 'auto',
- borderRadius: {
- _skip_check_: true,
- value: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(borderRadiusXS)} 0`
- },
- transform: 'translateY(50%) rotate(-135deg)',
- boxShadow,
- zIndex: 0,
- background: 'transparent'
- }
- };
- };
- /***/ }),
- /***/ "./components/switch/style/index.ts":
- /*!******************************************!*\
- !*** ./components/switch/style/index.ts ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genSwitchSmallStyle = token => {
- const {
- componentCls,
- trackHeightSM,
- trackPadding,
- trackMinWidthSM,
- innerMinMarginSM,
- innerMaxMarginSM,
- handleSizeSM,
- calc
- } = token;
- const switchInnerCls = `${componentCls}-inner`;
- const trackPaddingCalc = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(handleSizeSM).add(calc(trackPadding).mul(2)).equal());
- const innerMaxMarginCalc = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(innerMaxMarginSM).mul(2).equal());
- return {
- [componentCls]: {
- [`&${componentCls}-small`]: {
- minWidth: trackMinWidthSM,
- height: trackHeightSM,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(trackHeightSM),
- [`${componentCls}-inner`]: {
- paddingInlineStart: innerMaxMarginSM,
- paddingInlineEnd: innerMinMarginSM,
- [`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
- minHeight: trackHeightSM
- },
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
- marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
- },
- [`${switchInnerCls}-unchecked`]: {
- marginTop: calc(trackHeightSM).mul(-1).equal(),
- marginInlineStart: 0,
- marginInlineEnd: 0
- }
- },
- [`${componentCls}-handle`]: {
- width: handleSizeSM,
- height: handleSizeSM
- },
- [`${componentCls}-loading-icon`]: {
- top: calc(calc(handleSizeSM).sub(token.switchLoadingIconSize)).div(2).equal(),
- fontSize: token.switchLoadingIconSize
- },
- [`&${componentCls}-checked`]: {
- [`${componentCls}-inner`]: {
- paddingInlineStart: innerMinMarginSM,
- paddingInlineEnd: innerMaxMarginSM,
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: 0,
- marginInlineEnd: 0
- },
- [`${switchInnerCls}-unchecked`]: {
- marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
- marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
- }
- },
- [`${componentCls}-handle`]: {
- insetInlineStart: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(handleSizeSM).add(trackPadding).equal())})`
- }
- },
- [`&:not(${componentCls}-disabled):active`]: {
- [`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
- [`${switchInnerCls}-unchecked`]: {
- marginInlineStart: calc(token.marginXXS).div(2).equal(),
- marginInlineEnd: calc(token.marginXXS).mul(-1).div(2).equal()
- }
- },
- [`&${componentCls}-checked ${switchInnerCls}`]: {
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: calc(token.marginXXS).mul(-1).div(2).equal(),
- marginInlineEnd: calc(token.marginXXS).div(2).equal()
- }
- }
- }
- }
- }
- };
- };
- const genSwitchLoadingStyle = token => {
- const {
- componentCls,
- handleSize,
- calc
- } = token;
- return {
- [componentCls]: {
- [`${componentCls}-loading-icon${token.iconCls}`]: {
- position: 'relative',
- top: calc(calc(handleSize).sub(token.fontSize)).div(2).equal(),
- color: token.switchLoadingIconColor,
- verticalAlign: 'top'
- },
- [`&${componentCls}-checked ${componentCls}-loading-icon`]: {
- color: token.switchColor
- }
- }
- };
- };
- const genSwitchHandleStyle = token => {
- const {
- componentCls,
- trackPadding,
- handleBg,
- handleShadow,
- handleSize,
- calc
- } = token;
- const switchHandleCls = `${componentCls}-handle`;
- return {
- [componentCls]: {
- [switchHandleCls]: {
- position: 'absolute',
- top: trackPadding,
- insetInlineStart: trackPadding,
- width: handleSize,
- height: handleSize,
- transition: `all ${token.switchDuration} ease-in-out`,
- '&::before': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: 0,
- bottom: 0,
- insetInlineStart: 0,
- backgroundColor: handleBg,
- borderRadius: calc(handleSize).div(2).equal(),
- boxShadow: handleShadow,
- transition: `all ${token.switchDuration} ease-in-out`,
- content: '""'
- }
- },
- [`&${componentCls}-checked ${switchHandleCls}`]: {
- insetInlineStart: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(handleSize).add(trackPadding).equal())})`
- },
- [`&:not(${componentCls}-disabled):active`]: {
- [`${switchHandleCls}::before`]: {
- insetInlineEnd: token.switchHandleActiveInset,
- insetInlineStart: 0
- },
- [`&${componentCls}-checked ${switchHandleCls}::before`]: {
- insetInlineEnd: 0,
- insetInlineStart: token.switchHandleActiveInset
- }
- }
- }
- };
- };
- const genSwitchInnerStyle = token => {
- const {
- componentCls,
- trackHeight,
- trackPadding,
- innerMinMargin,
- innerMaxMargin,
- handleSize,
- calc
- } = token;
- const switchInnerCls = `${componentCls}-inner`;
- const trackPaddingCalc = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(handleSize).add(calc(trackPadding).mul(2)).equal());
- const innerMaxMarginCalc = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(innerMaxMargin).mul(2).equal());
- return {
- [componentCls]: {
- [switchInnerCls]: {
- display: 'block',
- overflow: 'hidden',
- borderRadius: 100,
- height: '100%',
- paddingInlineStart: innerMaxMargin,
- paddingInlineEnd: innerMinMargin,
- transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
- [`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
- display: 'block',
- color: token.colorTextLightSolid,
- fontSize: token.fontSizeSM,
- transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
- pointerEvents: 'none',
- minHeight: trackHeight
- },
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
- marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
- },
- [`${switchInnerCls}-unchecked`]: {
- marginTop: calc(trackHeight).mul(-1).equal(),
- marginInlineStart: 0,
- marginInlineEnd: 0
- }
- },
- [`&${componentCls}-checked ${switchInnerCls}`]: {
- paddingInlineStart: innerMinMargin,
- paddingInlineEnd: innerMaxMargin,
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: 0,
- marginInlineEnd: 0
- },
- [`${switchInnerCls}-unchecked`]: {
- marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
- marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
- }
- },
- [`&:not(${componentCls}-disabled):active`]: {
- [`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
- [`${switchInnerCls}-unchecked`]: {
- marginInlineStart: calc(trackPadding).mul(2).equal(),
- marginInlineEnd: calc(trackPadding).mul(-1).mul(2).equal()
- }
- },
- [`&${componentCls}-checked ${switchInnerCls}`]: {
- [`${switchInnerCls}-checked`]: {
- marginInlineStart: calc(trackPadding).mul(-1).mul(2).equal(),
- marginInlineEnd: calc(trackPadding).mul(2).equal()
- }
- }
- }
- }
- };
- };
- const genSwitchStyle = token => {
- const {
- componentCls,
- trackHeight,
- trackMinWidth
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- position: 'relative',
- display: 'inline-block',
- boxSizing: 'border-box',
- minWidth: trackMinWidth,
- height: trackHeight,
- lineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(trackHeight),
- verticalAlign: 'middle',
- background: token.colorTextQuaternary,
- border: '0',
- borderRadius: 100,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid}`,
- userSelect: 'none',
- [`&:hover:not(${componentCls}-disabled)`]: {
- background: token.colorTextTertiary
- }
- }), (0,_style__WEBPACK_IMPORTED_MODULE_2__.genFocusStyle)(token)), {
- [`&${componentCls}-checked`]: {
- background: token.switchColor,
- [`&:hover:not(${componentCls}-disabled)`]: {
- background: token.colorPrimaryHover
- }
- },
- [`&${componentCls}-loading, &${componentCls}-disabled`]: {
- cursor: 'not-allowed',
- opacity: token.switchDisabledOpacity,
- '*': {
- boxShadow: 'none',
- cursor: 'not-allowed'
- }
- },
- // rtl style
- [`&${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- })
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => {
- const {
- fontSize,
- lineHeight,
- controlHeight,
- colorWhite
- } = token;
- const height = fontSize * lineHeight;
- const heightSM = controlHeight / 2;
- const padding = 2; // Fixed value
- const handleSize = height - padding * 2;
- const handleSizeSM = heightSM - padding * 2;
- return {
- trackHeight: height,
- trackHeightSM: heightSM,
- trackMinWidth: handleSize * 2 + padding * 4,
- trackMinWidthSM: handleSizeSM * 2 + padding * 2,
- trackPadding: padding,
- // Fixed value
- handleBg: colorWhite,
- handleSize,
- handleSizeSM,
- handleShadow: `0 2px 4px 0 ${new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor('#00230b').setA(0.2).toRgbString()}`,
- innerMinMargin: handleSize / 2,
- innerMaxMargin: handleSize + padding + padding * 2,
- innerMinMarginSM: handleSizeSM / 2,
- innerMaxMarginSM: handleSizeSM + padding + padding * 2
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('Switch', token => {
- const switchToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- switchDuration: token.motionDurationMid,
- switchColor: token.colorPrimary,
- switchDisabledOpacity: token.opacityLoading,
- switchLoadingIconSize: token.calc(token.fontSizeIcon).mul(0.75).equal(),
- switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
- switchHandleActiveInset: '-30%'
- });
- return [genSwitchStyle(switchToken),
- // inner style
- genSwitchInnerStyle(switchToken),
- // handle style
- genSwitchHandleStyle(switchToken),
- // loading style
- genSwitchLoadingStyle(switchToken),
- // small style
- genSwitchSmallStyle(switchToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/table/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/table/style/index.ts + 15 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ table_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var cssinjs_utils_es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- ;// ./components/table/style/bordered.ts
- const genBorderedStyle = token => {
- const {
- componentCls,
- lineWidth,
- lineType,
- tableBorderColor,
- tableHeaderBg,
- tablePaddingVertical,
- tablePaddingHorizontal,
- calc
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- const getSizeBorderStyle = (size, paddingVertical, paddingHorizontal) => ({
- [`&${componentCls}-${size}`]: {
- [`> ${componentCls}-container`]: {
- [`> ${componentCls}-content, > ${componentCls}-body`]: {
- [`
- > table > tbody > tr > th,
- > table > tbody > tr > td
- `]: {
- [`> ${componentCls}-expanded-row-fixed`]: {
- margin: `${(0,cssinjs.unit)(calc(paddingVertical).mul(-1).equal())}
- ${(0,cssinjs.unit)(calc(calc(paddingHorizontal).add(lineWidth)).mul(-1).equal())}`
- }
- }
- }
- }
- }
- });
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}${componentCls}-bordered`]: Object.assign(Object.assign(Object.assign({
- // ============================ Title =============================
- [`> ${componentCls}-title`]: {
- border: tableBorder,
- borderBottom: 0
- },
- // ============================ Content ============================
- [`> ${componentCls}-container`]: {
- borderInlineStart: tableBorder,
- borderTop: tableBorder,
- [`
- > ${componentCls}-content,
- > ${componentCls}-header,
- > ${componentCls}-body,
- > ${componentCls}-summary
- `]: {
- '> table': {
- // ============================= Cell =============================
- [`
- > thead > tr > th,
- > thead > tr > td,
- > tbody > tr > th,
- > tbody > tr > td,
- > tfoot > tr > th,
- > tfoot > tr > td
- `]: {
- borderInlineEnd: tableBorder
- },
- // ============================ Header ============================
- '> thead': {
- '> tr:not(:last-child) > th': {
- borderBottom: tableBorder
- },
- '> tr > th::before': {
- backgroundColor: 'transparent !important'
- }
- },
- // Fixed right should provides additional border
- [`
- > thead > tr,
- > tbody > tr,
- > tfoot > tr
- `]: {
- [`> ${componentCls}-cell-fix-right-first::after`]: {
- borderInlineEnd: tableBorder
- }
- },
- // ========================== Expandable ==========================
- [`
- > tbody > tr > th,
- > tbody > tr > td
- `]: {
- [`> ${componentCls}-expanded-row-fixed`]: {
- margin: `${(0,cssinjs.unit)(calc(tablePaddingVertical).mul(-1).equal())} ${(0,cssinjs.unit)(calc(calc(tablePaddingHorizontal).add(lineWidth)).mul(-1).equal())}`,
- '&::after': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: lineWidth,
- bottom: 0,
- borderInlineEnd: tableBorder,
- content: '""'
- }
- }
- }
- }
- }
- },
- // ============================ Scroll ============================
- [`&${componentCls}-scroll-horizontal`]: {
- [`> ${componentCls}-container > ${componentCls}-body`]: {
- '> table > tbody': {
- [`
- > tr${componentCls}-expanded-row,
- > tr${componentCls}-placeholder
- `]: {
- '> th, > td': {
- borderInlineEnd: 0
- }
- }
- }
- }
- }
- }, getSizeBorderStyle('middle', token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle)), getSizeBorderStyle('small', token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall)), {
- // ============================ Footer ============================
- [`> ${componentCls}-footer`]: {
- border: tableBorder,
- borderTop: 0
- }
- }),
- // ============================ Nested ============================
- [`${componentCls}-cell`]: {
- [`${componentCls}-container:first-child`]: {
- // :first-child to avoid the case when bordered and title is set
- borderTop: 0
- },
- // https://github.com/ant-design/ant-design/issues/35577
- '&-scrollbar:not([rowspan])': {
- boxShadow: `0 ${(0,cssinjs.unit)(lineWidth)} 0 ${(0,cssinjs.unit)(lineWidth)} ${tableHeaderBg}`
- }
- },
- [`${componentCls}-bordered ${componentCls}-cell-scrollbar`]: {
- borderInlineEnd: tableBorder
- }
- }
- };
- };
- /* harmony default export */ var bordered = (genBorderedStyle);
- ;// ./components/table/style/ellipsis.ts
- const genEllipsisStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-cell-ellipsis`]: Object.assign(Object.assign({}, style.textEllipsis), {
- wordBreak: 'keep-all',
- // Fixed first or last should special process
- [`
- &${componentCls}-cell-fix-left-last,
- &${componentCls}-cell-fix-right-first
- `]: {
- overflow: 'visible',
- [`${componentCls}-cell-content`]: {
- display: 'block',
- overflow: 'hidden',
- textOverflow: 'ellipsis'
- }
- },
- [`${componentCls}-column-title`]: {
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- wordBreak: 'keep-all'
- }
- })
- }
- };
- };
- /* harmony default export */ var ellipsis = (genEllipsisStyle);
- ;// ./components/table/style/empty.ts
- // ========================= Placeholder ==========================
- const genEmptyStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-tbody > tr${componentCls}-placeholder`]: {
- textAlign: 'center',
- color: token.colorTextDisabled,
- [`
- &:hover > th,
- &:hover > td,
- `]: {
- background: token.colorBgContainer
- }
- }
- }
- };
- };
- /* harmony default export */ var empty = (genEmptyStyle);
- ;// ./components/table/style/expand.ts
- const genExpandStyle = token => {
- const {
- componentCls,
- antCls,
- motionDurationSlow,
- lineWidth,
- paddingXS,
- lineType,
- tableBorderColor,
- tableExpandIconBg,
- tableExpandColumnWidth,
- borderRadius,
- tablePaddingVertical,
- tablePaddingHorizontal,
- tableExpandedRowBg,
- paddingXXS,
- expandIconMarginTop,
- expandIconSize,
- expandIconHalfInner,
- expandIconScale,
- calc
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- const expandIconLineOffset = calc(paddingXXS).sub(lineWidth).equal();
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-expand-icon-col`]: {
- width: tableExpandColumnWidth
- },
- [`${componentCls}-row-expand-icon-cell`]: {
- textAlign: 'center',
- [`${componentCls}-row-expand-icon`]: {
- display: 'inline-flex',
- float: 'none',
- verticalAlign: 'sub'
- }
- },
- [`${componentCls}-row-indent`]: {
- height: 1,
- float: 'left'
- },
- [`${componentCls}-row-expand-icon`]: Object.assign(Object.assign({}, (0,style.operationUnit)(token)), {
- position: 'relative',
- float: 'left',
- width: expandIconSize,
- height: expandIconSize,
- color: 'inherit',
- lineHeight: (0,cssinjs.unit)(expandIconSize),
- background: tableExpandIconBg,
- border: tableBorder,
- borderRadius,
- transform: `scale(${expandIconScale})`,
- '&:focus, &:hover, &:active': {
- borderColor: 'currentcolor'
- },
- '&::before, &::after': {
- position: 'absolute',
- background: 'currentcolor',
- transition: `transform ${motionDurationSlow} ease-out`,
- content: '""'
- },
- '&::before': {
- top: expandIconHalfInner,
- insetInlineEnd: expandIconLineOffset,
- insetInlineStart: expandIconLineOffset,
- height: lineWidth
- },
- '&::after': {
- top: expandIconLineOffset,
- bottom: expandIconLineOffset,
- insetInlineStart: expandIconHalfInner,
- width: lineWidth,
- transform: 'rotate(90deg)'
- },
- // Motion effect
- '&-collapsed::before': {
- transform: 'rotate(-180deg)'
- },
- '&-collapsed::after': {
- transform: 'rotate(0deg)'
- },
- '&-spaced': {
- '&::before, &::after': {
- display: 'none',
- content: 'none'
- },
- background: 'transparent',
- border: 0,
- visibility: 'hidden'
- }
- }),
- [`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {
- marginTop: expandIconMarginTop,
- marginInlineEnd: paddingXS
- },
- [`tr${componentCls}-expanded-row`]: {
- '&, &:hover': {
- '> th, > td': {
- background: tableExpandedRowBg
- }
- },
- // https://github.com/ant-design/ant-design/issues/25573
- [`${antCls}-descriptions-view`]: {
- display: 'flex',
- table: {
- flex: 'auto',
- width: '100%'
- }
- }
- },
- // With fixed
- [`${componentCls}-expanded-row-fixed`]: {
- position: 'relative',
- margin: `${(0,cssinjs.unit)(calc(tablePaddingVertical).mul(-1).equal())} ${(0,cssinjs.unit)(calc(tablePaddingHorizontal).mul(-1).equal())}`,
- padding: `${(0,cssinjs.unit)(tablePaddingVertical)} ${(0,cssinjs.unit)(tablePaddingHorizontal)}`
- }
- }
- };
- };
- /* harmony default export */ var expand = (genExpandStyle);
- ;// ./components/table/style/filter.ts
- const genFilterStyle = token => {
- const {
- componentCls,
- antCls,
- iconCls,
- tableFilterDropdownWidth,
- tableFilterDropdownSearchWidth,
- paddingXXS,
- paddingXS,
- colorText,
- lineWidth,
- lineType,
- tableBorderColor,
- headerIconColor,
- fontSizeSM,
- tablePaddingHorizontal,
- borderRadius,
- motionDurationSlow,
- colorIcon,
- colorPrimary,
- tableHeaderFilterActiveBg,
- colorTextDisabled,
- tableFilterDropdownBg,
- tableFilterDropdownHeight,
- controlItemBgHover,
- controlItemBgActive,
- boxShadowSecondary,
- filterDropdownMenuBg,
- calc
- } = token;
- const dropdownPrefixCls = `${antCls}-dropdown`;
- const tableFilterDropdownPrefixCls = `${componentCls}-filter-dropdown`;
- const treePrefixCls = `${antCls}-tree`;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- return [{
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-filter-column`]: {
- display: 'flex',
- justifyContent: 'space-between'
- },
- [`${componentCls}-filter-trigger`]: {
- position: 'relative',
- display: 'flex',
- alignItems: 'center',
- marginBlock: calc(paddingXXS).mul(-1).equal(),
- marginInline: `${(0,cssinjs.unit)(paddingXXS)} ${(0,cssinjs.unit)(calc(tablePaddingHorizontal).div(2).mul(-1).equal())}`,
- padding: `0 ${(0,cssinjs.unit)(paddingXXS)}`,
- color: headerIconColor,
- fontSize: fontSizeSM,
- borderRadius,
- cursor: 'pointer',
- transition: `all ${motionDurationSlow}`,
- '&:hover': {
- color: colorIcon,
- background: tableHeaderFilterActiveBg
- },
- '&.active': {
- color: colorPrimary
- }
- }
- }
- }, {
- // Dropdown
- [`${antCls}-dropdown`]: {
- [tableFilterDropdownPrefixCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- minWidth: tableFilterDropdownWidth,
- backgroundColor: tableFilterDropdownBg,
- borderRadius,
- boxShadow: boxShadowSecondary,
- overflow: 'hidden',
- // Reset menu
- [`${dropdownPrefixCls}-menu`]: {
- // https://github.com/ant-design/ant-design/issues/4916
- // https://github.com/ant-design/ant-design/issues/19542
- maxHeight: tableFilterDropdownHeight,
- overflowX: 'hidden',
- border: 0,
- boxShadow: 'none',
- borderRadius: 'unset',
- backgroundColor: filterDropdownMenuBg,
- '&:empty::after': {
- display: 'block',
- padding: `${(0,cssinjs.unit)(paddingXS)} 0`,
- color: colorTextDisabled,
- fontSize: fontSizeSM,
- textAlign: 'center',
- content: '"Not Found"'
- }
- },
- [`${tableFilterDropdownPrefixCls}-tree`]: {
- paddingBlock: `${(0,cssinjs.unit)(paddingXS)} 0`,
- paddingInline: paddingXS,
- [treePrefixCls]: {
- padding: 0
- },
- [`${treePrefixCls}-treenode ${treePrefixCls}-node-content-wrapper:hover`]: {
- backgroundColor: controlItemBgHover
- },
- [`${treePrefixCls}-treenode-checkbox-checked ${treePrefixCls}-node-content-wrapper`]: {
- '&, &:hover': {
- backgroundColor: controlItemBgActive
- }
- }
- },
- [`${tableFilterDropdownPrefixCls}-search`]: {
- padding: paddingXS,
- borderBottom: tableBorder,
- '&-input': {
- input: {
- minWidth: tableFilterDropdownSearchWidth
- },
- [iconCls]: {
- color: colorTextDisabled
- }
- }
- },
- [`${tableFilterDropdownPrefixCls}-checkall`]: {
- width: '100%',
- marginBottom: paddingXXS,
- marginInlineStart: paddingXXS
- },
- // Operation
- [`${tableFilterDropdownPrefixCls}-btns`]: {
- display: 'flex',
- justifyContent: 'space-between',
- padding: `${(0,cssinjs.unit)(calc(paddingXS).sub(lineWidth).equal())} ${(0,cssinjs.unit)(paddingXS)}`,
- overflow: 'hidden',
- borderTop: tableBorder
- }
- })
- }
- },
- // Dropdown Menu & SubMenu
- {
- // submenu of table filter dropdown
- [`${antCls}-dropdown ${tableFilterDropdownPrefixCls}, ${tableFilterDropdownPrefixCls}-submenu`]: {
- // Checkbox
- [`${antCls}-checkbox-wrapper + span`]: {
- paddingInlineStart: paddingXS,
- color: colorText
- },
- '> ul': {
- maxHeight: 'calc(100vh - 130px)',
- overflowX: 'hidden',
- overflowY: 'auto'
- }
- }
- }];
- };
- /* harmony default export */ var filter = (genFilterStyle);
- ;// ./components/table/style/fixed.ts
- const genFixedStyle = token => {
- const {
- componentCls,
- lineWidth,
- colorSplit,
- motionDurationSlow,
- zIndexTableFixed,
- tableBg,
- zIndexTableSticky,
- calc
- } = token;
- const shadowColor = colorSplit;
- // Follow style is magic of shadow which should not follow token:
- return {
- [`${componentCls}-wrapper`]: {
- [`
- ${componentCls}-cell-fix-left,
- ${componentCls}-cell-fix-right
- `]: {
- position: 'sticky !important',
- zIndex: zIndexTableFixed,
- background: tableBg
- },
- [`
- ${componentCls}-cell-fix-left-first::after,
- ${componentCls}-cell-fix-left-last::after
- `]: {
- position: 'absolute',
- top: 0,
- right: {
- _skip_check_: true,
- value: 0
- },
- bottom: calc(lineWidth).mul(-1).equal(),
- width: 30,
- transform: 'translateX(100%)',
- transition: `box-shadow ${motionDurationSlow}`,
- content: '""',
- pointerEvents: 'none',
- // fix issues: https://github.com/ant-design/ant-design/issues/54587
- willChange: 'transform'
- },
- [`${componentCls}-cell-fix-left-all::after`]: {
- display: 'none'
- },
- [`
- ${componentCls}-cell-fix-right-first::after,
- ${componentCls}-cell-fix-right-last::after
- `]: {
- position: 'absolute',
- top: 0,
- bottom: calc(lineWidth).mul(-1).equal(),
- left: {
- _skip_check_: true,
- value: 0
- },
- width: 30,
- transform: 'translateX(-100%)',
- transition: `box-shadow ${motionDurationSlow}`,
- content: '""',
- pointerEvents: 'none'
- },
- [`${componentCls}-container`]: {
- position: 'relative',
- '&::before, &::after': {
- position: 'absolute',
- top: 0,
- bottom: 0,
- zIndex: calc(zIndexTableSticky).add(1).equal({
- unit: false
- }),
- width: 30,
- transition: `box-shadow ${motionDurationSlow}`,
- content: '""',
- pointerEvents: 'none'
- },
- '&::before': {
- insetInlineStart: 0
- },
- '&::after': {
- insetInlineEnd: 0
- }
- },
- [`${componentCls}-ping-left`]: {
- [`&:not(${componentCls}-has-fix-left) ${componentCls}-container::before`]: {
- boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
- },
- [`
- ${componentCls}-cell-fix-left-first::after,
- ${componentCls}-cell-fix-left-last::after
- `]: {
- boxShadow: `inset 10px 0 8px -8px ${shadowColor}`
- },
- [`${componentCls}-cell-fix-left-last::before`]: {
- backgroundColor: 'transparent !important'
- }
- },
- [`${componentCls}-ping-right`]: {
- [`&:not(${componentCls}-has-fix-right) ${componentCls}-container::after`]: {
- boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
- },
- [`
- ${componentCls}-cell-fix-right-first::after,
- ${componentCls}-cell-fix-right-last::after
- `]: {
- boxShadow: `inset -10px 0 8px -8px ${shadowColor}`
- }
- },
- // Gapped fixed Columns do not show the shadow
- [`${componentCls}-fixed-column-gapped`]: {
- [`
- ${componentCls}-cell-fix-left-first::after,
- ${componentCls}-cell-fix-left-last::after,
- ${componentCls}-cell-fix-right-first::after,
- ${componentCls}-cell-fix-right-last::after
- `]: {
- boxShadow: 'none'
- }
- }
- }
- };
- };
- /* harmony default export */ var fixed = (genFixedStyle);
- ;// ./components/table/style/pagination.ts
- const genPaginationStyle = token => {
- const {
- componentCls,
- antCls,
- margin
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- // ========================== Pagination ==========================
- [`${componentCls}-pagination${antCls}-pagination`]: {
- margin: `${(0,cssinjs.unit)(margin)} 0`
- },
- [`${componentCls}-pagination`]: {
- display: 'flex',
- flexWrap: 'wrap',
- rowGap: token.paddingXS,
- '> *': {
- flex: 'none'
- },
- '&-left': {
- justifyContent: 'flex-start'
- },
- '&-center': {
- justifyContent: 'center'
- },
- '&-right': {
- justifyContent: 'flex-end'
- }
- }
- }
- };
- };
- /* harmony default export */ var pagination = (genPaginationStyle);
- ;// ./components/table/style/radius.ts
- const genRadiusStyle = token => {
- const {
- componentCls,
- tableRadius
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- [componentCls]: {
- // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
- [`${componentCls}-title, ${componentCls}-header`]: {
- borderRadius: `${(0,cssinjs.unit)(tableRadius)} ${(0,cssinjs.unit)(tableRadius)} 0 0`
- },
- [`${componentCls}-title + ${componentCls}-container`]: {
- borderStartStartRadius: 0,
- borderStartEndRadius: 0,
- // https://github.com/ant-design/ant-design/issues/41975
- [`${componentCls}-header, table`]: {
- borderRadius: 0
- },
- 'table > thead > tr:first-child': {
- 'th:first-child, th:last-child, td:first-child, td:last-child': {
- borderRadius: 0
- }
- }
- },
- '&-container': {
- borderStartStartRadius: tableRadius,
- borderStartEndRadius: tableRadius,
- 'table > thead > tr:first-child': {
- '> *:first-child': {
- borderStartStartRadius: tableRadius
- },
- '> *:last-child': {
- borderStartEndRadius: tableRadius
- }
- }
- },
- '&-footer': {
- borderRadius: `0 0 ${(0,cssinjs.unit)(tableRadius)} ${(0,cssinjs.unit)(tableRadius)}`
- }
- }
- }
- };
- };
- /* harmony default export */ var radius = (genRadiusStyle);
- ;// ./components/table/style/rtl.ts
- const genStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-wrapper-rtl`]: {
- direction: 'rtl',
- table: {
- direction: 'rtl'
- },
- [`${componentCls}-pagination-left`]: {
- justifyContent: 'flex-end'
- },
- [`${componentCls}-pagination-right`]: {
- justifyContent: 'flex-start'
- },
- [`${componentCls}-row-expand-icon`]: {
- float: 'right',
- '&::after': {
- transform: 'rotate(-90deg)'
- },
- '&-collapsed::before': {
- transform: 'rotate(180deg)'
- },
- '&-collapsed::after': {
- transform: 'rotate(0deg)'
- }
- },
- [`${componentCls}-container`]: {
- '&::before': {
- insetInlineStart: 'unset',
- insetInlineEnd: 0
- },
- '&::after': {
- insetInlineStart: 0,
- insetInlineEnd: 'unset'
- },
- [`${componentCls}-row-indent`]: {
- float: 'right'
- }
- }
- }
- };
- };
- /* harmony default export */ var rtl = (genStyle);
- ;// ./components/table/style/selection.ts
- const genSelectionStyle = token => {
- const {
- componentCls,
- antCls,
- iconCls,
- fontSizeIcon,
- padding,
- paddingXS,
- headerIconColor,
- headerIconHoverColor,
- tableSelectionColumnWidth,
- tableSelectedRowBg,
- tableSelectedRowHoverBg,
- tableRowHoverBg,
- tablePaddingHorizontal,
- calc
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- // ========================== Selections ==========================
- [`${componentCls}-selection-col`]: {
- width: tableSelectionColumnWidth,
- [`&${componentCls}-selection-col-with-dropdown`]: {
- width: calc(tableSelectionColumnWidth).add(fontSizeIcon).add(calc(padding).div(4)).equal()
- }
- },
- [`${componentCls}-bordered ${componentCls}-selection-col`]: {
- width: calc(tableSelectionColumnWidth).add(calc(paddingXS).mul(2)).equal(),
- [`&${componentCls}-selection-col-with-dropdown`]: {
- width: calc(tableSelectionColumnWidth).add(fontSizeIcon).add(calc(padding).div(4)).add(calc(paddingXS).mul(2)).equal()
- }
- },
- [`
- table tr th${componentCls}-selection-column,
- table tr td${componentCls}-selection-column,
- ${componentCls}-selection-column
- `]: {
- paddingInlineEnd: token.paddingXS,
- paddingInlineStart: token.paddingXS,
- textAlign: 'center',
- [`${antCls}-radio-wrapper`]: {
- marginInlineEnd: 0
- }
- },
- [`table tr th${componentCls}-selection-column${componentCls}-cell-fix-left`]: {
- zIndex: calc(token.zIndexTableFixed).add(1).equal({
- unit: false
- })
- },
- [`table tr th${componentCls}-selection-column::after`]: {
- backgroundColor: 'transparent !important'
- },
- [`${componentCls}-selection`]: {
- position: 'relative',
- display: 'inline-flex',
- flexDirection: 'column'
- },
- [`${componentCls}-selection-extra`]: {
- position: 'absolute',
- top: 0,
- zIndex: 1,
- cursor: 'pointer',
- transition: `all ${token.motionDurationSlow}`,
- marginInlineStart: '100%',
- paddingInlineStart: (0,cssinjs.unit)(calc(tablePaddingHorizontal).div(4).equal()),
- [iconCls]: {
- color: headerIconColor,
- fontSize: fontSizeIcon,
- verticalAlign: 'baseline',
- '&:hover': {
- color: headerIconHoverColor
- }
- }
- },
- // ============================= Rows =============================
- [`${componentCls}-tbody`]: {
- [`${componentCls}-row`]: {
- [`&${componentCls}-row-selected`]: {
- [`> ${componentCls}-cell`]: {
- background: tableSelectedRowBg,
- '&-row-hover': {
- background: tableSelectedRowHoverBg
- }
- }
- },
- [`> ${componentCls}-cell-row-hover`]: {
- background: tableRowHoverBg
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var selection = (genSelectionStyle);
- ;// ./components/table/style/size.ts
- const genSizeStyle = token => {
- const {
- componentCls,
- tableExpandColumnWidth,
- calc
- } = token;
- const getSizeStyle = (size, paddingVertical, paddingHorizontal, fontSize) => ({
- [`${componentCls}${componentCls}-${size}`]: {
- fontSize,
- [`
- ${componentCls}-title,
- ${componentCls}-footer,
- ${componentCls}-cell,
- ${componentCls}-thead > tr > th,
- ${componentCls}-tbody > tr > th,
- ${componentCls}-tbody > tr > td,
- tfoot > tr > th,
- tfoot > tr > td
- `]: {
- padding: `${(0,cssinjs.unit)(paddingVertical)} ${(0,cssinjs.unit)(paddingHorizontal)}`
- },
- [`${componentCls}-filter-trigger`]: {
- marginInlineEnd: (0,cssinjs.unit)(calc(paddingHorizontal).div(2).mul(-1).equal())
- },
- [`${componentCls}-expanded-row-fixed`]: {
- margin: `${(0,cssinjs.unit)(calc(paddingVertical).mul(-1).equal())} ${(0,cssinjs.unit)(calc(paddingHorizontal).mul(-1).equal())}`
- },
- [`${componentCls}-tbody`]: {
- // ========================= Nest Table ===========================
- [`${componentCls}-wrapper:only-child ${componentCls}`]: {
- marginBlock: (0,cssinjs.unit)(calc(paddingVertical).mul(-1).equal()),
- marginInline: `${(0,cssinjs.unit)(calc(tableExpandColumnWidth).sub(paddingHorizontal).equal())} ${(0,cssinjs.unit)(calc(paddingHorizontal).mul(-1).equal())}`
- }
- },
- // https://github.com/ant-design/ant-design/issues/35167
- [`${componentCls}-selection-extra`]: {
- paddingInlineStart: (0,cssinjs.unit)(calc(paddingHorizontal).div(4).equal())
- }
- }
- });
- return {
- [`${componentCls}-wrapper`]: Object.assign(Object.assign({}, getSizeStyle('middle', token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle, token.tableFontSizeMiddle)), getSizeStyle('small', token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall, token.tableFontSizeSmall))
- };
- };
- /* harmony default export */ var size = (genSizeStyle);
- ;// ./components/table/style/sorter.ts
- const genSorterStyle = token => {
- const {
- componentCls,
- marginXXS,
- fontSizeIcon,
- headerIconColor,
- headerIconHoverColor
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-thead th${componentCls}-column-has-sorters`]: {
- outline: 'none',
- cursor: 'pointer',
- // why left 0s? Avoid column header move with transition when left is changed
- // https://github.com/ant-design/ant-design/issues/50588
- transition: `all ${token.motionDurationSlow}, left 0s`,
- '&:hover': {
- background: token.tableHeaderSortHoverBg,
- '&::before': {
- backgroundColor: 'transparent !important'
- }
- },
- '&:focus-visible': {
- color: token.colorPrimary
- },
- // https://github.com/ant-design/ant-design/issues/30969
- [`
- &${componentCls}-cell-fix-left:hover,
- &${componentCls}-cell-fix-right:hover
- `]: {
- background: token.tableFixedHeaderSortActiveBg
- }
- },
- [`${componentCls}-thead th${componentCls}-column-sort`]: {
- background: token.tableHeaderSortBg,
- '&::before': {
- backgroundColor: 'transparent !important'
- }
- },
- [`td${componentCls}-column-sort`]: {
- background: token.tableBodySortBg
- },
- [`${componentCls}-column-title`]: {
- position: 'relative',
- zIndex: 1,
- flex: 1,
- minWidth: 0
- },
- [`${componentCls}-column-sorters`]: {
- display: 'flex',
- flex: 'auto',
- alignItems: 'center',
- justifyContent: 'space-between',
- '&::after': {
- position: 'absolute',
- inset: 0,
- width: '100%',
- height: '100%',
- content: '""'
- }
- },
- [`${componentCls}-column-sorters-tooltip-target-sorter`]: {
- '&::after': {
- content: 'none'
- }
- },
- [`${componentCls}-column-sorter`]: {
- marginInlineStart: marginXXS,
- color: headerIconColor,
- fontSize: 0,
- transition: `color ${token.motionDurationSlow}`,
- '&-inner': {
- display: 'inline-flex',
- flexDirection: 'column',
- alignItems: 'center'
- },
- '&-up, &-down': {
- fontSize: fontSizeIcon,
- '&.active': {
- color: token.colorPrimary
- }
- },
- [`${componentCls}-column-sorter-up + ${componentCls}-column-sorter-down`]: {
- marginTop: '-0.3em'
- }
- },
- [`${componentCls}-column-sorters:hover ${componentCls}-column-sorter`]: {
- color: headerIconHoverColor
- }
- }
- };
- };
- /* harmony default export */ var sorter = (genSorterStyle);
- ;// ./components/table/style/sticky.ts
- const genStickyStyle = token => {
- const {
- componentCls,
- opacityLoading,
- tableScrollThumbBg,
- tableScrollThumbBgHover,
- tableScrollThumbSize,
- tableScrollBg,
- zIndexTableSticky,
- stickyScrollBarBorderRadius,
- lineWidth,
- lineType,
- tableBorderColor
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-sticky`]: {
- '&-holder': {
- position: 'sticky',
- zIndex: zIndexTableSticky,
- background: token.colorBgContainer
- },
- '&-scroll': {
- position: 'sticky',
- bottom: 0,
- height: `${(0,cssinjs.unit)(tableScrollThumbSize)} !important`,
- zIndex: zIndexTableSticky,
- display: 'flex',
- alignItems: 'center',
- background: tableScrollBg,
- borderTop: tableBorder,
- opacity: opacityLoading,
- '&:hover': {
- transformOrigin: 'center bottom'
- },
- // fake scrollbar style of sticky
- '&-bar': {
- height: tableScrollThumbSize,
- backgroundColor: tableScrollThumbBg,
- borderRadius: stickyScrollBarBorderRadius,
- transition: `all ${token.motionDurationSlow}, transform 0s`,
- position: 'absolute',
- bottom: 0,
- '&:hover, &-active': {
- backgroundColor: tableScrollThumbBgHover
- }
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var sticky = (genStickyStyle);
- ;// ./components/table/style/summary.ts
- const genSummaryStyle = token => {
- const {
- componentCls,
- lineWidth,
- tableBorderColor,
- calc
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${token.lineType} ${tableBorderColor}`;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-summary`]: {
- position: 'relative',
- zIndex: token.zIndexTableFixed,
- background: token.tableBg,
- '> tr': {
- '> th, > td': {
- borderBottom: tableBorder
- }
- }
- },
- [`div${componentCls}-summary`]: {
- boxShadow: `0 ${(0,cssinjs.unit)(calc(lineWidth).mul(-1).equal())} 0 ${tableBorderColor}`
- }
- }
- };
- };
- /* harmony default export */ var summary = (genSummaryStyle);
- ;// ./components/table/style/virtual.ts
- const genVirtualStyle = token => {
- const {
- componentCls,
- motionDurationMid,
- lineWidth,
- lineType,
- tableBorderColor,
- calc
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- const rowCellCls = `${componentCls}-expanded-row-cell`;
- return {
- [`${componentCls}-wrapper`]: {
- // ========================== Row ==========================
- [`${componentCls}-tbody-virtual`]: {
- [`${componentCls}-tbody-virtual-holder-inner`]: {
- [`
- & > ${componentCls}-row,
- & > div:not(${componentCls}-row) > ${componentCls}-row
- `]: {
- display: 'flex',
- boxSizing: 'border-box',
- width: '100%'
- }
- },
- [`${componentCls}-cell`]: {
- borderBottom: tableBorder,
- transition: `background ${motionDurationMid}`
- },
- [`${componentCls}-expanded-row`]: {
- [`${rowCellCls}${rowCellCls}-fixed`]: {
- position: 'sticky',
- insetInlineStart: 0,
- overflow: 'hidden',
- width: `calc(var(--virtual-width) - ${(0,cssinjs.unit)(lineWidth)})`,
- borderInlineEnd: 'none'
- }
- }
- },
- // ======================== Border =========================
- [`${componentCls}-bordered`]: {
- [`${componentCls}-tbody-virtual`]: {
- '&:after': {
- content: '""',
- insetInline: 0,
- bottom: 0,
- borderBottom: tableBorder,
- position: 'absolute'
- },
- [`${componentCls}-cell`]: {
- borderInlineEnd: tableBorder,
- [`&${componentCls}-cell-fix-right-first:before`]: {
- content: '""',
- position: 'absolute',
- insetBlock: 0,
- insetInlineStart: calc(lineWidth).mul(-1).equal(),
- borderInlineStart: tableBorder
- }
- }
- },
- // Empty placeholder
- [`&${componentCls}-virtual`]: {
- [`${componentCls}-placeholder ${componentCls}-cell`]: {
- borderInlineEnd: tableBorder,
- borderBottom: tableBorder
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var virtual = (genVirtualStyle);
- ;// ./components/table/style/index.ts
- const genTableStyle = token => {
- const {
- componentCls,
- fontWeightStrong,
- tablePaddingVertical,
- tablePaddingHorizontal,
- tableExpandColumnWidth,
- lineWidth,
- lineType,
- tableBorderColor,
- tableFontSize,
- tableBg,
- tableRadius,
- tableHeaderTextColor,
- motionDurationMid,
- tableHeaderBg,
- tableHeaderCellSplitColor,
- tableFooterTextColor,
- tableFooterBg,
- calc
- } = token;
- const tableBorder = `${(0,cssinjs.unit)(lineWidth)} ${lineType} ${tableBorderColor}`;
- return {
- [`${componentCls}-wrapper`]: Object.assign(Object.assign({
- clear: 'both',
- maxWidth: '100%',
- // fix https://github.com/ant-design/ant-design/issues/46177
- ['--rc-virtual-list-scrollbar-bg']: token.tableScrollBg
- }, (0,style.clearFix)()), {
- [componentCls]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- fontSize: tableFontSize,
- background: tableBg,
- borderRadius: `${(0,cssinjs.unit)(tableRadius)} ${(0,cssinjs.unit)(tableRadius)} 0 0`,
- // https://github.com/ant-design/ant-design/issues/47486
- scrollbarColor: `${token.tableScrollThumbBg} ${token.tableScrollBg}`
- }),
- // https://github.com/ant-design/ant-design/issues/17611
- table: {
- width: '100%',
- textAlign: 'start',
- borderRadius: `${(0,cssinjs.unit)(tableRadius)} ${(0,cssinjs.unit)(tableRadius)} 0 0`,
- borderCollapse: 'separate',
- borderSpacing: 0
- },
- // ============================= Cell ==============================
- [`
- ${componentCls}-cell,
- ${componentCls}-thead > tr > th,
- ${componentCls}-tbody > tr > th,
- ${componentCls}-tbody > tr > td,
- tfoot > tr > th,
- tfoot > tr > td
- `]: {
- position: 'relative',
- padding: `${(0,cssinjs.unit)(tablePaddingVertical)} ${(0,cssinjs.unit)(tablePaddingHorizontal)}`,
- overflowWrap: 'break-word'
- },
- // ============================ Title =============================
- [`${componentCls}-title`]: {
- padding: `${(0,cssinjs.unit)(tablePaddingVertical)} ${(0,cssinjs.unit)(tablePaddingHorizontal)}`
- },
- // ============================ Header ============================
- [`${componentCls}-thead`]: {
- [`
- > tr > th,
- > tr > td
- `]: {
- position: 'relative',
- color: tableHeaderTextColor,
- fontWeight: fontWeightStrong,
- textAlign: 'start',
- background: tableHeaderBg,
- borderBottom: tableBorder,
- transition: `background ${motionDurationMid} ease`,
- "&[colspan]:not([colspan='1'])": {
- textAlign: 'center'
- },
- [`&:not(:last-child):not(${componentCls}-selection-column):not(${componentCls}-row-expand-icon-cell):not([colspan])::before`]: {
- position: 'absolute',
- top: '50%',
- insetInlineEnd: 0,
- width: 1,
- height: '1.6em',
- backgroundColor: tableHeaderCellSplitColor,
- transform: 'translateY(-50%)',
- transition: `background-color ${motionDurationMid}`,
- content: '""'
- }
- },
- '> tr:not(:last-child) > th[colspan]': {
- borderBottom: 0
- }
- },
- // ============================ Body ============================
- [`${componentCls}-tbody`]: {
- '> tr': {
- '> th, > td': {
- transition: `background ${motionDurationMid}, border-color ${motionDurationMid}`,
- borderBottom: tableBorder,
- // ========================= Nest Table ===========================
- [`
- > ${componentCls}-wrapper:only-child,
- > ${componentCls}-expanded-row-fixed > ${componentCls}-wrapper:only-child
- `]: {
- [componentCls]: {
- marginBlock: (0,cssinjs.unit)(calc(tablePaddingVertical).mul(-1).equal()),
- marginInline: `${(0,cssinjs.unit)(calc(tableExpandColumnWidth).sub(tablePaddingHorizontal).equal())}
- ${(0,cssinjs.unit)(calc(tablePaddingHorizontal).mul(-1).equal())}`,
- [`${componentCls}-tbody > tr:last-child > td`]: {
- borderBottomWidth: 0,
- '&:first-child, &:last-child': {
- borderRadius: 0
- }
- }
- }
- }
- },
- '> th': {
- position: 'relative',
- color: tableHeaderTextColor,
- fontWeight: fontWeightStrong,
- textAlign: 'start',
- background: tableHeaderBg,
- borderBottom: tableBorder,
- transition: `background ${motionDurationMid} ease`
- }
- }
- },
- // ============================ Footer ============================
- [`${componentCls}-footer`]: {
- padding: `${(0,cssinjs.unit)(tablePaddingVertical)} ${(0,cssinjs.unit)(tablePaddingHorizontal)}`,
- color: tableFooterTextColor,
- background: tableFooterBg
- }
- })
- };
- };
- const prepareComponentToken = token => {
- const {
- colorFillAlter,
- colorBgContainer,
- colorTextHeading,
- colorFillSecondary,
- colorFillContent,
- controlItemBgActive,
- controlItemBgActiveHover,
- padding,
- paddingSM,
- paddingXS,
- colorBorderSecondary,
- borderRadiusLG,
- controlHeight,
- colorTextPlaceholder,
- fontSize,
- fontSizeSM,
- lineHeight,
- lineWidth,
- colorIcon,
- colorIconHover,
- opacityLoading,
- controlInteractiveSize
- } = token;
- const colorFillSecondarySolid = new es.FastColor(colorFillSecondary).onBackground(colorBgContainer).toHexString();
- const colorFillContentSolid = new es.FastColor(colorFillContent).onBackground(colorBgContainer).toHexString();
- const colorFillAlterSolid = new es.FastColor(colorFillAlter).onBackground(colorBgContainer).toHexString();
- const baseColorAction = new es.FastColor(colorIcon);
- const baseColorActionHover = new es.FastColor(colorIconHover);
- const expandIconHalfInner = controlInteractiveSize / 2 - lineWidth;
- const expandIconSize = expandIconHalfInner * 2 + lineWidth * 3;
- return {
- headerBg: colorFillAlterSolid,
- headerColor: colorTextHeading,
- headerSortActiveBg: colorFillSecondarySolid,
- headerSortHoverBg: colorFillContentSolid,
- bodySortBg: colorFillAlterSolid,
- rowHoverBg: colorFillAlterSolid,
- rowSelectedBg: controlItemBgActive,
- rowSelectedHoverBg: controlItemBgActiveHover,
- rowExpandedBg: colorFillAlter,
- cellPaddingBlock: padding,
- cellPaddingInline: padding,
- cellPaddingBlockMD: paddingSM,
- cellPaddingInlineMD: paddingXS,
- cellPaddingBlockSM: paddingXS,
- cellPaddingInlineSM: paddingXS,
- borderColor: colorBorderSecondary,
- headerBorderRadius: borderRadiusLG,
- footerBg: colorFillAlterSolid,
- footerColor: colorTextHeading,
- cellFontSize: fontSize,
- cellFontSizeMD: fontSize,
- cellFontSizeSM: fontSize,
- headerSplitColor: colorBorderSecondary,
- fixedHeaderSortActiveBg: colorFillSecondarySolid,
- headerFilterHoverBg: colorFillContent,
- filterDropdownMenuBg: colorBgContainer,
- filterDropdownBg: colorBgContainer,
- expandIconBg: colorBgContainer,
- selectionColumnWidth: controlHeight,
- stickyScrollBarBg: colorTextPlaceholder,
- stickyScrollBarBorderRadius: 100,
- expandIconMarginTop: (fontSize * lineHeight - lineWidth * 3) / 2 - Math.ceil((fontSizeSM * 1.4 - lineWidth * 3) / 2),
- headerIconColor: baseColorAction.clone().setA(baseColorAction.a * opacityLoading).toRgbString(),
- headerIconHoverColor: baseColorActionHover.clone().setA(baseColorActionHover.a * opacityLoading).toRgbString(),
- expandIconHalfInner,
- expandIconSize,
- expandIconScale: controlInteractiveSize / expandIconSize
- };
- };
- const zIndexTableFixed = 2;
- // ============================== Export ==============================
- /* harmony default export */ var table_style = ((0,genStyleUtils.genStyleHooks)('Table', token => {
- const {
- colorTextHeading,
- colorSplit,
- colorBgContainer,
- controlInteractiveSize: checkboxSize,
- headerBg,
- headerColor,
- headerSortActiveBg,
- headerSortHoverBg,
- bodySortBg,
- rowHoverBg,
- rowSelectedBg,
- rowSelectedHoverBg,
- rowExpandedBg,
- cellPaddingBlock,
- cellPaddingInline,
- cellPaddingBlockMD,
- cellPaddingInlineMD,
- cellPaddingBlockSM,
- cellPaddingInlineSM,
- borderColor,
- footerBg,
- footerColor,
- headerBorderRadius,
- cellFontSize,
- cellFontSizeMD,
- cellFontSizeSM,
- headerSplitColor,
- fixedHeaderSortActiveBg,
- headerFilterHoverBg,
- filterDropdownBg,
- expandIconBg,
- selectionColumnWidth,
- stickyScrollBarBg,
- calc
- } = token;
- const tableToken = (0,cssinjs_utils_es.mergeToken)(token, {
- tableFontSize: cellFontSize,
- tableBg: colorBgContainer,
- tableRadius: headerBorderRadius,
- tablePaddingVertical: cellPaddingBlock,
- tablePaddingHorizontal: cellPaddingInline,
- tablePaddingVerticalMiddle: cellPaddingBlockMD,
- tablePaddingHorizontalMiddle: cellPaddingInlineMD,
- tablePaddingVerticalSmall: cellPaddingBlockSM,
- tablePaddingHorizontalSmall: cellPaddingInlineSM,
- tableBorderColor: borderColor,
- tableHeaderTextColor: headerColor,
- tableHeaderBg: headerBg,
- tableFooterTextColor: footerColor,
- tableFooterBg: footerBg,
- tableHeaderCellSplitColor: headerSplitColor,
- tableHeaderSortBg: headerSortActiveBg,
- tableHeaderSortHoverBg: headerSortHoverBg,
- tableBodySortBg: bodySortBg,
- tableFixedHeaderSortActiveBg: fixedHeaderSortActiveBg,
- tableHeaderFilterActiveBg: headerFilterHoverBg,
- tableFilterDropdownBg: filterDropdownBg,
- tableRowHoverBg: rowHoverBg,
- tableSelectedRowBg: rowSelectedBg,
- tableSelectedRowHoverBg: rowSelectedHoverBg,
- zIndexTableFixed,
- zIndexTableSticky: calc(zIndexTableFixed).add(1).equal({
- unit: false
- }),
- tableFontSizeMiddle: cellFontSizeMD,
- tableFontSizeSmall: cellFontSizeSM,
- tableSelectionColumnWidth: selectionColumnWidth,
- tableExpandIconBg: expandIconBg,
- tableExpandColumnWidth: calc(checkboxSize).add(calc(token.padding).mul(2)).equal(),
- tableExpandedRowBg: rowExpandedBg,
- // Dropdown
- tableFilterDropdownWidth: 120,
- tableFilterDropdownHeight: 264,
- tableFilterDropdownSearchWidth: 140,
- // Virtual Scroll Bar
- tableScrollThumbSize: 8,
- // Mac scroll bar size
- tableScrollThumbBg: stickyScrollBarBg,
- tableScrollThumbBgHover: colorTextHeading,
- tableScrollBg: colorSplit
- });
- return [genTableStyle(tableToken), pagination(tableToken), summary(tableToken), sorter(tableToken), filter(tableToken), bordered(tableToken), radius(tableToken), expand(tableToken), summary(tableToken), empty(tableToken), selection(tableToken), fixed(tableToken), sticky(tableToken), ellipsis(tableToken), size(tableToken), rtl(tableToken), virtual(tableToken)];
- }, prepareComponentToken, {
- unitless: {
- expandIconScale: true
- }
- }));
- /***/ }),
- /***/ "./components/tabs/style/index.ts":
- /*!****************************************************!*\
- !*** ./components/tabs/style/index.ts + 1 modules ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ tabs_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/style/motion/slide.ts
- var slide = __webpack_require__("./components/style/motion/slide.ts");
- ;// ./components/tabs/style/motion.ts
- const genMotionStyle = token => {
- const {
- componentCls,
- motionDurationSlow
- } = token;
- return [{
- [componentCls]: {
- [`${componentCls}-switch`]: {
- '&-appear, &-enter': {
- transition: 'none',
- '&-start': {
- opacity: 0
- },
- '&-active': {
- opacity: 1,
- transition: `opacity ${motionDurationSlow}`
- }
- },
- '&-leave': {
- position: 'absolute',
- transition: 'none',
- inset: 0,
- '&-start': {
- opacity: 1
- },
- '&-active': {
- opacity: 0,
- transition: `opacity ${motionDurationSlow}`
- }
- }
- }
- }
- },
- // Follow code may reuse in other components
- [(0,slide.initSlideMotion)(token, 'slide-up'), (0,slide.initSlideMotion)(token, 'slide-down')]];
- };
- /* harmony default export */ var motion = (genMotionStyle);
- ;// ./components/tabs/style/index.ts
- const genCardStyle = token => {
- const {
- componentCls,
- tabsCardPadding,
- cardBg,
- cardGutter,
- colorBorderSecondary,
- itemSelectedColor
- } = token;
- return {
- [`${componentCls}-card`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- margin: 0,
- padding: tabsCardPadding,
- background: cardBg,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
- transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`
- },
- [`${componentCls}-tab-active`]: {
- color: itemSelectedColor,
- background: token.colorBgContainer
- },
- [`${componentCls}-tab-focus:has(${componentCls}-tab-btn:focus-visible)`]: (0,style.genFocusOutline)(token, -3),
- [`& ${componentCls}-tab${componentCls}-tab-focus ${componentCls}-tab-btn:focus-visible`]: {
- outline: 'none'
- },
- [`${componentCls}-ink-bar`]: {
- visibility: 'hidden'
- }
- },
- // ========================== Top & Bottom ==========================
- [`&${componentCls}-top, &${componentCls}-bottom`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab + ${componentCls}-tab`]: {
- marginLeft: {
- _skip_check_: true,
- value: (0,cssinjs.unit)(cardGutter)
- }
- }
- }
- },
- [`&${componentCls}-top`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- borderRadius: `${(0,cssinjs.unit)(token.borderRadiusLG)} ${(0,cssinjs.unit)(token.borderRadiusLG)} 0 0`
- },
- [`${componentCls}-tab-active`]: {
- borderBottomColor: token.colorBgContainer
- }
- }
- },
- [`&${componentCls}-bottom`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- borderRadius: `0 0 ${(0,cssinjs.unit)(token.borderRadiusLG)} ${(0,cssinjs.unit)(token.borderRadiusLG)}`
- },
- [`${componentCls}-tab-active`]: {
- borderTopColor: token.colorBgContainer
- }
- }
- },
- // ========================== Left & Right ==========================
- [`&${componentCls}-left, &${componentCls}-right`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab + ${componentCls}-tab`]: {
- marginTop: (0,cssinjs.unit)(cardGutter)
- }
- }
- },
- [`&${componentCls}-left`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- borderRadius: {
- _skip_check_: true,
- value: `${(0,cssinjs.unit)(token.borderRadiusLG)} 0 0 ${(0,cssinjs.unit)(token.borderRadiusLG)}`
- }
- },
- [`${componentCls}-tab-active`]: {
- borderRightColor: {
- _skip_check_: true,
- value: token.colorBgContainer
- }
- }
- }
- },
- [`&${componentCls}-right`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- borderRadius: {
- _skip_check_: true,
- value: `0 ${(0,cssinjs.unit)(token.borderRadiusLG)} ${(0,cssinjs.unit)(token.borderRadiusLG)} 0`
- }
- },
- [`${componentCls}-tab-active`]: {
- borderLeftColor: {
- _skip_check_: true,
- value: token.colorBgContainer
- }
- }
- }
- }
- }
- };
- };
- const genDropdownStyle = token => {
- const {
- componentCls,
- itemHoverColor,
- dropdownEdgeChildVerticalPadding
- } = token;
- return {
- [`${componentCls}-dropdown`]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- position: 'absolute',
- top: -9999,
- left: {
- _skip_check_: true,
- value: -9999
- },
- zIndex: token.zIndexPopup,
- display: 'block',
- '&-hidden': {
- display: 'none'
- },
- [`${componentCls}-dropdown-menu`]: {
- maxHeight: token.tabsDropdownHeight,
- margin: 0,
- padding: `${(0,cssinjs.unit)(dropdownEdgeChildVerticalPadding)} 0`,
- overflowX: 'hidden',
- overflowY: 'auto',
- textAlign: {
- _skip_check_: true,
- value: 'left'
- },
- listStyleType: 'none',
- backgroundColor: token.colorBgContainer,
- backgroundClip: 'padding-box',
- borderRadius: token.borderRadiusLG,
- outline: 'none',
- boxShadow: token.boxShadowSecondary,
- '&-item': Object.assign(Object.assign({}, style.textEllipsis), {
- display: 'flex',
- alignItems: 'center',
- minWidth: token.tabsDropdownWidth,
- margin: 0,
- padding: `${(0,cssinjs.unit)(token.paddingXXS)} ${(0,cssinjs.unit)(token.paddingSM)}`,
- color: token.colorText,
- fontWeight: 'normal',
- fontSize: token.fontSize,
- lineHeight: token.lineHeight,
- cursor: 'pointer',
- transition: `all ${token.motionDurationSlow}`,
- '> span': {
- flex: 1,
- whiteSpace: 'nowrap'
- },
- '&-remove': {
- flex: 'none',
- marginLeft: {
- _skip_check_: true,
- value: token.marginSM
- },
- color: token.colorIcon,
- fontSize: token.fontSizeSM,
- background: 'transparent',
- border: 0,
- cursor: 'pointer',
- '&:hover': {
- color: itemHoverColor
- }
- },
- '&:hover': {
- background: token.controlItemBgHover
- },
- '&-disabled': {
- '&, &:hover': {
- color: token.colorTextDisabled,
- background: 'transparent',
- cursor: 'not-allowed'
- }
- }
- })
- }
- })
- };
- };
- const genPositionStyle = token => {
- const {
- componentCls,
- margin,
- colorBorderSecondary,
- horizontalMargin,
- verticalItemPadding,
- verticalItemMargin,
- calc
- } = token;
- return {
- // ========================== Top & Bottom ==========================
- [`${componentCls}-top, ${componentCls}-bottom`]: {
- flexDirection: 'column',
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- margin: horizontalMargin,
- '&::before': {
- position: 'absolute',
- right: {
- _skip_check_: true,
- value: 0
- },
- left: {
- _skip_check_: true,
- value: 0
- },
- borderBottom: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
- content: "''"
- },
- [`${componentCls}-ink-bar`]: {
- height: token.lineWidthBold,
- '&-animated': {
- transition: `width ${token.motionDurationSlow}, left ${token.motionDurationSlow},
- right ${token.motionDurationSlow}`
- }
- },
- [`${componentCls}-nav-wrap`]: {
- '&::before, &::after': {
- top: 0,
- bottom: 0,
- width: token.controlHeight
- },
- '&::before': {
- left: {
- _skip_check_: true,
- value: 0
- },
- boxShadow: token.boxShadowTabsOverflowLeft
- },
- '&::after': {
- right: {
- _skip_check_: true,
- value: 0
- },
- boxShadow: token.boxShadowTabsOverflowRight
- },
- [`&${componentCls}-nav-wrap-ping-left::before`]: {
- opacity: 1
- },
- [`&${componentCls}-nav-wrap-ping-right::after`]: {
- opacity: 1
- }
- }
- }
- },
- [`${componentCls}-top`]: {
- [`> ${componentCls}-nav,
- > div > ${componentCls}-nav`]: {
- '&::before': {
- bottom: 0
- },
- [`${componentCls}-ink-bar`]: {
- bottom: 0
- }
- }
- },
- [`${componentCls}-bottom`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- order: 1,
- marginTop: margin,
- marginBottom: 0,
- '&::before': {
- top: 0
- },
- [`${componentCls}-ink-bar`]: {
- top: 0
- }
- },
- [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
- order: 0
- }
- },
- // ========================== Left & Right ==========================
- [`${componentCls}-left, ${componentCls}-right`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- flexDirection: 'column',
- minWidth: calc(token.controlHeight).mul(1.25).equal(),
- // >>>>>>>>>>> Tab
- [`${componentCls}-tab`]: {
- padding: verticalItemPadding,
- textAlign: 'center'
- },
- [`${componentCls}-tab + ${componentCls}-tab`]: {
- margin: verticalItemMargin
- },
- // >>>>>>>>>>> Nav
- [`${componentCls}-nav-wrap`]: {
- flexDirection: 'column',
- '&::before, &::after': {
- right: {
- _skip_check_: true,
- value: 0
- },
- left: {
- _skip_check_: true,
- value: 0
- },
- height: token.controlHeight
- },
- '&::before': {
- top: 0,
- boxShadow: token.boxShadowTabsOverflowTop
- },
- '&::after': {
- bottom: 0,
- boxShadow: token.boxShadowTabsOverflowBottom
- },
- [`&${componentCls}-nav-wrap-ping-top::before`]: {
- opacity: 1
- },
- [`&${componentCls}-nav-wrap-ping-bottom::after`]: {
- opacity: 1
- }
- },
- // >>>>>>>>>>> Ink Bar
- [`${componentCls}-ink-bar`]: {
- width: token.lineWidthBold,
- '&-animated': {
- transition: `height ${token.motionDurationSlow}, top ${token.motionDurationSlow}`
- }
- },
- [`${componentCls}-nav-list, ${componentCls}-nav-operations`]: {
- flex: '1 0 auto',
- // fix safari scroll problem
- flexDirection: 'column'
- }
- }
- },
- [`${componentCls}-left`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-ink-bar`]: {
- right: {
- _skip_check_: true,
- value: 0
- }
- }
- },
- [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
- marginLeft: {
- _skip_check_: true,
- value: (0,cssinjs.unit)(calc(token.lineWidth).mul(-1).equal())
- },
- borderLeft: {
- _skip_check_: true,
- value: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- },
- [`> ${componentCls}-content > ${componentCls}-tabpane`]: {
- paddingLeft: {
- _skip_check_: true,
- value: token.paddingLG
- }
- }
- }
- },
- [`${componentCls}-right`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- order: 1,
- [`${componentCls}-ink-bar`]: {
- left: {
- _skip_check_: true,
- value: 0
- }
- }
- },
- [`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
- order: 0,
- marginRight: {
- _skip_check_: true,
- value: calc(token.lineWidth).mul(-1).equal()
- },
- borderRight: {
- _skip_check_: true,
- value: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
- },
- [`> ${componentCls}-content > ${componentCls}-tabpane`]: {
- paddingRight: {
- _skip_check_: true,
- value: token.paddingLG
- }
- }
- }
- }
- };
- };
- const genSizeStyle = token => {
- const {
- componentCls,
- cardPaddingSM,
- cardPaddingLG,
- cardHeightSM,
- cardHeightLG,
- horizontalItemPaddingSM,
- horizontalItemPaddingLG
- } = token;
- return {
- // >>>>> shared
- [componentCls]: {
- '&-small': {
- [`> ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- padding: horizontalItemPaddingSM,
- fontSize: token.titleFontSizeSM
- }
- }
- },
- '&-large': {
- [`> ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- padding: horizontalItemPaddingLG,
- fontSize: token.titleFontSizeLG,
- lineHeight: token.lineHeightLG
- }
- }
- }
- },
- // >>>>> card
- [`${componentCls}-card`]: {
- // Small
- [`&${componentCls}-small`]: {
- [`> ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- padding: cardPaddingSM
- },
- [`${componentCls}-nav-add`]: {
- minWidth: cardHeightSM,
- minHeight: cardHeightSM
- }
- },
- [`&${componentCls}-bottom`]: {
- [`> ${componentCls}-nav ${componentCls}-tab`]: {
- borderRadius: `0 0 ${(0,cssinjs.unit)(token.borderRadius)} ${(0,cssinjs.unit)(token.borderRadius)}`
- }
- },
- [`&${componentCls}-top`]: {
- [`> ${componentCls}-nav ${componentCls}-tab`]: {
- borderRadius: `${(0,cssinjs.unit)(token.borderRadius)} ${(0,cssinjs.unit)(token.borderRadius)} 0 0`
- }
- },
- [`&${componentCls}-right`]: {
- [`> ${componentCls}-nav ${componentCls}-tab`]: {
- borderRadius: {
- _skip_check_: true,
- value: `0 ${(0,cssinjs.unit)(token.borderRadius)} ${(0,cssinjs.unit)(token.borderRadius)} 0`
- }
- }
- },
- [`&${componentCls}-left`]: {
- [`> ${componentCls}-nav ${componentCls}-tab`]: {
- borderRadius: {
- _skip_check_: true,
- value: `${(0,cssinjs.unit)(token.borderRadius)} 0 0 ${(0,cssinjs.unit)(token.borderRadius)}`
- }
- }
- }
- },
- // Large
- [`&${componentCls}-large`]: {
- [`> ${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- padding: cardPaddingLG
- },
- [`${componentCls}-nav-add`]: {
- minWidth: cardHeightLG,
- minHeight: cardHeightLG
- }
- }
- }
- }
- };
- };
- const genTabStyle = token => {
- const {
- componentCls,
- itemActiveColor,
- itemHoverColor,
- iconCls,
- tabsHorizontalItemMargin,
- horizontalItemPadding,
- itemSelectedColor,
- itemColor
- } = token;
- const tabCls = `${componentCls}-tab`;
- return {
- [tabCls]: {
- position: 'relative',
- WebkitTouchCallout: 'none',
- WebkitTapHighlightColor: 'transparent',
- display: 'inline-flex',
- alignItems: 'center',
- padding: horizontalItemPadding,
- fontSize: token.titleFontSize,
- background: 'transparent',
- border: 0,
- outline: 'none',
- cursor: 'pointer',
- color: itemColor,
- '&-btn, &-remove': {
- '&:focus:not(:focus-visible), &:active': {
- color: itemActiveColor
- }
- },
- '&-btn': {
- outline: 'none',
- transition: `all ${token.motionDurationSlow}`,
- [`${tabCls}-icon:not(:last-child)`]: {
- marginInlineEnd: token.marginSM
- }
- },
- '&-remove': Object.assign({
- flex: 'none',
- lineHeight: 1,
- marginRight: {
- _skip_check_: true,
- value: token.calc(token.marginXXS).mul(-1).equal()
- },
- marginLeft: {
- _skip_check_: true,
- value: token.marginXS
- },
- color: token.colorIcon,
- fontSize: token.fontSizeSM,
- background: 'transparent',
- border: 'none',
- outline: 'none',
- cursor: 'pointer',
- transition: `all ${token.motionDurationSlow}`,
- '&:hover': {
- color: token.colorTextHeading
- }
- }, (0,style.genFocusStyle)(token)),
- '&:hover': {
- color: itemHoverColor
- },
- [`&${tabCls}-active ${tabCls}-btn`]: {
- color: itemSelectedColor,
- textShadow: token.tabsActiveTextShadow
- },
- [`&${tabCls}-focus ${tabCls}-btn:focus-visible`]: (0,style.genFocusOutline)(token),
- [`&${tabCls}-disabled`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed'
- },
- [`&${tabCls}-disabled ${tabCls}-btn, &${tabCls}-disabled ${componentCls}-remove`]: {
- '&:focus, &:active': {
- color: token.colorTextDisabled
- }
- },
- [`& ${tabCls}-remove ${iconCls}`]: {
- margin: 0,
- verticalAlign: 'middle'
- },
- [`${iconCls}:not(:last-child)`]: {
- marginRight: {
- _skip_check_: true,
- value: token.marginSM
- }
- }
- },
- [`${tabCls} + ${tabCls}`]: {
- margin: {
- _skip_check_: true,
- value: tabsHorizontalItemMargin
- }
- }
- };
- };
- const genRtlStyle = token => {
- const {
- componentCls,
- tabsHorizontalItemMarginRTL,
- iconCls,
- cardGutter,
- calc
- } = token;
- const rtlCls = `${componentCls}-rtl`;
- return {
- [rtlCls]: {
- direction: 'rtl',
- [`${componentCls}-nav`]: {
- [`${componentCls}-tab`]: {
- margin: {
- _skip_check_: true,
- value: tabsHorizontalItemMarginRTL
- },
- [`${componentCls}-tab:last-of-type`]: {
- marginLeft: {
- _skip_check_: true,
- value: 0
- }
- },
- [iconCls]: {
- marginRight: {
- _skip_check_: true,
- value: 0
- },
- marginLeft: {
- _skip_check_: true,
- value: (0,cssinjs.unit)(token.marginSM)
- }
- },
- [`${componentCls}-tab-remove`]: {
- marginRight: {
- _skip_check_: true,
- value: (0,cssinjs.unit)(token.marginXS)
- },
- marginLeft: {
- _skip_check_: true,
- value: (0,cssinjs.unit)(calc(token.marginXXS).mul(-1).equal())
- },
- [iconCls]: {
- margin: 0
- }
- }
- }
- },
- [`&${componentCls}-left`]: {
- [`> ${componentCls}-nav`]: {
- order: 1
- },
- [`> ${componentCls}-content-holder`]: {
- order: 0
- }
- },
- [`&${componentCls}-right`]: {
- [`> ${componentCls}-nav`]: {
- order: 0
- },
- [`> ${componentCls}-content-holder`]: {
- order: 1
- }
- },
- // ====================== Card ======================
- [`&${componentCls}-card${componentCls}-top, &${componentCls}-card${componentCls}-bottom`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-tab + ${componentCls}-tab`]: {
- marginRight: {
- _skip_check_: true,
- value: cardGutter
- },
- marginLeft: {
- _skip_check_: true,
- value: 0
- }
- }
- }
- }
- },
- [`${componentCls}-dropdown-rtl`]: {
- direction: 'rtl'
- },
- [`${componentCls}-menu-item`]: {
- [`${componentCls}-dropdown-rtl`]: {
- textAlign: {
- _skip_check_: true,
- value: 'right'
- }
- }
- }
- };
- };
- const genTabsStyle = token => {
- const {
- componentCls,
- tabsCardPadding,
- cardHeight,
- cardGutter,
- itemHoverColor,
- itemActiveColor,
- colorBorderSecondary
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- display: 'flex',
- // ========================== Navigation ==========================
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- position: 'relative',
- display: 'flex',
- flex: 'none',
- alignItems: 'center',
- [`${componentCls}-nav-wrap`]: {
- position: 'relative',
- display: 'flex',
- flex: 'auto',
- alignSelf: 'stretch',
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- transform: 'translate(0)',
- // Fix chrome render bug
- // >>>>> Ping shadow
- '&::before, &::after': {
- position: 'absolute',
- zIndex: 1,
- opacity: 0,
- transition: `opacity ${token.motionDurationSlow}`,
- content: "''",
- pointerEvents: 'none'
- }
- },
- [`${componentCls}-nav-list`]: {
- position: 'relative',
- display: 'flex',
- transition: `opacity ${token.motionDurationSlow}`
- },
- // >>>>>>>> Operations
- [`${componentCls}-nav-operations`]: {
- display: 'flex',
- alignSelf: 'stretch'
- },
- [`${componentCls}-nav-operations-hidden`]: {
- position: 'absolute',
- visibility: 'hidden',
- pointerEvents: 'none'
- },
- [`${componentCls}-nav-more`]: {
- position: 'relative',
- padding: tabsCardPadding,
- background: 'transparent',
- border: 0,
- color: token.colorText,
- '&::after': {
- position: 'absolute',
- right: {
- _skip_check_: true,
- value: 0
- },
- bottom: 0,
- left: {
- _skip_check_: true,
- value: 0
- },
- height: token.calc(token.controlHeightLG).div(8).equal(),
- transform: 'translateY(100%)',
- content: "''"
- }
- },
- [`${componentCls}-nav-add`]: Object.assign({
- minWidth: cardHeight,
- minHeight: cardHeight,
- marginLeft: {
- _skip_check_: true,
- value: cardGutter
- },
- background: 'transparent',
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
- borderRadius: `${(0,cssinjs.unit)(token.borderRadiusLG)} ${(0,cssinjs.unit)(token.borderRadiusLG)} 0 0`,
- outline: 'none',
- cursor: 'pointer',
- color: token.colorText,
- transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`,
- '&:hover': {
- color: itemHoverColor
- },
- '&:active, &:focus:not(:focus-visible)': {
- color: itemActiveColor
- }
- }, (0,style.genFocusStyle)(token, -3))
- },
- [`${componentCls}-extra-content`]: {
- flex: 'none'
- },
- // ============================ InkBar ============================
- [`${componentCls}-ink-bar`]: {
- position: 'absolute',
- background: token.inkBarColor,
- pointerEvents: 'none'
- }
- }), genTabStyle(token)), {
- // =========================== TabPanes ===========================
- [`${componentCls}-content`]: {
- position: 'relative',
- width: '100%'
- },
- [`${componentCls}-content-holder`]: {
- flex: 'auto',
- minWidth: 0,
- minHeight: 0
- },
- [`${componentCls}-tabpane`]: Object.assign(Object.assign({}, (0,style.genFocusStyle)(token)), {
- '&-hidden': {
- display: 'none'
- }
- })
- }),
- [`${componentCls}-centered`]: {
- [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
- [`${componentCls}-nav-wrap`]: {
- [`&:not([class*='${componentCls}-nav-wrap-ping']) > ${componentCls}-nav-list`]: {
- margin: 'auto'
- }
- }
- }
- }
- };
- };
- const prepareComponentToken = token => {
- const {
- cardHeight,
- cardHeightSM,
- cardHeightLG,
- controlHeight,
- controlHeightLG
- } = token;
- const mergedCardHeight = cardHeight || controlHeightLG;
- const mergedCardHeightSM = cardHeightSM || controlHeight;
- // `controlHeight` missing XL variable, so we directly write it here:
- const mergedCardHeightLG = cardHeightLG || controlHeightLG + 8;
- return {
- zIndexPopup: token.zIndexPopupBase + 50,
- cardBg: token.colorFillAlter,
- // We can not pass this as valid value,
- // Since `cardHeight` will lock nav add button height.
- cardHeight: mergedCardHeight,
- cardHeightSM: mergedCardHeightSM,
- cardHeightLG: mergedCardHeightLG,
- // Initialize with empty string, because cardPadding will be calculated with cardHeight by default.
- cardPadding: `${(mergedCardHeight - token.fontHeight) / 2 - token.lineWidth}px ${token.padding}px`,
- cardPaddingSM: `${(mergedCardHeightSM - token.fontHeight) / 2 - token.lineWidth}px ${token.paddingXS}px`,
- cardPaddingLG: `${(mergedCardHeightLG - token.fontHeightLG) / 2 - token.lineWidth}px ${token.padding}px`,
- titleFontSize: token.fontSize,
- titleFontSizeLG: token.fontSizeLG,
- titleFontSizeSM: token.fontSize,
- inkBarColor: token.colorPrimary,
- horizontalMargin: `0 0 ${token.margin}px 0`,
- horizontalItemGutter: 32,
- // Fixed Value
- // Initialize with empty string, because horizontalItemMargin will be calculated with horizontalItemGutter by default.
- horizontalItemMargin: ``,
- horizontalItemMarginRTL: ``,
- horizontalItemPadding: `${token.paddingSM}px 0`,
- horizontalItemPaddingSM: `${token.paddingXS}px 0`,
- horizontalItemPaddingLG: `${token.padding}px 0`,
- verticalItemPadding: `${token.paddingXS}px ${token.paddingLG}px`,
- verticalItemMargin: `${token.margin}px 0 0 0`,
- itemColor: token.colorText,
- itemSelectedColor: token.colorPrimary,
- itemHoverColor: token.colorPrimaryHover,
- itemActiveColor: token.colorPrimaryActive,
- cardGutter: token.marginXXS / 2
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ var tabs_style = ((0,genStyleUtils.genStyleHooks)('Tabs', token => {
- const tabsToken = (0,es.mergeToken)(token, {
- // `cardPadding` is empty by default, so we could calculate with dynamic `cardHeight`
- tabsCardPadding: token.cardPadding,
- dropdownEdgeChildVerticalPadding: token.paddingXXS,
- tabsActiveTextShadow: '0 0 0.25px currentcolor',
- tabsDropdownHeight: 200,
- tabsDropdownWidth: 120,
- tabsHorizontalItemMargin: `0 0 0 ${(0,cssinjs.unit)(token.horizontalItemGutter)}`,
- tabsHorizontalItemMarginRTL: `0 0 0 ${(0,cssinjs.unit)(token.horizontalItemGutter)}`
- });
- return [genSizeStyle(tabsToken), genRtlStyle(tabsToken), genPositionStyle(tabsToken), genDropdownStyle(tabsToken), genCardStyle(tabsToken), genTabsStyle(tabsToken), motion(tabsToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/tag/style/index.ts":
- /*!***************************************!*\
- !*** ./components/tag/style/index.ts ***!
- \***************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; },
- /* harmony export */ prepareToken: function() { return /* binding */ prepareToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // ============================== Styles ==============================
- const genBaseStyle = token => {
- const {
- paddingXXS,
- lineWidth,
- tagPaddingHorizontal,
- componentCls,
- calc
- } = token;
- const paddingInline = calc(tagPaddingHorizontal).sub(lineWidth).equal();
- const iconMarginInline = calc(paddingXXS).sub(lineWidth).equal();
- return {
- // Result
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- display: 'inline-block',
- height: 'auto',
- // https://github.com/ant-design/ant-design/pull/47504
- marginInlineEnd: token.marginXS,
- paddingInline,
- fontSize: token.tagFontSize,
- lineHeight: token.tagLineHeight,
- whiteSpace: 'nowrap',
- background: token.defaultBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderRadius: token.borderRadiusSM,
- opacity: 1,
- transition: `all ${token.motionDurationMid}`,
- textAlign: 'start',
- position: 'relative',
- // RTL
- [`&${componentCls}-rtl`]: {
- direction: 'rtl'
- },
- '&, a, a:hover': {
- color: token.defaultColor
- },
- [`${componentCls}-close-icon`]: {
- marginInlineStart: iconMarginInline,
- fontSize: token.tagIconSize,
- color: token.colorIcon,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid}`,
- '&:hover': {
- color: token.colorTextHeading
- }
- },
- [`&${componentCls}-has-color`]: {
- borderColor: 'transparent',
- [`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
- color: token.colorTextLightSolid
- }
- },
- '&-checkable': {
- backgroundColor: 'transparent',
- borderColor: 'transparent',
- cursor: 'pointer',
- [`&:not(${componentCls}-checkable-checked):hover`]: {
- color: token.colorPrimary,
- backgroundColor: token.colorFillSecondary
- },
- '&:active, &-checked': {
- color: token.colorTextLightSolid
- },
- '&-checked': {
- backgroundColor: token.colorPrimary,
- '&:hover': {
- backgroundColor: token.colorPrimaryHover
- }
- },
- '&:active': {
- backgroundColor: token.colorPrimaryActive
- }
- },
- '&-hidden': {
- display: 'none'
- },
- // To ensure that a space will be placed between character and `Icon`.
- [`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
- marginInlineStart: paddingInline
- }
- }),
- [`${componentCls}-borderless`]: {
- borderColor: 'transparent',
- background: token.tagBorderlessBg
- }
- };
- };
- // ============================== Export ==============================
- const prepareToken = token => {
- const {
- lineWidth,
- fontSizeIcon,
- calc
- } = token;
- const tagFontSize = token.fontSizeSM;
- const tagToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.mergeToken)(token, {
- tagFontSize,
- tagLineHeight: (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(token.lineHeightSM).mul(tagFontSize).equal()),
- tagIconSize: calc(fontSizeIcon).sub(calc(lineWidth).mul(2)).equal(),
- // Tag icon is much smaller
- tagPaddingHorizontal: 8,
- // Fixed padding.
- tagBorderlessBg: token.defaultBg
- });
- return tagToken;
- };
- const prepareComponentToken = token => ({
- defaultBg: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorFillQuaternary).onBackground(token.colorBgContainer).toHexString(),
- defaultColor: token.colorText
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__.genStyleHooks)('Tag', token => {
- const tagToken = prepareToken(token);
- return genBaseStyle(tagToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/theme/context.ts":
- /*!*************************************!*\
- !*** ./components/theme/context.ts ***!
- \*************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ DesignTokenContext: function() { return /* binding */ DesignTokenContext; },
- /* harmony export */ defaultConfig: function() { return /* binding */ defaultConfig; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _themes_seed__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./themes/seed */ "./components/theme/themes/seed.ts");
- // ================================ Context =================================
- // To ensure snapshot stable. We disable hashed in test env.
- const defaultConfig = {
- token: _themes_seed__WEBPACK_IMPORTED_MODULE_1__["default"],
- override: {
- override: _themes_seed__WEBPACK_IMPORTED_MODULE_1__["default"]
- },
- hashed: true
- };
- const DesignTokenContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createContext(defaultConfig);
- /***/ }),
- /***/ "./components/theme/interface/presetColors.ts":
- /*!****************************************************!*\
- !*** ./components/theme/interface/presetColors.ts ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ PresetColors: function() { return /* binding */ PresetColors; }
- /* harmony export */ });
- const PresetColors = ['blue', 'purple', 'cyan', 'green', 'magenta', 'pink', 'red', 'orange', 'yellow', 'volcano', 'geekblue', 'lime', 'gold'];
- /***/ }),
- /***/ "./components/theme/themes/default/index.ts":
- /*!**************************************************************!*\
- !*** ./components/theme/themes/default/index.ts + 5 modules ***!
- \**************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ derivative; }
- });
- // EXTERNAL MODULE: ./node_modules/@ant-design/colors/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/colors/es/index.js");
- // EXTERNAL MODULE: ./components/theme/themes/seed.ts
- var seed = __webpack_require__("./components/theme/themes/seed.ts");
- // EXTERNAL MODULE: ./components/theme/themes/shared/genColorMapToken.ts
- var genColorMapToken = __webpack_require__("./components/theme/themes/shared/genColorMapToken.ts");
- ;// ./components/theme/themes/shared/genRadius.ts
- const genRadius = radiusBase => {
- let radiusLG = radiusBase;
- let radiusSM = radiusBase;
- let radiusXS = radiusBase;
- let radiusOuter = radiusBase;
- // radiusLG
- if (radiusBase < 6 && radiusBase >= 5) {
- radiusLG = radiusBase + 1;
- } else if (radiusBase < 16 && radiusBase >= 6) {
- radiusLG = radiusBase + 2;
- } else if (radiusBase >= 16) {
- radiusLG = 16;
- }
- // radiusSM
- if (radiusBase < 7 && radiusBase >= 5) {
- radiusSM = 4;
- } else if (radiusBase < 8 && radiusBase >= 7) {
- radiusSM = 5;
- } else if (radiusBase < 14 && radiusBase >= 8) {
- radiusSM = 6;
- } else if (radiusBase < 16 && radiusBase >= 14) {
- radiusSM = 7;
- } else if (radiusBase >= 16) {
- radiusSM = 8;
- }
- // radiusXS
- if (radiusBase < 6 && radiusBase >= 2) {
- radiusXS = 1;
- } else if (radiusBase >= 6) {
- radiusXS = 2;
- }
- // radiusOuter
- if (radiusBase > 4 && radiusBase < 8) {
- radiusOuter = 4;
- } else if (radiusBase >= 8) {
- radiusOuter = 6;
- }
- return {
- borderRadius: radiusBase,
- borderRadiusXS: radiusXS,
- borderRadiusSM: radiusSM,
- borderRadiusLG: radiusLG,
- borderRadiusOuter: radiusOuter
- };
- };
- /* harmony default export */ var shared_genRadius = (genRadius);
- ;// ./components/theme/themes/shared/genCommonMapToken.ts
- function genCommonMapToken(token) {
- const {
- motionUnit,
- motionBase,
- borderRadius,
- lineWidth
- } = token;
- return Object.assign({
- // motion
- motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
- motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
- motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
- // line
- lineWidthBold: lineWidth + 1
- }, shared_genRadius(borderRadius));
- }
- // EXTERNAL MODULE: ./components/theme/themes/shared/genControlHeight.ts
- var genControlHeight = __webpack_require__("./components/theme/themes/shared/genControlHeight.ts");
- // EXTERNAL MODULE: ./components/theme/themes/shared/genFontMapToken.ts
- var genFontMapToken = __webpack_require__("./components/theme/themes/shared/genFontMapToken.ts");
- ;// ./components/theme/themes/shared/genSizeMapToken.ts
- function genSizeMapToken(token) {
- const {
- sizeUnit,
- sizeStep
- } = token;
- return {
- sizeXXL: sizeUnit * (sizeStep + 8),
- // 48
- sizeXL: sizeUnit * (sizeStep + 4),
- // 32
- sizeLG: sizeUnit * (sizeStep + 2),
- // 24
- sizeMD: sizeUnit * (sizeStep + 1),
- // 20
- sizeMS: sizeUnit * sizeStep,
- // 16
- size: sizeUnit * sizeStep,
- // 16
- sizeSM: sizeUnit * (sizeStep - 1),
- // 12
- sizeXS: sizeUnit * (sizeStep - 2),
- // 8
- sizeXXS: sizeUnit * (sizeStep - 3) // 4
- };
- }
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var fast_color_es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- ;// ./components/theme/themes/default/colorAlgorithm.ts
- const getAlphaColor = (baseColor, alpha) => new fast_color_es.FastColor(baseColor).setA(alpha).toRgbString();
- const getSolidColor = (baseColor, brightness) => {
- const instance = new fast_color_es.FastColor(baseColor);
- return instance.darken(brightness).toHexString();
- };
- ;// ./components/theme/themes/default/colors.ts
- const generateColorPalettes = baseColor => {
- const colors = (0,es.generate)(baseColor);
- return {
- 1: colors[0],
- 2: colors[1],
- 3: colors[2],
- 4: colors[3],
- 5: colors[4],
- 6: colors[5],
- 7: colors[6],
- 8: colors[4],
- 9: colors[5],
- 10: colors[6]
- // 8: colors[7],
- // 9: colors[8],
- // 10: colors[9],
- };
- };
- const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
- const colorBgBase = bgBaseColor || '#fff';
- const colorTextBase = textBaseColor || '#000';
- return {
- colorBgBase,
- colorTextBase,
- colorText: getAlphaColor(colorTextBase, 0.88),
- colorTextSecondary: getAlphaColor(colorTextBase, 0.65),
- colorTextTertiary: getAlphaColor(colorTextBase, 0.45),
- colorTextQuaternary: getAlphaColor(colorTextBase, 0.25),
- colorFill: getAlphaColor(colorTextBase, 0.15),
- colorFillSecondary: getAlphaColor(colorTextBase, 0.06),
- colorFillTertiary: getAlphaColor(colorTextBase, 0.04),
- colorFillQuaternary: getAlphaColor(colorTextBase, 0.02),
- colorBgSolid: getAlphaColor(colorTextBase, 1),
- colorBgSolidHover: getAlphaColor(colorTextBase, 0.75),
- colorBgSolidActive: getAlphaColor(colorTextBase, 0.95),
- colorBgLayout: getSolidColor(colorBgBase, 4),
- colorBgContainer: getSolidColor(colorBgBase, 0),
- colorBgElevated: getSolidColor(colorBgBase, 0),
- colorBgSpotlight: getAlphaColor(colorTextBase, 0.85),
- colorBgBlur: 'transparent',
- colorBorder: getSolidColor(colorBgBase, 15),
- colorBorderSecondary: getSolidColor(colorBgBase, 6)
- };
- };
- ;// ./components/theme/themes/default/index.ts
- function derivative(token) {
- // pink is deprecated name of magenta, keep this for backwards compatibility
- es.presetPrimaryColors.pink = es.presetPrimaryColors.magenta;
- es.presetPalettes.pink = es.presetPalettes.magenta;
- const colorPalettes = Object.keys(seed.defaultPresetColors).map(colorKey => {
- const colors = token[colorKey] === es.presetPrimaryColors[colorKey] ? es.presetPalettes[colorKey] : (0,es.generate)(token[colorKey]);
- return Array.from({
- length: 10
- }, () => 1).reduce((prev, _, i) => {
- prev[`${colorKey}-${i + 1}`] = colors[i];
- prev[`${colorKey}${i + 1}`] = colors[i];
- return prev;
- }, {});
- }).reduce((prev, cur) => {
- prev = Object.assign(Object.assign({}, prev), cur);
- return prev;
- }, {});
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, token), colorPalettes), (0,genColorMapToken["default"])(token, {
- generateColorPalettes: generateColorPalettes,
- generateNeutralColorPalettes: generateNeutralColorPalettes
- })), (0,genFontMapToken["default"])(token.fontSize)), genSizeMapToken(token)), (0,genControlHeight["default"])(token)), genCommonMapToken(token));
- }
- /***/ }),
- /***/ "./components/theme/themes/default/theme.ts":
- /*!**************************************************!*\
- !*** ./components/theme/themes/default/theme.ts ***!
- \**************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index */ "./components/theme/themes/default/index.ts");
- const defaultTheme = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.createTheme)(_index__WEBPACK_IMPORTED_MODULE_1__["default"]);
- /* harmony default export */ __webpack_exports__["default"] = (defaultTheme);
- /***/ }),
- /***/ "./components/theme/themes/seed.ts":
- /*!*****************************************!*\
- !*** ./components/theme/themes/seed.ts ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ defaultPresetColors: function() { return /* binding */ defaultPresetColors; }
- /* harmony export */ });
- const defaultPresetColors = {
- blue: '#1677FF',
- purple: '#722ED1',
- cyan: '#13C2C2',
- green: '#52C41A',
- magenta: '#EB2F96',
- /**
- * @deprecated Use magenta instead
- */
- pink: '#EB2F96',
- red: '#F5222D',
- orange: '#FA8C16',
- yellow: '#FADB14',
- volcano: '#FA541C',
- geekblue: '#2F54EB',
- gold: '#FAAD14',
- lime: '#A0D911'
- };
- const seedToken = Object.assign(Object.assign({}, defaultPresetColors), {
- // Color
- colorPrimary: '#1677ff',
- colorSuccess: '#52c41a',
- colorWarning: '#faad14',
- colorError: '#ff4d4f',
- colorInfo: '#1677ff',
- colorLink: '',
- colorTextBase: '',
- colorBgBase: '',
- // Font
- fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
- 'Noto Color Emoji'`,
- fontFamilyCode: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
- fontSize: 14,
- // Line
- lineWidth: 1,
- lineType: 'solid',
- // Motion
- motionUnit: 0.1,
- motionBase: 0,
- motionEaseOutCirc: 'cubic-bezier(0.08, 0.82, 0.17, 1)',
- motionEaseInOutCirc: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)',
- motionEaseOut: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
- motionEaseInOut: 'cubic-bezier(0.645, 0.045, 0.355, 1)',
- motionEaseOutBack: 'cubic-bezier(0.12, 0.4, 0.29, 1.46)',
- motionEaseInBack: 'cubic-bezier(0.71, -0.46, 0.88, 0.6)',
- motionEaseInQuint: 'cubic-bezier(0.755, 0.05, 0.855, 0.06)',
- motionEaseOutQuint: 'cubic-bezier(0.23, 1, 0.32, 1)',
- // Radius
- borderRadius: 6,
- // Size
- sizeUnit: 4,
- sizeStep: 4,
- sizePopupArrow: 16,
- // Control Base
- controlHeight: 32,
- // zIndex
- zIndexBase: 0,
- zIndexPopupBase: 1000,
- // Image
- opacityImage: 1,
- // Wireframe
- wireframe: false,
- // Motion
- motion: true
- });
- /* harmony default export */ __webpack_exports__["default"] = (seedToken);
- /***/ }),
- /***/ "./components/theme/themes/shared/genColorMapToken.ts":
- /*!************************************************************!*\
- !*** ./components/theme/themes/shared/genColorMapToken.ts ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ genColorMapToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- function genColorMapToken(seed, {
- generateColorPalettes,
- generateNeutralColorPalettes
- }) {
- const {
- colorSuccess: colorSuccessBase,
- colorWarning: colorWarningBase,
- colorError: colorErrorBase,
- colorInfo: colorInfoBase,
- colorPrimary: colorPrimaryBase,
- colorBgBase,
- colorTextBase
- } = seed;
- const primaryColors = generateColorPalettes(colorPrimaryBase);
- const successColors = generateColorPalettes(colorSuccessBase);
- const warningColors = generateColorPalettes(colorWarningBase);
- const errorColors = generateColorPalettes(colorErrorBase);
- const infoColors = generateColorPalettes(colorInfoBase);
- const neutralColors = generateNeutralColorPalettes(colorBgBase, colorTextBase);
- // Color Link
- const colorLink = seed.colorLink || seed.colorInfo;
- const linkColors = generateColorPalettes(colorLink);
- const colorErrorBgFilledHover = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(errorColors[1]).mix(new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(errorColors[3]), 50).toHexString();
- return Object.assign(Object.assign({}, neutralColors), {
- colorPrimaryBg: primaryColors[1],
- colorPrimaryBgHover: primaryColors[2],
- colorPrimaryBorder: primaryColors[3],
- colorPrimaryBorderHover: primaryColors[4],
- colorPrimaryHover: primaryColors[5],
- colorPrimary: primaryColors[6],
- colorPrimaryActive: primaryColors[7],
- colorPrimaryTextHover: primaryColors[8],
- colorPrimaryText: primaryColors[9],
- colorPrimaryTextActive: primaryColors[10],
- colorSuccessBg: successColors[1],
- colorSuccessBgHover: successColors[2],
- colorSuccessBorder: successColors[3],
- colorSuccessBorderHover: successColors[4],
- colorSuccessHover: successColors[4],
- colorSuccess: successColors[6],
- colorSuccessActive: successColors[7],
- colorSuccessTextHover: successColors[8],
- colorSuccessText: successColors[9],
- colorSuccessTextActive: successColors[10],
- colorErrorBg: errorColors[1],
- colorErrorBgHover: errorColors[2],
- colorErrorBgFilledHover,
- colorErrorBgActive: errorColors[3],
- colorErrorBorder: errorColors[3],
- colorErrorBorderHover: errorColors[4],
- colorErrorHover: errorColors[5],
- colorError: errorColors[6],
- colorErrorActive: errorColors[7],
- colorErrorTextHover: errorColors[8],
- colorErrorText: errorColors[9],
- colorErrorTextActive: errorColors[10],
- colorWarningBg: warningColors[1],
- colorWarningBgHover: warningColors[2],
- colorWarningBorder: warningColors[3],
- colorWarningBorderHover: warningColors[4],
- colorWarningHover: warningColors[4],
- colorWarning: warningColors[6],
- colorWarningActive: warningColors[7],
- colorWarningTextHover: warningColors[8],
- colorWarningText: warningColors[9],
- colorWarningTextActive: warningColors[10],
- colorInfoBg: infoColors[1],
- colorInfoBgHover: infoColors[2],
- colorInfoBorder: infoColors[3],
- colorInfoBorderHover: infoColors[4],
- colorInfoHover: infoColors[4],
- colorInfo: infoColors[6],
- colorInfoActive: infoColors[7],
- colorInfoTextHover: infoColors[8],
- colorInfoText: infoColors[9],
- colorInfoTextActive: infoColors[10],
- colorLinkHover: linkColors[4],
- colorLink: linkColors[6],
- colorLinkActive: linkColors[7],
- colorBgMask: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor('#000').setA(0.45).toRgbString(),
- colorWhite: '#fff'
- });
- }
- /***/ }),
- /***/ "./components/theme/themes/shared/genControlHeight.ts":
- /*!************************************************************!*\
- !*** ./components/theme/themes/shared/genControlHeight.ts ***!
- \************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- const genControlHeight = token => {
- const {
- controlHeight
- } = token;
- return {
- controlHeightSM: controlHeight * 0.75,
- controlHeightXS: controlHeight * 0.5,
- controlHeightLG: controlHeight * 1.25
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = (genControlHeight);
- /***/ }),
- /***/ "./components/theme/themes/shared/genFontMapToken.ts":
- /*!***********************************************************!*\
- !*** ./components/theme/themes/shared/genFontMapToken.ts ***!
- \***********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _genFontSizes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./genFontSizes */ "./components/theme/themes/shared/genFontSizes.ts");
- const genFontMapToken = fontSize => {
- const fontSizePairs = (0,_genFontSizes__WEBPACK_IMPORTED_MODULE_0__["default"])(fontSize);
- const fontSizes = fontSizePairs.map(pair => pair.size);
- const lineHeights = fontSizePairs.map(pair => pair.lineHeight);
- const fontSizeMD = fontSizes[1];
- const fontSizeSM = fontSizes[0];
- const fontSizeLG = fontSizes[2];
- const lineHeight = lineHeights[1];
- const lineHeightSM = lineHeights[0];
- const lineHeightLG = lineHeights[2];
- return {
- fontSizeSM,
- fontSize: fontSizeMD,
- fontSizeLG,
- fontSizeXL: fontSizes[3],
- fontSizeHeading1: fontSizes[6],
- fontSizeHeading2: fontSizes[5],
- fontSizeHeading3: fontSizes[4],
- fontSizeHeading4: fontSizes[3],
- fontSizeHeading5: fontSizes[2],
- lineHeight,
- lineHeightLG,
- lineHeightSM,
- fontHeight: Math.round(lineHeight * fontSizeMD),
- fontHeightLG: Math.round(lineHeightLG * fontSizeLG),
- fontHeightSM: Math.round(lineHeightSM * fontSizeSM),
- lineHeightHeading1: lineHeights[6],
- lineHeightHeading2: lineHeights[5],
- lineHeightHeading3: lineHeights[4],
- lineHeightHeading4: lineHeights[3],
- lineHeightHeading5: lineHeights[2]
- };
- };
- /* harmony default export */ __webpack_exports__["default"] = (genFontMapToken);
- /***/ }),
- /***/ "./components/theme/themes/shared/genFontSizes.ts":
- /*!********************************************************!*\
- !*** ./components/theme/themes/shared/genFontSizes.ts ***!
- \********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ getFontSizes; },
- /* harmony export */ getLineHeight: function() { return /* binding */ getLineHeight; }
- /* harmony export */ });
- function getLineHeight(fontSize) {
- return (fontSize + 8) / fontSize;
- }
- // https://zhuanlan.zhihu.com/p/32746810
- function getFontSizes(base) {
- const fontSizes = Array.from({
- length: 10
- }).map((_, index) => {
- const i = index - 1;
- const baseSize = base * Math.pow(Math.E, i / 5);
- const intSize = index > 1 ? Math.floor(baseSize) : Math.ceil(baseSize);
- // Convert to even
- return Math.floor(intSize / 2) * 2;
- });
- fontSizes[1] = base;
- return fontSizes.map(size => ({
- size,
- lineHeight: getLineHeight(size)
- }));
- }
- /***/ }),
- /***/ "./components/theme/useToken.ts":
- /*!**************************************!*\
- !*** ./components/theme/useToken.ts ***!
- \**************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useToken; },
- /* harmony export */ unitless: function() { return /* binding */ unitless; }
- /* harmony export */ });
- /* unused harmony exports ignore, getComputedToken */
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../version */ "./components/version/index.tsx");
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./context */ "./components/theme/context.ts");
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./context */ "./components/theme/themes/default/theme.ts");
- /* harmony import */ var _themes_seed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./themes/seed */ "./components/theme/themes/seed.ts");
- /* harmony import */ var _util_alias__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/alias */ "./components/theme/util/alias.ts");
- var __rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- const unitless = {
- lineHeight: true,
- lineHeightSM: true,
- lineHeightLG: true,
- lineHeightHeading1: true,
- lineHeightHeading2: true,
- lineHeightHeading3: true,
- lineHeightHeading4: true,
- lineHeightHeading5: true,
- opacityLoading: true,
- fontWeightStrong: true,
- zIndexPopupBase: true,
- zIndexBase: true,
- opacityImage: true
- };
- const ignore = {
- motionBase: true,
- motionUnit: true
- };
- const preserve = {
- screenXS: true,
- screenXSMin: true,
- screenXSMax: true,
- screenSM: true,
- screenSMMin: true,
- screenSMMax: true,
- screenMD: true,
- screenMDMin: true,
- screenMDMax: true,
- screenLG: true,
- screenLGMin: true,
- screenLGMax: true,
- screenXL: true,
- screenXLMin: true,
- screenXLMax: true,
- screenXXL: true,
- screenXXLMin: true
- };
- const getComputedToken = (originToken, overrideToken, theme) => {
- const derivativeToken = theme.getDerivativeToken(originToken);
- const {
- override
- } = overrideToken,
- components = __rest(overrideToken, ["override"]);
- // Merge with override
- let mergedDerivativeToken = Object.assign(Object.assign({}, derivativeToken), {
- override
- });
- // Format if needed
- mergedDerivativeToken = (0,_util_alias__WEBPACK_IMPORTED_MODULE_6__["default"])(mergedDerivativeToken);
- if (components) {
- Object.entries(components).forEach(([key, value]) => {
- const {
- theme: componentTheme
- } = value,
- componentTokens = __rest(value, ["theme"]);
- let mergedComponentToken = componentTokens;
- if (componentTheme) {
- mergedComponentToken = getComputedToken(Object.assign(Object.assign({}, mergedDerivativeToken), componentTokens), {
- override: componentTokens
- }, componentTheme);
- }
- mergedDerivativeToken[key] = mergedComponentToken;
- });
- }
- return mergedDerivativeToken;
- };
- // ================================== Hook ==================================
- function useToken() {
- const {
- token: rootDesignToken,
- hashed,
- theme,
- override,
- cssVar
- } = react__WEBPACK_IMPORTED_MODULE_0___default().useContext(_context__WEBPACK_IMPORTED_MODULE_3__.DesignTokenContext);
- const salt = `${_version__WEBPACK_IMPORTED_MODULE_2__["default"]}-${hashed || ''}`;
- const mergedTheme = theme || _context__WEBPACK_IMPORTED_MODULE_4__["default"];
- const [token, hashId, realToken] = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_1__.useCacheToken)(mergedTheme, [_themes_seed__WEBPACK_IMPORTED_MODULE_5__["default"], rootDesignToken], {
- salt,
- override,
- getComputedToken,
- // formatToken will not be consumed after 1.15.0 with getComputedToken.
- // But token will break if @ant-design/cssinjs is under 1.15.0 without it
- formatToken: _util_alias__WEBPACK_IMPORTED_MODULE_6__["default"],
- cssVar: cssVar && {
- prefix: cssVar.prefix,
- key: cssVar.key,
- unitless,
- ignore,
- preserve
- }
- });
- return [mergedTheme, realToken, hashed ? hashId : '', token, cssVar];
- }
- /***/ }),
- /***/ "./components/theme/util/alias.ts":
- /*!****************************************!*\
- !*** ./components/theme/util/alias.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ formatToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _themes_seed__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../themes/seed */ "./components/theme/themes/seed.ts");
- /* harmony import */ var _getAlphaColor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getAlphaColor */ "./components/theme/util/getAlphaColor.ts");
- var __rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- };
- /**
- * Seed (designer) > Derivative (designer) > Alias (developer).
- *
- * Merge seed & derivative & override token and generate alias token for developer.
- */
- function formatToken(derivativeToken) {
- const {
- override
- } = derivativeToken,
- restToken = __rest(derivativeToken, ["override"]);
- const overrideTokens = Object.assign({}, override);
- Object.keys(_themes_seed__WEBPACK_IMPORTED_MODULE_1__["default"]).forEach(token => {
- delete overrideTokens[token];
- });
- const mergedToken = Object.assign(Object.assign({}, restToken), overrideTokens);
- const screenXS = 480;
- const screenSM = 576;
- const screenMD = 768;
- const screenLG = 992;
- const screenXL = 1200;
- const screenXXL = 1600;
- // Motion
- if (mergedToken.motion === false) {
- const fastDuration = '0s';
- mergedToken.motionDurationFast = fastDuration;
- mergedToken.motionDurationMid = fastDuration;
- mergedToken.motionDurationSlow = fastDuration;
- }
- // Generate alias token
- const aliasToken = Object.assign(Object.assign(Object.assign({}, mergedToken), {
- // ============== Background ============== //
- colorFillContent: mergedToken.colorFillSecondary,
- colorFillContentHover: mergedToken.colorFill,
- colorFillAlter: mergedToken.colorFillQuaternary,
- colorBgContainerDisabled: mergedToken.colorFillTertiary,
- // ============== Split ============== //
- colorBorderBg: mergedToken.colorBgContainer,
- colorSplit: (0,_getAlphaColor__WEBPACK_IMPORTED_MODULE_2__["default"])(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
- // ============== Text ============== //
- colorTextPlaceholder: mergedToken.colorTextQuaternary,
- colorTextDisabled: mergedToken.colorTextQuaternary,
- colorTextHeading: mergedToken.colorText,
- colorTextLabel: mergedToken.colorTextSecondary,
- colorTextDescription: mergedToken.colorTextTertiary,
- colorTextLightSolid: mergedToken.colorWhite,
- colorHighlight: mergedToken.colorError,
- colorBgTextHover: mergedToken.colorFillSecondary,
- colorBgTextActive: mergedToken.colorFill,
- colorIcon: mergedToken.colorTextTertiary,
- colorIconHover: mergedToken.colorText,
- colorErrorOutline: (0,_getAlphaColor__WEBPACK_IMPORTED_MODULE_2__["default"])(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
- colorWarningOutline: (0,_getAlphaColor__WEBPACK_IMPORTED_MODULE_2__["default"])(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
- // Font
- fontSizeIcon: mergedToken.fontSizeSM,
- // Line
- lineWidthFocus: mergedToken.lineWidth * 3,
- // Control
- lineWidth: mergedToken.lineWidth,
- controlOutlineWidth: mergedToken.lineWidth * 2,
- // Checkbox size and expand icon size
- controlInteractiveSize: mergedToken.controlHeight / 2,
- controlItemBgHover: mergedToken.colorFillTertiary,
- controlItemBgActive: mergedToken.colorPrimaryBg,
- controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
- controlItemBgActiveDisabled: mergedToken.colorFill,
- controlTmpOutline: mergedToken.colorFillQuaternary,
- controlOutline: (0,_getAlphaColor__WEBPACK_IMPORTED_MODULE_2__["default"])(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
- lineType: mergedToken.lineType,
- borderRadius: mergedToken.borderRadius,
- borderRadiusXS: mergedToken.borderRadiusXS,
- borderRadiusSM: mergedToken.borderRadiusSM,
- borderRadiusLG: mergedToken.borderRadiusLG,
- fontWeightStrong: 600,
- opacityLoading: 0.65,
- linkDecoration: 'none',
- linkHoverDecoration: 'none',
- linkFocusDecoration: 'none',
- controlPaddingHorizontal: 12,
- controlPaddingHorizontalSM: 8,
- paddingXXS: mergedToken.sizeXXS,
- paddingXS: mergedToken.sizeXS,
- paddingSM: mergedToken.sizeSM,
- padding: mergedToken.size,
- paddingMD: mergedToken.sizeMD,
- paddingLG: mergedToken.sizeLG,
- paddingXL: mergedToken.sizeXL,
- paddingContentHorizontalLG: mergedToken.sizeLG,
- paddingContentVerticalLG: mergedToken.sizeMS,
- paddingContentHorizontal: mergedToken.sizeMS,
- paddingContentVertical: mergedToken.sizeSM,
- paddingContentHorizontalSM: mergedToken.size,
- paddingContentVerticalSM: mergedToken.sizeXS,
- marginXXS: mergedToken.sizeXXS,
- marginXS: mergedToken.sizeXS,
- marginSM: mergedToken.sizeSM,
- margin: mergedToken.size,
- marginMD: mergedToken.sizeMD,
- marginLG: mergedToken.sizeLG,
- marginXL: mergedToken.sizeXL,
- marginXXL: mergedToken.sizeXXL,
- boxShadow: `
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowSecondary: `
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowTertiary: `
- 0 1px 2px 0 rgba(0, 0, 0, 0.03),
- 0 1px 6px -1px rgba(0, 0, 0, 0.02),
- 0 2px 4px 0 rgba(0, 0, 0, 0.02)
- `,
- screenXS,
- screenXSMin: screenXS,
- screenXSMax: screenSM - 1,
- screenSM,
- screenSMMin: screenSM,
- screenSMMax: screenMD - 1,
- screenMD,
- screenMDMin: screenMD,
- screenMDMax: screenLG - 1,
- screenLG,
- screenLGMin: screenLG,
- screenLGMax: screenXL - 1,
- screenXL,
- screenXLMin: screenXL,
- screenXLMax: screenXXL - 1,
- screenXXL,
- screenXXLMin: screenXXL,
- boxShadowPopoverArrow: '2px 2px 5px rgba(0, 0, 0, 0.05)',
- boxShadowCard: `
- 0 1px 2px -2px ${new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor('rgba(0, 0, 0, 0.16)').toRgbString()},
- 0 3px 6px 0 ${new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor('rgba(0, 0, 0, 0.12)').toRgbString()},
- 0 5px 12px 4px ${new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor('rgba(0, 0, 0, 0.09)').toRgbString()}
- `,
- boxShadowDrawerRight: `
- -6px 0 16px 0 rgba(0, 0, 0, 0.08),
- -3px 0 6px -4px rgba(0, 0, 0, 0.12),
- -9px 0 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowDrawerLeft: `
- 6px 0 16px 0 rgba(0, 0, 0, 0.08),
- 3px 0 6px -4px rgba(0, 0, 0, 0.12),
- 9px 0 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowDrawerUp: `
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowDrawerDown: `
- 0 -6px 16px 0 rgba(0, 0, 0, 0.08),
- 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
- 0 -9px 28px 8px rgba(0, 0, 0, 0.05)
- `,
- boxShadowTabsOverflowLeft: 'inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)',
- boxShadowTabsOverflowRight: 'inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)',
- boxShadowTabsOverflowTop: 'inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)',
- boxShadowTabsOverflowBottom: 'inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)'
- }), overrideTokens);
- return aliasToken;
- }
- /***/ }),
- /***/ "./components/theme/util/genPresetColor.ts":
- /*!*************************************************!*\
- !*** ./components/theme/util/genPresetColor.ts ***!
- \*************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ genPresetColor; }
- /* harmony export */ });
- /* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../interface */ "./components/theme/interface/presetColors.ts");
- function genPresetColor(token, genCss) {
- return _interface__WEBPACK_IMPORTED_MODULE_0__.PresetColors.reduce((prev, colorKey) => {
- const lightColor = token[`${colorKey}1`];
- const lightBorderColor = token[`${colorKey}3`];
- const darkColor = token[`${colorKey}6`];
- const textColor = token[`${colorKey}7`];
- return Object.assign(Object.assign({}, prev), genCss(colorKey, {
- lightColor,
- lightBorderColor,
- darkColor,
- textColor
- }));
- }, {});
- }
- /***/ }),
- /***/ "./components/theme/util/genStyleUtils.ts":
- /*!************************************************!*\
- !*** ./components/theme/util/genStyleUtils.ts ***!
- \************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ genComponentStyleHook: function() { return /* binding */ genComponentStyleHook; },
- /* harmony export */ genStyleHooks: function() { return /* binding */ genStyleHooks; },
- /* harmony export */ genSubStyleComponent: function() { return /* binding */ genSubStyleComponent; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_cssinjs_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/cssinjs-utils */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _config_provider_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config-provider/context */ "./components/config-provider/context.ts");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _useToken__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../useToken */ "./components/theme/useToken.ts");
- const {
- genStyleHooks,
- genComponentStyleHook,
- genSubStyleComponent
- } = (0,_ant_design_cssinjs_utils__WEBPACK_IMPORTED_MODULE_1__.genStyleUtils)({
- usePrefix: () => {
- const {
- getPrefixCls,
- iconPrefixCls
- } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_config_provider_context__WEBPACK_IMPORTED_MODULE_2__.ConfigContext);
- const rootPrefixCls = getPrefixCls();
- return {
- rootPrefixCls,
- iconPrefixCls
- };
- },
- useToken: () => {
- const [theme, realToken, hashId, token, cssVar] = (0,_useToken__WEBPACK_IMPORTED_MODULE_4__["default"])();
- return {
- theme,
- realToken,
- hashId,
- token,
- cssVar
- };
- },
- useCSP: () => {
- const {
- csp
- } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_config_provider_context__WEBPACK_IMPORTED_MODULE_2__.ConfigContext);
- return csp !== null && csp !== void 0 ? csp : {};
- },
- getResetStyles: (token, config) => {
- var _a;
- const linkStyle = (0,_style__WEBPACK_IMPORTED_MODULE_3__.genLinkStyle)(token);
- return [linkStyle, {
- '&': linkStyle
- }, (0,_style__WEBPACK_IMPORTED_MODULE_3__.genIconStyle)((_a = config === null || config === void 0 ? void 0 : config.prefix.iconPrefixCls) !== null && _a !== void 0 ? _a : _config_provider_context__WEBPACK_IMPORTED_MODULE_2__.defaultIconPrefixCls)];
- },
- getCommonStyle: _style__WEBPACK_IMPORTED_MODULE_3__.genCommonStyle,
- getCompUnitless: () => _useToken__WEBPACK_IMPORTED_MODULE_4__.unitless
- });
- /***/ }),
- /***/ "./components/theme/util/getAlphaColor.ts":
- /*!************************************************!*\
- !*** ./components/theme/util/getAlphaColor.ts ***!
- \************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- function isStableColor(color) {
- return color >= 0 && color <= 255;
- }
- function getAlphaColor(frontColor, backgroundColor) {
- const {
- r: fR,
- g: fG,
- b: fB,
- a: originAlpha
- } = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(frontColor).toRgb();
- if (originAlpha < 1) {
- return frontColor;
- }
- const {
- r: bR,
- g: bG,
- b: bB
- } = new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor(backgroundColor).toRgb();
- for (let fA = 0.01; fA <= 1; fA += 0.01) {
- const r = Math.round((fR - bR * (1 - fA)) / fA);
- const g = Math.round((fG - bG * (1 - fA)) / fA);
- const b = Math.round((fB - bB * (1 - fA)) / fA);
- if (isStableColor(r) && isStableColor(g) && isStableColor(b)) {
- return new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor({
- r,
- g,
- b,
- a: Math.round(fA * 100) / 100
- }).toRgbString();
- }
- }
- // fallback
- /* istanbul ignore next */
- return new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_0__.FastColor({
- r: fR,
- g: fG,
- b: fB,
- a: 1
- }).toRgbString();
- }
- /* harmony default export */ __webpack_exports__["default"] = (getAlphaColor);
- /***/ }),
- /***/ "./components/theme/util/useResetIconStyle.ts":
- /*!****************************************************!*\
- !*** ./components/theme/util/useResetIconStyle.ts ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _useToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../useToken */ "./components/theme/useToken.ts");
- const useResetIconStyle = (iconPrefixCls, csp) => {
- const [theme, token] = (0,_useToken__WEBPACK_IMPORTED_MODULE_2__["default"])();
- // Generate style for icons
- return (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.useStyleRegister)({
- theme,
- token,
- hashId: '',
- path: ['ant-design-icons', iconPrefixCls],
- nonce: () => csp === null || csp === void 0 ? void 0 : csp.nonce,
- layer: {
- name: 'antd'
- }
- }, () => (0,_style__WEBPACK_IMPORTED_MODULE_1__.genIconStyle)(iconPrefixCls));
- };
- /* harmony default export */ __webpack_exports__["default"] = (useResetIconStyle);
- /***/ }),
- /***/ "./components/time-picker/locale/en_US.ts":
- /*!************************************************!*\
- !*** ./components/time-picker/locale/en_US.ts ***!
- \************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- const locale = {
- placeholder: 'Select time',
- rangePlaceholder: ['Start time', 'End time']
- };
- /* harmony default export */ __webpack_exports__["default"] = (locale);
- /***/ }),
- /***/ "./components/timeline/style/index.ts":
- /*!********************************************!*\
- !*** ./components/timeline/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genTimelineStyle = token => {
- const {
- componentCls,
- calc
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- margin: 0,
- padding: 0,
- listStyle: 'none',
- [`${componentCls}-item`]: {
- position: 'relative',
- margin: 0,
- paddingBottom: token.itemPaddingBottom,
- fontSize: token.fontSize,
- listStyle: 'none',
- '&-tail': {
- position: 'absolute',
- insetBlockStart: token.itemHeadSize,
- insetInlineStart: calc(calc(token.itemHeadSize).sub(token.tailWidth)).div(2).equal(),
- height: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.itemHeadSize)})`,
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.tailWidth)} ${token.lineType} ${token.tailColor}`
- },
- '&-pending': {
- [`${componentCls}-item-head`]: {
- fontSize: token.fontSizeSM,
- backgroundColor: 'transparent'
- },
- [`${componentCls}-item-tail`]: {
- display: 'none'
- }
- },
- '&-head': {
- position: 'absolute',
- width: token.itemHeadSize,
- height: token.itemHeadSize,
- backgroundColor: token.dotBg,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.dotBorderWidth)} ${token.lineType} transparent`,
- borderRadius: '50%',
- '&-blue': {
- color: token.colorPrimary,
- borderColor: token.colorPrimary
- },
- '&-red': {
- color: token.colorError,
- borderColor: token.colorError
- },
- '&-green': {
- color: token.colorSuccess,
- borderColor: token.colorSuccess
- },
- '&-gray': {
- color: token.colorTextDisabled,
- borderColor: token.colorTextDisabled
- }
- },
- '&-head-custom': {
- position: 'absolute',
- insetBlockStart: calc(token.itemHeadSize).div(2).equal(),
- insetInlineStart: calc(token.itemHeadSize).div(2).equal(),
- width: 'auto',
- height: 'auto',
- marginBlockStart: 0,
- paddingBlock: token.customHeadPaddingVertical,
- lineHeight: 1,
- textAlign: 'center',
- border: 0,
- borderRadius: 0,
- transform: 'translate(-50%, -50%)'
- },
- '&-content': {
- position: 'relative',
- insetBlockStart: calc(calc(token.fontSize).mul(token.lineHeight).sub(token.fontSize)).mul(-1).add(token.lineWidth).equal(),
- marginInlineStart: calc(token.margin).add(token.itemHeadSize).equal(),
- marginInlineEnd: 0,
- marginBlockStart: 0,
- marginBlockEnd: 0,
- wordBreak: 'break-word'
- },
- '&-last': {
- [`> ${componentCls}-item-tail`]: {
- display: 'none'
- },
- [`> ${componentCls}-item-content`]: {
- minHeight: calc(token.controlHeightLG).mul(1.2).equal()
- }
- }
- },
- [`&${componentCls}-alternate,
- &${componentCls}-right,
- &${componentCls}-label`]: {
- [`${componentCls}-item`]: {
- '&-tail, &-head, &-head-custom': {
- insetInlineStart: '50%'
- },
- '&-head': {
- marginInlineStart: calc(token.marginXXS).mul(-1).equal(),
- '&-custom': {
- marginInlineStart: calc(token.tailWidth).div(2).equal()
- }
- },
- '&-left': {
- [`${componentCls}-item-content`]: {
- insetInlineStart: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginXXS)})`,
- width: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginSM)})`,
- textAlign: 'start'
- }
- },
- '&-right': {
- [`${componentCls}-item-content`]: {
- width: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginSM)})`,
- margin: 0,
- textAlign: 'end'
- }
- }
- }
- },
- [`&${componentCls}-right`]: {
- [`${componentCls}-item-right`]: {
- [`${componentCls}-item-tail,
- ${componentCls}-item-head,
- ${componentCls}-item-head-custom`]: {
- insetInlineStart: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(calc(token.itemHeadSize).add(token.tailWidth)).div(2).equal())})`
- },
- [`${componentCls}-item-content`]: {
- width: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(calc(token.itemHeadSize).add(token.marginXS).equal())})`
- }
- }
- },
- [`&${componentCls}-pending
- ${componentCls}-item-last
- ${componentCls}-item-tail`]: {
- display: 'block',
- height: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.margin)})`,
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.tailWidth)} dotted ${token.tailColor}`
- },
- [`&${componentCls}-reverse
- ${componentCls}-item-last
- ${componentCls}-item-tail`]: {
- display: 'none'
- },
- [`&${componentCls}-reverse ${componentCls}-item-pending`]: {
- [`${componentCls}-item-tail`]: {
- insetBlockStart: token.margin,
- display: 'block',
- height: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.margin)})`,
- borderInlineStart: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.tailWidth)} dotted ${token.tailColor}`
- },
- [`${componentCls}-item-content`]: {
- minHeight: calc(token.controlHeightLG).mul(1.2).equal()
- }
- },
- [`&${componentCls}-label`]: {
- [`${componentCls}-item-label`]: {
- position: 'absolute',
- insetBlockStart: calc(calc(token.fontSize).mul(token.lineHeight).sub(token.fontSize)).mul(-1).add(token.tailWidth).equal(),
- width: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginSM)})`,
- textAlign: 'end'
- },
- [`${componentCls}-item-right`]: {
- [`${componentCls}-item-label`]: {
- insetInlineStart: `calc(50% + ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginSM)})`,
- width: `calc(50% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.marginSM)})`,
- textAlign: 'start'
- }
- }
- },
- // ====================== RTL =======================
- '&-rtl': {
- direction: 'rtl',
- [`${componentCls}-item-head-custom`]: {
- transform: `translate(50%, -50%)`
- }
- }
- })
- };
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => ({
- tailColor: token.colorSplit,
- tailWidth: token.lineWidthBold,
- dotBorderWidth: token.wireframe ? token.lineWidthBold : token.lineWidth * 3,
- dotBg: token.colorBgContainer,
- itemPaddingBottom: token.padding * 1.25
- });
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Timeline', token => {
- const timeLineToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- itemHeadSize: 10,
- customHeadPaddingVertical: token.paddingXXS,
- paddingInlineEnd: 2
- });
- return genTimelineStyle(timeLineToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/tooltip/style/index.ts":
- /*!*******************************************!*\
- !*** ./components/tooltip/style/index.ts ***!
- \*******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/motion */ "./components/style/motion/zoom.ts");
- /* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style/placementArrow */ "./components/style/placementArrow.ts");
- /* harmony import */ var _style_roundedArrow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style/roundedArrow */ "./components/style/roundedArrow.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genPresetColor.ts");
- const genTooltipStyle = token => {
- const {
- calc,
- componentCls,
- // ant-tooltip
- tooltipMaxWidth,
- tooltipColor,
- tooltipBg,
- tooltipBorderRadius,
- zIndexPopup,
- controlHeight,
- boxShadowSecondary,
- paddingSM,
- paddingXS,
- arrowOffsetHorizontal,
- sizePopupArrow
- } = token;
- // arrowOffsetHorizontal + arrowWidth + borderRadius
- const edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();
- // borderRadius * 2 + arrowWidth
- const centerAlignMinWidth = calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal();
- return [{
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'absolute',
- zIndex: zIndexPopup,
- display: 'block',
- width: 'max-content',
- maxWidth: tooltipMaxWidth,
- visibility: 'visible',
- // When use `autoArrow`, origin will follow the arrow position
- '--valid-offset-x': 'var(--arrow-offset-horizontal, var(--arrow-x))',
- transformOrigin: [`var(--valid-offset-x, 50%)`, `var(--arrow-y, 50%)`].join(' '),
- '&-hidden': {
- display: 'none'
- },
- '--antd-arrow-background-color': tooltipBg,
- // Wrapper for the tooltip content
- [`${componentCls}-inner`]: {
- minWidth: centerAlignMinWidth,
- minHeight: controlHeight,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(paddingSM).div(2).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`,
- color: `var(--ant-tooltip-color, ${tooltipColor})`,
- textAlign: 'start',
- textDecoration: 'none',
- wordWrap: 'break-word',
- backgroundColor: tooltipBg,
- borderRadius: tooltipBorderRadius,
- boxShadow: boxShadowSecondary,
- boxSizing: 'border-box'
- },
- // Align placement should have another min width
- [[`&-placement-topLeft`, `&-placement-topRight`, `&-placement-bottomLeft`, `&-placement-bottomRight`].join(',')]: {
- minWidth: edgeAlignMinWidth
- },
- // Limit left and right placement radius
- [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(',')]: {
- [`${componentCls}-inner`]: {
- borderRadius: token.min(tooltipBorderRadius, _style_placementArrow__WEBPACK_IMPORTED_MODULE_3__.MAX_VERTICAL_CONTENT_RADIUS)
- }
- },
- [`${componentCls}-content`]: {
- position: 'relative'
- }
- }), (0,_theme_internal__WEBPACK_IMPORTED_MODULE_7__["default"])(token, (colorKey, {
- darkColor
- }) => ({
- [`&${componentCls}-${colorKey}`]: {
- [`${componentCls}-inner`]: {
- backgroundColor: darkColor
- },
- [`${componentCls}-arrow`]: {
- '--antd-arrow-background-color': darkColor
- }
- }
- }))), {
- // RTL
- '&-rtl': {
- direction: 'rtl'
- }
- })
- },
- // Arrow Style
- (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_3__["default"])(token, 'var(--antd-arrow-background-color)'),
- // Pure Render
- {
- [`${componentCls}-pure`]: {
- position: 'relative',
- maxWidth: 'none',
- margin: token.sizePopupArrow
- }
- }];
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => Object.assign(Object.assign({
- zIndexPopup: token.zIndexPopupBase + 70
- }, (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_3__.getArrowOffsetToken)({
- contentRadius: token.borderRadius,
- limitVerticalRadius: true
- })), (0,_style_roundedArrow__WEBPACK_IMPORTED_MODULE_4__.getArrowToken)((0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, {
- borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)
- })));
- /* harmony default export */ __webpack_exports__["default"] = ((prefixCls, injectStyle = true) => {
- const useStyle = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.genStyleHooks)('Tooltip', token => {
- const {
- borderRadius,
- colorTextLightSolid,
- colorBgSpotlight
- } = token;
- const TooltipToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, {
- // default variables
- tooltipMaxWidth: 250,
- tooltipColor: colorTextLightSolid,
- tooltipBorderRadius: borderRadius,
- tooltipBg: colorBgSpotlight
- });
- return [genTooltipStyle(TooltipToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_2__.initZoomMotion)(token, 'zoom-big-fast')];
- }, prepareComponentToken, {
- resetStyle: false,
- // Popover use Tooltip as internal component. We do not need to handle this.
- injectStyle
- });
- return useStyle(prefixCls);
- });
- /***/ }),
- /***/ "./components/tour/style/index.ts":
- /*!****************************************!*\
- !*** ./components/tour/style/index.ts ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/fast-color */ "./node_modules/@ant-design/fast-color/es/index.js");
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../style/placementArrow */ "./components/style/placementArrow.ts");
- /* harmony import */ var _style_roundedArrow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style/roundedArrow */ "./components/style/roundedArrow.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- padding,
- paddingXS,
- borderRadius,
- borderRadiusXS,
- colorPrimary,
- colorFill,
- indicatorHeight,
- indicatorWidth,
- boxShadowTertiary,
- zIndexPopup,
- colorBgElevated,
- fontWeightStrong,
- marginXS,
- colorTextLightSolid,
- tourBorderRadius,
- colorWhite,
- primaryNextBtnHoverBg,
- closeBtnSize,
- motionDurationSlow,
- antCls,
- primaryPrevBtnBg
- } = token;
- return [{
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_2__.resetComponent)(token)), {
- position: 'absolute',
- zIndex: zIndexPopup,
- maxWidth: 'fit-content',
- visibility: 'visible',
- width: 520,
- '--antd-arrow-background-color': colorBgElevated,
- '&-pure': {
- maxWidth: '100%',
- position: 'relative'
- },
- [`&${componentCls}-hidden`]: {
- display: 'none'
- },
- // ============================= panel content ============================
- [`${componentCls}-content`]: {
- position: 'relative'
- },
- [`${componentCls}-inner`]: {
- textAlign: 'start',
- textDecoration: 'none',
- borderRadius: tourBorderRadius,
- boxShadow: boxShadowTertiary,
- position: 'relative',
- backgroundColor: colorBgElevated,
- border: 'none',
- backgroundClip: 'padding-box',
- [`${componentCls}-close`]: Object.assign({
- position: 'absolute',
- top: padding,
- insetInlineEnd: padding,
- color: token.colorIcon,
- background: 'none',
- border: 'none',
- width: closeBtnSize,
- height: closeBtnSize,
- borderRadius: token.borderRadiusSM,
- transition: `background-color ${token.motionDurationMid}, color ${token.motionDurationMid}`,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- cursor: 'pointer',
- '&:hover': {
- color: token.colorIconHover,
- backgroundColor: token.colorBgTextHover
- },
- '&:active': {
- backgroundColor: token.colorBgTextActive
- }
- }, (0,_style__WEBPACK_IMPORTED_MODULE_2__.genFocusStyle)(token)),
- [`${componentCls}-cover`]: {
- textAlign: 'center',
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(padding).add(closeBtnSize).add(paddingXS).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)} 0`,
- img: {
- width: '100%'
- }
- },
- [`${componentCls}-header`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)}`,
- width: `calc(100% - ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(closeBtnSize)})`,
- wordBreak: 'break-word',
- [`${componentCls}-title`]: {
- fontWeight: fontWeightStrong
- }
- },
- [`${componentCls}-description`]: {
- padding: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)}`,
- wordWrap: 'break-word'
- },
- [`${componentCls}-footer`]: {
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(padding)}`,
- textAlign: 'end',
- borderRadius: `0 0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(borderRadiusXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(borderRadiusXS)}`,
- display: 'flex',
- [`${componentCls}-indicators`]: {
- display: 'inline-block',
- [`${componentCls}-indicator`]: {
- width: indicatorWidth,
- height: indicatorHeight,
- display: 'inline-block',
- borderRadius: '50%',
- background: colorFill,
- '&:not(:last-child)': {
- marginInlineEnd: indicatorHeight
- },
- '&-active': {
- background: colorPrimary
- }
- }
- },
- [`${componentCls}-buttons`]: {
- marginInlineStart: 'auto',
- [`${antCls}-btn`]: {
- marginInlineStart: marginXS
- }
- }
- }
- },
- // ============================= primary type ===========================
- // `$` for panel, `&$` for pure panel
- [`${componentCls}-primary, &${componentCls}-primary`]: {
- '--antd-arrow-background-color': colorPrimary,
- [`${componentCls}-inner`]: {
- color: colorTextLightSolid,
- textAlign: 'start',
- textDecoration: 'none',
- backgroundColor: colorPrimary,
- borderRadius,
- boxShadow: boxShadowTertiary,
- [`${componentCls}-close`]: {
- color: colorTextLightSolid
- },
- [`${componentCls}-indicators`]: {
- [`${componentCls}-indicator`]: {
- background: primaryPrevBtnBg,
- '&-active': {
- background: colorTextLightSolid
- }
- }
- },
- [`${componentCls}-prev-btn`]: {
- color: colorTextLightSolid,
- borderColor: primaryPrevBtnBg,
- backgroundColor: colorPrimary,
- '&:hover': {
- backgroundColor: primaryPrevBtnBg,
- borderColor: 'transparent'
- }
- },
- [`${componentCls}-next-btn`]: {
- color: colorPrimary,
- borderColor: 'transparent',
- background: colorWhite,
- '&:hover': {
- background: primaryNextBtnHoverBg
- }
- }
- }
- }
- }),
- // ============================= mask ===========================
- [`${componentCls}-mask`]: {
- [`${componentCls}-placeholder-animated`]: {
- transition: `all ${motionDurationSlow}`
- }
- },
- // =========== Limit left and right placement radius ==============
- [['&-placement-left', '&-placement-leftTop', '&-placement-leftBottom', '&-placement-right', '&-placement-rightTop', '&-placement-rightBottom'].join(',')]: {
- [`${componentCls}-inner`]: {
- borderRadius: token.min(tourBorderRadius, _style_placementArrow__WEBPACK_IMPORTED_MODULE_3__.MAX_VERTICAL_CONTENT_RADIUS)
- }
- }
- },
- // ============================= Arrow ===========================
- (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_3__["default"])(token, 'var(--antd-arrow-background-color)')];
- };
- // ============================== Export ==============================
- const prepareComponentToken = token => Object.assign(Object.assign({
- zIndexPopup: token.zIndexPopupBase + 70,
- closeBtnSize: token.fontSize * token.lineHeight,
- primaryPrevBtnBg: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorTextLightSolid).setA(0.15).toRgbString(),
- primaryNextBtnHoverBg: new _ant_design_fast_color__WEBPACK_IMPORTED_MODULE_1__.FastColor(token.colorBgTextHover).onBackground(token.colorWhite).toRgbString()
- }, (0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_3__.getArrowOffsetToken)({
- contentRadius: token.borderRadiusLG,
- limitVerticalRadius: true
- })), (0,_style_roundedArrow__WEBPACK_IMPORTED_MODULE_4__.getArrowToken)(token));
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_6__.genStyleHooks)('Tour', token => {
- const {
- borderRadiusLG
- } = token;
- const TourToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_5__.mergeToken)(token, {
- indicatorWidth: 6,
- indicatorHeight: 6,
- tourBorderRadius: borderRadiusLG
- });
- return genBaseStyle(TourToken);
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/transfer/style/index.ts":
- /*!********************************************!*\
- !*** ./components/transfer/style/index.ts ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ "./components/style/index.tsx");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- const genTransferCustomizeStyle = token => {
- const {
- antCls,
- componentCls,
- listHeight,
- controlHeightLG
- } = token;
- const tableCls = `${antCls}-table`;
- const inputCls = `${antCls}-input`;
- return {
- [`${componentCls}-customize-list`]: {
- [`${componentCls}-list`]: {
- flex: '1 1 50%',
- width: 'auto',
- height: 'auto',
- minHeight: listHeight,
- minWidth: 0
- },
- // =================== Hook Components ===================
- [`${tableCls}-wrapper`]: {
- [`${tableCls}-small`]: {
- border: 0,
- borderRadius: 0,
- [`${tableCls}-selection-column`]: {
- width: controlHeightLG,
- minWidth: controlHeightLG
- }
- },
- [`${tableCls}-pagination${tableCls}-pagination`]: {
- margin: 0,
- padding: token.paddingXS
- }
- },
- [`${inputCls}[disabled]`]: {
- backgroundColor: 'transparent'
- }
- }
- };
- };
- const genTransferStatusColor = (token, color) => {
- const {
- componentCls,
- colorBorder
- } = token;
- return {
- [`${componentCls}-list`]: {
- borderColor: color,
- '&-search:not([disabled])': {
- borderColor: colorBorder
- }
- }
- };
- };
- const genTransferStatusStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-status-error`]: Object.assign({}, genTransferStatusColor(token, token.colorError)),
- [`${componentCls}-status-warning`]: Object.assign({}, genTransferStatusColor(token, token.colorWarning))
- };
- };
- const genTransferListStyle = token => {
- const {
- componentCls,
- colorBorder,
- colorSplit,
- lineWidth,
- itemHeight,
- headerHeight,
- transferHeaderVerticalPadding,
- itemPaddingBlock,
- controlItemBgActive,
- colorTextDisabled,
- colorTextSecondary,
- listHeight,
- listWidth,
- listWidthLG,
- fontSizeIcon,
- marginXS,
- paddingSM,
- lineType,
- antCls,
- iconCls,
- motionDurationSlow,
- controlItemBgHover,
- borderRadiusLG,
- colorBgContainer,
- colorText,
- controlItemBgActiveHover
- } = token;
- const contentBorderRadius = (0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(borderRadiusLG).sub(lineWidth).equal());
- return {
- display: 'flex',
- flexDirection: 'column',
- width: listWidth,
- height: listHeight,
- border: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorBorder}`,
- borderRadius: token.borderRadiusLG,
- '&-with-pagination': {
- width: listWidthLG,
- height: 'auto'
- },
- '&-search': {
- [`${iconCls}-search`]: {
- color: colorTextDisabled
- }
- },
- '&-header': {
- display: 'flex',
- flex: 'none',
- alignItems: 'center',
- height: headerHeight,
- // border-top is on the transfer dom. We should minus 1px for this
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(transferHeaderVerticalPadding).sub(lineWidth).equal())} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingSM)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(transferHeaderVerticalPadding)}`,
- color: colorText,
- background: colorBgContainer,
- borderBottom: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- borderRadius: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(borderRadiusLG)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(borderRadiusLG)} 0 0`,
- '> *:not(:last-child)': {
- marginInlineEnd: 4 // This is magic and fixed number, DO NOT use token since it may change.
- },
- '> *': {
- flex: 'none'
- },
- '&-title': Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis), {
- flex: 'auto',
- textAlign: 'end'
- }),
- '&-dropdown': Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetIcon)()), {
- fontSize: fontSizeIcon,
- transform: 'translateY(10%)',
- cursor: 'pointer',
- '&[disabled]': {
- cursor: 'not-allowed'
- }
- })
- },
- '&-body': {
- display: 'flex',
- flex: 'auto',
- flexDirection: 'column',
- fontSize: token.fontSize,
- // https://blog.csdn.net/qq449245884/article/details/107373672/
- minHeight: 0,
- '&-search-wrapper': {
- position: 'relative',
- flex: 'none',
- padding: paddingSM
- }
- },
- '&-content': {
- flex: 'auto',
- margin: 0,
- padding: 0,
- overflow: 'auto',
- listStyle: 'none',
- borderRadius: `0 0 ${contentBorderRadius} ${contentBorderRadius}`,
- '&-item': {
- display: 'flex',
- alignItems: 'center',
- minHeight: itemHeight,
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(itemPaddingBlock)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(paddingSM)}`,
- transition: `all ${motionDurationSlow}`,
- '> *:not(:last-child)': {
- marginInlineEnd: marginXS
- },
- '> *': {
- flex: 'none'
- },
- '&-text': Object.assign(Object.assign({}, _style__WEBPACK_IMPORTED_MODULE_1__.textEllipsis), {
- flex: 'auto'
- }),
- '&-remove': Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.operationUnit)(token)), {
- color: colorBorder,
- '&:hover, &:focus': {
- color: colorTextSecondary
- }
- }),
- [`&:not(${componentCls}-list-content-item-disabled)`]: {
- '&:hover': {
- backgroundColor: controlItemBgHover,
- cursor: 'pointer'
- },
- [`&${componentCls}-list-content-item-checked:hover`]: {
- backgroundColor: controlItemBgActiveHover
- }
- },
- '&-checked': {
- backgroundColor: controlItemBgActive
- },
- '&-disabled': {
- color: colorTextDisabled,
- cursor: 'not-allowed'
- }
- },
- // Do not change hover style when `oneWay` mode
- [`&-show-remove ${componentCls}-list-content-item:not(${componentCls}-list-content-item-disabled):hover`]: {
- background: 'transparent',
- cursor: 'default'
- }
- },
- '&-pagination': {
- padding: token.paddingXS,
- textAlign: 'end',
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`,
- [`${antCls}-pagination-options`]: {
- paddingInlineEnd: token.paddingXS
- }
- },
- '&-body-not-found': {
- flex: 'none',
- width: '100%',
- margin: 'auto 0',
- color: colorTextDisabled,
- textAlign: 'center'
- },
- '&-footer': {
- borderTop: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(lineWidth)} ${lineType} ${colorSplit}`
- },
- // fix: https://github.com/ant-design/ant-design/issues/44489
- '&-checkbox': {
- lineHeight: 1
- }
- };
- };
- const genTransferStyle = token => {
- const {
- antCls,
- iconCls,
- componentCls,
- marginXS,
- marginXXS,
- fontSizeIcon,
- colorBgContainerDisabled
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__.resetComponent)(token)), {
- position: 'relative',
- display: 'flex',
- alignItems: 'stretch',
- [`${componentCls}-disabled`]: {
- [`${componentCls}-list`]: {
- background: colorBgContainerDisabled
- }
- },
- [`${componentCls}-list`]: genTransferListStyle(token),
- [`${componentCls}-operation`]: {
- display: 'flex',
- flex: 'none',
- flexDirection: 'column',
- alignSelf: 'center',
- margin: `0 ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(marginXS)}`,
- verticalAlign: 'middle',
- gap: marginXXS,
- [`${antCls}-btn ${iconCls}`]: {
- fontSize: fontSizeIcon
- }
- }
- })
- };
- };
- const genTransferRTLStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- };
- };
- const prepareComponentToken = token => {
- const {
- fontSize,
- lineHeight,
- controlHeight,
- controlHeightLG,
- lineWidth
- } = token;
- const fontHeight = Math.round(fontSize * lineHeight);
- return {
- listWidth: 180,
- listHeight: 200,
- listWidthLG: 250,
- headerHeight: controlHeightLG,
- itemHeight: controlHeight,
- itemPaddingBlock: (controlHeight - fontHeight) / 2,
- transferHeaderVerticalPadding: Math.ceil((controlHeightLG - lineWidth - fontHeight) / 2)
- };
- };
- // ============================== Export ==============================
- /* harmony default export */ __webpack_exports__["default"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('Transfer', token => {
- const transferToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token);
- return [genTransferStyle(transferToken), genTransferCustomizeStyle(transferToken), genTransferStatusStyle(transferToken), genTransferRTLStyle(transferToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/tree-select/style/index.ts":
- /*!***********************************************!*\
- !*** ./components/tree-select/style/index.ts ***!
- \***********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useTreeSelectStyle; },
- /* harmony export */ prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- /* harmony export */ });
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ "./alias/cssinjs.js");
- /* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _checkbox_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../checkbox/style */ "./components/checkbox/style/index.ts");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ "./node_modules/@ant-design/cssinjs-utils/es/index.js");
- /* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ "./components/theme/util/genStyleUtils.ts");
- /* harmony import */ var _tree_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../tree/style */ "./components/tree/style/index.ts");
- // =============================== Base ===============================
- const genBaseStyle = token => {
- const {
- componentCls,
- treePrefixCls,
- colorBgElevated
- } = token;
- const treeCls = `.${treePrefixCls}`;
- return [
- // ======================================================
- // == Dropdown ==
- // ======================================================
- {
- [`${componentCls}-dropdown`]: [{
- padding: `${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.paddingXS)} ${(0,_ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.unit)(token.calc(token.paddingXS).div(2).equal())}`
- },
- // ====================== Tree ======================
- (0,_tree_style__WEBPACK_IMPORTED_MODULE_4__.genTreeStyle)(treePrefixCls, (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- colorBgContainer: colorBgElevated
- }), false), {
- [treeCls]: {
- borderRadius: 0,
- [`${treeCls}-list-holder-inner`]: {
- alignItems: 'stretch',
- [`${treeCls}-treenode`]: {
- [`${treeCls}-node-content-wrapper`]: {
- flex: 'auto'
- }
- }
- }
- }
- },
- // ==================== Checkbox ====================
- (0,_checkbox_style__WEBPACK_IMPORTED_MODULE_1__.getStyle)(`${treePrefixCls}-checkbox`, token),
- // ====================== RTL =======================
- {
- '&-rtl': {
- direction: 'rtl',
- [`${treeCls}-switcher${treeCls}-switcher_close`]: {
- [`${treeCls}-switcher-icon svg`]: {
- transform: 'rotate(90deg)'
- }
- }
- }
- }]
- }];
- };
- const prepareComponentToken = _tree_style__WEBPACK_IMPORTED_MODULE_4__.initComponentToken;
- // ============================== Export ==============================
- function useTreeSelectStyle(prefixCls, treePrefixCls, rootCls) {
- return (0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__.genStyleHooks)('TreeSelect', token => {
- const treeSelectToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__.mergeToken)(token, {
- treePrefixCls
- });
- return genBaseStyle(treeSelectToken);
- }, _tree_style__WEBPACK_IMPORTED_MODULE_4__.initComponentToken)(prefixCls, rootCls);
- }
- /***/ }),
- /***/ "./components/tree/style/index.ts":
- /*!****************************************************!*\
- !*** ./components/tree/style/index.ts + 1 modules ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ tree_style; },
- genBaseStyle: function() { return /* binding */ genBaseStyle; },
- genTreeStyle: function() { return /* binding */ genTreeStyle; },
- initComponentToken: function() { return /* binding */ initComponentToken; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./components/checkbox/style/index.ts
- var style = __webpack_require__("./components/checkbox/style/index.ts");
- // EXTERNAL MODULE: ./components/style/index.tsx
- var components_style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/collapse.ts
- var collapse = __webpack_require__("./components/style/motion/collapse.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- ;// ./components/tree/style/directory.ts
- // ============================ Directory =============================
- const genDirectoryStyle = ({
- treeCls,
- treeNodeCls,
- directoryNodeSelectedBg,
- directoryNodeSelectedColor,
- motionDurationMid,
- borderRadius,
- controlItemBgHover
- }) => ({
- [`${treeCls}${treeCls}-directory ${treeNodeCls}`]: {
- // >>> Title
- [`${treeCls}-node-content-wrapper`]: {
- position: 'static',
- [`&:has(${treeCls}-drop-indicator)`]: {
- position: 'relative'
- },
- [`> *:not(${treeCls}-drop-indicator)`]: {
- position: 'relative'
- },
- '&:hover': {
- background: 'transparent'
- },
- // Expand interactive area to whole line
- '&:before': {
- position: 'absolute',
- inset: 0,
- transition: `background-color ${motionDurationMid}`,
- content: '""',
- borderRadius
- },
- '&:hover:before': {
- background: controlItemBgHover
- }
- },
- [`${treeCls}-switcher, ${treeCls}-checkbox, ${treeCls}-draggable-icon`]: {
- zIndex: 1
- },
- // ============= Selected =============
- '&-selected': {
- background: directoryNodeSelectedBg,
- borderRadius,
- [`${treeCls}-switcher, ${treeCls}-draggable-icon`]: {
- color: directoryNodeSelectedColor
- },
- // >>> Title
- [`${treeCls}-node-content-wrapper`]: {
- color: directoryNodeSelectedColor,
- background: 'transparent',
- '&, &:hover': {
- color: directoryNodeSelectedColor
- },
- '&:before, &:hover:before': {
- background: directoryNodeSelectedBg
- }
- }
- }
- }
- });
- ;// ./components/tree/style/index.ts
- // ============================ Keyframes =============================
- const treeNodeFX = new cssinjs.Keyframes('ant-tree-node-fx-do-not-use', {
- '0%': {
- opacity: 0
- },
- '100%': {
- opacity: 1
- }
- });
- // ============================== Switch ==============================
- const getSwitchStyle = (prefixCls, token) => ({
- [`.${prefixCls}-switcher-icon`]: {
- display: 'inline-block',
- fontSize: 10,
- verticalAlign: 'baseline',
- svg: {
- transition: `transform ${token.motionDurationSlow}`
- }
- }
- });
- // =============================== Drop ===============================
- const getDropIndicatorStyle = (prefixCls, token) => ({
- [`.${prefixCls}-drop-indicator`]: {
- position: 'absolute',
- // it should displayed over the following node
- zIndex: 1,
- height: 2,
- backgroundColor: token.colorPrimary,
- borderRadius: 1,
- pointerEvents: 'none',
- '&:after': {
- position: 'absolute',
- top: -3,
- insetInlineStart: -6,
- width: 8,
- height: 8,
- backgroundColor: 'transparent',
- border: `${(0,cssinjs.unit)(token.lineWidthBold)} solid ${token.colorPrimary}`,
- borderRadius: '50%',
- content: '""'
- }
- }
- });
- const genBaseStyle = (prefixCls, token) => {
- const {
- treeCls,
- treeNodeCls,
- treeNodePadding,
- titleHeight,
- indentSize,
- nodeSelectedBg,
- nodeHoverBg,
- colorTextQuaternary,
- controlItemBgActiveDisabled
- } = token;
- return {
- [treeCls]: Object.assign(Object.assign({}, (0,components_style.resetComponent)(token)), {
- // fix https://github.com/ant-design/ant-design/issues/50316
- ['--rc-virtual-list-scrollbar-bg']: token.colorSplit,
- background: token.colorBgContainer,
- borderRadius: token.borderRadius,
- transition: `background-color ${token.motionDurationSlow}`,
- '&-rtl': {
- direction: 'rtl'
- },
- [`&${treeCls}-rtl ${treeCls}-switcher_close ${treeCls}-switcher-icon svg`]: {
- transform: 'rotate(90deg)'
- },
- [`&-focused:not(:hover):not(${treeCls}-active-focused)`]: (0,components_style.genFocusOutline)(token),
- // =================== Virtual List ===================
- [`${treeCls}-list-holder-inner`]: {
- alignItems: 'flex-start'
- },
- [`&${treeCls}-block-node`]: {
- [`${treeCls}-list-holder-inner`]: {
- alignItems: 'stretch',
- // >>> Title
- [`${treeCls}-node-content-wrapper`]: {
- flex: 'auto'
- },
- // >>> Drag
- [`${treeNodeCls}.dragging:after`]: {
- position: 'absolute',
- inset: 0,
- border: `1px solid ${token.colorPrimary}`,
- opacity: 0,
- animationName: treeNodeFX,
- animationDuration: token.motionDurationSlow,
- animationPlayState: 'running',
- animationFillMode: 'forwards',
- content: '""',
- pointerEvents: 'none',
- borderRadius: token.borderRadius
- }
- }
- },
- // ===================== TreeNode =====================
- [treeNodeCls]: {
- display: 'flex',
- alignItems: 'flex-start',
- marginBottom: treeNodePadding,
- lineHeight: (0,cssinjs.unit)(titleHeight),
- position: 'relative',
- // 非常重要,避免 drop-indicator 在拖拽过程中闪烁
- '&:before': {
- content: '""',
- position: 'absolute',
- zIndex: 1,
- insetInlineStart: 0,
- width: '100%',
- top: '100%',
- height: treeNodePadding
- },
- // Disabled
- [`&-disabled ${treeCls}-node-content-wrapper`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed',
- '&:hover': {
- background: 'transparent'
- }
- },
- [`${treeCls}-checkbox-disabled + ${treeCls}-node-selected,&${treeNodeCls}-disabled${treeNodeCls}-selected ${treeCls}-node-content-wrapper`]: {
- backgroundColor: controlItemBgActiveDisabled
- },
- // we can not set pointer-events to none for checkbox in tree
- // ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-2605234058
- [`${treeCls}-checkbox-disabled`]: {
- pointerEvents: 'unset'
- },
- // not disable
- [`&:not(${treeNodeCls}-disabled)`]: {
- // >>> Title
- [`${treeCls}-node-content-wrapper`]: {
- '&:hover': {
- color: token.nodeHoverColor
- }
- }
- },
- [`&-active ${treeCls}-node-content-wrapper`]: {
- background: token.controlItemBgHover
- },
- [`&:not(${treeNodeCls}-disabled).filter-node ${treeCls}-title`]: {
- color: token.colorPrimary,
- fontWeight: token.fontWeightStrong
- },
- '&-draggable': {
- cursor: 'grab',
- [`${treeCls}-draggable-icon`]: {
- // https://github.com/ant-design/ant-design/issues/41915
- flexShrink: 0,
- width: titleHeight,
- textAlign: 'center',
- visibility: 'visible',
- color: colorTextQuaternary
- },
- [`&${treeNodeCls}-disabled ${treeCls}-draggable-icon`]: {
- visibility: 'hidden'
- }
- }
- },
- // >>> Indent
- [`${treeCls}-indent`]: {
- alignSelf: 'stretch',
- whiteSpace: 'nowrap',
- userSelect: 'none',
- '&-unit': {
- display: 'inline-block',
- width: indentSize
- }
- },
- // >>> Drag Handler
- [`${treeCls}-draggable-icon`]: {
- visibility: 'hidden'
- },
- // Switcher / Checkbox
- [`${treeCls}-switcher, ${treeCls}-checkbox`]: {
- marginInlineEnd: token.calc(token.calc(titleHeight).sub(token.controlInteractiveSize)).div(2).equal()
- },
- // >>> Switcher
- [`${treeCls}-switcher`]: Object.assign(Object.assign({}, getSwitchStyle(prefixCls, token)), {
- position: 'relative',
- flex: 'none',
- alignSelf: 'stretch',
- width: titleHeight,
- textAlign: 'center',
- cursor: 'pointer',
- userSelect: 'none',
- transition: `all ${token.motionDurationSlow}`,
- '&-noop': {
- cursor: 'unset'
- },
- '&:before': {
- pointerEvents: 'none',
- content: '""',
- width: titleHeight,
- height: titleHeight,
- position: 'absolute',
- left: {
- _skip_check_: true,
- value: 0
- },
- top: 0,
- borderRadius: token.borderRadius,
- transition: `all ${token.motionDurationSlow}`
- },
- [`&:not(${treeCls}-switcher-noop):hover:before`]: {
- backgroundColor: token.colorBgTextHover
- },
- [`&_close ${treeCls}-switcher-icon svg`]: {
- transform: 'rotate(-90deg)'
- },
- '&-loading-icon': {
- color: token.colorPrimary
- },
- '&-leaf-line': {
- position: 'relative',
- zIndex: 1,
- display: 'inline-block',
- width: '100%',
- height: '100%',
- // https://github.com/ant-design/ant-design/issues/31884
- '&:before': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: token.calc(titleHeight).div(2).equal(),
- bottom: token.calc(treeNodePadding).mul(-1).equal(),
- marginInlineStart: -1,
- borderInlineEnd: `1px solid ${token.colorBorder}`,
- content: '""'
- },
- '&:after': {
- position: 'absolute',
- width: token.calc(token.calc(titleHeight).div(2).equal()).mul(0.8).equal(),
- height: token.calc(titleHeight).div(2).equal(),
- borderBottom: `1px solid ${token.colorBorder}`,
- content: '""'
- }
- }
- }),
- // >>> Title
- // add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span`
- [`${treeCls}-node-content-wrapper`]: Object.assign(Object.assign({
- position: 'relative',
- minHeight: titleHeight,
- paddingBlock: 0,
- paddingInline: token.paddingXS,
- background: 'transparent',
- borderRadius: token.borderRadius,
- cursor: 'pointer',
- transition: `all ${token.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`
- }, getDropIndicatorStyle(prefixCls, token)), {
- '&:hover': {
- backgroundColor: nodeHoverBg
- },
- [`&${treeCls}-node-selected`]: {
- color: token.nodeSelectedColor,
- backgroundColor: nodeSelectedBg
- },
- // Icon
- [`${treeCls}-iconEle`]: {
- display: 'inline-block',
- width: titleHeight,
- height: titleHeight,
- textAlign: 'center',
- verticalAlign: 'top',
- '&:empty': {
- display: 'none'
- }
- }
- }),
- // https://github.com/ant-design/ant-design/issues/28217
- [`${treeCls}-unselectable ${treeCls}-node-content-wrapper:hover`]: {
- backgroundColor: 'transparent'
- },
- [`${treeNodeCls}.drop-container > [draggable]`]: {
- boxShadow: `0 0 0 2px ${token.colorPrimary}`
- },
- // ==================== Show Line =====================
- '&-show-line': {
- // ================ Indent lines ================
- [`${treeCls}-indent-unit`]: {
- position: 'relative',
- height: '100%',
- '&:before': {
- position: 'absolute',
- top: 0,
- insetInlineEnd: token.calc(titleHeight).div(2).equal(),
- bottom: token.calc(treeNodePadding).mul(-1).equal(),
- borderInlineEnd: `1px solid ${token.colorBorder}`,
- content: '""'
- },
- '&-end:before': {
- display: 'none'
- }
- },
- // ============== Cover Background ==============
- [`${treeCls}-switcher`]: {
- background: 'transparent',
- '&-line-icon': {
- // https://github.com/ant-design/ant-design/issues/32813
- verticalAlign: '-0.15em'
- }
- }
- },
- [`${treeNodeCls}-leaf-last ${treeCls}-switcher-leaf-line:before`]: {
- top: 'auto !important',
- bottom: 'auto !important',
- height: `${(0,cssinjs.unit)(token.calc(titleHeight).div(2).equal())} !important`
- }
- })
- };
- };
- // ============================== Merged ==============================
- const genTreeStyle = (prefixCls, token,
- /**
- * @descCN 是否启用目录树样式
- * @descEN Whether to enable directory style
- * @default true
- */
- enableDirectory = true) => {
- const treeCls = `.${prefixCls}`;
- const treeNodeCls = `${treeCls}-treenode`;
- const treeNodePadding = token.calc(token.paddingXS).div(2).equal();
- const treeToken = (0,es.mergeToken)(token, {
- treeCls,
- treeNodeCls,
- treeNodePadding
- });
- return [
- // Basic
- genBaseStyle(prefixCls, treeToken),
- // Directory
- enableDirectory && genDirectoryStyle(treeToken)].filter(Boolean);
- };
- const initComponentToken = token => {
- const {
- controlHeightSM,
- controlItemBgHover,
- controlItemBgActive
- } = token;
- const titleHeight = controlHeightSM;
- return {
- titleHeight,
- indentSize: titleHeight,
- nodeHoverBg: controlItemBgHover,
- nodeHoverColor: token.colorText,
- nodeSelectedBg: controlItemBgActive,
- nodeSelectedColor: token.colorText
- };
- };
- const prepareComponentToken = token => {
- const {
- colorTextLightSolid,
- colorPrimary
- } = token;
- return Object.assign(Object.assign({}, initComponentToken(token)), {
- directoryNodeSelectedColor: colorTextLightSolid,
- directoryNodeSelectedBg: colorPrimary
- });
- };
- /* harmony default export */ var tree_style = ((0,genStyleUtils.genStyleHooks)('Tree', (token, {
- prefixCls
- }) => [{
- [token.componentCls]: (0,style.getStyle)(`${prefixCls}-checkbox`, token)
- }, genTreeStyle(prefixCls, token), (0,collapse["default"])(token)], prepareComponentToken));
- /***/ }),
- /***/ "./components/typography/style/index.ts":
- /*!**********************************************************!*\
- !*** ./components/typography/style/index.ts + 1 modules ***!
- \**********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ typography_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/colors/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/colors/es/index.js");
- ;// ./components/typography/style/mixins.ts
- /*
- .typography-title(@fontSize; @fontWeight; @lineHeight; @headingColor; @headingMarginBottom;) {
- margin-bottom: @headingMarginBottom;
- color: @headingColor;
- font-weight: @fontWeight;
- fontSize: @fontSize;
- line-height: @lineHeight;
- }
- */
- const getTitleStyle = (fontSize, lineHeight, color, token) => {
- const {
- titleMarginBottom,
- fontWeightStrong
- } = token;
- return {
- marginBottom: titleMarginBottom,
- color,
- fontWeight: fontWeightStrong,
- fontSize,
- lineHeight
- };
- };
- const getTitleStyles = token => {
- const headings = [1, 2, 3, 4, 5];
- const styles = {};
- headings.forEach(headingLevel => {
- styles[`
- h${headingLevel}&,
- div&-h${headingLevel},
- div&-h${headingLevel} > textarea,
- h${headingLevel}
- `] = getTitleStyle(token[`fontSizeHeading${headingLevel}`], token[`lineHeightHeading${headingLevel}`], token.colorTextHeading, token);
- });
- return styles;
- };
- const getLinkStyles = token => {
- const {
- componentCls
- } = token;
- return {
- 'a&, a': Object.assign(Object.assign({}, (0,style.operationUnit)(token)), {
- userSelect: 'text',
- [`&[disabled], &${componentCls}-disabled`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed',
- '&:active, &:hover': {
- color: token.colorTextDisabled
- },
- '&:active': {
- pointerEvents: 'none'
- }
- }
- })
- };
- };
- const getResetStyles = token => ({
- code: {
- margin: '0 0.2em',
- paddingInline: '0.4em',
- paddingBlock: '0.2em 0.1em',
- fontSize: '85%',
- fontFamily: token.fontFamilyCode,
- background: 'rgba(150, 150, 150, 0.1)',
- border: '1px solid rgba(100, 100, 100, 0.2)',
- borderRadius: 3
- },
- kbd: {
- margin: '0 0.2em',
- paddingInline: '0.4em',
- paddingBlock: '0.15em 0.1em',
- fontSize: '90%',
- fontFamily: token.fontFamilyCode,
- background: 'rgba(150, 150, 150, 0.06)',
- border: '1px solid rgba(100, 100, 100, 0.2)',
- borderBottomWidth: 2,
- borderRadius: 3
- },
- mark: {
- padding: 0,
- // FIXME hardcode in v4
- backgroundColor: es.gold[2]
- },
- 'u, ins': {
- textDecoration: 'underline',
- textDecorationSkipInk: 'auto'
- },
- 's, del': {
- textDecoration: 'line-through'
- },
- strong: {
- fontWeight: token.fontWeightStrong
- },
- // list
- 'ul, ol': {
- marginInline: 0,
- marginBlock: '0 1em',
- padding: 0,
- li: {
- marginInline: '20px 0',
- marginBlock: 0,
- paddingInline: '4px 0',
- paddingBlock: 0
- }
- },
- ul: {
- listStyleType: 'circle',
- ul: {
- listStyleType: 'disc'
- }
- },
- ol: {
- listStyleType: 'decimal'
- },
- // pre & block
- 'pre, blockquote': {
- margin: '1em 0'
- },
- pre: {
- padding: '0.4em 0.6em',
- whiteSpace: 'pre-wrap',
- wordWrap: 'break-word',
- background: 'rgba(150, 150, 150, 0.1)',
- border: '1px solid rgba(100, 100, 100, 0.2)',
- borderRadius: 3,
- fontFamily: token.fontFamilyCode,
- // Compatible for marked
- code: {
- display: 'inline',
- margin: 0,
- padding: 0,
- fontSize: 'inherit',
- fontFamily: 'inherit',
- background: 'transparent',
- border: 0
- }
- },
- blockquote: {
- paddingInline: '0.6em 0',
- paddingBlock: 0,
- borderInlineStart: '4px solid rgba(100, 100, 100, 0.2)',
- opacity: 0.85
- }
- });
- const getEditableStyles = token => {
- const {
- componentCls,
- paddingSM
- } = token;
- const inputShift = paddingSM;
- return {
- '&-edit-content': {
- position: 'relative',
- 'div&': {
- insetInlineStart: token.calc(token.paddingSM).mul(-1).equal(),
- insetBlockStart: token.calc(inputShift).div(-2).add(1).equal(),
- marginBottom: token.calc(inputShift).div(2).sub(2).equal()
- },
- [`${componentCls}-edit-content-confirm`]: {
- position: 'absolute',
- insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
- insetBlockEnd: token.marginXS,
- color: token.colorIcon,
- // default style
- fontWeight: 'normal',
- fontSize: token.fontSize,
- fontStyle: 'normal',
- pointerEvents: 'none'
- },
- textarea: {
- margin: '0!important',
- // Fix Editable Textarea flash in Firefox
- MozTransition: 'none',
- height: '1em'
- }
- }
- };
- };
- const getCopyableStyles = token => ({
- [`${token.componentCls}-copy-success`]: {
- [`
- &,
- &:hover,
- &:focus`]: {
- color: token.colorSuccess
- }
- },
- [`${token.componentCls}-copy-icon-only`]: {
- marginInlineStart: 0
- }
- });
- const getEllipsisStyles = () => ({
- [`
- a&-ellipsis,
- span&-ellipsis
- `]: {
- display: 'inline-block',
- maxWidth: '100%'
- },
- '&-ellipsis-single-line': {
- whiteSpace: 'nowrap',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- // https://blog.csdn.net/iefreer/article/details/50421025
- 'a&, span&': {
- verticalAlign: 'bottom'
- },
- '> code': {
- paddingBlock: 0,
- maxWidth: 'calc(100% - 1.2em)',
- display: 'inline-block',
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- verticalAlign: 'bottom',
- // https://github.com/ant-design/ant-design/issues/45953
- boxSizing: 'content-box'
- }
- },
- '&-ellipsis-multiple-line': {
- display: '-webkit-box',
- overflow: 'hidden',
- WebkitLineClamp: 3,
- WebkitBoxOrient: 'vertical'
- }
- });
- ;// ./components/typography/style/index.ts
- const genTypographyStyle = token => {
- const {
- componentCls,
- titleMarginTop
- } = token;
- return {
- [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- color: token.colorText,
- wordBreak: 'break-word',
- lineHeight: token.lineHeight,
- [`&${componentCls}-secondary`]: {
- color: token.colorTextDescription
- },
- [`&${componentCls}-success`]: {
- color: token.colorSuccessText
- },
- [`&${componentCls}-warning`]: {
- color: token.colorWarningText
- },
- [`&${componentCls}-danger`]: {
- color: token.colorErrorText,
- 'a&:active, a&:focus': {
- color: token.colorErrorTextActive
- },
- 'a&:hover': {
- color: token.colorErrorTextHover
- }
- },
- [`&${componentCls}-disabled`]: {
- color: token.colorTextDisabled,
- cursor: 'not-allowed',
- userSelect: 'none'
- },
- [`
- div&,
- p
- `]: {
- marginBottom: '1em'
- }
- }, getTitleStyles(token)), {
- [`
- & + h1${componentCls},
- & + h2${componentCls},
- & + h3${componentCls},
- & + h4${componentCls},
- & + h5${componentCls}
- `]: {
- marginTop: titleMarginTop
- },
- [`
- div,
- ul,
- li,
- p,
- h1,
- h2,
- h3,
- h4,
- h5`]: {
- [`
- + h1,
- + h2,
- + h3,
- + h4,
- + h5
- `]: {
- marginTop: titleMarginTop
- }
- }
- }), getResetStyles(token)), getLinkStyles(token)), {
- // Operation
- [`
- ${componentCls}-expand,
- ${componentCls}-collapse,
- ${componentCls}-edit,
- ${componentCls}-copy
- `]: Object.assign(Object.assign({}, (0,style.operationUnit)(token)), {
- marginInlineStart: token.marginXXS
- })
- }), getEditableStyles(token)), getCopyableStyles(token)), getEllipsisStyles()), {
- '&-rtl': {
- direction: 'rtl'
- }
- })
- };
- };
- const prepareComponentToken = () => ({
- titleMarginTop: '1.2em',
- titleMarginBottom: '0.5em'
- });
- // ============================== Export ==============================
- /* harmony default export */ var typography_style = ((0,genStyleUtils.genStyleHooks)('Typography', genTypographyStyle, prepareComponentToken));
- /***/ }),
- /***/ "./components/upload/style/index.ts":
- /*!******************************************************!*\
- !*** ./components/upload/style/index.ts + 5 modules ***!
- \******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ upload_style; },
- prepareComponentToken: function() { return /* binding */ prepareComponentToken; }
- });
- // EXTERNAL MODULE: ./components/style/index.tsx
- var style = __webpack_require__("./components/style/index.tsx");
- // EXTERNAL MODULE: ./components/style/motion/collapse.ts
- var collapse = __webpack_require__("./components/style/motion/collapse.ts");
- // EXTERNAL MODULE: ./components/theme/util/genStyleUtils.ts
- var genStyleUtils = __webpack_require__("./components/theme/util/genStyleUtils.ts");
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules
- var es = __webpack_require__("./node_modules/@ant-design/cssinjs-utils/es/index.js");
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- ;// ./components/upload/style/dragger.ts
- const genDraggerStyle = token => {
- const {
- componentCls,
- iconCls
- } = token;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-drag`]: {
- position: 'relative',
- width: '100%',
- height: '100%',
- textAlign: 'center',
- background: token.colorFillAlter,
- border: `${(0,cssinjs.unit)(token.lineWidth)} dashed ${token.colorBorder}`,
- borderRadius: token.borderRadiusLG,
- cursor: 'pointer',
- transition: `border-color ${token.motionDurationSlow}`,
- [componentCls]: {
- padding: token.padding
- },
- [`${componentCls}-btn`]: {
- display: 'table',
- width: '100%',
- height: '100%',
- outline: 'none',
- borderRadius: token.borderRadiusLG,
- '&:focus-visible': {
- outline: `${(0,cssinjs.unit)(token.lineWidthFocus)} solid ${token.colorPrimaryBorder}`
- }
- },
- [`${componentCls}-drag-container`]: {
- display: 'table-cell',
- verticalAlign: 'middle'
- },
- [`
- &:not(${componentCls}-disabled):hover,
- &-hover:not(${componentCls}-disabled)
- `]: {
- borderColor: token.colorPrimaryHover
- },
- [`p${componentCls}-drag-icon`]: {
- marginBottom: token.margin,
- [iconCls]: {
- color: token.colorPrimary,
- fontSize: token.uploadThumbnailSize
- }
- },
- [`p${componentCls}-text`]: {
- margin: `0 0 ${(0,cssinjs.unit)(token.marginXXS)}`,
- color: token.colorTextHeading,
- fontSize: token.fontSizeLG
- },
- [`p${componentCls}-hint`]: {
- color: token.colorTextDescription,
- fontSize: token.fontSize
- },
- // ===================== Disabled =====================
- [`&${componentCls}-disabled`]: {
- [`p${componentCls}-drag-icon ${iconCls},
- p${componentCls}-text,
- p${componentCls}-hint
- `]: {
- color: token.colorTextDisabled
- }
- }
- }
- }
- };
- };
- /* harmony default export */ var dragger = (genDraggerStyle);
- ;// ./components/upload/style/list.ts
- const genListStyle = token => {
- const {
- componentCls,
- iconCls,
- fontSize,
- lineHeight,
- calc
- } = token;
- const itemCls = `${componentCls}-list-item`;
- const actionsCls = `${itemCls}-actions`;
- const actionCls = `${itemCls}-action`;
- return {
- [`${componentCls}-wrapper`]: {
- [`${componentCls}-list`]: Object.assign(Object.assign({}, (0,style.clearFix)()), {
- lineHeight: token.lineHeight,
- [itemCls]: {
- position: 'relative',
- height: calc(token.lineHeight).mul(fontSize).equal(),
- marginTop: token.marginXS,
- fontSize,
- display: 'flex',
- alignItems: 'center',
- transition: `background-color ${token.motionDurationSlow}`,
- borderRadius: token.borderRadiusSM,
- '&:hover': {
- backgroundColor: token.controlItemBgHover
- },
- [`${itemCls}-name`]: Object.assign(Object.assign({}, style.textEllipsis), {
- padding: `0 ${(0,cssinjs.unit)(token.paddingXS)}`,
- lineHeight,
- flex: 'auto',
- transition: `all ${token.motionDurationSlow}`
- }),
- [actionsCls]: {
- whiteSpace: 'nowrap',
- [actionCls]: {
- opacity: 0
- },
- [iconCls]: {
- color: token.actionsColor,
- transition: `all ${token.motionDurationSlow}`
- },
- [`
- ${actionCls}:focus-visible,
- &.picture ${actionCls}
- `]: {
- opacity: 1
- }
- },
- [`${componentCls}-icon ${iconCls}`]: {
- color: token.colorIcon,
- fontSize
- },
- [`${itemCls}-progress`]: {
- position: 'absolute',
- bottom: token.calc(token.uploadProgressOffset).mul(-1).equal(),
- width: '100%',
- paddingInlineStart: calc(fontSize).add(token.paddingXS).equal(),
- fontSize,
- lineHeight: 0,
- pointerEvents: 'none',
- '> div': {
- margin: 0
- }
- }
- },
- [`${itemCls}:hover ${actionCls}`]: {
- opacity: 1
- },
- [`${itemCls}-error`]: {
- color: token.colorError,
- [`${itemCls}-name, ${componentCls}-icon ${iconCls}`]: {
- color: token.colorError
- },
- [actionsCls]: {
- [`${iconCls}, ${iconCls}:hover`]: {
- color: token.colorError
- },
- [actionCls]: {
- opacity: 1
- }
- }
- },
- [`${componentCls}-list-item-container`]: {
- transition: `opacity ${token.motionDurationSlow}, height ${token.motionDurationSlow}`,
- // For smooth removing animation
- '&::before': {
- display: 'table',
- width: 0,
- height: 0,
- content: '""'
- }
- }
- })
- }
- };
- };
- /* harmony default export */ var list = (genListStyle);
- // EXTERNAL MODULE: ./components/style/motion/fade.ts
- var fade = __webpack_require__("./components/style/motion/fade.ts");
- ;// ./components/upload/style/motion.ts
- // =========================== Motion ===========================
- const genMotionStyle = token => {
- const {
- componentCls
- } = token;
- const uploadAnimateInlineIn = new cssinjs.Keyframes('uploadAnimateInlineIn', {
- from: {
- width: 0,
- height: 0,
- padding: 0,
- opacity: 0,
- margin: token.calc(token.marginXS).div(-2).equal()
- }
- });
- const uploadAnimateInlineOut = new cssinjs.Keyframes('uploadAnimateInlineOut', {
- to: {
- width: 0,
- height: 0,
- padding: 0,
- opacity: 0,
- margin: token.calc(token.marginXS).div(-2).equal()
- }
- });
- const inlineCls = `${componentCls}-animate-inline`;
- return [{
- [`${componentCls}-wrapper`]: {
- [`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
- animationDuration: token.motionDurationSlow,
- animationTimingFunction: token.motionEaseInOutCirc,
- animationFillMode: 'forwards'
- },
- [`${inlineCls}-appear, ${inlineCls}-enter`]: {
- animationName: uploadAnimateInlineIn
- },
- [`${inlineCls}-leave`]: {
- animationName: uploadAnimateInlineOut
- }
- }
- }, {
- [`${componentCls}-wrapper`]: (0,fade.initFadeMotion)(token)
- }, uploadAnimateInlineIn, uploadAnimateInlineOut];
- };
- /* harmony default export */ var motion = (genMotionStyle);
- // EXTERNAL MODULE: ./node_modules/@ant-design/colors/es/index.js + 2 modules
- var colors_es = __webpack_require__("./node_modules/@ant-design/colors/es/index.js");
- ;// ./components/upload/style/picture.ts
- const genPictureStyle = token => {
- const {
- componentCls,
- iconCls,
- uploadThumbnailSize,
- uploadProgressOffset,
- calc
- } = token;
- const listCls = `${componentCls}-list`;
- const itemCls = `${listCls}-item`;
- return {
- [`${componentCls}-wrapper`]: {
- // ${listCls} 增加优先级
- [`
- ${listCls}${listCls}-picture,
- ${listCls}${listCls}-picture-card,
- ${listCls}${listCls}-picture-circle
- `]: {
- [itemCls]: {
- position: 'relative',
- height: calc(uploadThumbnailSize).add(calc(token.lineWidth).mul(2)).add(calc(token.paddingXS).mul(2)).equal(),
- padding: token.paddingXS,
- border: `${(0,cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
- borderRadius: token.borderRadiusLG,
- '&:hover': {
- background: 'transparent'
- },
- [`${itemCls}-thumbnail`]: Object.assign(Object.assign({}, style.textEllipsis), {
- width: uploadThumbnailSize,
- height: uploadThumbnailSize,
- lineHeight: (0,cssinjs.unit)(calc(uploadThumbnailSize).add(token.paddingSM).equal()),
- textAlign: 'center',
- flex: 'none',
- [iconCls]: {
- fontSize: token.fontSizeHeading2,
- color: token.colorPrimary
- },
- img: {
- display: 'block',
- width: '100%',
- height: '100%',
- overflow: 'hidden'
- }
- }),
- [`${itemCls}-progress`]: {
- bottom: uploadProgressOffset,
- width: `calc(100% - ${(0,cssinjs.unit)(calc(token.paddingSM).mul(2).equal())})`,
- marginTop: 0,
- paddingInlineStart: calc(uploadThumbnailSize).add(token.paddingXS).equal()
- }
- },
- [`${itemCls}-error`]: {
- borderColor: token.colorError,
- // Adjust the color of the error icon : https://github.com/ant-design/ant-design/pull/24160
- [`${itemCls}-thumbnail ${iconCls}`]: {
- [`svg path[fill='${colors_es.blue[0]}']`]: {
- fill: token.colorErrorBg
- },
- [`svg path[fill='${colors_es.blue.primary}']`]: {
- fill: token.colorError
- }
- }
- },
- [`${itemCls}-uploading`]: {
- borderStyle: 'dashed',
- [`${itemCls}-name`]: {
- marginBottom: uploadProgressOffset
- }
- }
- },
- [`${listCls}${listCls}-picture-circle ${itemCls}`]: {
- [`&, &::before, ${itemCls}-thumbnail`]: {
- borderRadius: '50%'
- }
- }
- }
- };
- };
- const genPictureCardStyle = token => {
- const {
- componentCls,
- iconCls,
- fontSizeLG,
- colorTextLightSolid,
- calc
- } = token;
- const listCls = `${componentCls}-list`;
- const itemCls = `${listCls}-item`;
- const uploadPictureCardSize = token.uploadPicCardSize;
- return {
- [`
- ${componentCls}-wrapper${componentCls}-picture-card-wrapper,
- ${componentCls}-wrapper${componentCls}-picture-circle-wrapper
- `]: Object.assign(Object.assign({}, (0,style.clearFix)()), {
- display: 'block',
- [`${componentCls}${componentCls}-select`]: {
- width: uploadPictureCardSize,
- height: uploadPictureCardSize,
- textAlign: 'center',
- verticalAlign: 'top',
- backgroundColor: token.colorFillAlter,
- border: `${(0,cssinjs.unit)(token.lineWidth)} dashed ${token.colorBorder}`,
- borderRadius: token.borderRadiusLG,
- cursor: 'pointer',
- transition: `border-color ${token.motionDurationSlow}`,
- [`> ${componentCls}`]: {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- height: '100%',
- textAlign: 'center'
- },
- [`&:not(${componentCls}-disabled):hover`]: {
- borderColor: token.colorPrimary
- }
- },
- // list
- [`${listCls}${listCls}-picture-card, ${listCls}${listCls}-picture-circle`]: {
- display: 'flex',
- flexWrap: 'wrap',
- '@supports not (gap: 1px)': {
- '& > *': {
- marginBlockEnd: token.marginXS,
- marginInlineEnd: token.marginXS
- }
- },
- '@supports (gap: 1px)': {
- gap: token.marginXS
- },
- [`${listCls}-item-container`]: {
- display: 'inline-block',
- width: uploadPictureCardSize,
- height: uploadPictureCardSize,
- verticalAlign: 'top'
- },
- '&::after': {
- display: 'none'
- },
- '&::before': {
- display: 'none'
- },
- [itemCls]: {
- height: '100%',
- margin: 0,
- '&::before': {
- position: 'absolute',
- zIndex: 1,
- width: `calc(100% - ${(0,cssinjs.unit)(calc(token.paddingXS).mul(2).equal())})`,
- height: `calc(100% - ${(0,cssinjs.unit)(calc(token.paddingXS).mul(2).equal())})`,
- backgroundColor: token.colorBgMask,
- opacity: 0,
- transition: `all ${token.motionDurationSlow}`,
- content: '" "'
- }
- },
- [`${itemCls}:hover`]: {
- [`&::before, ${itemCls}-actions`]: {
- opacity: 1
- }
- },
- [`${itemCls}-actions`]: {
- position: 'absolute',
- insetInlineStart: 0,
- zIndex: 10,
- width: '100%',
- whiteSpace: 'nowrap',
- textAlign: 'center',
- opacity: 0,
- transition: `all ${token.motionDurationSlow}`,
- [`
- ${iconCls}-eye,
- ${iconCls}-download,
- ${iconCls}-delete
- `]: {
- zIndex: 10,
- width: fontSizeLG,
- margin: `0 ${(0,cssinjs.unit)(token.marginXXS)}`,
- fontSize: fontSizeLG,
- cursor: 'pointer',
- transition: `all ${token.motionDurationSlow}`,
- color: colorTextLightSolid,
- '&:hover': {
- color: colorTextLightSolid
- },
- svg: {
- verticalAlign: 'baseline'
- }
- }
- },
- [`${itemCls}-thumbnail, ${itemCls}-thumbnail img`]: {
- position: 'static',
- display: 'block',
- width: '100%',
- height: '100%',
- objectFit: 'contain'
- },
- [`${itemCls}-name`]: {
- display: 'none',
- textAlign: 'center'
- },
- [`${itemCls}-file + ${itemCls}-name`]: {
- position: 'absolute',
- bottom: token.margin,
- display: 'block',
- width: `calc(100% - ${(0,cssinjs.unit)(calc(token.paddingXS).mul(2).equal())})`
- },
- [`${itemCls}-uploading`]: {
- [`&${itemCls}`]: {
- backgroundColor: token.colorFillAlter
- },
- [`&::before, ${iconCls}-eye, ${iconCls}-download, ${iconCls}-delete`]: {
- display: 'none'
- }
- },
- [`${itemCls}-progress`]: {
- bottom: token.marginXL,
- width: `calc(100% - ${(0,cssinjs.unit)(calc(token.paddingXS).mul(2).equal())})`,
- paddingInlineStart: 0
- }
- }
- }),
- [`${componentCls}-wrapper${componentCls}-picture-circle-wrapper`]: {
- [`${componentCls}${componentCls}-select`]: {
- borderRadius: '50%'
- }
- }
- };
- };
- ;// ./components/upload/style/rtl.ts
- // =========================== Motion ===========================
- const genRtlStyle = token => {
- const {
- componentCls
- } = token;
- return {
- [`${componentCls}-rtl`]: {
- direction: 'rtl'
- }
- };
- };
- /* harmony default export */ var rtl = (genRtlStyle);
- ;// ./components/upload/style/index.ts
- const genBaseStyle = token => {
- const {
- componentCls,
- colorTextDisabled
- } = token;
- return {
- [`${componentCls}-wrapper`]: Object.assign(Object.assign({}, (0,style.resetComponent)(token)), {
- [componentCls]: {
- outline: 0,
- "input[type='file']": {
- cursor: 'pointer'
- }
- },
- [`${componentCls}-select`]: {
- display: 'inline-block'
- },
- [`${componentCls}-hidden`]: {
- display: 'none'
- },
- [`${componentCls}-disabled`]: {
- color: colorTextDisabled,
- cursor: 'not-allowed'
- }
- })
- };
- };
- const prepareComponentToken = token => ({
- actionsColor: token.colorIcon
- });
- // ============================== Export ==============================
- /* harmony default export */ var upload_style = ((0,genStyleUtils.genStyleHooks)('Upload', token => {
- const {
- fontSizeHeading3,
- fontHeight,
- lineWidth,
- controlHeightLG,
- calc
- } = token;
- const uploadToken = (0,es.mergeToken)(token, {
- uploadThumbnailSize: calc(fontSizeHeading3).mul(2).equal(),
- uploadProgressOffset: calc(calc(fontHeight).div(2)).add(lineWidth).equal(),
- uploadPicCardSize: calc(controlHeightLG).mul(2.55).equal()
- });
- return [genBaseStyle(uploadToken), dragger(uploadToken), genPictureStyle(uploadToken), genPictureCardStyle(uploadToken), list(uploadToken), motion(uploadToken), rtl(uploadToken), (0,collapse["default"])(uploadToken)];
- }, prepareComponentToken));
- /***/ }),
- /***/ "./components/version/index.tsx":
- /*!**************************************************!*\
- !*** ./components/version/index.tsx + 1 modules ***!
- \**************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ components_version; }
- });
- ;// ./components/version/version.ts
- /* harmony default export */ var version = ('5.27.4');
- ;// ./components/version/index.tsx
- // @ts-ignore
- /* harmony default export */ var components_version = (version);
- /***/ }),
- /***/ "./index-style-only.js":
- /*!*****************************!*\
- !*** ./index-style-only.js ***!
- \*****************************/
- /***/ (function(module, exports, __webpack_require__) {
- function pascalCase(name) {
- return name.charAt(0).toUpperCase() + name.slice(1).replace(/-(\w)/g, (m, n) => n.toUpperCase());
- }
- // Just import style for https://github.com/ant-design/ant-design/issues/3745
- const req = __webpack_require__("./components sync recursive ^\\.\\/[^_][\\w-]+\\/style\\/index\\.tsx?$");
- req.keys().forEach(mod => {
- let v = req(mod);
- if (v?.default) {
- v = v.default;
- }
- const match = mod.match(/^\.\/([^_][\w-]+)\/index\.tsx?$/);
- if (match?.[1]) {
- if (match[1] === 'message' || match[1] === 'notification') {
- // message & notification should not be capitalized
- exports[match[1]] = v;
- } else {
- exports[pascalCase(match[1])] = v;
- }
- }
- });
- module.exports = exports;
- /***/ }),
- /***/ "./index.js":
- /*!******************!*\
- !*** ./index.js ***!
- \******************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- __webpack_require__(/*! ./index-style-only */ "./index-style-only.js");
- module.exports = __webpack_require__(/*! ./components */ "./components/index.ts");
- /***/ }),
- /***/ "./node_modules/@ant-design/colors/es/index.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ant-design/colors/es/index.js + 2 modules ***!
- \*****************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- blue: function() { return /* reexport */ blue; },
- generate: function() { return /* reexport */ generate; },
- gold: function() { return /* reexport */ gold; },
- presetPalettes: function() { return /* reexport */ presetPalettes; },
- presetPrimaryColors: function() { return /* reexport */ presetPrimaryColors; }
- });
- // UNUSED EXPORTS: blueDark, cyan, cyanDark, geekblue, geekblueDark, goldDark, gray, green, greenDark, grey, greyDark, lime, limeDark, magenta, magentaDark, orange, orangeDark, presetDarkPalettes, purple, purpleDark, red, redDark, volcano, volcanoDark, yellow, yellowDark
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- ;// ./node_modules/@ant-design/colors/es/generate.js
- var hueStep = 2; // 色相阶梯
- var saturationStep = 0.16; // 饱和度阶梯,浅色部分
- var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
- var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
- var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
- var lightColorCount = 5; // 浅色数量,主色上
- var darkColorCount = 4; // 深色数量,主色下
- // 暗色主题颜色映射关系表
- var darkColorMap = [{
- index: 7,
- amount: 15
- }, {
- index: 6,
- amount: 25
- }, {
- index: 5,
- amount: 30
- }, {
- index: 5,
- amount: 45
- }, {
- index: 5,
- amount: 65
- }, {
- index: 5,
- amount: 85
- }, {
- index: 4,
- amount: 90
- }, {
- index: 3,
- amount: 95
- }, {
- index: 2,
- amount: 97
- }, {
- index: 1,
- amount: 98
- }];
- function getHue(hsv, i, light) {
- var hue;
- // 根据色相不同,色相转向不同
- if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
- hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
- } else {
- hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
- }
- if (hue < 0) {
- hue += 360;
- } else if (hue >= 360) {
- hue -= 360;
- }
- return hue;
- }
- function getSaturation(hsv, i, light) {
- // grey color don't change saturation
- if (hsv.h === 0 && hsv.s === 0) {
- return hsv.s;
- }
- var saturation;
- if (light) {
- saturation = hsv.s - saturationStep * i;
- } else if (i === darkColorCount) {
- saturation = hsv.s + saturationStep;
- } else {
- saturation = hsv.s + saturationStep2 * i;
- }
- // 边界值修正
- if (saturation > 1) {
- saturation = 1;
- }
- // 第一格的 s 限制在 0.06-0.1 之间
- if (light && i === lightColorCount && saturation > 0.1) {
- saturation = 0.1;
- }
- if (saturation < 0.06) {
- saturation = 0.06;
- }
- return Math.round(saturation * 100) / 100;
- }
- function getValue(hsv, i, light) {
- var value;
- if (light) {
- value = hsv.v + brightnessStep1 * i;
- } else {
- value = hsv.v - brightnessStep2 * i;
- }
- // Clamp value between 0 and 1
- value = Math.max(0, Math.min(1, value));
- return Math.round(value * 100) / 100;
- }
- function generate(color) {
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var patterns = [];
- var pColor = new es.FastColor(color);
- var hsv = pColor.toHsv();
- for (var i = lightColorCount; i > 0; i -= 1) {
- var c = new es.FastColor({
- h: getHue(hsv, i, true),
- s: getSaturation(hsv, i, true),
- v: getValue(hsv, i, true)
- });
- patterns.push(c);
- }
- patterns.push(pColor);
- for (var _i = 1; _i <= darkColorCount; _i += 1) {
- var _c = new es.FastColor({
- h: getHue(hsv, _i),
- s: getSaturation(hsv, _i),
- v: getValue(hsv, _i)
- });
- patterns.push(_c);
- }
- // dark theme patterns
- if (opts.theme === 'dark') {
- return darkColorMap.map(function (_ref) {
- var index = _ref.index,
- amount = _ref.amount;
- return new es.FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
- });
- }
- return patterns.map(function (c) {
- return c.toHexString();
- });
- }
- ;// ./node_modules/@ant-design/colors/es/presets.js
- // Generated by script. Do NOT modify!
- var presetPrimaryColors = {
- "red": "#F5222D",
- "volcano": "#FA541C",
- "orange": "#FA8C16",
- "gold": "#FAAD14",
- "yellow": "#FADB14",
- "lime": "#A0D911",
- "green": "#52C41A",
- "cyan": "#13C2C2",
- "blue": "#1677FF",
- "geekblue": "#2F54EB",
- "purple": "#722ED1",
- "magenta": "#EB2F96",
- "grey": "#666666"
- };
- var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
- red.primary = red[5];
- var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
- volcano.primary = volcano[5];
- var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
- orange.primary = orange[5];
- var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
- gold.primary = gold[5];
- var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
- yellow.primary = yellow[5];
- var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
- lime.primary = lime[5];
- var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
- green.primary = green[5];
- var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
- cyan.primary = cyan[5];
- var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
- blue.primary = blue[5];
- var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
- geekblue.primary = geekblue[5];
- var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
- purple.primary = purple[5];
- var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
- magenta.primary = magenta[5];
- var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
- grey.primary = grey[5];
- var gray = grey;
- var presetPalettes = {
- red: red,
- volcano: volcano,
- orange: orange,
- gold: gold,
- yellow: yellow,
- lime: lime,
- green: green,
- cyan: cyan,
- blue: blue,
- geekblue: geekblue,
- purple: purple,
- magenta: magenta,
- grey: grey
- };
- var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
- redDark.primary = redDark[5];
- var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
- volcanoDark.primary = volcanoDark[5];
- var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
- orangeDark.primary = orangeDark[5];
- var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
- goldDark.primary = goldDark[5];
- var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
- yellowDark.primary = yellowDark[5];
- var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
- limeDark.primary = limeDark[5];
- var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
- greenDark.primary = greenDark[5];
- var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
- cyanDark.primary = cyanDark[5];
- var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
- blueDark.primary = blueDark[5];
- var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
- geekblueDark.primary = geekblueDark[5];
- var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
- purpleDark.primary = purpleDark[5];
- var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
- magentaDark.primary = magentaDark[5];
- var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
- greyDark.primary = greyDark[5];
- var presetDarkPalettes = {
- red: redDark,
- volcano: volcanoDark,
- orange: orangeDark,
- gold: goldDark,
- yellow: yellowDark,
- lime: limeDark,
- green: greenDark,
- cyan: cyanDark,
- blue: blueDark,
- geekblue: geekblueDark,
- purple: purpleDark,
- magenta: magentaDark,
- grey: greyDark
- };
- ;// ./node_modules/@ant-design/colors/es/index.js
- /***/ }),
- /***/ "./node_modules/@ant-design/cssinjs-utils/es/index.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/@ant-design/cssinjs-utils/es/index.js + 12 modules ***!
- \*************************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- genStyleUtils: function() { return /* reexport */ util_genStyleUtils; },
- mergeToken: function() { return /* reexport */ merge; }
- });
- // UNUSED EXPORTS: genCalc, statistic, statisticToken
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
- // EXTERNAL MODULE: ./alias/cssinjs.js
- var cssinjs = __webpack_require__("./alias/cssinjs.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
- var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
- var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/inherits.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
- var createSuper = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createSuper.js");
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/calc/calculator.js
- var AbstractCalculator = /*#__PURE__*/(0,createClass["default"])(function AbstractCalculator() {
- (0,classCallCheck["default"])(this, AbstractCalculator);
- });
- /* harmony default export */ var calculator = (AbstractCalculator);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.js
- var CALC_UNIT = 'CALC_UNIT';
- var regexp = new RegExp(CALC_UNIT, 'g');
- function unit(value) {
- if (typeof value === 'number') {
- return "".concat(value).concat(CALC_UNIT);
- }
- return value;
- }
- var CSSCalculator = /*#__PURE__*/function (_AbstractCalculator) {
- (0,inherits["default"])(CSSCalculator, _AbstractCalculator);
- var _super = (0,createSuper["default"])(CSSCalculator);
- function CSSCalculator(num, unitlessCssVar) {
- var _this;
- (0,classCallCheck["default"])(this, CSSCalculator);
- _this = _super.call(this);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "result", '');
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "unitlessCssVar", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "lowPriority", void 0);
- var numType = (0,esm_typeof["default"])(num);
- _this.unitlessCssVar = unitlessCssVar;
- if (num instanceof CSSCalculator) {
- _this.result = "(".concat(num.result, ")");
- } else if (numType === 'number') {
- _this.result = unit(num);
- } else if (numType === 'string') {
- _this.result = num;
- }
- return _this;
- }
- (0,createClass["default"])(CSSCalculator, [{
- key: "add",
- value: function add(num) {
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " + ").concat(num.getResult());
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " + ").concat(unit(num));
- }
- this.lowPriority = true;
- return this;
- }
- }, {
- key: "sub",
- value: function sub(num) {
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " - ").concat(num.getResult());
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " - ").concat(unit(num));
- }
- this.lowPriority = true;
- return this;
- }
- }, {
- key: "mul",
- value: function mul(num) {
- if (this.lowPriority) {
- this.result = "(".concat(this.result, ")");
- }
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " * ").concat(num.getResult(true));
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " * ").concat(num);
- }
- this.lowPriority = false;
- return this;
- }
- }, {
- key: "div",
- value: function div(num) {
- if (this.lowPriority) {
- this.result = "(".concat(this.result, ")");
- }
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " / ").concat(num.getResult(true));
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " / ").concat(num);
- }
- this.lowPriority = false;
- return this;
- }
- }, {
- key: "getResult",
- value: function getResult(force) {
- return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
- }
- }, {
- key: "equal",
- value: function equal(options) {
- var _this2 = this;
- var _ref = options || {},
- cssUnit = _ref.unit;
- var mergedUnit = true;
- if (typeof cssUnit === 'boolean') {
- mergedUnit = cssUnit;
- } else if (Array.from(this.unitlessCssVar).some(function (cssVar) {
- return _this2.result.includes(cssVar);
- })) {
- mergedUnit = false;
- }
- this.result = this.result.replace(regexp, mergedUnit ? 'px' : '');
- if (typeof this.lowPriority !== 'undefined') {
- return "calc(".concat(this.result, ")");
- }
- return this.result;
- }
- }]);
- return CSSCalculator;
- }(calculator);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.js
- var NumCalculator = /*#__PURE__*/function (_AbstractCalculator) {
- (0,inherits["default"])(NumCalculator, _AbstractCalculator);
- var _super = (0,createSuper["default"])(NumCalculator);
- function NumCalculator(num) {
- var _this;
- (0,classCallCheck["default"])(this, NumCalculator);
- _this = _super.call(this);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "result", 0);
- if (num instanceof NumCalculator) {
- _this.result = num.result;
- } else if (typeof num === 'number') {
- _this.result = num;
- }
- return _this;
- }
- (0,createClass["default"])(NumCalculator, [{
- key: "add",
- value: function add(num) {
- if (num instanceof NumCalculator) {
- this.result += num.result;
- } else if (typeof num === 'number') {
- this.result += num;
- }
- return this;
- }
- }, {
- key: "sub",
- value: function sub(num) {
- if (num instanceof NumCalculator) {
- this.result -= num.result;
- } else if (typeof num === 'number') {
- this.result -= num;
- }
- return this;
- }
- }, {
- key: "mul",
- value: function mul(num) {
- if (num instanceof NumCalculator) {
- this.result *= num.result;
- } else if (typeof num === 'number') {
- this.result *= num;
- }
- return this;
- }
- }, {
- key: "div",
- value: function div(num) {
- if (num instanceof NumCalculator) {
- this.result /= num.result;
- } else if (typeof num === 'number') {
- this.result /= num;
- }
- return this;
- }
- }, {
- key: "equal",
- value: function equal() {
- return this.result;
- }
- }]);
- return NumCalculator;
- }(calculator);
- /* harmony default export */ var calc_NumCalculator = (NumCalculator);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/calc/index.js
- var genCalc = function genCalc(type, unitlessCssVar) {
- var Calculator = type === 'css' ? CSSCalculator : calc_NumCalculator;
- return function (num) {
- return new Calculator(num, unitlessCssVar);
- };
- };
- /* harmony default export */ var util_calc = (genCalc);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/getCompVarPrefix.js
- var getCompVarPrefix = function getCompVarPrefix(component, prefix) {
- return "".concat([prefix, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, '$1-$2').replace(/([a-z])([A-Z])/g, '$1-$2')].filter(Boolean).join('-'));
- };
- /* harmony default export */ var util_getCompVarPrefix = (getCompVarPrefix);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/index.js
- var es = __webpack_require__("./node_modules/rc-util/es/index.js");
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.js
- function getComponentToken(component, token, defaultToken, options) {
- var customToken = (0,objectSpread2["default"])({}, token[component]);
- if (options !== null && options !== void 0 && options.deprecatedTokens) {
- var deprecatedTokens = options.deprecatedTokens;
- deprecatedTokens.forEach(function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 2),
- oldTokenKey = _ref2[0],
- newTokenKey = _ref2[1];
- if (true) {
- (0,es.warning)(!(customToken !== null && customToken !== void 0 && customToken[oldTokenKey]), "Component Token `".concat(String(oldTokenKey), "` of ").concat(String(component), " is deprecated. Please use `").concat(String(newTokenKey), "` instead."));
- }
- // Should wrap with `if` clause, or there will be `undefined` in object.
- if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {
- var _customToken$newToken;
- (_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 ? _customToken$newToken : customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey];
- }
- });
- }
- var mergedToken = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, defaultToken), customToken);
- // Remove same value as global token to minimize size
- Object.keys(mergedToken).forEach(function (key) {
- if (mergedToken[key] === token[key]) {
- delete mergedToken[key];
- }
- });
- return mergedToken;
- }
- /* harmony default export */ var util_getComponentToken = (getComponentToken);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/statistic.js
- var enableStatistic = true || 0;
- var recording = true;
- /**
- * This function will do as `Object.assign` in production. But will use Object.defineProperty:get to
- * pass all value access in development. To support statistic field usage with alias token.
- */
- function merge() {
- for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
- objs[_key] = arguments[_key];
- }
- /* istanbul ignore next */
- if (!enableStatistic) {
- return Object.assign.apply(Object, [{}].concat(objs));
- }
- recording = false;
- var ret = {};
- objs.forEach(function (obj) {
- if ((0,esm_typeof["default"])(obj) !== 'object') {
- return;
- }
- var keys = Object.keys(obj);
- keys.forEach(function (key) {
- Object.defineProperty(ret, key, {
- configurable: true,
- enumerable: true,
- get: function get() {
- return obj[key];
- }
- });
- });
- });
- recording = true;
- return ret;
- }
- /** @internal Internal Usage. Not use in your production. */
- var statistic = {};
- /** @internal Internal Usage. Not use in your production. */
- var _statistic_build_ = {};
- /* istanbul ignore next */
- function noop() {}
- /** Statistic token usage case. Should use `merge` function if you do not want spread record. */
- var statisticToken = function statisticToken(token) {
- var tokenKeys;
- var proxy = token;
- var flush = noop;
- if (enableStatistic && typeof Proxy !== 'undefined') {
- tokenKeys = new Set();
- proxy = new Proxy(token, {
- get: function get(obj, prop) {
- if (recording) {
- var _tokenKeys;
- (_tokenKeys = tokenKeys) === null || _tokenKeys === void 0 || _tokenKeys.add(prop);
- }
- return obj[prop];
- }
- });
- flush = function flush(componentName, componentToken) {
- var _statistic$componentN;
- statistic[componentName] = {
- global: Array.from(tokenKeys),
- component: (0,objectSpread2["default"])((0,objectSpread2["default"])({}, (_statistic$componentN = statistic[componentName]) === null || _statistic$componentN === void 0 ? void 0 : _statistic$componentN.component), componentToken)
- };
- };
- }
- return {
- token: proxy,
- keys: tokenKeys,
- flush: flush
- };
- };
- /* harmony default export */ var util_statistic = (statisticToken);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/getDefaultComponentToken.js
- function getDefaultComponentToken(component, token, getDefaultToken) {
- if (typeof getDefaultToken === 'function') {
- var _token$component;
- return getDefaultToken(merge(token, (_token$component = token[component]) !== null && _token$component !== void 0 ? _token$component : {}));
- }
- return getDefaultToken !== null && getDefaultToken !== void 0 ? getDefaultToken : {};
- }
- /* harmony default export */ var util_getDefaultComponentToken = (getDefaultComponentToken);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/maxmin.js
- function genMaxMin(type) {
- if (type === 'js') {
- return {
- max: Math.max,
- min: Math.min
- };
- }
- return {
- max: function max() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return "max(".concat(args.map(function (value) {
- return (0,cssinjs.unit)(value);
- }).join(','), ")");
- },
- min: function min() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return "min(".concat(args.map(function (value) {
- return (0,cssinjs.unit)(value);
- }).join(','), ")");
- }
- };
- }
- /* harmony default export */ var maxmin = (genMaxMin);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.js
- var BEAT_LIMIT = 1000 * 60 * 10;
- /**
- * A helper class to map keys to values.
- * It supports both primitive keys and object keys.
- */
- var ArrayKeyMap = /*#__PURE__*/function () {
- function ArrayKeyMap() {
- (0,classCallCheck["default"])(this, ArrayKeyMap);
- (0,defineProperty["default"])(this, "map", new Map());
- // Use WeakMap to avoid memory leak
- (0,defineProperty["default"])(this, "objectIDMap", new WeakMap());
- (0,defineProperty["default"])(this, "nextID", 0);
- (0,defineProperty["default"])(this, "lastAccessBeat", new Map());
- // We will clean up the cache when reach the limit
- (0,defineProperty["default"])(this, "accessBeat", 0);
- }
- (0,createClass["default"])(ArrayKeyMap, [{
- key: "set",
- value: function set(keys, value) {
- // New set will trigger clear
- this.clear();
- // Set logic
- var compositeKey = this.getCompositeKey(keys);
- this.map.set(compositeKey, value);
- this.lastAccessBeat.set(compositeKey, Date.now());
- }
- }, {
- key: "get",
- value: function get(keys) {
- var compositeKey = this.getCompositeKey(keys);
- var cache = this.map.get(compositeKey);
- this.lastAccessBeat.set(compositeKey, Date.now());
- this.accessBeat += 1;
- return cache;
- }
- }, {
- key: "getCompositeKey",
- value: function getCompositeKey(keys) {
- var _this = this;
- var ids = keys.map(function (key) {
- if (key && (0,esm_typeof["default"])(key) === 'object') {
- return "obj_".concat(_this.getObjectID(key));
- }
- return "".concat((0,esm_typeof["default"])(key), "_").concat(key);
- });
- return ids.join('|');
- }
- }, {
- key: "getObjectID",
- value: function getObjectID(obj) {
- if (this.objectIDMap.has(obj)) {
- return this.objectIDMap.get(obj);
- }
- var id = this.nextID;
- this.objectIDMap.set(obj, id);
- this.nextID += 1;
- return id;
- }
- }, {
- key: "clear",
- value: function clear() {
- var _this2 = this;
- if (this.accessBeat > 10000) {
- var now = Date.now();
- this.lastAccessBeat.forEach(function (beat, key) {
- if (now - beat > BEAT_LIMIT) {
- _this2.map.delete(key);
- _this2.lastAccessBeat.delete(key);
- }
- });
- this.accessBeat = 0;
- }
- }
- }]);
- return ArrayKeyMap;
- }();
- var uniqueMap = new ArrayKeyMap();
- /**
- * Like `useMemo`, but this hook result will be shared across all instances.
- */
- function useUniqueMemo(memoFn, deps) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- var cachedValue = uniqueMap.get(deps);
- if (cachedValue) {
- return cachedValue;
- }
- var newValue = memoFn();
- uniqueMap.set(deps, newValue);
- return newValue;
- }, deps);
- }
- /* harmony default export */ var hooks_useUniqueMemo = (useUniqueMemo);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/hooks/useCSP.js
- /**
- * Provide a default hook since not everyone needs to config this.
- */
- var useDefaultCSP = function useDefaultCSP() {
- return {};
- };
- /* harmony default export */ var hooks_useCSP = (useDefaultCSP);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/util/genStyleUtils.js
- function genStyleUtils(config) {
- // Dependency inversion for preparing basic config.
- var _config$useCSP = config.useCSP,
- useCSP = _config$useCSP === void 0 ? hooks_useCSP : _config$useCSP,
- useToken = config.useToken,
- usePrefix = config.usePrefix,
- getResetStyles = config.getResetStyles,
- getCommonStyle = config.getCommonStyle,
- getCompUnitless = config.getCompUnitless;
- function genStyleHooks(component, styleFn, getDefaultToken, options) {
- var componentName = Array.isArray(component) ? component[0] : component;
- function prefixToken(key) {
- return "".concat(String(componentName)).concat(key.slice(0, 1).toUpperCase()).concat(key.slice(1));
- }
- // Fill unitless
- var originUnitless = (options === null || options === void 0 ? void 0 : options.unitless) || {};
- var originCompUnitless = typeof getCompUnitless === 'function' ? getCompUnitless(component) : {};
- var compUnitless = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, originCompUnitless), {}, (0,defineProperty["default"])({}, prefixToken('zIndexPopup'), true));
- Object.keys(originUnitless).forEach(function (key) {
- compUnitless[prefixToken(key)] = originUnitless[key];
- });
- // Options
- var mergedOptions = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, options), {}, {
- unitless: compUnitless,
- prefixToken: prefixToken
- });
- // Hooks
- var useStyle = genComponentStyleHook(component, styleFn, getDefaultToken, mergedOptions);
- var useCSSVar = genCSSVarRegister(componentName, getDefaultToken, mergedOptions);
- return function (prefixCls) {
- var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
- var _useStyle = useStyle(prefixCls, rootCls),
- _useStyle2 = (0,slicedToArray["default"])(_useStyle, 2),
- hashId = _useStyle2[1];
- var _useCSSVar = useCSSVar(rootCls),
- _useCSSVar2 = (0,slicedToArray["default"])(_useCSSVar, 2),
- wrapCSSVar = _useCSSVar2[0],
- cssVarCls = _useCSSVar2[1];
- return [wrapCSSVar, hashId, cssVarCls];
- };
- }
- function genCSSVarRegister(component, getDefaultToken, options) {
- var compUnitless = options.unitless,
- _options$injectStyle = options.injectStyle,
- injectStyle = _options$injectStyle === void 0 ? true : _options$injectStyle,
- prefixToken = options.prefixToken,
- ignore = options.ignore;
- var CSSVarRegister = function CSSVarRegister(_ref) {
- var rootCls = _ref.rootCls,
- _ref$cssVar = _ref.cssVar,
- cssVar = _ref$cssVar === void 0 ? {} : _ref$cssVar;
- var _useToken = useToken(),
- realToken = _useToken.realToken;
- (0,cssinjs.useCSSVarRegister)({
- path: [component],
- prefix: cssVar.prefix,
- key: cssVar.key,
- unitless: compUnitless,
- ignore: ignore,
- token: realToken,
- scope: rootCls
- }, function () {
- var defaultToken = util_getDefaultComponentToken(component, realToken, getDefaultToken);
- var componentToken = util_getComponentToken(component, realToken, defaultToken, {
- deprecatedTokens: options === null || options === void 0 ? void 0 : options.deprecatedTokens
- });
- Object.keys(defaultToken).forEach(function (key) {
- componentToken[prefixToken(key)] = componentToken[key];
- delete componentToken[key];
- });
- return componentToken;
- });
- return null;
- };
- var useCSSVar = function useCSSVar(rootCls) {
- var _useToken2 = useToken(),
- cssVar = _useToken2.cssVar;
- return [function (node) {
- return injectStyle && cssVar ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(CSSVarRegister, {
- rootCls: rootCls,
- cssVar: cssVar,
- component: component
- }), node) : node;
- }, cssVar === null || cssVar === void 0 ? void 0 : cssVar.key];
- };
- return useCSSVar;
- }
- function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var cells = Array.isArray(componentName) ? componentName : [componentName, componentName];
- var _cells = (0,slicedToArray["default"])(cells, 1),
- component = _cells[0];
- var concatComponent = cells.join('-');
- var mergedLayer = config.layer || {
- name: 'antd'
- };
- // Return new style hook
- return function (prefixCls) {
- var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
- var _useToken3 = useToken(),
- theme = _useToken3.theme,
- realToken = _useToken3.realToken,
- hashId = _useToken3.hashId,
- token = _useToken3.token,
- cssVar = _useToken3.cssVar;
- var _usePrefix = usePrefix(),
- rootPrefixCls = _usePrefix.rootPrefixCls,
- iconPrefixCls = _usePrefix.iconPrefixCls;
- var csp = useCSP();
- var type = cssVar ? 'css' : 'js';
- // Use unique memo to share the result across all instances
- var calc = hooks_useUniqueMemo(function () {
- var unitlessCssVar = new Set();
- if (cssVar) {
- Object.keys(options.unitless || {}).forEach(function (key) {
- // Some component proxy the AliasToken (e.g. Image) and some not (e.g. Modal)
- // We should both pass in `unitlessCssVar` to make sure the CSSVar can be unitless.
- unitlessCssVar.add((0,cssinjs.token2CSSVar)(key, cssVar.prefix));
- unitlessCssVar.add((0,cssinjs.token2CSSVar)(key, util_getCompVarPrefix(component, cssVar.prefix)));
- });
- }
- return util_calc(type, unitlessCssVar);
- }, [type, component, cssVar === null || cssVar === void 0 ? void 0 : cssVar.prefix]);
- var _genMaxMin = maxmin(type),
- max = _genMaxMin.max,
- min = _genMaxMin.min;
- // Shared config
- var sharedConfig = {
- theme: theme,
- token: token,
- hashId: hashId,
- nonce: function nonce() {
- return csp.nonce;
- },
- clientOnly: options.clientOnly,
- layer: mergedLayer,
- // antd is always at top of styles
- order: options.order || -999
- };
- // This if statement is safe, as it will only be used if the generator has the function. It's not dynamic.
- if (typeof getResetStyles === 'function') {
- // Generate style for all need reset tags.
- (0,cssinjs.useStyleRegister)((0,objectSpread2["default"])((0,objectSpread2["default"])({}, sharedConfig), {}, {
- clientOnly: false,
- path: ['Shared', rootPrefixCls]
- }), function () {
- return getResetStyles(token, {
- prefix: {
- rootPrefixCls: rootPrefixCls,
- iconPrefixCls: iconPrefixCls
- },
- csp: csp
- });
- });
- }
- var wrapSSR = (0,cssinjs.useStyleRegister)((0,objectSpread2["default"])((0,objectSpread2["default"])({}, sharedConfig), {}, {
- path: [concatComponent, prefixCls, iconPrefixCls]
- }), function () {
- if (options.injectStyle === false) {
- return [];
- }
- var _statisticToken = util_statistic(token),
- proxyToken = _statisticToken.token,
- flush = _statisticToken.flush;
- var defaultComponentToken = util_getDefaultComponentToken(component, realToken, getDefaultToken);
- var componentCls = ".".concat(prefixCls);
- var componentToken = util_getComponentToken(component, realToken, defaultComponentToken, {
- deprecatedTokens: options.deprecatedTokens
- });
- if (cssVar && defaultComponentToken && (0,esm_typeof["default"])(defaultComponentToken) === 'object') {
- Object.keys(defaultComponentToken).forEach(function (key) {
- defaultComponentToken[key] = "var(".concat((0,cssinjs.token2CSSVar)(key, util_getCompVarPrefix(component, cssVar.prefix)), ")");
- });
- }
- var mergedToken = merge(proxyToken, {
- componentCls: componentCls,
- prefixCls: prefixCls,
- iconCls: ".".concat(iconPrefixCls),
- antCls: ".".concat(rootPrefixCls),
- calc: calc,
- // @ts-ignore
- max: max,
- // @ts-ignore
- min: min
- }, cssVar ? defaultComponentToken : componentToken);
- var styleInterpolation = styleFn(mergedToken, {
- hashId: hashId,
- prefixCls: prefixCls,
- rootPrefixCls: rootPrefixCls,
- iconPrefixCls: iconPrefixCls
- });
- flush(component, componentToken);
- var commonStyle = typeof getCommonStyle === 'function' ? getCommonStyle(mergedToken, prefixCls, rootCls, options.resetFont) : null;
- return [options.resetStyle === false ? null : commonStyle, styleInterpolation];
- });
- return [wrapSSR, hashId];
- };
- }
- function genSubStyleComponent(componentName, styleFn, getDefaultToken) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, (0,objectSpread2["default"])({
- resetStyle: false,
- // Sub Style should default after root one
- order: -998
- }, options));
- var StyledComponent = function StyledComponent(_ref2) {
- var prefixCls = _ref2.prefixCls,
- _ref2$rootCls = _ref2.rootCls,
- rootCls = _ref2$rootCls === void 0 ? prefixCls : _ref2$rootCls;
- useStyle(prefixCls, rootCls);
- return null;
- };
- if (true) {
- StyledComponent.displayName = "SubStyle_".concat(String(Array.isArray(componentName) ? componentName.join('.') : componentName));
- }
- return StyledComponent;
- }
- return {
- genStyleHooks: genStyleHooks,
- genSubStyleComponent: genSubStyleComponent,
- genComponentStyleHook: genComponentStyleHook
- };
- }
- /* harmony default export */ var util_genStyleUtils = (genStyleUtils);
- ;// ./node_modules/@ant-design/cssinjs-utils/es/index.js
- /***/ }),
- /***/ "./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js ***!
- \*************************************************************/
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* module decorator */ module = __webpack_require__.hmd(module);
- function useProdHMR() {
- return false;
- }
- var webpackHMR = false;
- function useDevHMR() {
- return webpackHMR;
- }
- /* harmony default export */ __webpack_exports__["default"] = ( false ? 0 : useDevHMR);
- // Webpack `module.hot.accept` do not support any deps update trigger
- // We have to hack handler to force mark as HRM
- if ( true && module && module.hot && 0) // removed by dead control flow
- { var originWebpackHotUpdate, win; }
- /***/ }),
- /***/ "./node_modules/@ant-design/cssinjs/es/index.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@ant-design/cssinjs/es/index.js + 38 modules ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- Keyframes: function() { return /* reexport */ Keyframes; },
- NaNLinter: function() { return /* reexport */ NaNLinter; },
- StyleContext: function() { return /* reexport */ es_StyleContext; },
- StyleProvider: function() { return /* reexport */ StyleProvider; },
- Theme: function() { return /* reexport */ Theme; },
- _experimental: function() { return /* binding */ _experimental; },
- createCache: function() { return /* reexport */ createCache; },
- createTheme: function() { return /* reexport */ createTheme; },
- extractStyle: function() { return /* reexport */ extractStyle; },
- genCalc: function() { return /* reexport */ calc; },
- getComputedToken: function() { return /* reexport */ getComputedToken; },
- legacyLogicalPropertiesTransformer: function() { return /* reexport */ legacyLogicalProperties; },
- legacyNotSelectorLinter: function() { return /* reexport */ legacyNotSelectorLinter; },
- logicalPropertiesLinter: function() { return /* reexport */ logicalPropertiesLinter; },
- parentSelectorLinter: function() { return /* reexport */ parentSelectorLinter; },
- px2remTransformer: function() { return /* reexport */ px2rem; },
- token2CSSVar: function() { return /* reexport */ token2CSSVar; },
- unit: function() { return /* reexport */ util_unit; },
- useCSSVarRegister: function() { return /* reexport */ hooks_useCSSVarRegister; },
- useCacheToken: function() { return /* reexport */ useCacheToken; },
- useStyleRegister: function() { return /* reexport */ useStyleRegister; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
- var toConsumableArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- ;// ./node_modules/@emotion/hash/dist/hash.browser.esm.js
- /* eslint-disable */
- // Inspired by https://github.com/garycourt/murmurhash-js
- // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
- function murmur2(str) {
- // 'm' and 'r' are mixing constants generated offline.
- // They're not really 'magic', they just happen to work well.
- // const m = 0x5bd1e995;
- // const r = 24;
- // Initialize the hash
- var h = 0; // Mix 4 bytes at a time into the hash
- var k,
- i = 0,
- len = str.length;
- for (; len >= 4; ++i, len -= 4) {
- k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
- k =
- /* Math.imul(k, m): */
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
- k ^=
- /* k >>> r: */
- k >>> 24;
- h =
- /* Math.imul(k, m): */
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- } // Handle the last few bytes of the input array
- switch (len) {
- case 3:
- h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
- case 2:
- h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
- case 1:
- h ^= str.charCodeAt(i) & 0xff;
- h =
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- } // Do a few final mixes of the hash to ensure the last few
- // bytes are well-incorporated.
- h ^= h >>> 13;
- h =
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- return ((h ^ h >>> 15) >>> 0).toString(36);
- }
- /* harmony default export */ var hash_browser_esm = (murmur2);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/dynamicCSS.js
- var dynamicCSS = __webpack_require__("./node_modules/rc-util/es/Dom/dynamicCSS.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useMemo.js
- var useMemo = __webpack_require__("./node_modules/rc-util/es/hooks/useMemo.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/isEqual.js
- var isEqual = __webpack_require__("./node_modules/rc-util/es/isEqual.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
- ;// ./node_modules/@ant-design/cssinjs/es/Cache.js
- // [times, realValue]
- var SPLIT = '%';
- /** Connect key with `SPLIT` */
- function pathKey(keys) {
- return keys.join(SPLIT);
- }
- var Entity = /*#__PURE__*/function () {
- function Entity(instanceId) {
- (0,classCallCheck["default"])(this, Entity);
- (0,defineProperty["default"])(this, "instanceId", void 0);
- /** @private Internal cache map. Do not access this directly */
- (0,defineProperty["default"])(this, "cache", new Map());
- (0,defineProperty["default"])(this, "extracted", new Set());
- this.instanceId = instanceId;
- }
- (0,createClass["default"])(Entity, [{
- key: "get",
- value: function get(keys) {
- return this.opGet(pathKey(keys));
- }
- /** A fast get cache with `get` concat. */
- }, {
- key: "opGet",
- value: function opGet(keyPathStr) {
- return this.cache.get(keyPathStr) || null;
- }
- }, {
- key: "update",
- value: function update(keys, valueFn) {
- return this.opUpdate(pathKey(keys), valueFn);
- }
- /** A fast get cache with `get` concat. */
- }, {
- key: "opUpdate",
- value: function opUpdate(keyPathStr, valueFn) {
- var prevValue = this.cache.get(keyPathStr);
- var nextValue = valueFn(prevValue);
- if (nextValue === null) {
- this.cache.delete(keyPathStr);
- } else {
- this.cache.set(keyPathStr, nextValue);
- }
- }
- }]);
- return Entity;
- }();
- /* harmony default export */ var Cache = (Entity);
- ;// ./node_modules/@ant-design/cssinjs/es/StyleContext.js
- var _excluded = ["children"];
- var ATTR_TOKEN = 'data-token-hash';
- var ATTR_MARK = 'data-css-hash';
- var ATTR_CACHE_PATH = 'data-cache-path';
- // Mark css-in-js instance in style element
- var CSS_IN_JS_INSTANCE = '__cssinjs_instance__';
- function createCache() {
- var cssinjsInstanceId = Math.random().toString(12).slice(2);
- // Tricky SSR: Move all inline style to the head.
- // PS: We do not recommend tricky mode.
- if (typeof document !== 'undefined' && document.head && document.body) {
- var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")) || [];
- var firstChild = document.head.firstChild;
- Array.from(styles).forEach(function (style) {
- style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || cssinjsInstanceId;
- // Not force move if no head
- if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
- document.head.insertBefore(style, firstChild);
- }
- });
- // Deduplicate of moved styles
- var styleHash = {};
- Array.from(document.querySelectorAll("style[".concat(ATTR_MARK, "]"))).forEach(function (style) {
- var hash = style.getAttribute(ATTR_MARK);
- if (styleHash[hash]) {
- if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
- var _style$parentNode;
- (_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);
- }
- } else {
- styleHash[hash] = true;
- }
- });
- }
- return new Cache(cssinjsInstanceId);
- }
- var StyleContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({
- hashPriority: 'low',
- cache: createCache(),
- defaultCache: true
- });
- var StyleProvider = function StyleProvider(props) {
- var children = props.children,
- restProps = (0,objectWithoutProperties["default"])(props, _excluded);
- var parentContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(StyleContext);
- var context = (0,useMemo["default"])(function () {
- var mergedContext = (0,objectSpread2["default"])({}, parentContext);
- Object.keys(restProps).forEach(function (key) {
- var value = restProps[key];
- if (restProps[key] !== undefined) {
- mergedContext[key] = value;
- }
- });
- var cache = restProps.cache;
- mergedContext.cache = mergedContext.cache || createCache();
- mergedContext.defaultCache = !cache && parentContext.defaultCache;
- return mergedContext;
- }, [parentContext, restProps], function (prev, next) {
- return !(0,isEqual["default"])(prev[0], next[0], true) || !(0,isEqual["default"])(prev[1], next[1], true);
- });
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(StyleContext.Provider, {
- value: context
- }, children);
- };
- /* harmony default export */ var es_StyleContext = (StyleContext);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
- var canUseDom = __webpack_require__("./node_modules/rc-util/es/Dom/canUseDom.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
- var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
- var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/inherits.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
- var createSuper = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createSuper.js");
- ;// ./node_modules/@ant-design/cssinjs/es/theme/calc/calculator.js
- var AbstractCalculator = /*#__PURE__*/(0,createClass["default"])(function AbstractCalculator() {
- (0,classCallCheck["default"])(this, AbstractCalculator);
- });
- /* harmony default export */ var calculator = (AbstractCalculator);
- ;// ./node_modules/@ant-design/cssinjs/es/theme/calc/CSSCalculator.js
- var CALC_UNIT = 'CALC_UNIT';
- var regexp = new RegExp(CALC_UNIT, 'g');
- function unit(value) {
- if (typeof value === 'number') {
- return "".concat(value).concat(CALC_UNIT);
- }
- return value;
- }
- var CSSCalculator = /*#__PURE__*/function (_AbstractCalculator) {
- (0,inherits["default"])(CSSCalculator, _AbstractCalculator);
- var _super = (0,createSuper["default"])(CSSCalculator);
- function CSSCalculator(num, unitlessCssVar) {
- var _this;
- (0,classCallCheck["default"])(this, CSSCalculator);
- _this = _super.call(this);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "result", '');
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "unitlessCssVar", void 0);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "lowPriority", void 0);
- var numType = (0,esm_typeof["default"])(num);
- _this.unitlessCssVar = unitlessCssVar;
- if (num instanceof CSSCalculator) {
- _this.result = "(".concat(num.result, ")");
- } else if (numType === 'number') {
- _this.result = unit(num);
- } else if (numType === 'string') {
- _this.result = num;
- }
- return _this;
- }
- (0,createClass["default"])(CSSCalculator, [{
- key: "add",
- value: function add(num) {
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " + ").concat(num.getResult());
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " + ").concat(unit(num));
- }
- this.lowPriority = true;
- return this;
- }
- }, {
- key: "sub",
- value: function sub(num) {
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " - ").concat(num.getResult());
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " - ").concat(unit(num));
- }
- this.lowPriority = true;
- return this;
- }
- }, {
- key: "mul",
- value: function mul(num) {
- if (this.lowPriority) {
- this.result = "(".concat(this.result, ")");
- }
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " * ").concat(num.getResult(true));
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " * ").concat(num);
- }
- this.lowPriority = false;
- return this;
- }
- }, {
- key: "div",
- value: function div(num) {
- if (this.lowPriority) {
- this.result = "(".concat(this.result, ")");
- }
- if (num instanceof CSSCalculator) {
- this.result = "".concat(this.result, " / ").concat(num.getResult(true));
- } else if (typeof num === 'number' || typeof num === 'string') {
- this.result = "".concat(this.result, " / ").concat(num);
- }
- this.lowPriority = false;
- return this;
- }
- }, {
- key: "getResult",
- value: function getResult(force) {
- return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
- }
- }, {
- key: "equal",
- value: function equal(options) {
- var _this2 = this;
- var _ref = options || {},
- cssUnit = _ref.unit;
- var mergedUnit = true;
- if (typeof cssUnit === 'boolean') {
- mergedUnit = cssUnit;
- } else if (Array.from(this.unitlessCssVar).some(function (cssVar) {
- return _this2.result.includes(cssVar);
- })) {
- mergedUnit = false;
- }
- this.result = this.result.replace(regexp, mergedUnit ? 'px' : '');
- if (typeof this.lowPriority !== 'undefined') {
- return "calc(".concat(this.result, ")");
- }
- return this.result;
- }
- }]);
- return CSSCalculator;
- }(calculator);
- ;// ./node_modules/@ant-design/cssinjs/es/theme/calc/NumCalculator.js
- var NumCalculator = /*#__PURE__*/function (_AbstractCalculator) {
- (0,inherits["default"])(NumCalculator, _AbstractCalculator);
- var _super = (0,createSuper["default"])(NumCalculator);
- function NumCalculator(num) {
- var _this;
- (0,classCallCheck["default"])(this, NumCalculator);
- _this = _super.call(this);
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "result", 0);
- if (num instanceof NumCalculator) {
- _this.result = num.result;
- } else if (typeof num === 'number') {
- _this.result = num;
- }
- return _this;
- }
- (0,createClass["default"])(NumCalculator, [{
- key: "add",
- value: function add(num) {
- if (num instanceof NumCalculator) {
- this.result += num.result;
- } else if (typeof num === 'number') {
- this.result += num;
- }
- return this;
- }
- }, {
- key: "sub",
- value: function sub(num) {
- if (num instanceof NumCalculator) {
- this.result -= num.result;
- } else if (typeof num === 'number') {
- this.result -= num;
- }
- return this;
- }
- }, {
- key: "mul",
- value: function mul(num) {
- if (num instanceof NumCalculator) {
- this.result *= num.result;
- } else if (typeof num === 'number') {
- this.result *= num;
- }
- return this;
- }
- }, {
- key: "div",
- value: function div(num) {
- if (num instanceof NumCalculator) {
- this.result /= num.result;
- } else if (typeof num === 'number') {
- this.result /= num;
- }
- return this;
- }
- }, {
- key: "equal",
- value: function equal() {
- return this.result;
- }
- }]);
- return NumCalculator;
- }(calculator);
- ;// ./node_modules/@ant-design/cssinjs/es/theme/calc/index.js
- var genCalc = function genCalc(type, unitlessCssVar) {
- var Calculator = type === 'css' ? CSSCalculator : NumCalculator;
- return function (num) {
- return new Calculator(num, unitlessCssVar);
- };
- };
- /* harmony default export */ var calc = (genCalc);
- ;// ./node_modules/@ant-design/cssinjs/es/theme/ThemeCache.js
- // ================================== Cache ==================================
- function sameDerivativeOption(left, right) {
- if (left.length !== right.length) {
- return false;
- }
- for (var i = 0; i < left.length; i++) {
- if (left[i] !== right[i]) {
- return false;
- }
- }
- return true;
- }
- var ThemeCache = /*#__PURE__*/function () {
- function ThemeCache() {
- (0,classCallCheck["default"])(this, ThemeCache);
- (0,defineProperty["default"])(this, "cache", void 0);
- (0,defineProperty["default"])(this, "keys", void 0);
- (0,defineProperty["default"])(this, "cacheCallTimes", void 0);
- this.cache = new Map();
- this.keys = [];
- this.cacheCallTimes = 0;
- }
- (0,createClass["default"])(ThemeCache, [{
- key: "size",
- value: function size() {
- return this.keys.length;
- }
- }, {
- key: "internalGet",
- value: function internalGet(derivativeOption) {
- var _cache2, _cache3;
- var updateCallTimes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var cache = {
- map: this.cache
- };
- derivativeOption.forEach(function (derivative) {
- if (!cache) {
- cache = undefined;
- } else {
- var _cache;
- cache = (_cache = cache) === null || _cache === void 0 || (_cache = _cache.map) === null || _cache === void 0 ? void 0 : _cache.get(derivative);
- }
- });
- if ((_cache2 = cache) !== null && _cache2 !== void 0 && _cache2.value && updateCallTimes) {
- cache.value[1] = this.cacheCallTimes++;
- }
- return (_cache3 = cache) === null || _cache3 === void 0 ? void 0 : _cache3.value;
- }
- }, {
- key: "get",
- value: function get(derivativeOption) {
- var _this$internalGet;
- return (_this$internalGet = this.internalGet(derivativeOption, true)) === null || _this$internalGet === void 0 ? void 0 : _this$internalGet[0];
- }
- }, {
- key: "has",
- value: function has(derivativeOption) {
- return !!this.internalGet(derivativeOption);
- }
- }, {
- key: "set",
- value: function set(derivativeOption, value) {
- var _this = this;
- // New cache
- if (!this.has(derivativeOption)) {
- if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
- var _this$keys$reduce = this.keys.reduce(function (result, key) {
- var _result = (0,slicedToArray["default"])(result, 2),
- callTimes = _result[1];
- if (_this.internalGet(key)[1] < callTimes) {
- return [key, _this.internalGet(key)[1]];
- }
- return result;
- }, [this.keys[0], this.cacheCallTimes]),
- _this$keys$reduce2 = (0,slicedToArray["default"])(_this$keys$reduce, 1),
- targetKey = _this$keys$reduce2[0];
- this.delete(targetKey);
- }
- this.keys.push(derivativeOption);
- }
- var cache = this.cache;
- derivativeOption.forEach(function (derivative, index) {
- if (index === derivativeOption.length - 1) {
- cache.set(derivative, {
- value: [value, _this.cacheCallTimes++]
- });
- } else {
- var cacheValue = cache.get(derivative);
- if (!cacheValue) {
- cache.set(derivative, {
- map: new Map()
- });
- } else if (!cacheValue.map) {
- cacheValue.map = new Map();
- }
- cache = cache.get(derivative).map;
- }
- });
- }
- }, {
- key: "deleteByPath",
- value: function deleteByPath(currentCache, derivatives) {
- var cache = currentCache.get(derivatives[0]);
- if (derivatives.length === 1) {
- var _cache$value;
- if (!cache.map) {
- currentCache.delete(derivatives[0]);
- } else {
- currentCache.set(derivatives[0], {
- map: cache.map
- });
- }
- return (_cache$value = cache.value) === null || _cache$value === void 0 ? void 0 : _cache$value[0];
- }
- var result = this.deleteByPath(cache.map, derivatives.slice(1));
- if ((!cache.map || cache.map.size === 0) && !cache.value) {
- currentCache.delete(derivatives[0]);
- }
- return result;
- }
- }, {
- key: "delete",
- value: function _delete(derivativeOption) {
- // If cache exists
- if (this.has(derivativeOption)) {
- this.keys = this.keys.filter(function (item) {
- return !sameDerivativeOption(item, derivativeOption);
- });
- return this.deleteByPath(this.cache, derivativeOption);
- }
- return undefined;
- }
- }]);
- return ThemeCache;
- }();
- (0,defineProperty["default"])(ThemeCache, "MAX_CACHE_SIZE", 20);
- (0,defineProperty["default"])(ThemeCache, "MAX_CACHE_OFFSET", 5);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
- var warning = __webpack_require__("./node_modules/rc-util/es/warning.js");
- ;// ./node_modules/@ant-design/cssinjs/es/theme/Theme.js
- var uuid = 0;
- /**
- * Theme with algorithms to derive tokens from design tokens.
- * Use `createTheme` first which will help to manage the theme instance cache.
- */
- var Theme = /*#__PURE__*/function () {
- function Theme(derivatives) {
- (0,classCallCheck["default"])(this, Theme);
- (0,defineProperty["default"])(this, "derivatives", void 0);
- (0,defineProperty["default"])(this, "id", void 0);
- this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
- this.id = uuid;
- if (derivatives.length === 0) {
- (0,warning.warning)(derivatives.length > 0, '[Ant Design CSS-in-JS] Theme should have at least one derivative function.');
- }
- uuid += 1;
- }
- (0,createClass["default"])(Theme, [{
- key: "getDerivativeToken",
- value: function getDerivativeToken(token) {
- return this.derivatives.reduce(function (result, derivative) {
- return derivative(token, result);
- }, undefined);
- }
- }]);
- return Theme;
- }();
- ;// ./node_modules/@ant-design/cssinjs/es/theme/createTheme.js
- var cacheThemes = new ThemeCache();
- /**
- * Same as new Theme, but will always return same one if `derivative` not changed.
- */
- function createTheme(derivatives) {
- var derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
- // Create new theme if not exist
- if (!cacheThemes.has(derivativeArr)) {
- cacheThemes.set(derivativeArr, new Theme(derivativeArr));
- }
- // Get theme from cache and return
- return cacheThemes.get(derivativeArr);
- }
- ;// ./node_modules/@ant-design/cssinjs/es/theme/index.js
- ;// ./node_modules/@ant-design/cssinjs/es/util/index.js
- // Create a cache for memo concat
- var resultCache = new WeakMap();
- var RESULT_VALUE = {};
- function memoResult(callback, deps) {
- var current = resultCache;
- for (var i = 0; i < deps.length; i += 1) {
- var dep = deps[i];
- if (!current.has(dep)) {
- current.set(dep, new WeakMap());
- }
- current = current.get(dep);
- }
- if (!current.has(RESULT_VALUE)) {
- current.set(RESULT_VALUE, callback());
- }
- return current.get(RESULT_VALUE);
- }
- // Create a cache here to avoid always loop generate
- var flattenTokenCache = new WeakMap();
- /**
- * Flatten token to string, this will auto cache the result when token not change
- */
- function flattenToken(token) {
- var str = flattenTokenCache.get(token) || '';
- if (!str) {
- Object.keys(token).forEach(function (key) {
- var value = token[key];
- str += key;
- if (value instanceof Theme) {
- str += value.id;
- } else if (value && (0,esm_typeof["default"])(value) === 'object') {
- str += flattenToken(value);
- } else {
- str += value;
- }
- });
- // https://github.com/ant-design/ant-design/issues/48386
- // Should hash the string to avoid style tag name too long
- str = hash_browser_esm(str);
- // Put in cache
- flattenTokenCache.set(token, str);
- }
- return str;
- }
- /**
- * Convert derivative token to key string
- */
- function token2key(token, salt) {
- return hash_browser_esm("".concat(salt, "_").concat(flattenToken(token)));
- }
- var randomSelectorKey = "random-".concat(Date.now(), "-").concat(Math.random()).replace(/\./g, '');
- // Magic `content` for detect selector support
- var checkContent = '_bAmBoO_';
- function supportSelector(styleStr, handleElement, supportCheck) {
- if ((0,canUseDom["default"])()) {
- var _getComputedStyle$con, _ele$parentNode;
- (0,dynamicCSS.updateCSS)(styleStr, randomSelectorKey);
- var _ele = document.createElement('div');
- _ele.style.position = 'fixed';
- _ele.style.left = '0';
- _ele.style.top = '0';
- handleElement === null || handleElement === void 0 || handleElement(_ele);
- document.body.appendChild(_ele);
- if (true) {
- _ele.innerHTML = 'Test';
- _ele.style.zIndex = '9999999';
- }
- var support = supportCheck ? supportCheck(_ele) : (_getComputedStyle$con = getComputedStyle(_ele).content) === null || _getComputedStyle$con === void 0 ? void 0 : _getComputedStyle$con.includes(checkContent);
- (_ele$parentNode = _ele.parentNode) === null || _ele$parentNode === void 0 || _ele$parentNode.removeChild(_ele);
- (0,dynamicCSS.removeCSS)(randomSelectorKey);
- return support;
- }
- return false;
- }
- var canLayer = undefined;
- function supportLayer() {
- if (canLayer === undefined) {
- canLayer = supportSelector("@layer ".concat(randomSelectorKey, " { .").concat(randomSelectorKey, " { content: \"").concat(checkContent, "\"!important; } }"), function (ele) {
- ele.className = randomSelectorKey;
- });
- }
- return canLayer;
- }
- var canWhere = undefined;
- function supportWhere() {
- if (canWhere === undefined) {
- canWhere = supportSelector(":where(.".concat(randomSelectorKey, ") { content: \"").concat(checkContent, "\"!important; }"), function (ele) {
- ele.className = randomSelectorKey;
- });
- }
- return canWhere;
- }
- var canLogic = undefined;
- function supportLogicProps() {
- if (canLogic === undefined) {
- canLogic = supportSelector(".".concat(randomSelectorKey, " { inset-block: 93px !important; }"), function (ele) {
- ele.className = randomSelectorKey;
- }, function (ele) {
- return getComputedStyle(ele).bottom === '93px';
- });
- }
- return canLogic;
- }
- var isClientSide = (0,canUseDom["default"])();
- function util_unit(num) {
- if (typeof num === 'number') {
- return "".concat(num, "px");
- }
- return num;
- }
- function toStyleStr(style, tokenKey, styleId) {
- var customizeAttrs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var plain = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- if (plain) {
- return style;
- }
- var attrs = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, customizeAttrs), {}, (0,defineProperty["default"])((0,defineProperty["default"])({}, ATTR_TOKEN, tokenKey), ATTR_MARK, styleId));
- var attrStr = Object.keys(attrs).map(function (attr) {
- var val = attrs[attr];
- return val ? "".concat(attr, "=\"").concat(val, "\"") : null;
- }).filter(function (v) {
- return v;
- }).join(' ');
- return "<style ".concat(attrStr, ">").concat(style, "</style>");
- }
- ;// ./node_modules/@ant-design/cssinjs/es/util/css-variables.js
- var token2CSSVar = function token2CSSVar(token) {
- var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- return "--".concat(prefix ? "".concat(prefix, "-") : '').concat(token).replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, '$1-$2').replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase();
- };
- var serializeCSSVar = function serializeCSSVar(cssVars, hashId, options) {
- if (!Object.keys(cssVars).length) {
- return '';
- }
- return ".".concat(hashId).concat(options !== null && options !== void 0 && options.scope ? ".".concat(options.scope) : '', "{").concat(Object.entries(cssVars).map(function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
- return "".concat(key, ":").concat(value, ";");
- }).join(''), "}");
- };
- var transformToken = function transformToken(token, themeKey, config) {
- var cssVars = {};
- var result = {};
- Object.entries(token).forEach(function (_ref3) {
- var _config$preserve, _config$ignore;
- var _ref4 = (0,slicedToArray["default"])(_ref3, 2),
- key = _ref4[0],
- value = _ref4[1];
- if (config !== null && config !== void 0 && (_config$preserve = config.preserve) !== null && _config$preserve !== void 0 && _config$preserve[key]) {
- result[key] = value;
- } else if ((typeof value === 'string' || typeof value === 'number') && !(config !== null && config !== void 0 && (_config$ignore = config.ignore) !== null && _config$ignore !== void 0 && _config$ignore[key])) {
- var _config$unitless;
- var cssVar = token2CSSVar(key, config === null || config === void 0 ? void 0 : config.prefix);
- cssVars[cssVar] = typeof value === 'number' && !(config !== null && config !== void 0 && (_config$unitless = config.unitless) !== null && _config$unitless !== void 0 && _config$unitless[key]) ? "".concat(value, "px") : String(value);
- result[key] = "var(".concat(cssVar, ")");
- }
- });
- return [result, serializeCSSVar(cssVars, themeKey, {
- scope: config === null || config === void 0 ? void 0 : config.scope
- })];
- };
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useLayoutEffect.js
- var useLayoutEffect = __webpack_require__("./node_modules/rc-util/es/hooks/useLayoutEffect.js");
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useCompatibleInsertionEffect.js
- // import canUseDom from 'rc-util/lib/Dom/canUseDom';
- // We need fully clone React function here
- // to avoid webpack warning React 17 do not export `useId`
- var fullClone = (0,objectSpread2["default"])({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
- var useInsertionEffect = fullClone.useInsertionEffect;
- /**
- * Polyfill `useInsertionEffect` for React < 18
- * @param renderEffect will be executed in `useMemo`, and do not have callback
- * @param effect will be executed in `useLayoutEffect`
- * @param deps
- */
- var useInsertionEffectPolyfill = function useInsertionEffectPolyfill(renderEffect, effect, deps) {
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(renderEffect, deps);
- (0,useLayoutEffect["default"])(function () {
- return effect(true);
- }, deps);
- };
- /**
- * Compatible `useInsertionEffect`
- * will use `useInsertionEffect` if React version >= 18,
- * otherwise use `useInsertionEffectPolyfill`.
- */
- var useCompatibleInsertionEffect = useInsertionEffect ? function (renderEffect, effect, deps) {
- return useInsertionEffect(function () {
- renderEffect();
- return effect();
- }, deps);
- } : useInsertionEffectPolyfill;
- /* harmony default export */ var hooks_useCompatibleInsertionEffect = (useCompatibleInsertionEffect);
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useEffectCleanupRegister.js
- var useEffectCleanupRegister_fullClone = (0,objectSpread2["default"])({}, external_root_React_commonjs2_react_commonjs_react_amd_react_);
- var useEffectCleanupRegister_useInsertionEffect = useEffectCleanupRegister_fullClone.useInsertionEffect;
- // DO NOT register functions in useEffect cleanup function, or functions that registered will never be called.
- var useCleanupRegister = function useCleanupRegister(deps) {
- var effectCleanups = [];
- var cleanupFlag = false;
- function register(fn) {
- if (cleanupFlag) {
- if (true) {
- (0,warning.warning)(false, '[Ant Design CSS-in-JS] You are registering a cleanup function after unmount, which will not have any effect.');
- }
- return;
- }
- effectCleanups.push(fn);
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- // Compatible with strict mode
- cleanupFlag = false;
- return function () {
- cleanupFlag = true;
- if (effectCleanups.length) {
- effectCleanups.forEach(function (fn) {
- return fn();
- });
- }
- };
- }, deps);
- return register;
- };
- var useRun = function useRun() {
- return function (fn) {
- fn();
- };
- };
- // Only enable register in React 18
- var useEffectCleanupRegister = typeof useEffectCleanupRegister_useInsertionEffect !== 'undefined' ? useCleanupRegister : useRun;
- /* harmony default export */ var hooks_useEffectCleanupRegister = (useEffectCleanupRegister);
- // EXTERNAL MODULE: ./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js
- var useHMR = __webpack_require__("./node_modules/@ant-design/cssinjs/es/hooks/useHMR.js");
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js
- function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove,
- // Add additional effect trigger by `useInsertionEffect`
- onCacheEffect) {
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_StyleContext),
- globalCache = _React$useContext.cache;
- var fullPath = [prefix].concat((0,toConsumableArray["default"])(keyPath));
- var fullPathStr = pathKey(fullPath);
- var register = hooks_useEffectCleanupRegister([fullPathStr]);
- var HMRUpdate = (0,useHMR["default"])();
- var buildCache = function buildCache(updater) {
- globalCache.opUpdate(fullPathStr, function (prevCache) {
- var _ref = prevCache || [undefined, undefined],
- _ref2 = (0,slicedToArray["default"])(_ref, 2),
- _ref2$ = _ref2[0],
- times = _ref2$ === void 0 ? 0 : _ref2$,
- cache = _ref2[1];
- // HMR should always ignore cache since developer may change it
- var tmpCache = cache;
- if ( true && cache && HMRUpdate) {
- onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(tmpCache, HMRUpdate);
- tmpCache = null;
- }
- var mergedCache = tmpCache || cacheFn();
- var data = [times, mergedCache];
- // Call updater if need additional logic
- return updater ? updater(data) : data;
- });
- };
- // Create cache
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- buildCache();
- }, /* eslint-disable react-hooks/exhaustive-deps */
- [fullPathStr]
- /* eslint-enable */);
- var cacheEntity = globalCache.opGet(fullPathStr);
- // HMR clean the cache but not trigger `useMemo` again
- // Let's fallback of this
- // ref https://github.com/ant-design/cssinjs/issues/127
- if ( true && !cacheEntity) {
- buildCache();
- cacheEntity = globalCache.opGet(fullPathStr);
- }
- var cacheContent = cacheEntity[1];
- // Remove if no need anymore
- hooks_useCompatibleInsertionEffect(function () {
- onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);
- }, function (polyfill) {
- // It's bad to call build again in effect.
- // But we have to do this since StrictMode will call effect twice
- // which will clear cache on the first time.
- buildCache(function (_ref3) {
- var _ref4 = (0,slicedToArray["default"])(_ref3, 2),
- times = _ref4[0],
- cache = _ref4[1];
- if (polyfill && times === 0) {
- onCacheEffect === null || onCacheEffect === void 0 || onCacheEffect(cacheContent);
- }
- return [times + 1, cache];
- });
- return function () {
- globalCache.opUpdate(fullPathStr, function (prevCache) {
- var _ref5 = prevCache || [],
- _ref6 = (0,slicedToArray["default"])(_ref5, 2),
- _ref6$ = _ref6[0],
- times = _ref6$ === void 0 ? 0 : _ref6$,
- cache = _ref6[1];
- var nextCount = times - 1;
- if (nextCount === 0) {
- // Always remove styles in useEffect callback
- register(function () {
- // With polyfill, registered callback will always be called synchronously
- // But without polyfill, it will be called in effect clean up,
- // And by that time this cache is cleaned up.
- if (polyfill || !globalCache.opGet(fullPathStr)) {
- onCacheRemove === null || onCacheRemove === void 0 || onCacheRemove(cache, false);
- }
- });
- return null;
- }
- return [times - 1, cache];
- });
- };
- }, [fullPathStr]);
- return cacheContent;
- }
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js
- var EMPTY_OVERRIDE = {};
- // Generate different prefix to make user selector break in production env.
- // This helps developer not to do style override directly on the hash id.
- var hashPrefix = true ? 'css-dev-only-do-not-override' : 0;
- var tokenKeys = new Map();
- function recordCleanToken(tokenKey) {
- tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
- }
- function removeStyleTags(key, instanceId) {
- if (typeof document !== 'undefined') {
- var styles = document.querySelectorAll("style[".concat(ATTR_TOKEN, "=\"").concat(key, "\"]"));
- styles.forEach(function (style) {
- if (style[CSS_IN_JS_INSTANCE] === instanceId) {
- var _style$parentNode;
- (_style$parentNode = style.parentNode) === null || _style$parentNode === void 0 || _style$parentNode.removeChild(style);
- }
- });
- }
- }
- var TOKEN_THRESHOLD = 0;
- // Remove will check current keys first
- function cleanTokenStyle(tokenKey, instanceId) {
- tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
- var cleanableKeyList = new Set();
- tokenKeys.forEach(function (value, key) {
- if (value <= 0) cleanableKeyList.add(key);
- });
- // Should keep tokens under threshold for not to insert style too often
- if (tokenKeys.size - cleanableKeyList.size > TOKEN_THRESHOLD) {
- cleanableKeyList.forEach(function (key) {
- removeStyleTags(key, instanceId);
- tokenKeys.delete(key);
- });
- }
- }
- var getComputedToken = function getComputedToken(originToken, overrideToken, theme, format) {
- var derivativeToken = theme.getDerivativeToken(originToken);
- // Merge with override
- var mergedDerivativeToken = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, derivativeToken), overrideToken);
- // Format if needed
- if (format) {
- mergedDerivativeToken = format(mergedDerivativeToken);
- }
- return mergedDerivativeToken;
- };
- var TOKEN_PREFIX = 'token';
- /**
- * Cache theme derivative token as global shared one
- * @param theme Theme entity
- * @param tokens List of tokens, used for cache. Please do not dynamic generate object directly
- * @param option Additional config
- * @returns Call Theme.getDerivativeToken(tokenObject) to get token
- */
- function useCacheToken(theme, tokens) {
- var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(es_StyleContext),
- instanceId = _useContext.cache.instanceId,
- container = _useContext.container;
- var _option$salt = option.salt,
- salt = _option$salt === void 0 ? '' : _option$salt,
- _option$override = option.override,
- override = _option$override === void 0 ? EMPTY_OVERRIDE : _option$override,
- formatToken = option.formatToken,
- compute = option.getComputedToken,
- cssVar = option.cssVar;
- // Basic - We do basic cache here
- var mergedToken = memoResult(function () {
- return Object.assign.apply(Object, [{}].concat((0,toConsumableArray["default"])(tokens)));
- }, tokens);
- var tokenStr = flattenToken(mergedToken);
- var overrideTokenStr = flattenToken(override);
- var cssVarStr = cssVar ? flattenToken(cssVar) : '';
- var cachedToken = useGlobalCache(TOKEN_PREFIX, [salt, theme.id, tokenStr, overrideTokenStr, cssVarStr], function () {
- var _cssVar$key;
- var mergedDerivativeToken = compute ? compute(mergedToken, override, theme) : getComputedToken(mergedToken, override, theme, formatToken);
- // Replace token value with css variables
- var actualToken = (0,objectSpread2["default"])({}, mergedDerivativeToken);
- var cssVarsStr = '';
- if (!!cssVar) {
- var _transformToken = transformToken(mergedDerivativeToken, cssVar.key, {
- prefix: cssVar.prefix,
- ignore: cssVar.ignore,
- unitless: cssVar.unitless,
- preserve: cssVar.preserve
- });
- var _transformToken2 = (0,slicedToArray["default"])(_transformToken, 2);
- mergedDerivativeToken = _transformToken2[0];
- cssVarsStr = _transformToken2[1];
- }
- // Optimize for `useStyleRegister` performance
- var tokenKey = token2key(mergedDerivativeToken, salt);
- mergedDerivativeToken._tokenKey = tokenKey;
- actualToken._tokenKey = token2key(actualToken, salt);
- var themeKey = (_cssVar$key = cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) !== null && _cssVar$key !== void 0 ? _cssVar$key : tokenKey;
- mergedDerivativeToken._themeKey = themeKey;
- recordCleanToken(themeKey);
- var hashId = "".concat(hashPrefix, "-").concat(hash_browser_esm(tokenKey));
- mergedDerivativeToken._hashId = hashId; // Not used
- return [mergedDerivativeToken, hashId, actualToken, cssVarsStr, (cssVar === null || cssVar === void 0 ? void 0 : cssVar.key) || ''];
- }, function (cache) {
- // Remove token will remove all related style
- cleanTokenStyle(cache[0]._themeKey, instanceId);
- }, function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 4),
- token = _ref2[0],
- cssVarsStr = _ref2[3];
- if (cssVar && cssVarsStr) {
- var style = (0,dynamicCSS.updateCSS)(cssVarsStr, hash_browser_esm("css-variables-".concat(token._themeKey)), {
- mark: ATTR_MARK,
- prepend: 'queue',
- attachTo: container,
- priority: -999
- });
- style[CSS_IN_JS_INSTANCE] = instanceId;
- // Used for `useCacheToken` to remove on batch when token removed
- style.setAttribute(ATTR_TOKEN, token._themeKey);
- }
- });
- return cachedToken;
- }
- var extract = function extract(cache, effectStyles, options) {
- var _cache = (0,slicedToArray["default"])(cache, 5),
- realToken = _cache[2],
- styleStr = _cache[3],
- cssVarKey = _cache[4];
- var _ref3 = options || {},
- plain = _ref3.plain;
- if (!styleStr) {
- return null;
- }
- var styleId = realToken._tokenKey;
- var order = -999;
- // ====================== Style ======================
- // Used for rc-util
- var sharedAttrs = {
- 'data-rc-order': 'prependQueue',
- 'data-rc-priority': "".concat(order)
- };
- var styleText = toStyleStr(styleStr, cssVarKey, styleId, sharedAttrs, plain);
- return [order, styleId, styleText];
- };
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- ;// ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
- var unitlessKeys = {
- animationIterationCount: 1,
- borderImageOutset: 1,
- borderImageSlice: 1,
- borderImageWidth: 1,
- boxFlex: 1,
- boxFlexGroup: 1,
- boxOrdinalGroup: 1,
- columnCount: 1,
- columns: 1,
- flex: 1,
- flexGrow: 1,
- flexPositive: 1,
- flexShrink: 1,
- flexNegative: 1,
- flexOrder: 1,
- gridRow: 1,
- gridRowEnd: 1,
- gridRowSpan: 1,
- gridRowStart: 1,
- gridColumn: 1,
- gridColumnEnd: 1,
- gridColumnSpan: 1,
- gridColumnStart: 1,
- msGridRow: 1,
- msGridRowSpan: 1,
- msGridColumn: 1,
- msGridColumnSpan: 1,
- fontWeight: 1,
- lineHeight: 1,
- opacity: 1,
- order: 1,
- orphans: 1,
- tabSize: 1,
- widows: 1,
- zIndex: 1,
- zoom: 1,
- WebkitLineClamp: 1,
- // SVG-related properties
- fillOpacity: 1,
- floodOpacity: 1,
- stopOpacity: 1,
- strokeDasharray: 1,
- strokeDashoffset: 1,
- strokeMiterlimit: 1,
- strokeOpacity: 1,
- strokeWidth: 1
- };
- /* harmony default export */ var unitless_browser_esm = (unitlessKeys);
- ;// ./node_modules/stylis/src/Enum.js
- var MS = '-ms-'
- var MOZ = '-moz-'
- var WEBKIT = '-webkit-'
- var COMMENT = 'comm'
- var RULESET = 'rule'
- var DECLARATION = 'decl'
- var PAGE = '@page'
- var MEDIA = '@media'
- var IMPORT = '@import'
- var CHARSET = '@charset'
- var VIEWPORT = '@viewport'
- var SUPPORTS = '@supports'
- var DOCUMENT = '@document'
- var NAMESPACE = '@namespace'
- var KEYFRAMES = '@keyframes'
- var FONT_FACE = '@font-face'
- var COUNTER_STYLE = '@counter-style'
- var FONT_FEATURE_VALUES = '@font-feature-values'
- var LAYER = '@layer'
- var SCOPE = '@scope'
- ;// ./node_modules/stylis/src/Utility.js
- /**
- * @param {number}
- * @return {number}
- */
- var abs = Math.abs
- /**
- * @param {number}
- * @return {string}
- */
- var from = String.fromCharCode
- /**
- * @param {object}
- * @return {object}
- */
- var Utility_assign = Object.assign
- /**
- * @param {string} value
- * @param {number} length
- * @return {number}
- */
- function hash (value, length) {
- return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
- }
- /**
- * @param {string} value
- * @return {string}
- */
- function trim (value) {
- return value.trim()
- }
- /**
- * @param {string} value
- * @param {RegExp} pattern
- * @return {string?}
- */
- function match (value, pattern) {
- return (value = pattern.exec(value)) ? value[0] : value
- }
- /**
- * @param {string} value
- * @param {(string|RegExp)} pattern
- * @param {string} replacement
- * @return {string}
- */
- function replace (value, pattern, replacement) {
- return value.replace(pattern, replacement)
- }
- /**
- * @param {string} value
- * @param {string} search
- * @param {number} position
- * @return {number}
- */
- function indexof (value, search, position) {
- return value.indexOf(search, position)
- }
- /**
- * @param {string} value
- * @param {number} index
- * @return {number}
- */
- function charat (value, index) {
- return value.charCodeAt(index) | 0
- }
- /**
- * @param {string} value
- * @param {number} begin
- * @param {number} end
- * @return {string}
- */
- function substr (value, begin, end) {
- return value.slice(begin, end)
- }
- /**
- * @param {string} value
- * @return {number}
- */
- function strlen (value) {
- return value.length
- }
- /**
- * @param {any[]} value
- * @return {number}
- */
- function sizeof (value) {
- return value.length
- }
- /**
- * @param {any} value
- * @param {any[]} array
- * @return {any}
- */
- function append (value, array) {
- return array.push(value), value
- }
- /**
- * @param {string[]} array
- * @param {function} callback
- * @return {string}
- */
- function combine (array, callback) {
- return array.map(callback).join('')
- }
- /**
- * @param {string[]} array
- * @param {RegExp} pattern
- * @return {string[]}
- */
- function filter (array, pattern) {
- return array.filter(function (value) { return !match(value, pattern) })
- }
- ;// ./node_modules/stylis/src/Serializer.js
- /**
- * @param {object[]} children
- * @param {function} callback
- * @return {string}
- */
- function serialize (children, callback) {
- var output = ''
- for (var i = 0; i < children.length; i++)
- output += callback(children[i], i, children, callback) || ''
- return output
- }
- /**
- * @param {object} element
- * @param {number} index
- * @param {object[]} children
- * @param {function} callback
- * @return {string}
- */
- function stringify (element, index, children, callback) {
- switch (element.type) {
- case LAYER: if (element.children.length) break
- case IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value
- case COMMENT: return ''
- case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
- case RULESET: if (!strlen(element.value = element.props.join(','))) return ''
- }
- return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
- }
- ;// ./node_modules/stylis/src/Tokenizer.js
- var line = 1
- var column = 1
- var Tokenizer_length = 0
- var position = 0
- var character = 0
- var characters = ''
- /**
- * @param {string} value
- * @param {object | null} root
- * @param {object | null} parent
- * @param {string} type
- * @param {string[] | string} props
- * @param {object[] | string} children
- * @param {object[]} siblings
- * @param {number} length
- */
- function node (value, root, parent, type, props, children, length, siblings) {
- return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}
- }
- /**
- * @param {object} root
- * @param {object} props
- * @return {object}
- */
- function copy (root, props) {
- return Utility_assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props)
- }
- /**
- * @param {object} root
- */
- function lift (root) {
- while (root.root)
- root = copy(root.root, {children: [root]})
- append(root, root.siblings)
- }
- /**
- * @return {number}
- */
- function Tokenizer_char () {
- return character
- }
- /**
- * @return {number}
- */
- function prev () {
- character = position > 0 ? charat(characters, --position) : 0
- if (column--, character === 10)
- column = 1, line--
- return character
- }
- /**
- * @return {number}
- */
- function next () {
- character = position < Tokenizer_length ? charat(characters, position++) : 0
- if (column++, character === 10)
- column = 1, line++
- return character
- }
- /**
- * @return {number}
- */
- function peek () {
- return charat(characters, position)
- }
- /**
- * @return {number}
- */
- function caret () {
- return position
- }
- /**
- * @param {number} begin
- * @param {number} end
- * @return {string}
- */
- function slice (begin, end) {
- return substr(characters, begin, end)
- }
- /**
- * @param {number} type
- * @return {number}
- */
- function token (type) {
- switch (type) {
- // \0 \t \n \r \s whitespace token
- case 0: case 9: case 10: case 13: case 32:
- return 5
- // ! + , / > @ ~ isolate token
- case 33: case 43: case 44: case 47: case 62: case 64: case 126:
- // ; { } breakpoint token
- case 59: case 123: case 125:
- return 4
- // : accompanied token
- case 58:
- return 3
- // " ' ( [ opening delimit token
- case 34: case 39: case 40: case 91:
- return 2
- // ) ] closing delimit token
- case 41: case 93:
- return 1
- }
- return 0
- }
- /**
- * @param {string} value
- * @return {any[]}
- */
- function alloc (value) {
- return line = column = 1, Tokenizer_length = strlen(characters = value), position = 0, []
- }
- /**
- * @param {any} value
- * @return {any}
- */
- function dealloc (value) {
- return characters = '', value
- }
- /**
- * @param {number} type
- * @return {string}
- */
- function delimit (type) {
- return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
- }
- /**
- * @param {string} value
- * @return {string[]}
- */
- function tokenize (value) {
- return dealloc(tokenizer(alloc(value)))
- }
- /**
- * @param {number} type
- * @return {string}
- */
- function whitespace (type) {
- while (character = peek())
- if (character < 33)
- next()
- else
- break
- return token(type) > 2 || token(character) > 3 ? '' : ' '
- }
- /**
- * @param {string[]} children
- * @return {string[]}
- */
- function tokenizer (children) {
- while (next())
- switch (token(character)) {
- case 0: append(identifier(position - 1), children)
- break
- case 2: append(delimit(character), children)
- break
- default: append(from(character), children)
- }
- return children
- }
- /**
- * @param {number} index
- * @param {number} count
- * @return {string}
- */
- function escaping (index, count) {
- while (--count && next())
- // not 0-9 A-F a-f
- if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
- break
- return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
- }
- /**
- * @param {number} type
- * @return {number}
- */
- function delimiter (type) {
- while (next())
- switch (character) {
- // ] ) " '
- case type:
- return position
- // " '
- case 34: case 39:
- if (type !== 34 && type !== 39)
- delimiter(character)
- break
- // (
- case 40:
- if (type === 41)
- delimiter(type)
- break
- // \
- case 92:
- next()
- break
- }
- return position
- }
- /**
- * @param {number} type
- * @param {number} index
- * @return {number}
- */
- function commenter (type, index) {
- while (next())
- // //
- if (type + character === 47 + 10)
- break
- // /*
- else if (type + character === 42 + 42 && peek() === 47)
- break
- return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
- }
- /**
- * @param {number} index
- * @return {string}
- */
- function identifier (index) {
- while (!token(peek()))
- next()
- return slice(index, position)
- }
- ;// ./node_modules/stylis/src/Parser.js
- /**
- * @param {string} value
- * @return {object[]}
- */
- function compile (value) {
- return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
- }
- /**
- * @param {string} value
- * @param {object} root
- * @param {object?} parent
- * @param {string[]} rule
- * @param {string[]} rules
- * @param {string[]} rulesets
- * @param {number[]} pseudo
- * @param {number[]} points
- * @param {string[]} declarations
- * @return {object}
- */
- function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
- var index = 0
- var offset = 0
- var length = pseudo
- var atrule = 0
- var property = 0
- var previous = 0
- var variable = 1
- var scanning = 1
- var ampersand = 1
- var character = 0
- var type = ''
- var props = rules
- var children = rulesets
- var reference = rule
- var characters = type
- while (scanning)
- switch (previous = character, character = next()) {
- // (
- case 40:
- if (previous != 108 && charat(characters, length - 1) == 58) {
- if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(index ? points[index - 1] : 0)) != -1)
- ampersand = -1
- break
- }
- // " ' [
- case 34: case 39: case 91:
- characters += delimit(character)
- break
- // \t \n \r \s
- case 9: case 10: case 13: case 32:
- characters += whitespace(previous)
- break
- // \
- case 92:
- characters += escaping(caret() - 1, 7)
- continue
- // /
- case 47:
- switch (peek()) {
- case 42: case 47:
- append(comment(commenter(next(), caret()), root, parent, declarations), declarations)
- if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== ' ') characters += ' '
- break
- default:
- characters += '/'
- }
- break
- // {
- case 123 * variable:
- points[index++] = strlen(characters) * ampersand
- // } ; \0
- case 125 * variable: case 59: case 0:
- switch (character) {
- // \0 }
- case 0: case 125: scanning = 0
- // ;
- case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '')
- if (property > 0 && (strlen(characters) - length || (variable === 0 && previous === 47)))
- append(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)
- break
- // @ ;
- case 59: characters += ';'
- // { rule/at-rule
- default:
- append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)
- if (character === 123)
- if (offset === 0)
- parse(characters, root, reference, reference, props, rulesets, length, points, children)
- else {
- switch (atrule) {
- // c(ontainer)
- case 99:
- if (charat(characters, 3) === 110) break
- // l(ayer)
- case 108:
- if (charat(characters, 2) === 97) break
- default:
- offset = 0
- // d(ocument) m(edia) s(upports)
- case 100: case 109: case 115:
- }
- if (offset) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)
- else parse(characters, reference, reference, reference, [''], children, 0, points, children)
- }
- }
- index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
- break
- // :
- case 58:
- length = 1 + strlen(characters), property = previous
- default:
- if (variable < 1)
- if (character == 123)
- --variable
- else if (character == 125 && variable++ == 0 && prev() == 125)
- continue
- switch (characters += from(character), character * variable) {
- // &
- case 38:
- ampersand = offset > 0 ? 1 : (characters += '\f', -1)
- break
- // ,
- case 44:
- points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1
- break
- // @
- case 64:
- // -
- if (peek() === 45)
- characters += delimit(next())
- atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++
- break
- // -
- case 45:
- if (previous === 45 && strlen(characters) == 2)
- variable = 0
- }
- }
- return rulesets
- }
- /**
- * @param {string} value
- * @param {object} root
- * @param {object?} parent
- * @param {number} index
- * @param {number} offset
- * @param {string[]} rules
- * @param {number[]} points
- * @param {string} type
- * @param {string[]} props
- * @param {string[]} children
- * @param {number} length
- * @param {object[]} siblings
- * @return {object}
- */
- function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {
- var post = offset - 1
- var rule = offset === 0 ? rules : ['']
- var size = sizeof(rule)
- for (var i = 0, j = 0, k = 0; i < index; ++i)
- for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
- if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
- props[k++] = z
- return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)
- }
- /**
- * @param {number} value
- * @param {object} root
- * @param {object?} parent
- * @param {object[]} siblings
- * @return {object}
- */
- function comment (value, root, parent, siblings) {
- return node(value, root, parent, COMMENT, from(Tokenizer_char()), substr(value, 2, -2), 0, siblings)
- }
- /**
- * @param {string} value
- * @param {object} root
- * @param {object?} parent
- * @param {number} length
- * @param {object[]} siblings
- * @return {object}
- */
- function declaration (value, root, parent, length, siblings) {
- return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)
- }
- ;// ./node_modules/@ant-design/cssinjs/es/linters/utils.js
- function lintWarning(message, info) {
- var path = info.path,
- parentSelectors = info.parentSelectors;
- (0,warning["default"])(false, "[Ant Design CSS-in-JS] ".concat(path ? "Error in ".concat(path, ": ") : '').concat(message).concat(parentSelectors.length ? " Selector: ".concat(parentSelectors.join(' | ')) : ''));
- }
- ;// ./node_modules/@ant-design/cssinjs/es/linters/contentQuotesLinter.js
- var linter = function linter(key, value, info) {
- if (key === 'content') {
- // From emotion: https://github.com/emotion-js/emotion/blob/main/packages/serialize/src/index.js#L63
- var contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
- var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
- if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
- lintWarning("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"".concat(value, "\"'`."), info);
- }
- }
- };
- /* harmony default export */ var contentQuotesLinter = (linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/hashedAnimationLinter.js
- var hashedAnimationLinter_linter = function linter(key, value, info) {
- if (key === 'animation') {
- if (info.hashId && value !== 'none') {
- lintWarning("You seem to be using hashed animation '".concat(value, "', in which case 'animationName' with Keyframe as value is recommended."), info);
- }
- }
- };
- /* harmony default export */ var hashedAnimationLinter = (hashedAnimationLinter_linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/legacyNotSelectorLinter.js
- function isConcatSelector(selector) {
- var _selector$match;
- var notContent = ((_selector$match = selector.match(/:not\(([^)]*)\)/)) === null || _selector$match === void 0 ? void 0 : _selector$match[1]) || '';
- // split selector. e.g.
- // `h1#a.b` => ['h1', #a', '.b']
- var splitCells = notContent.split(/(\[[^[]*])|(?=[.#])/).filter(function (str) {
- return str;
- });
- return splitCells.length > 1;
- }
- function parsePath(info) {
- return info.parentSelectors.reduce(function (prev, cur) {
- if (!prev) {
- return cur;
- }
- return cur.includes('&') ? cur.replace(/&/g, prev) : "".concat(prev, " ").concat(cur);
- }, '');
- }
- var legacyNotSelectorLinter_linter = function linter(key, value, info) {
- var parentSelectorPath = parsePath(info);
- var notList = parentSelectorPath.match(/:not\([^)]*\)/g) || [];
- if (notList.length > 0 && notList.some(isConcatSelector)) {
- lintWarning("Concat ':not' selector not support in legacy browsers.", info);
- }
- };
- /* harmony default export */ var legacyNotSelectorLinter = (legacyNotSelectorLinter_linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/logicalPropertiesLinter.js
- var logicalPropertiesLinter_linter = function linter(key, value, info) {
- switch (key) {
- case 'marginLeft':
- case 'marginRight':
- case 'paddingLeft':
- case 'paddingRight':
- case 'left':
- case 'right':
- case 'borderLeft':
- case 'borderLeftWidth':
- case 'borderLeftStyle':
- case 'borderLeftColor':
- case 'borderRight':
- case 'borderRightWidth':
- case 'borderRightStyle':
- case 'borderRightColor':
- case 'borderTopLeftRadius':
- case 'borderTopRightRadius':
- case 'borderBottomLeftRadius':
- case 'borderBottomRightRadius':
- lintWarning("You seem to be using non-logical property '".concat(key, "' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
- return;
- case 'margin':
- case 'padding':
- case 'borderWidth':
- case 'borderStyle':
- // case 'borderColor':
- if (typeof value === 'string') {
- var valueArr = value.split(' ').map(function (item) {
- return item.trim();
- });
- if (valueArr.length === 4 && valueArr[1] !== valueArr[3]) {
- lintWarning("You seem to be using '".concat(key, "' property with different left ").concat(key, " and right ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
- }
- }
- return;
- case 'clear':
- case 'textAlign':
- if (value === 'left' || value === 'right') {
- lintWarning("You seem to be using non-logical value '".concat(value, "' of ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
- }
- return;
- case 'borderRadius':
- if (typeof value === 'string') {
- var radiusGroups = value.split('/').map(function (item) {
- return item.trim();
- });
- var invalid = radiusGroups.reduce(function (result, group) {
- if (result) {
- return result;
- }
- var radiusArr = group.split(' ').map(function (item) {
- return item.trim();
- });
- // borderRadius: '2px 4px'
- if (radiusArr.length >= 2 && radiusArr[0] !== radiusArr[1]) {
- return true;
- }
- // borderRadius: '4px 4px 2px'
- if (radiusArr.length === 3 && radiusArr[1] !== radiusArr[2]) {
- return true;
- }
- // borderRadius: '4px 4px 2px 4px'
- if (radiusArr.length === 4 && radiusArr[2] !== radiusArr[3]) {
- return true;
- }
- return result;
- }, false);
- if (invalid) {
- lintWarning("You seem to be using non-logical value '".concat(value, "' of ").concat(key, ", which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties."), info);
- }
- }
- return;
- default:
- }
- };
- /* harmony default export */ var logicalPropertiesLinter = (logicalPropertiesLinter_linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/NaNLinter.js
- var NaNLinter_linter = function linter(key, value, info) {
- if (typeof value === 'string' && /NaN/g.test(value) || Number.isNaN(value)) {
- lintWarning("Unexpected 'NaN' in property '".concat(key, ": ").concat(value, "'."), info);
- }
- };
- /* harmony default export */ var NaNLinter = (NaNLinter_linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/parentSelectorLinter.js
- var parentSelectorLinter_linter = function linter(key, value, info) {
- if (info.parentSelectors.some(function (selector) {
- var selectors = selector.split(',');
- return selectors.some(function (item) {
- return item.split('&').length > 2;
- });
- })) {
- lintWarning('Should not use more than one `&` in a selector.', info);
- }
- };
- /* harmony default export */ var parentSelectorLinter = (parentSelectorLinter_linter);
- ;// ./node_modules/@ant-design/cssinjs/es/linters/index.js
- ;// ./node_modules/@ant-design/cssinjs/es/util/cacheMapUtil.js
- var ATTR_CACHE_MAP = 'data-ant-cssinjs-cache-path';
- /**
- * This marks style from the css file.
- * Which means not exist in `<style />` tag.
- */
- var CSS_FILE_STYLE = '_FILE_STYLE__';
- function cacheMapUtil_serialize(cachePathMap) {
- return Object.keys(cachePathMap).map(function (path) {
- var hash = cachePathMap[path];
- return "".concat(path, ":").concat(hash);
- }).join(';');
- }
- var cachePathMap;
- var fromCSSFile = true;
- /**
- * @private Test usage only. Can save remove if no need.
- */
- function cacheMapUtil_reset(mockCache) {
- var fromFile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- cachePathMap = mockCache;
- fromCSSFile = fromFile;
- }
- function prepare() {
- if (!cachePathMap) {
- cachePathMap = {};
- if ((0,canUseDom["default"])()) {
- var div = document.createElement('div');
- div.className = ATTR_CACHE_MAP;
- div.style.position = 'fixed';
- div.style.visibility = 'hidden';
- div.style.top = '-9999px';
- document.body.appendChild(div);
- var content = getComputedStyle(div).content || '';
- content = content.replace(/^"/, '').replace(/"$/, '');
- // Fill data
- content.split(';').forEach(function (item) {
- var _item$split = item.split(':'),
- _item$split2 = (0,slicedToArray["default"])(_item$split, 2),
- path = _item$split2[0],
- hash = _item$split2[1];
- cachePathMap[path] = hash;
- });
- // Remove inline record style
- var inlineMapStyle = document.querySelector("style[".concat(ATTR_CACHE_MAP, "]"));
- if (inlineMapStyle) {
- var _inlineMapStyle$paren;
- fromCSSFile = false;
- (_inlineMapStyle$paren = inlineMapStyle.parentNode) === null || _inlineMapStyle$paren === void 0 || _inlineMapStyle$paren.removeChild(inlineMapStyle);
- }
- document.body.removeChild(div);
- }
- }
- }
- function existPath(path) {
- prepare();
- return !!cachePathMap[path];
- }
- function getStyleAndHash(path) {
- var hash = cachePathMap[path];
- var styleStr = null;
- if (hash && (0,canUseDom["default"])()) {
- if (fromCSSFile) {
- styleStr = CSS_FILE_STYLE;
- } else {
- var _style = document.querySelector("style[".concat(ATTR_MARK, "=\"").concat(cachePathMap[path], "\"]"));
- if (_style) {
- styleStr = _style.innerHTML;
- } else {
- // Clean up since not exist anymore
- delete cachePathMap[path];
- }
- }
- }
- return [styleStr, hash];
- }
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js
- // @ts-ignore
- var SKIP_CHECK = '_skip_check_';
- var MULTI_VALUE = '_multi_value_';
- // ============================================================================
- // == Parser ==
- // ============================================================================
- // Preprocessor style content to browser support one
- function normalizeStyle(styleStr) {
- var serialized = serialize(compile(styleStr), stringify);
- return serialized.replace(/\{%%%\:[^;];}/g, ';');
- }
- function isCompoundCSSProperty(value) {
- return (0,esm_typeof["default"])(value) === 'object' && value && (SKIP_CHECK in value || MULTI_VALUE in value);
- }
- // 注入 hash 值
- function injectSelectorHash(key, hashId, hashPriority) {
- if (!hashId) {
- return key;
- }
- var hashClassName = ".".concat(hashId);
- var hashSelector = hashPriority === 'low' ? ":where(".concat(hashClassName, ")") : hashClassName;
- // 注入 hashId
- var keys = key.split(',').map(function (k) {
- var _firstPath$match;
- var fullPath = k.trim().split(/\s+/);
- // 如果 Selector 第一个是 HTML Element,那我们就插到它的后面。反之,就插到最前面。
- var firstPath = fullPath[0] || '';
- var htmlElement = ((_firstPath$match = firstPath.match(/^\w+/)) === null || _firstPath$match === void 0 ? void 0 : _firstPath$match[0]) || '';
- firstPath = "".concat(htmlElement).concat(hashSelector).concat(firstPath.slice(htmlElement.length));
- return [firstPath].concat((0,toConsumableArray["default"])(fullPath.slice(1))).join(' ');
- });
- return keys.join(',');
- }
- // Parse CSSObject to style content
- var parseStyle = function parseStyle(interpolation) {
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
- root: true,
- parentSelectors: []
- },
- root = _ref.root,
- injectHash = _ref.injectHash,
- parentSelectors = _ref.parentSelectors;
- var hashId = config.hashId,
- layer = config.layer,
- path = config.path,
- hashPriority = config.hashPriority,
- _config$transformers = config.transformers,
- transformers = _config$transformers === void 0 ? [] : _config$transformers,
- _config$linters = config.linters,
- linters = _config$linters === void 0 ? [] : _config$linters;
- var styleStr = '';
- var effectStyle = {};
- function parseKeyframes(keyframes) {
- var animationName = keyframes.getName(hashId);
- if (!effectStyle[animationName]) {
- var _parseStyle = parseStyle(keyframes.style, config, {
- root: false,
- parentSelectors: parentSelectors
- }),
- _parseStyle2 = (0,slicedToArray["default"])(_parseStyle, 1),
- _parsedStr = _parseStyle2[0];
- effectStyle[animationName] = "@keyframes ".concat(keyframes.getName(hashId)).concat(_parsedStr);
- }
- }
- function flattenList(list) {
- var fullList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- list.forEach(function (item) {
- if (Array.isArray(item)) {
- flattenList(item, fullList);
- } else if (item) {
- fullList.push(item);
- }
- });
- return fullList;
- }
- var flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]);
- flattenStyleList.forEach(function (originStyle) {
- // Only root level can use raw string
- var style = typeof originStyle === 'string' && !root ? {} : originStyle;
- if (typeof style === 'string') {
- styleStr += "".concat(style, "\n");
- } else if (style._keyframe) {
- // Keyframe
- parseKeyframes(style);
- } else {
- var mergedStyle = transformers.reduce(function (prev, trans) {
- var _trans$visit;
- return (trans === null || trans === void 0 || (_trans$visit = trans.visit) === null || _trans$visit === void 0 ? void 0 : _trans$visit.call(trans, prev)) || prev;
- }, style);
- // Normal CSSObject
- Object.keys(mergedStyle).forEach(function (key) {
- var value = mergedStyle[key];
- if ((0,esm_typeof["default"])(value) === 'object' && value && (key !== 'animationName' || !value._keyframe) && !isCompoundCSSProperty(value)) {
- var subInjectHash = false;
- // 当成嵌套对象来处理
- var mergedKey = key.trim();
- // Whether treat child as root. In most case it is false.
- var nextRoot = false;
- // 拆分多个选择器
- if ((root || injectHash) && hashId) {
- if (mergedKey.startsWith('@')) {
- // 略过媒体查询,交给子节点继续插入 hashId
- subInjectHash = true;
- } else if (mergedKey === '&') {
- // 抹掉 root selector 上的单个 &
- mergedKey = injectSelectorHash('', hashId, hashPriority);
- } else {
- // 注入 hashId
- mergedKey = injectSelectorHash(key, hashId, hashPriority);
- }
- } else if (root && !hashId && (mergedKey === '&' || mergedKey === '')) {
- // In case of `{ '&': { a: { color: 'red' } } }` or `{ '': { a: { color: 'red' } } }` without hashId,
- // we will get `&{a:{color:red;}}` or `{a:{color:red;}}` string for stylis to compile.
- // But it does not conform to stylis syntax,
- // and finally we will get `{color:red;}` as css, which is wrong.
- // So we need to remove key in root, and treat child `{ a: { color: 'red' } }` as root.
- mergedKey = '';
- nextRoot = true;
- }
- var _parseStyle3 = parseStyle(value, config, {
- root: nextRoot,
- injectHash: subInjectHash,
- parentSelectors: [].concat((0,toConsumableArray["default"])(parentSelectors), [mergedKey])
- }),
- _parseStyle4 = (0,slicedToArray["default"])(_parseStyle3, 2),
- _parsedStr2 = _parseStyle4[0],
- childEffectStyle = _parseStyle4[1];
- effectStyle = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, effectStyle), childEffectStyle);
- styleStr += "".concat(mergedKey).concat(_parsedStr2);
- } else {
- var _value;
- function appendStyle(cssKey, cssValue) {
- if ( true && ((0,esm_typeof["default"])(value) !== 'object' || !(value !== null && value !== void 0 && value[SKIP_CHECK]))) {
- [contentQuotesLinter, hashedAnimationLinter].concat((0,toConsumableArray["default"])(linters)).forEach(function (linter) {
- return linter(cssKey, cssValue, {
- path: path,
- hashId: hashId,
- parentSelectors: parentSelectors
- });
- });
- }
- // 如果是样式则直接插入
- var styleName = cssKey.replace(/[A-Z]/g, function (match) {
- return "-".concat(match.toLowerCase());
- });
- // Auto suffix with px
- var formatValue = cssValue;
- if (!unitless_browser_esm[cssKey] && typeof formatValue === 'number' && formatValue !== 0) {
- formatValue = "".concat(formatValue, "px");
- }
- // handle animationName & Keyframe value
- if (cssKey === 'animationName' && cssValue !== null && cssValue !== void 0 && cssValue._keyframe) {
- parseKeyframes(cssValue);
- formatValue = cssValue.getName(hashId);
- }
- styleStr += "".concat(styleName, ":").concat(formatValue, ";");
- }
- var actualValue = (_value = value === null || value === void 0 ? void 0 : value.value) !== null && _value !== void 0 ? _value : value;
- if ((0,esm_typeof["default"])(value) === 'object' && value !== null && value !== void 0 && value[MULTI_VALUE] && Array.isArray(actualValue)) {
- actualValue.forEach(function (item) {
- appendStyle(key, item);
- });
- } else {
- appendStyle(key, actualValue);
- }
- }
- });
- }
- });
- if (!root) {
- styleStr = "{".concat(styleStr, "}");
- } else if (layer) {
- // fixme: https://github.com/thysultan/stylis/pull/339
- if (styleStr) {
- styleStr = "@layer ".concat(layer.name, " {").concat(styleStr, "}");
- }
- if (layer.dependencies) {
- effectStyle["@layer ".concat(layer.name)] = layer.dependencies.map(function (deps) {
- return "@layer ".concat(deps, ", ").concat(layer.name, ";");
- }).join('\n');
- }
- }
- return [styleStr, effectStyle];
- };
- // ============================================================================
- // == Register ==
- // ============================================================================
- function uniqueHash(path, styleStr) {
- return hash_browser_esm("".concat(path.join('%')).concat(styleStr));
- }
- function Empty() {
- return null;
- }
- var STYLE_PREFIX = 'style';
- /**
- * Register a style to the global style sheet.
- */
- function useStyleRegister(info, styleFn) {
- var token = info.token,
- path = info.path,
- hashId = info.hashId,
- layer = info.layer,
- nonce = info.nonce,
- clientOnly = info.clientOnly,
- _info$order = info.order,
- order = _info$order === void 0 ? 0 : _info$order;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(es_StyleContext),
- autoClear = _React$useContext.autoClear,
- mock = _React$useContext.mock,
- defaultCache = _React$useContext.defaultCache,
- hashPriority = _React$useContext.hashPriority,
- container = _React$useContext.container,
- ssrInline = _React$useContext.ssrInline,
- transformers = _React$useContext.transformers,
- linters = _React$useContext.linters,
- cache = _React$useContext.cache,
- enableLayer = _React$useContext.layer;
- var tokenKey = token._tokenKey;
- var fullPath = [tokenKey];
- if (enableLayer) {
- fullPath.push('layer');
- }
- fullPath.push.apply(fullPath, (0,toConsumableArray["default"])(path));
- // Check if need insert style
- var isMergedClientSide = isClientSide;
- if ( true && mock !== undefined) {
- isMergedClientSide = mock === 'client';
- }
- var _useGlobalCache = useGlobalCache(STYLE_PREFIX, fullPath,
- // Create cache if needed
- function () {
- var cachePath = fullPath.join('|');
- // Get style from SSR inline style directly
- if (existPath(cachePath)) {
- var _getStyleAndHash = getStyleAndHash(cachePath),
- _getStyleAndHash2 = (0,slicedToArray["default"])(_getStyleAndHash, 2),
- inlineCacheStyleStr = _getStyleAndHash2[0],
- styleHash = _getStyleAndHash2[1];
- if (inlineCacheStyleStr) {
- return [inlineCacheStyleStr, tokenKey, styleHash, {}, clientOnly, order];
- }
- }
- // Generate style
- var styleObj = styleFn();
- var _parseStyle5 = parseStyle(styleObj, {
- hashId: hashId,
- hashPriority: hashPriority,
- layer: enableLayer ? layer : undefined,
- path: path.join('-'),
- transformers: transformers,
- linters: linters
- }),
- _parseStyle6 = (0,slicedToArray["default"])(_parseStyle5, 2),
- parsedStyle = _parseStyle6[0],
- effectStyle = _parseStyle6[1];
- var styleStr = normalizeStyle(parsedStyle);
- var styleId = uniqueHash(fullPath, styleStr);
- return [styleStr, tokenKey, styleId, effectStyle, clientOnly, order];
- },
- // Remove cache if no need
- function (_ref2, fromHMR) {
- var _ref3 = (0,slicedToArray["default"])(_ref2, 3),
- styleId = _ref3[2];
- if ((fromHMR || autoClear) && isClientSide) {
- (0,dynamicCSS.removeCSS)(styleId, {
- mark: ATTR_MARK,
- attachTo: container
- });
- }
- },
- // Effect: Inject style here
- function (_ref4) {
- var _ref5 = (0,slicedToArray["default"])(_ref4, 4),
- styleStr = _ref5[0],
- _ = _ref5[1],
- styleId = _ref5[2],
- effectStyle = _ref5[3];
- if (isMergedClientSide && styleStr !== CSS_FILE_STYLE) {
- var mergedCSSConfig = {
- mark: ATTR_MARK,
- prepend: enableLayer ? false : 'queue',
- attachTo: container,
- priority: order
- };
- var nonceStr = typeof nonce === 'function' ? nonce() : nonce;
- if (nonceStr) {
- mergedCSSConfig.csp = {
- nonce: nonceStr
- };
- }
- // ================= Split Effect Style =================
- // We will split effectStyle here since @layer should be at the top level
- var effectLayerKeys = [];
- var effectRestKeys = [];
- Object.keys(effectStyle).forEach(function (key) {
- if (key.startsWith('@layer')) {
- effectLayerKeys.push(key);
- } else {
- effectRestKeys.push(key);
- }
- });
- // ================= Inject Layer Style =================
- // Inject layer style
- effectLayerKeys.forEach(function (effectKey) {
- (0,dynamicCSS.updateCSS)(normalizeStyle(effectStyle[effectKey]), "_layer-".concat(effectKey), (0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedCSSConfig), {}, {
- prepend: true
- }));
- });
- // ==================== Inject Style ====================
- // Inject style
- var style = (0,dynamicCSS.updateCSS)(styleStr, styleId, mergedCSSConfig);
- style[CSS_IN_JS_INSTANCE] = cache.instanceId;
- // Used for `useCacheToken` to remove on batch when token removed
- style.setAttribute(ATTR_TOKEN, tokenKey);
- // Debug usage. Dev only
- if (true) {
- style.setAttribute(ATTR_CACHE_PATH, fullPath.join('|'));
- }
- // ================ Inject Effect Style =================
- // Inject client side effect style
- effectRestKeys.forEach(function (effectKey) {
- (0,dynamicCSS.updateCSS)(normalizeStyle(effectStyle[effectKey]), "_effect-".concat(effectKey), mergedCSSConfig);
- });
- }
- }),
- _useGlobalCache2 = (0,slicedToArray["default"])(_useGlobalCache, 3),
- cachedStyleStr = _useGlobalCache2[0],
- cachedTokenKey = _useGlobalCache2[1],
- cachedStyleId = _useGlobalCache2[2];
- return function (node) {
- var styleNode;
- if (!ssrInline || isMergedClientSide || !defaultCache) {
- styleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Empty, null);
- } else {
- styleNode = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("style", (0,esm_extends["default"])({}, (0,defineProperty["default"])((0,defineProperty["default"])({}, ATTR_TOKEN, cachedTokenKey), ATTR_MARK, cachedStyleId), {
- dangerouslySetInnerHTML: {
- __html: cachedStyleStr
- }
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, null, styleNode, node);
- };
- }
- var useStyleRegister_extract = function extract(cache, effectStyles, options) {
- var _cache = (0,slicedToArray["default"])(cache, 6),
- styleStr = _cache[0],
- tokenKey = _cache[1],
- styleId = _cache[2],
- effectStyle = _cache[3],
- clientOnly = _cache[4],
- order = _cache[5];
- var _ref7 = options || {},
- plain = _ref7.plain;
- // Skip client only style
- if (clientOnly) {
- return null;
- }
- var keyStyleText = styleStr;
- // ====================== Share ======================
- // Used for rc-util
- var sharedAttrs = {
- 'data-rc-order': 'prependQueue',
- 'data-rc-priority': "".concat(order)
- };
- // ====================== Style ======================
- keyStyleText = toStyleStr(styleStr, tokenKey, styleId, sharedAttrs, plain);
- // =============== Create effect style ===============
- if (effectStyle) {
- Object.keys(effectStyle).forEach(function (effectKey) {
- // Effect style can be reused
- if (!effectStyles[effectKey]) {
- effectStyles[effectKey] = true;
- var effectStyleStr = normalizeStyle(effectStyle[effectKey]);
- var effectStyleHTML = toStyleStr(effectStyleStr, tokenKey, "_effect-".concat(effectKey), sharedAttrs, plain);
- if (effectKey.startsWith('@layer')) {
- keyStyleText = effectStyleHTML + keyStyleText;
- } else {
- keyStyleText += effectStyleHTML;
- }
- }
- });
- }
- return [order, styleId, keyStyleText];
- };
- ;// ./node_modules/@ant-design/cssinjs/es/hooks/useCSSVarRegister.js
- var CSS_VAR_PREFIX = 'cssVar';
- var useCSSVarRegister = function useCSSVarRegister(config, fn) {
- var key = config.key,
- prefix = config.prefix,
- unitless = config.unitless,
- ignore = config.ignore,
- token = config.token,
- _config$scope = config.scope,
- scope = _config$scope === void 0 ? '' : _config$scope;
- var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(es_StyleContext),
- instanceId = _useContext.cache.instanceId,
- container = _useContext.container;
- var tokenKey = token._tokenKey;
- var stylePath = [].concat((0,toConsumableArray["default"])(config.path), [key, scope, tokenKey]);
- var cache = useGlobalCache(CSS_VAR_PREFIX, stylePath, function () {
- var originToken = fn();
- var _transformToken = transformToken(originToken, key, {
- prefix: prefix,
- unitless: unitless,
- ignore: ignore,
- scope: scope
- }),
- _transformToken2 = (0,slicedToArray["default"])(_transformToken, 2),
- mergedToken = _transformToken2[0],
- cssVarsStr = _transformToken2[1];
- var styleId = uniqueHash(stylePath, cssVarsStr);
- return [mergedToken, cssVarsStr, styleId, key];
- }, function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 3),
- styleId = _ref2[2];
- if (isClientSide) {
- (0,dynamicCSS.removeCSS)(styleId, {
- mark: ATTR_MARK,
- attachTo: container
- });
- }
- }, function (_ref3) {
- var _ref4 = (0,slicedToArray["default"])(_ref3, 3),
- cssVarsStr = _ref4[1],
- styleId = _ref4[2];
- if (!cssVarsStr) {
- return;
- }
- var style = (0,dynamicCSS.updateCSS)(cssVarsStr, styleId, {
- mark: ATTR_MARK,
- prepend: 'queue',
- attachTo: container,
- priority: -999
- });
- style[CSS_IN_JS_INSTANCE] = instanceId;
- // Used for `useCacheToken` to remove on batch when token removed
- style.setAttribute(ATTR_TOKEN, key);
- });
- return cache;
- };
- var useCSSVarRegister_extract = function extract(cache, effectStyles, options) {
- var _cache = (0,slicedToArray["default"])(cache, 4),
- styleStr = _cache[1],
- styleId = _cache[2],
- cssVarKey = _cache[3];
- var _ref5 = options || {},
- plain = _ref5.plain;
- if (!styleStr) {
- return null;
- }
- var order = -999;
- // ====================== Style ======================
- // Used for rc-util
- var sharedAttrs = {
- 'data-rc-order': 'prependQueue',
- 'data-rc-priority': "".concat(order)
- };
- var styleText = toStyleStr(styleStr, cssVarKey, styleId, sharedAttrs, plain);
- return [order, styleId, styleText];
- };
- /* harmony default export */ var hooks_useCSSVarRegister = (useCSSVarRegister);
- ;// ./node_modules/@ant-design/cssinjs/es/extractStyle.js
- var ExtractStyleFns = (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, STYLE_PREFIX, useStyleRegister_extract), TOKEN_PREFIX, extract), CSS_VAR_PREFIX, useCSSVarRegister_extract);
- function isNotNull(value) {
- return value !== null;
- }
- function extractStyle(cache, options) {
- var _ref = typeof options === 'boolean' ? {
- plain: options
- } : options || {},
- _ref$plain = _ref.plain,
- plain = _ref$plain === void 0 ? false : _ref$plain,
- _ref$types = _ref.types,
- types = _ref$types === void 0 ? ['style', 'token', 'cssVar'] : _ref$types,
- _ref$once = _ref.once,
- once = _ref$once === void 0 ? false : _ref$once;
- var matchPrefixRegexp = new RegExp("^(".concat((typeof types === 'string' ? [types] : types).join('|'), ")%"));
- // prefix with `style` is used for `useStyleRegister` to cache style context
- var styleKeys = Array.from(cache.cache.keys()).filter(function (key) {
- return matchPrefixRegexp.test(key);
- });
- // Common effect styles like animation
- var effectStyles = {};
- // Mapping of cachePath to style hash
- var cachePathMap = {};
- var styleText = '';
- styleKeys.map(function (key) {
- if (once && cache.extracted.has(key)) {
- return null; // Skip if already extracted
- }
- var cachePath = key.replace(matchPrefixRegexp, '').replace(/%/g, '|');
- var _key$split = key.split('%'),
- _key$split2 = (0,slicedToArray["default"])(_key$split, 1),
- prefix = _key$split2[0];
- var extractFn = ExtractStyleFns[prefix];
- var extractedStyle = extractFn(cache.cache.get(key)[1], effectStyles, {
- plain: plain
- });
- if (!extractedStyle) {
- return null;
- }
- var _extractedStyle = (0,slicedToArray["default"])(extractedStyle, 3),
- order = _extractedStyle[0],
- styleId = _extractedStyle[1],
- styleStr = _extractedStyle[2];
- if (key.startsWith('style')) {
- cachePathMap[cachePath] = styleId;
- }
- // record that this style has been extracted
- cache.extracted.add(key);
- return [order, styleStr];
- }).filter(isNotNull).sort(function (_ref2, _ref3) {
- var _ref4 = (0,slicedToArray["default"])(_ref2, 1),
- o1 = _ref4[0];
- var _ref5 = (0,slicedToArray["default"])(_ref3, 1),
- o2 = _ref5[0];
- return o1 - o2;
- }).forEach(function (_ref6) {
- var _ref7 = (0,slicedToArray["default"])(_ref6, 2),
- style = _ref7[1];
- styleText += style;
- });
- // ==================== Fill Cache Path ====================
- styleText += toStyleStr(".".concat(ATTR_CACHE_MAP, "{content:\"").concat(cacheMapUtil_serialize(cachePathMap), "\";}"), undefined, undefined, (0,defineProperty["default"])({}, ATTR_CACHE_MAP, ATTR_CACHE_MAP), plain);
- return styleText;
- }
- ;// ./node_modules/@ant-design/cssinjs/es/Keyframes.js
- var Keyframe = /*#__PURE__*/function () {
- function Keyframe(name, style) {
- (0,classCallCheck["default"])(this, Keyframe);
- (0,defineProperty["default"])(this, "name", void 0);
- (0,defineProperty["default"])(this, "style", void 0);
- (0,defineProperty["default"])(this, "_keyframe", true);
- this.name = name;
- this.style = style;
- }
- (0,createClass["default"])(Keyframe, [{
- key: "getName",
- value: function getName() {
- var hashId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- return hashId ? "".concat(hashId, "-").concat(this.name) : this.name;
- }
- }]);
- return Keyframe;
- }();
- /* harmony default export */ var Keyframes = (Keyframe);
- ;// ./node_modules/@ant-design/cssinjs/es/transformers/legacyLogicalProperties.js
- function splitValues(value) {
- if (typeof value === 'number') {
- return [[value], false];
- }
- var rawStyle = String(value).trim();
- var importantCells = rawStyle.match(/(.*)(!important)/);
- var splitStyle = (importantCells ? importantCells[1] : rawStyle).trim().split(/\s+/);
- // Combine styles split in brackets, like `calc(1px + 2px)`
- var temp = [];
- var brackets = 0;
- return [splitStyle.reduce(function (list, item) {
- if (item.includes('(') || item.includes(')')) {
- var left = item.split('(').length - 1;
- var right = item.split(')').length - 1;
- brackets += left - right;
- }
- if (brackets >= 0) temp.push(item);
- if (brackets === 0) {
- list.push(temp.join(' '));
- temp = [];
- }
- return list;
- }, []), !!importantCells];
- }
- function noSplit(list) {
- list.notSplit = true;
- return list;
- }
- var keyMap = {
- // Inset
- inset: ['top', 'right', 'bottom', 'left'],
- insetBlock: ['top', 'bottom'],
- insetBlockStart: ['top'],
- insetBlockEnd: ['bottom'],
- insetInline: ['left', 'right'],
- insetInlineStart: ['left'],
- insetInlineEnd: ['right'],
- // Margin
- marginBlock: ['marginTop', 'marginBottom'],
- marginBlockStart: ['marginTop'],
- marginBlockEnd: ['marginBottom'],
- marginInline: ['marginLeft', 'marginRight'],
- marginInlineStart: ['marginLeft'],
- marginInlineEnd: ['marginRight'],
- // Padding
- paddingBlock: ['paddingTop', 'paddingBottom'],
- paddingBlockStart: ['paddingTop'],
- paddingBlockEnd: ['paddingBottom'],
- paddingInline: ['paddingLeft', 'paddingRight'],
- paddingInlineStart: ['paddingLeft'],
- paddingInlineEnd: ['paddingRight'],
- // Border
- borderBlock: noSplit(['borderTop', 'borderBottom']),
- borderBlockStart: noSplit(['borderTop']),
- borderBlockEnd: noSplit(['borderBottom']),
- borderInline: noSplit(['borderLeft', 'borderRight']),
- borderInlineStart: noSplit(['borderLeft']),
- borderInlineEnd: noSplit(['borderRight']),
- // Border width
- borderBlockWidth: ['borderTopWidth', 'borderBottomWidth'],
- borderBlockStartWidth: ['borderTopWidth'],
- borderBlockEndWidth: ['borderBottomWidth'],
- borderInlineWidth: ['borderLeftWidth', 'borderRightWidth'],
- borderInlineStartWidth: ['borderLeftWidth'],
- borderInlineEndWidth: ['borderRightWidth'],
- // Border style
- borderBlockStyle: ['borderTopStyle', 'borderBottomStyle'],
- borderBlockStartStyle: ['borderTopStyle'],
- borderBlockEndStyle: ['borderBottomStyle'],
- borderInlineStyle: ['borderLeftStyle', 'borderRightStyle'],
- borderInlineStartStyle: ['borderLeftStyle'],
- borderInlineEndStyle: ['borderRightStyle'],
- // Border color
- borderBlockColor: ['borderTopColor', 'borderBottomColor'],
- borderBlockStartColor: ['borderTopColor'],
- borderBlockEndColor: ['borderBottomColor'],
- borderInlineColor: ['borderLeftColor', 'borderRightColor'],
- borderInlineStartColor: ['borderLeftColor'],
- borderInlineEndColor: ['borderRightColor'],
- // Border radius
- borderStartStartRadius: ['borderTopLeftRadius'],
- borderStartEndRadius: ['borderTopRightRadius'],
- borderEndStartRadius: ['borderBottomLeftRadius'],
- borderEndEndRadius: ['borderBottomRightRadius']
- };
- function wrapImportantAndSkipCheck(value, important) {
- var parsedValue = value;
- if (important) {
- parsedValue = "".concat(parsedValue, " !important");
- }
- return {
- _skip_check_: true,
- value: parsedValue
- };
- }
- /**
- * Convert css logical properties to legacy properties.
- * Such as: `margin-block-start` to `margin-top`.
- * Transform list:
- * - inset
- * - margin
- * - padding
- * - border
- */
- var transform = {
- visit: function visit(cssObj) {
- var clone = {};
- Object.keys(cssObj).forEach(function (key) {
- var value = cssObj[key];
- var matchValue = keyMap[key];
- if (matchValue && (typeof value === 'number' || typeof value === 'string')) {
- var _splitValues = splitValues(value),
- _splitValues2 = (0,slicedToArray["default"])(_splitValues, 2),
- _values = _splitValues2[0],
- _important = _splitValues2[1];
- if (matchValue.length && matchValue.notSplit) {
- // not split means always give same value like border
- matchValue.forEach(function (matchKey) {
- clone[matchKey] = wrapImportantAndSkipCheck(value, _important);
- });
- } else if (matchValue.length === 1) {
- // Handle like `marginBlockStart` => `marginTop`
- clone[matchValue[0]] = wrapImportantAndSkipCheck(_values[0], _important);
- } else if (matchValue.length === 2) {
- // Handle like `marginBlock` => `marginTop` & `marginBottom`
- matchValue.forEach(function (matchKey, index) {
- var _values$index;
- clone[matchKey] = wrapImportantAndSkipCheck((_values$index = _values[index]) !== null && _values$index !== void 0 ? _values$index : _values[0], _important);
- });
- } else if (matchValue.length === 4) {
- // Handle like `inset` => `top` & `right` & `bottom` & `left`
- matchValue.forEach(function (matchKey, index) {
- var _ref, _values$index2;
- clone[matchKey] = wrapImportantAndSkipCheck((_ref = (_values$index2 = _values[index]) !== null && _values$index2 !== void 0 ? _values$index2 : _values[index - 2]) !== null && _ref !== void 0 ? _ref : _values[0], _important);
- });
- } else {
- clone[key] = value;
- }
- } else {
- clone[key] = value;
- }
- });
- return clone;
- }
- };
- /* harmony default export */ var legacyLogicalProperties = (transform);
- ;// ./node_modules/@ant-design/cssinjs/es/transformers/px2rem.js
- /**
- * respect https://github.com/cuth/postcss-pxtorem
- */
- // @ts-ignore
- var pxRegex = /url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;
- function toFixed(number, precision) {
- var multiplier = Math.pow(10, precision + 1),
- wholeNumber = Math.floor(number * multiplier);
- return Math.round(wholeNumber / 10) * 10 / multiplier;
- }
- var px2rem_transform = function transform() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var _options$rootValue = options.rootValue,
- rootValue = _options$rootValue === void 0 ? 16 : _options$rootValue,
- _options$precision = options.precision,
- precision = _options$precision === void 0 ? 5 : _options$precision,
- _options$mediaQuery = options.mediaQuery,
- mediaQuery = _options$mediaQuery === void 0 ? false : _options$mediaQuery;
- var pxReplace = function pxReplace(m, $1) {
- if (!$1) return m;
- var pixels = parseFloat($1);
- // covenant: pixels <= 1, not transform to rem @zombieJ
- if (pixels <= 1) return m;
- var fixedVal = toFixed(pixels / rootValue, precision);
- return "".concat(fixedVal, "rem");
- };
- var visit = function visit(cssObj) {
- var clone = (0,objectSpread2["default"])({}, cssObj);
- Object.entries(cssObj).forEach(function (_ref) {
- var _ref2 = (0,slicedToArray["default"])(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
- if (typeof value === 'string' && value.includes('px')) {
- var newValue = value.replace(pxRegex, pxReplace);
- clone[key] = newValue;
- }
- // no unit
- if (!unitless_browser_esm[key] && typeof value === 'number' && value !== 0) {
- clone[key] = "".concat(value, "px").replace(pxRegex, pxReplace);
- }
- // Media queries
- var mergedKey = key.trim();
- if (mergedKey.startsWith('@') && mergedKey.includes('px') && mediaQuery) {
- var newKey = key.replace(pxRegex, pxReplace);
- clone[newKey] = clone[key];
- delete clone[key];
- }
- });
- return clone;
- };
- return {
- visit: visit
- };
- };
- /* harmony default export */ var px2rem = (px2rem_transform);
- ;// ./node_modules/@ant-design/cssinjs/es/index.js
- var _experimental = {
- supportModernCSS: function supportModernCSS() {
- return supportWhere() && supportLogicProps();
- }
- };
- /***/ }),
- /***/ "./node_modules/@ant-design/fast-color/es/index.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@ant-design/fast-color/es/index.js + 2 modules ***!
- \*********************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- FastColor: function() { return /* reexport */ FastColor; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- ;// ./node_modules/@ant-design/fast-color/es/FastColor.js
- const round = Math.round;
- /**
- * Support format, alpha unit will check the % mark:
- * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
- * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
- * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
- * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
- * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
- *
- * When `base` is provided, the percentage value will be divided by `base`.
- */
- function splitColorStr(str, parseNum) {
- const match = str
- // Remove str before `(`
- .replace(/^[^(]*\((.*)/, '$1')
- // Remove str after `)`
- .replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
- const numList = match.map(item => parseFloat(item));
- for (let i = 0; i < 3; i += 1) {
- numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
- }
- // For alpha. 50% should be 0.5
- if (match[3]) {
- numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
- } else {
- // By default, alpha is 1
- numList[3] = 1;
- }
- return numList;
- }
- const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
- /** round and limit number to integer between 0-255 */
- function limitRange(value, max) {
- const mergedMax = max || 255;
- if (value > mergedMax) {
- return mergedMax;
- }
- if (value < 0) {
- return 0;
- }
- return value;
- }
- class FastColor {
- constructor(input) {
- /**
- * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
- */
- (0,defineProperty["default"])(this, "isValid", true);
- /**
- * Red, R in RGB
- */
- (0,defineProperty["default"])(this, "r", 0);
- /**
- * Green, G in RGB
- */
- (0,defineProperty["default"])(this, "g", 0);
- /**
- * Blue, B in RGB
- */
- (0,defineProperty["default"])(this, "b", 0);
- /**
- * Alpha/Opacity, A in RGBA/HSLA
- */
- (0,defineProperty["default"])(this, "a", 1);
- // HSV privates
- (0,defineProperty["default"])(this, "_h", void 0);
- (0,defineProperty["default"])(this, "_s", void 0);
- (0,defineProperty["default"])(this, "_l", void 0);
- (0,defineProperty["default"])(this, "_v", void 0);
- // intermediate variables to calculate HSL/HSV
- (0,defineProperty["default"])(this, "_max", void 0);
- (0,defineProperty["default"])(this, "_min", void 0);
- (0,defineProperty["default"])(this, "_brightness", void 0);
- /**
- * Always check 3 char in the object to determine the format.
- * We not use function in check to save bundle size.
- * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
- */
- function matchFormat(str) {
- return str[0] in input && str[1] in input && str[2] in input;
- }
- if (!input) {
- // Do nothing since already initialized
- } else if (typeof input === 'string') {
- const trimStr = input.trim();
- function matchPrefix(prefix) {
- return trimStr.startsWith(prefix);
- }
- if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
- this.fromHexString(trimStr);
- } else if (matchPrefix('rgb')) {
- this.fromRgbString(trimStr);
- } else if (matchPrefix('hsl')) {
- this.fromHslString(trimStr);
- } else if (matchPrefix('hsv') || matchPrefix('hsb')) {
- this.fromHsvString(trimStr);
- }
- } else if (input instanceof FastColor) {
- this.r = input.r;
- this.g = input.g;
- this.b = input.b;
- this.a = input.a;
- this._h = input._h;
- this._s = input._s;
- this._l = input._l;
- this._v = input._v;
- } else if (matchFormat('rgb')) {
- this.r = limitRange(input.r);
- this.g = limitRange(input.g);
- this.b = limitRange(input.b);
- this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
- } else if (matchFormat('hsl')) {
- this.fromHsl(input);
- } else if (matchFormat('hsv')) {
- this.fromHsv(input);
- } else {
- throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
- }
- }
- // ======================= Setter =======================
- setR(value) {
- return this._sc('r', value);
- }
- setG(value) {
- return this._sc('g', value);
- }
- setB(value) {
- return this._sc('b', value);
- }
- setA(value) {
- return this._sc('a', value, 1);
- }
- setHue(value) {
- const hsv = this.toHsv();
- hsv.h = value;
- return this._c(hsv);
- }
- // ======================= Getter =======================
- /**
- * Returns the perceived luminance of a color, from 0-1.
- * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
- */
- getLuminance() {
- function adjustGamma(raw) {
- const val = raw / 255;
- return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
- }
- const R = adjustGamma(this.r);
- const G = adjustGamma(this.g);
- const B = adjustGamma(this.b);
- return 0.2126 * R + 0.7152 * G + 0.0722 * B;
- }
- getHue() {
- if (typeof this._h === 'undefined') {
- const delta = this.getMax() - this.getMin();
- if (delta === 0) {
- this._h = 0;
- } else {
- this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
- }
- }
- return this._h;
- }
- getSaturation() {
- if (typeof this._s === 'undefined') {
- const delta = this.getMax() - this.getMin();
- if (delta === 0) {
- this._s = 0;
- } else {
- this._s = delta / this.getMax();
- }
- }
- return this._s;
- }
- getLightness() {
- if (typeof this._l === 'undefined') {
- this._l = (this.getMax() + this.getMin()) / 510;
- }
- return this._l;
- }
- getValue() {
- if (typeof this._v === 'undefined') {
- this._v = this.getMax() / 255;
- }
- return this._v;
- }
- /**
- * Returns the perceived brightness of the color, from 0-255.
- * Note: this is not the b of HSB
- * @see http://www.w3.org/TR/AERT#color-contrast
- */
- getBrightness() {
- if (typeof this._brightness === 'undefined') {
- this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
- }
- return this._brightness;
- }
- // ======================== Func ========================
- darken(amount = 10) {
- const h = this.getHue();
- const s = this.getSaturation();
- let l = this.getLightness() - amount / 100;
- if (l < 0) {
- l = 0;
- }
- return this._c({
- h,
- s,
- l,
- a: this.a
- });
- }
- lighten(amount = 10) {
- const h = this.getHue();
- const s = this.getSaturation();
- let l = this.getLightness() + amount / 100;
- if (l > 1) {
- l = 1;
- }
- return this._c({
- h,
- s,
- l,
- a: this.a
- });
- }
- /**
- * Mix the current color a given amount with another color, from 0 to 100.
- * 0 means no mixing (return current color).
- */
- mix(input, amount = 50) {
- const color = this._c(input);
- const p = amount / 100;
- const calc = key => (color[key] - this[key]) * p + this[key];
- const rgba = {
- r: round(calc('r')),
- g: round(calc('g')),
- b: round(calc('b')),
- a: round(calc('a') * 100) / 100
- };
- return this._c(rgba);
- }
- /**
- * Mix the color with pure white, from 0 to 100.
- * Providing 0 will do nothing, providing 100 will always return white.
- */
- tint(amount = 10) {
- return this.mix({
- r: 255,
- g: 255,
- b: 255,
- a: 1
- }, amount);
- }
- /**
- * Mix the color with pure black, from 0 to 100.
- * Providing 0 will do nothing, providing 100 will always return black.
- */
- shade(amount = 10) {
- return this.mix({
- r: 0,
- g: 0,
- b: 0,
- a: 1
- }, amount);
- }
- onBackground(background) {
- const bg = this._c(background);
- const alpha = this.a + bg.a * (1 - this.a);
- const calc = key => {
- return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
- };
- return this._c({
- r: calc('r'),
- g: calc('g'),
- b: calc('b'),
- a: alpha
- });
- }
- // ======================= Status =======================
- isDark() {
- return this.getBrightness() < 128;
- }
- isLight() {
- return this.getBrightness() >= 128;
- }
- // ======================== MISC ========================
- equals(other) {
- return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
- }
- clone() {
- return this._c(this);
- }
- // ======================= Format =======================
- toHexString() {
- let hex = '#';
- const rHex = (this.r || 0).toString(16);
- hex += rHex.length === 2 ? rHex : '0' + rHex;
- const gHex = (this.g || 0).toString(16);
- hex += gHex.length === 2 ? gHex : '0' + gHex;
- const bHex = (this.b || 0).toString(16);
- hex += bHex.length === 2 ? bHex : '0' + bHex;
- if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
- const aHex = round(this.a * 255).toString(16);
- hex += aHex.length === 2 ? aHex : '0' + aHex;
- }
- return hex;
- }
- /** CSS support color pattern */
- toHsl() {
- return {
- h: this.getHue(),
- s: this.getSaturation(),
- l: this.getLightness(),
- a: this.a
- };
- }
- /** CSS support color pattern */
- toHslString() {
- const h = this.getHue();
- const s = round(this.getSaturation() * 100);
- const l = round(this.getLightness() * 100);
- return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
- }
- /** Same as toHsb */
- toHsv() {
- return {
- h: this.getHue(),
- s: this.getSaturation(),
- v: this.getValue(),
- a: this.a
- };
- }
- toRgb() {
- return {
- r: this.r,
- g: this.g,
- b: this.b,
- a: this.a
- };
- }
- toRgbString() {
- return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
- }
- toString() {
- return this.toRgbString();
- }
- // ====================== Privates ======================
- /** Return a new FastColor object with one channel changed */
- _sc(rgb, value, max) {
- const clone = this.clone();
- clone[rgb] = limitRange(value, max);
- return clone;
- }
- _c(input) {
- return new this.constructor(input);
- }
- getMax() {
- if (typeof this._max === 'undefined') {
- this._max = Math.max(this.r, this.g, this.b);
- }
- return this._max;
- }
- getMin() {
- if (typeof this._min === 'undefined') {
- this._min = Math.min(this.r, this.g, this.b);
- }
- return this._min;
- }
- fromHexString(trimStr) {
- const withoutPrefix = trimStr.replace('#', '');
- function connectNum(index1, index2) {
- return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
- }
- if (withoutPrefix.length < 6) {
- // #rgb or #rgba
- this.r = connectNum(0);
- this.g = connectNum(1);
- this.b = connectNum(2);
- this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
- } else {
- // #rrggbb or #rrggbbaa
- this.r = connectNum(0, 1);
- this.g = connectNum(2, 3);
- this.b = connectNum(4, 5);
- this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
- }
- }
- fromHsl({
- h,
- s,
- l,
- a
- }) {
- this._h = h % 360;
- this._s = s;
- this._l = l;
- this.a = typeof a === 'number' ? a : 1;
- if (s <= 0) {
- const rgb = round(l * 255);
- this.r = rgb;
- this.g = rgb;
- this.b = rgb;
- }
- let r = 0,
- g = 0,
- b = 0;
- const huePrime = h / 60;
- const chroma = (1 - Math.abs(2 * l - 1)) * s;
- const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
- if (huePrime >= 0 && huePrime < 1) {
- r = chroma;
- g = secondComponent;
- } else if (huePrime >= 1 && huePrime < 2) {
- r = secondComponent;
- g = chroma;
- } else if (huePrime >= 2 && huePrime < 3) {
- g = chroma;
- b = secondComponent;
- } else if (huePrime >= 3 && huePrime < 4) {
- g = secondComponent;
- b = chroma;
- } else if (huePrime >= 4 && huePrime < 5) {
- r = secondComponent;
- b = chroma;
- } else if (huePrime >= 5 && huePrime < 6) {
- r = chroma;
- b = secondComponent;
- }
- const lightnessModification = l - chroma / 2;
- this.r = round((r + lightnessModification) * 255);
- this.g = round((g + lightnessModification) * 255);
- this.b = round((b + lightnessModification) * 255);
- }
- fromHsv({
- h,
- s,
- v,
- a
- }) {
- this._h = h % 360;
- this._s = s;
- this._v = v;
- this.a = typeof a === 'number' ? a : 1;
- const vv = round(v * 255);
- this.r = vv;
- this.g = vv;
- this.b = vv;
- if (s <= 0) {
- return;
- }
- const hh = h / 60;
- const i = Math.floor(hh);
- const ff = hh - i;
- const p = round(v * (1.0 - s) * 255);
- const q = round(v * (1.0 - s * ff) * 255);
- const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
- switch (i) {
- case 0:
- this.g = t;
- this.b = p;
- break;
- case 1:
- this.r = q;
- this.b = p;
- break;
- case 2:
- this.r = p;
- this.b = t;
- break;
- case 3:
- this.r = p;
- this.g = q;
- break;
- case 4:
- this.r = t;
- this.g = p;
- break;
- case 5:
- default:
- this.g = p;
- this.b = q;
- break;
- }
- }
- fromHsvString(trimStr) {
- const cells = splitColorStr(trimStr, parseHSVorHSL);
- this.fromHsv({
- h: cells[0],
- s: cells[1],
- v: cells[2],
- a: cells[3]
- });
- }
- fromHslString(trimStr) {
- const cells = splitColorStr(trimStr, parseHSVorHSL);
- this.fromHsl({
- h: cells[0],
- s: cells[1],
- l: cells[2],
- a: cells[3]
- });
- }
- fromRgbString(trimStr) {
- const cells = splitColorStr(trimStr, (num, txt) =>
- // Convert percentage to number. e.g. 50% -> 128
- txt.includes('%') ? round(num / 100 * 255) : num);
- this.r = cells[0];
- this.g = cells[1];
- this.b = cells[2];
- this.a = cells[3];
- }
- }
- ;// ./node_modules/@ant-design/fast-color/es/types.js
- ;// ./node_modules/@ant-design/fast-color/es/index.js
- /***/ }),
- /***/ "./node_modules/@ant-design/icons/es/components/AntdIcon.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules ***!
- \******************************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ AntdIcon; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__("./node_modules/classnames/index.js");
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- // EXTERNAL MODULE: ./node_modules/@ant-design/colors/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/colors/es/index.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/Context.js
- var Context = __webpack_require__("./node_modules/@ant-design/icons/es/components/Context.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/dynamicCSS.js
- var dynamicCSS = __webpack_require__("./node_modules/rc-util/es/Dom/dynamicCSS.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/shadow.js
- var shadow = __webpack_require__("./node_modules/rc-util/es/Dom/shadow.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
- var warning = __webpack_require__("./node_modules/rc-util/es/warning.js");
- ;// ./node_modules/@ant-design/icons/es/utils.js
- function camelCase(input) {
- return input.replace(/-(.)/g, function (match, g) {
- return g.toUpperCase();
- });
- }
- function utils_warning(valid, message) {
- (0,warning["default"])(valid, "[@ant-design/icons] ".concat(message));
- }
- function isIconDefinition(target) {
- return (0,esm_typeof["default"])(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && ((0,esm_typeof["default"])(target.icon) === 'object' || typeof target.icon === 'function');
- }
- function normalizeAttrs() {
- var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- return Object.keys(attrs).reduce(function (acc, key) {
- var val = attrs[key];
- switch (key) {
- case 'class':
- acc.className = val;
- delete acc.class;
- break;
- default:
- delete acc[key];
- acc[camelCase(key)] = val;
- }
- return acc;
- }, {});
- }
- function generate(node, key, rootProps) {
- if (!rootProps) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(node.tag, (0,objectSpread2["default"])({
- key: key
- }, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
- return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
- }));
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(node.tag, (0,objectSpread2["default"])((0,objectSpread2["default"])({
- key: key
- }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
- return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
- }));
- }
- function getSecondaryColor(primaryColor) {
- // choose the second color
- return (0,es.generate)(primaryColor)[0];
- }
- function normalizeTwoToneColors(twoToneColor) {
- if (!twoToneColor) {
- return [];
- }
- return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
- }
- // These props make sure that the SVG behaviours like general text.
- // Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
- var svgBaseProps = {
- width: '1em',
- height: '1em',
- fill: 'currentColor',
- 'aria-hidden': 'true',
- focusable: 'false'
- };
- var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
- var useInsertStyles = function useInsertStyles(eleRef) {
- var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(Context["default"]),
- csp = _useContext.csp,
- prefixCls = _useContext.prefixCls,
- layer = _useContext.layer;
- var mergedStyleStr = iconStyles;
- if (prefixCls) {
- mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
- }
- if (layer) {
- mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
- }
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- var ele = eleRef.current;
- var shadowRoot = (0,shadow.getShadowRoot)(ele);
- (0,dynamicCSS.updateCSS)(mergedStyleStr, '@ant-design-icons', {
- prepend: !layer,
- csp: csp,
- attachTo: shadowRoot
- });
- }, []);
- };
- ;// ./node_modules/@ant-design/icons/es/components/IconBase.js
- var _excluded = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
- var twoToneColorPalette = {
- primaryColor: '#333',
- secondaryColor: '#E6E6E6',
- calculated: false
- };
- function setTwoToneColors(_ref) {
- var primaryColor = _ref.primaryColor,
- secondaryColor = _ref.secondaryColor;
- twoToneColorPalette.primaryColor = primaryColor;
- twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
- twoToneColorPalette.calculated = !!secondaryColor;
- }
- function getTwoToneColors() {
- return (0,objectSpread2["default"])({}, twoToneColorPalette);
- }
- var IconBase = function IconBase(props) {
- var icon = props.icon,
- className = props.className,
- onClick = props.onClick,
- style = props.style,
- primaryColor = props.primaryColor,
- secondaryColor = props.secondaryColor,
- restProps = (0,objectWithoutProperties["default"])(props, _excluded);
- var svgRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef();
- var colors = twoToneColorPalette;
- if (primaryColor) {
- colors = {
- primaryColor: primaryColor,
- secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
- };
- }
- useInsertStyles(svgRef);
- utils_warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
- if (!isIconDefinition(icon)) {
- return null;
- }
- var target = icon;
- if (target && typeof target.icon === 'function') {
- target = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, target), {}, {
- icon: target.icon(colors.primaryColor, colors.secondaryColor)
- });
- }
- return generate(target.icon, "svg-".concat(target.name), (0,objectSpread2["default"])((0,objectSpread2["default"])({
- className: className,
- onClick: onClick,
- style: style,
- 'data-icon': target.name,
- width: '1em',
- height: '1em',
- fill: 'currentColor',
- 'aria-hidden': 'true'
- }, restProps), {}, {
- ref: svgRef
- }));
- };
- IconBase.displayName = 'IconReact';
- IconBase.getTwoToneColors = getTwoToneColors;
- IconBase.setTwoToneColors = setTwoToneColors;
- /* harmony default export */ var components_IconBase = (IconBase);
- ;// ./node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js
- function setTwoToneColor(twoToneColor) {
- var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
- _normalizeTwoToneColo2 = (0,slicedToArray["default"])(_normalizeTwoToneColo, 2),
- primaryColor = _normalizeTwoToneColo2[0],
- secondaryColor = _normalizeTwoToneColo2[1];
- return components_IconBase.setTwoToneColors({
- primaryColor: primaryColor,
- secondaryColor: secondaryColor
- });
- }
- function getTwoToneColor() {
- var colors = components_IconBase.getTwoToneColors();
- if (!colors.calculated) {
- return colors.primaryColor;
- }
- return [colors.primaryColor, colors.secondaryColor];
- }
- ;// ./node_modules/@ant-design/icons/es/components/AntdIcon.js
- 'use client';
- var AntdIcon_excluded = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
- // Initial setting
- // should move it to antd main repo?
- setTwoToneColor(es.blue.primary);
- // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720
- var Icon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var className = props.className,
- icon = props.icon,
- spin = props.spin,
- rotate = props.rotate,
- tabIndex = props.tabIndex,
- onClick = props.onClick,
- twoToneColor = props.twoToneColor,
- restProps = (0,objectWithoutProperties["default"])(props, AntdIcon_excluded);
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(Context["default"]),
- _React$useContext$pre = _React$useContext.prefixCls,
- prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,
- rootClassName = _React$useContext.rootClassName;
- var classString = classnames_default()(rootClassName, prefixCls, (0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), className);
- var iconTabIndex = tabIndex;
- if (iconTabIndex === undefined && onClick) {
- iconTabIndex = -1;
- }
- var svgStyle = rotate ? {
- msTransform: "rotate(".concat(rotate, "deg)"),
- transform: "rotate(".concat(rotate, "deg)")
- } : undefined;
- var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
- _normalizeTwoToneColo2 = (0,slicedToArray["default"])(_normalizeTwoToneColo, 2),
- primaryColor = _normalizeTwoToneColo2[0],
- secondaryColor = _normalizeTwoToneColo2[1];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement("span", (0,esm_extends["default"])({
- role: "img",
- "aria-label": icon.name
- }, restProps, {
- ref: ref,
- tabIndex: iconTabIndex,
- onClick: onClick,
- className: classString
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(components_IconBase, {
- icon: icon,
- primaryColor: primaryColor,
- secondaryColor: secondaryColor,
- style: svgStyle
- }));
- });
- Icon.displayName = 'AntdIcon';
- Icon.getTwoToneColor = getTwoToneColor;
- Icon.setTwoToneColor = setTwoToneColor;
- /* harmony default export */ var AntdIcon = (Icon);
- /***/ }),
- /***/ "./node_modules/@ant-design/icons/es/components/Context.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@ant-design/icons/es/components/Context.js ***!
- \*****************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- var IconContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({});
- /* harmony default export */ __webpack_exports__["default"] = (IconContext);
- /***/ }),
- /***/ "./node_modules/@ant-design/icons/es/icons/RightOutlined.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules ***!
- \******************************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ icons_RightOutlined; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- ;// ./node_modules/@ant-design/icons-svg/es/asn/RightOutlined.js
- // This icon file is generated automatically.
- var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
- /* harmony default export */ var asn_RightOutlined = (RightOutlined);
- // EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 3 modules
- var AntdIcon = __webpack_require__("./node_modules/@ant-design/icons/es/components/AntdIcon.js");
- ;// ./node_modules/@ant-design/icons/es/icons/RightOutlined.js
- // GENERATE BY ./scripts/generate.ts
- // DON NOT EDIT IT MANUALLY
- var RightOutlined_RightOutlined = function RightOutlined(props, ref) {
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(AntdIcon["default"], (0,esm_extends["default"])({}, props, {
- ref: ref,
- icon: asn_RightOutlined
- }));
- };
- /** */
- var RefIcon = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(RightOutlined_RightOutlined);
- if (true) {
- RefIcon.displayName = 'RightOutlined';
- }
- /* harmony default export */ var icons_RightOutlined = (RefIcon);
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
- \*********************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _arrayLikeToArray; }
- /* harmony export */ });
- function _arrayLikeToArray(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _arrayWithHoles; }
- /* harmony export */ });
- function _arrayWithHoles(r) {
- if (Array.isArray(r)) return r;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
- \**************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _assertThisInitialized; }
- /* harmony export */ });
- function _assertThisInitialized(e) {
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _classCallCheck; }
- /* harmony export */ });
- function _classCallCheck(a, n) {
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***!
- \****************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _createClass; }
- /* harmony export */ });
- /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
- function _defineProperties(e, r) {
- for (var t = 0; t < r.length; t++) {
- var o = r[t];
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(o.key), o);
- }
- }
- function _createClass(e, r, t) {
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
- writable: !1
- }), e;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/createSuper.js":
- /*!****************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/createSuper.js ***!
- \****************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _createSuper; }
- /* harmony export */ });
- /* harmony import */ var _getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
- /* harmony import */ var _isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js");
- /* harmony import */ var _possibleConstructorReturn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./possibleConstructorReturn.js */ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
- function _createSuper(t) {
- var r = (0,_isNativeReflectConstruct_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
- return function () {
- var e,
- o = (0,_getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t);
- if (r) {
- var s = (0,_getPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this).constructor;
- e = Reflect.construct(o, arguments, s);
- } else e = o.apply(this, arguments);
- return (0,_possibleConstructorReturn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, e);
- };
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _defineProperty; }
- /* harmony export */ });
- /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
- function _defineProperty(e, r, t) {
- return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, {
- value: t,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[r] = t, e;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
- /*!************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
- \************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _extends; }
- /* harmony export */ });
- function _extends() {
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
- for (var e = 1; e < arguments.length; e++) {
- var t = arguments[e];
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
- }
- return n;
- }, _extends.apply(null, arguments);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _getPrototypeOf; }
- /* harmony export */ });
- function _getPrototypeOf(t) {
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
- return t.__proto__ || Object.getPrototypeOf(t);
- }, _getPrototypeOf(t);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/inherits.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/inherits.js ***!
- \*************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _inherits; }
- /* harmony export */ });
- /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
- function _inherits(t, e) {
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
- t.prototype = Object.create(e && e.prototype, {
- constructor: {
- value: t,
- writable: !0,
- configurable: !0
- }
- }), Object.defineProperty(t, "prototype", {
- writable: !1
- }), e && (0,_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t, e);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js ***!
- \*****************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _isNativeReflectConstruct; }
- /* harmony export */ });
- function _isNativeReflectConstruct() {
- try {
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
- } catch (t) {}
- return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
- return !!t;
- })();
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
- \********************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _iterableToArray; }
- /* harmony export */ });
- function _iterableToArray(r) {
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
- /*!********************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
- \********************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _nonIterableRest; }
- /* harmony export */ });
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
- \******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _objectSpread2; }
- /* harmony export */ });
- /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- function ownKeys(e, r) {
- var t = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- r && (o = o.filter(function (r) {
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
- })), t.push.apply(t, o);
- }
- return t;
- }
- function _objectSpread2(e) {
- for (var r = 1; r < arguments.length; r++) {
- var t = null != arguments[r] ? arguments[r] : {};
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
- (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
- });
- }
- return e;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js":
- /*!****************************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules ***!
- \****************************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ _objectWithoutProperties; }
- });
- ;// ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
- function _objectWithoutPropertiesLoose(r, e) {
- if (null == r) return {};
- var t = {};
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
- if (-1 !== e.indexOf(n)) continue;
- t[n] = r[n];
- }
- return t;
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
- function _objectWithoutProperties(e, t) {
- if (null == e) return {};
- var o,
- r,
- i = _objectWithoutPropertiesLoose(e, t);
- if (Object.getOwnPropertySymbols) {
- var n = Object.getOwnPropertySymbols(e);
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
- }
- return i;
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
- \******************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _possibleConstructorReturn; }
- /* harmony export */ });
- /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- /* harmony import */ var _assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized.js */ "./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
- function _possibleConstructorReturn(t, e) {
- if (e && ("object" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e) || "function" == typeof e)) return e;
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
- return (0,_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
- \*******************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _setPrototypeOf; }
- /* harmony export */ });
- function _setPrototypeOf(t, e) {
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
- return t.__proto__ = e, t;
- }, _setPrototypeOf(t, e);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules ***!
- \******************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ _slicedToArray; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
- var arrayWithHoles = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
- function _iterableToArrayLimit(r, l) {
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t) {
- var e,
- n,
- i,
- u,
- a = [],
- f = !0,
- o = !1;
- try {
- if (i = (t = t.call(r)).next, 0 === l) {
- if (Object(t) !== t) return;
- f = !1;
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
- } catch (r) {
- o = !0, n = r;
- } finally {
- try {
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
- } finally {
- if (o) throw n;
- }
- }
- return a;
- }
- }
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
- var unsupportedIterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
- var nonIterableRest = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
- function _slicedToArray(r, e) {
- return (0,arrayWithHoles["default"])(r) || _iterableToArrayLimit(r, e) || (0,unsupportedIterableToArray["default"])(r, e) || (0,nonIterableRest["default"])();
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/toArray.js":
- /*!************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/toArray.js ***!
- \************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _toArray; }
- /* harmony export */ });
- /* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
- /* harmony import */ var _iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray.js */ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
- /* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
- /* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
- function _toArray(r) {
- return (0,_arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r) || (0,_iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(r) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(r) || (0,_nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])();
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":
- /*!**********************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules ***!
- \**********************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ _toConsumableArray; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
- var arrayLikeToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
- function _arrayWithoutHoles(r) {
- if (Array.isArray(r)) return (0,arrayLikeToArray["default"])(r);
- }
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
- var iterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
- var unsupportedIterableToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
- function _toConsumableArray(r) {
- return _arrayWithoutHoles(r) || (0,iterableToArray["default"])(r) || (0,unsupportedIterableToArray["default"])(r) || _nonIterableSpread();
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js + 1 modules ***!
- \******************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- "default": function() { return /* binding */ toPropertyKey; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- ;// ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
- function toPrimitive(t, r) {
- if ("object" != (0,esm_typeof["default"])(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != (0,esm_typeof["default"])(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
- }
- ;// ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
- function toPropertyKey(t) {
- var i = toPrimitive(t, "string");
- return "symbol" == (0,esm_typeof["default"])(i) ? i : i + "";
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***!
- \***********************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _typeof; }
- /* harmony export */ });
- function _typeof(o) {
- "@babel/helpers - typeof";
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
- return typeof o;
- } : function (o) {
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
- }, _typeof(o);
- }
- /***/ }),
- /***/ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
- \*******************************************************************************/
- /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ _unsupportedIterableToArray; }
- /* harmony export */ });
- /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
- function _unsupportedIterableToArray(r, a) {
- if (r) {
- if ("string" == typeof r) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r, a);
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r, a) : void 0;
- }
- }
- /***/ }),
- /***/ "./node_modules/@rc-component/color-picker/es/index.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/@rc-component/color-picker/es/index.js + 14 modules ***!
- \**************************************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- Color: function() { return /* reexport */ Color; },
- ColorBlock: function() { return /* reexport */ components_ColorBlock; },
- "default": function() { return /* binding */ color_picker_es; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
- var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/inherits.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
- var createSuper = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createSuper.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/@ant-design/fast-color/es/index.js + 2 modules
- var es = __webpack_require__("./node_modules/@ant-design/fast-color/es/index.js");
- ;// ./node_modules/@rc-component/color-picker/es/color.js
- var _excluded = ["b"],
- _excluded2 = ["v"];
- var getRoundNumber = function getRoundNumber(value) {
- return Math.round(Number(value || 0));
- };
- var convertHsb2Hsv = function convertHsb2Hsv(color) {
- if (color instanceof es.FastColor) {
- return color;
- }
- if (color && (0,esm_typeof["default"])(color) === 'object' && 'h' in color && 'b' in color) {
- var _ref = color,
- b = _ref.b,
- resets = (0,objectWithoutProperties["default"])(_ref, _excluded);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, resets), {}, {
- v: b
- });
- }
- if (typeof color === 'string' && /hsb/.test(color)) {
- return color.replace(/hsb/, 'hsv');
- }
- return color;
- };
- var Color = /*#__PURE__*/function (_FastColor) {
- (0,inherits["default"])(Color, _FastColor);
- var _super = (0,createSuper["default"])(Color);
- function Color(color) {
- (0,classCallCheck["default"])(this, Color);
- return _super.call(this, convertHsb2Hsv(color));
- }
- (0,createClass["default"])(Color, [{
- key: "toHsbString",
- value: function toHsbString() {
- var hsb = this.toHsb();
- var saturation = getRoundNumber(hsb.s * 100);
- var lightness = getRoundNumber(hsb.b * 100);
- var hue = getRoundNumber(hsb.h);
- var alpha = hsb.a;
- var hsbString = "hsb(".concat(hue, ", ").concat(saturation, "%, ").concat(lightness, "%)");
- var hsbaString = "hsba(".concat(hue, ", ").concat(saturation, "%, ").concat(lightness, "%, ").concat(alpha.toFixed(alpha === 0 ? 0 : 2), ")");
- return alpha === 1 ? hsbString : hsbaString;
- }
- }, {
- key: "toHsb",
- value: function toHsb() {
- var _this$toHsv = this.toHsv(),
- v = _this$toHsv.v,
- resets = (0,objectWithoutProperties["default"])(_this$toHsv, _excluded2);
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, resets), {}, {
- b: v,
- a: this.a
- });
- }
- }]);
- return Color;
- }(es.FastColor);
- ;// ./node_modules/@rc-component/color-picker/es/util.js
- var ColorPickerPrefixCls = 'rc-color-picker';
- var generateColor = function generateColor(color) {
- if (color instanceof Color) {
- return color;
- }
- return new Color(color);
- };
- var defaultColor = generateColor('#1677ff');
- var calculateColor = function calculateColor(props) {
- var offset = props.offset,
- targetRef = props.targetRef,
- containerRef = props.containerRef,
- color = props.color,
- type = props.type;
- var _containerRef$current = containerRef.current.getBoundingClientRect(),
- width = _containerRef$current.width,
- height = _containerRef$current.height;
- var _targetRef$current$ge = targetRef.current.getBoundingClientRect(),
- targetWidth = _targetRef$current$ge.width,
- targetHeight = _targetRef$current$ge.height;
- var centerOffsetX = targetWidth / 2;
- var centerOffsetY = targetHeight / 2;
- var saturation = (offset.x + centerOffsetX) / width;
- var bright = 1 - (offset.y + centerOffsetY) / height;
- var hsb = color.toHsb();
- var alphaOffset = saturation;
- var hueOffset = (offset.x + centerOffsetX) / width * 360;
- if (type) {
- switch (type) {
- case 'hue':
- return generateColor((0,objectSpread2["default"])((0,objectSpread2["default"])({}, hsb), {}, {
- h: hueOffset <= 0 ? 0 : hueOffset
- }));
- case 'alpha':
- return generateColor((0,objectSpread2["default"])((0,objectSpread2["default"])({}, hsb), {}, {
- a: alphaOffset <= 0 ? 0 : alphaOffset
- }));
- }
- }
- return generateColor({
- h: hsb.h,
- s: saturation <= 0 ? 0 : saturation,
- b: bright >= 1 ? 1 : bright,
- a: hsb.a
- });
- };
- var calcOffset = function calcOffset(color, type) {
- var hsb = color.toHsb();
- switch (type) {
- case 'hue':
- return {
- x: hsb.h / 360 * 100,
- y: 50
- };
- case 'alpha':
- return {
- x: color.a * 100,
- y: 50
- };
- // Picker panel
- default:
- return {
- x: hsb.s * 100,
- y: (1 - hsb.b) * 100
- };
- }
- };
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__("./node_modules/classnames/index.js");
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- ;// ./node_modules/@rc-component/color-picker/es/components/ColorBlock.js
- var ColorBlock = function ColorBlock(_ref) {
- var color = _ref.color,
- prefixCls = _ref.prefixCls,
- className = _ref.className,
- style = _ref.style,
- onClick = _ref.onClick;
- var colorBlockCls = "".concat(prefixCls, "-color-block");
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()(colorBlockCls, className),
- style: style,
- onClick: onClick
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(colorBlockCls, "-inner"),
- style: {
- background: color
- }
- }));
- };
- /* harmony default export */ var components_ColorBlock = (ColorBlock);
- ;// ./node_modules/@rc-component/color-picker/es/hooks/useColorDrag.js
- function getPosition(e) {
- var obj = 'touches' in e ? e.touches[0] : e;
- var scrollXOffset = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageXOffset;
- var scrollYOffset = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
- return {
- pageX: obj.pageX - scrollXOffset,
- pageY: obj.pageY - scrollYOffset
- };
- }
- function useColorDrag(props) {
- var targetRef = props.targetRef,
- containerRef = props.containerRef,
- direction = props.direction,
- onDragChange = props.onDragChange,
- onDragChangeComplete = props.onDragChangeComplete,
- calculate = props.calculate,
- color = props.color,
- disabledDrag = props.disabledDrag;
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
- x: 0,
- y: 0
- }),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- offsetValue = _useState2[0],
- setOffsetValue = _useState2[1];
- var mouseMoveRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- var mouseUpRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // Always get position from `color`
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- setOffsetValue(calculate());
- }, [color]);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return function () {
- document.removeEventListener('mousemove', mouseMoveRef.current);
- document.removeEventListener('mouseup', mouseUpRef.current);
- document.removeEventListener('touchmove', mouseMoveRef.current);
- document.removeEventListener('touchend', mouseUpRef.current);
- mouseMoveRef.current = null;
- mouseUpRef.current = null;
- };
- }, []);
- var updateOffset = function updateOffset(e) {
- var _getPosition = getPosition(e),
- pageX = _getPosition.pageX,
- pageY = _getPosition.pageY;
- var _containerRef$current = containerRef.current.getBoundingClientRect(),
- rectX = _containerRef$current.x,
- rectY = _containerRef$current.y,
- width = _containerRef$current.width,
- height = _containerRef$current.height;
- var _targetRef$current$ge = targetRef.current.getBoundingClientRect(),
- targetWidth = _targetRef$current$ge.width,
- targetHeight = _targetRef$current$ge.height;
- var centerOffsetX = targetWidth / 2;
- var centerOffsetY = targetHeight / 2;
- var offsetX = Math.max(0, Math.min(pageX - rectX, width)) - centerOffsetX;
- var offsetY = Math.max(0, Math.min(pageY - rectY, height)) - centerOffsetY;
- var calcOffset = {
- x: offsetX,
- y: direction === 'x' ? offsetValue.y : offsetY
- };
- // Exclusion of boundary cases
- if (targetWidth === 0 && targetHeight === 0 || targetWidth !== targetHeight) {
- return false;
- }
- onDragChange === null || onDragChange === void 0 || onDragChange(calcOffset);
- };
- var onDragMove = function onDragMove(e) {
- e.preventDefault();
- updateOffset(e);
- };
- var onDragStop = function onDragStop(e) {
- e.preventDefault();
- document.removeEventListener('mousemove', mouseMoveRef.current);
- document.removeEventListener('mouseup', mouseUpRef.current);
- document.removeEventListener('touchmove', mouseMoveRef.current);
- document.removeEventListener('touchend', mouseUpRef.current);
- mouseMoveRef.current = null;
- mouseUpRef.current = null;
- onDragChangeComplete === null || onDragChangeComplete === void 0 || onDragChangeComplete();
- };
- var onDragStart = function onDragStart(e) {
- // https://github.com/ant-design/ant-design/issues/43529
- document.removeEventListener('mousemove', mouseMoveRef.current);
- document.removeEventListener('mouseup', mouseUpRef.current);
- if (disabledDrag) {
- return;
- }
- updateOffset(e);
- document.addEventListener('mousemove', onDragMove);
- document.addEventListener('mouseup', onDragStop);
- document.addEventListener('touchmove', onDragMove);
- document.addEventListener('touchend', onDragStop);
- mouseMoveRef.current = onDragMove;
- mouseUpRef.current = onDragStop;
- };
- return [offsetValue, onDragStart];
- }
- /* harmony default export */ var hooks_useColorDrag = (useColorDrag);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/index.js
- var rc_util_es = __webpack_require__("./node_modules/rc-util/es/index.js");
- ;// ./node_modules/@rc-component/color-picker/es/components/Handler.js
- var Handler = function Handler(_ref) {
- var _ref$size = _ref.size,
- size = _ref$size === void 0 ? 'default' : _ref$size,
- color = _ref.color,
- prefixCls = _ref.prefixCls;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-handler"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-handler-sm"), size === 'small')),
- style: {
- backgroundColor: color
- }
- });
- };
- /* harmony default export */ var components_Handler = (Handler);
- ;// ./node_modules/@rc-component/color-picker/es/components/Palette.js
- var Palette = function Palette(_ref) {
- var children = _ref.children,
- style = _ref.style,
- prefixCls = _ref.prefixCls;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-palette"),
- style: (0,objectSpread2["default"])({
- position: 'relative'
- }, style)
- }, children);
- };
- /* harmony default export */ var components_Palette = (Palette);
- ;// ./node_modules/@rc-component/color-picker/es/components/Transform.js
- var Transform = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var children = props.children,
- x = props.x,
- y = props.y;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: ref,
- style: {
- position: 'absolute',
- left: "".concat(x, "%"),
- top: "".concat(y, "%"),
- zIndex: 1,
- transform: 'translate(-50%, -50%)'
- }
- }, children);
- });
- /* harmony default export */ var components_Transform = (Transform);
- ;// ./node_modules/@rc-component/color-picker/es/components/Picker.js
- var Picker = function Picker(_ref) {
- var color = _ref.color,
- onChange = _ref.onChange,
- prefixCls = _ref.prefixCls,
- onChangeComplete = _ref.onChangeComplete,
- disabled = _ref.disabled;
- var pickerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var transformRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var colorRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(color);
- var onDragChange = (0,rc_util_es.useEvent)(function (offsetValue) {
- var calcColor = calculateColor({
- offset: offsetValue,
- targetRef: transformRef,
- containerRef: pickerRef,
- color: color
- });
- colorRef.current = calcColor;
- onChange(calcColor);
- });
- var _useColorDrag = hooks_useColorDrag({
- color: color,
- containerRef: pickerRef,
- targetRef: transformRef,
- calculate: function calculate() {
- return calcOffset(color);
- },
- onDragChange: onDragChange,
- onDragChangeComplete: function onDragChangeComplete() {
- return onChangeComplete === null || onChangeComplete === void 0 ? void 0 : onChangeComplete(colorRef.current);
- },
- disabledDrag: disabled
- }),
- _useColorDrag2 = (0,slicedToArray["default"])(_useColorDrag, 2),
- offset = _useColorDrag2[0],
- dragStartHandle = _useColorDrag2[1];
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: pickerRef,
- className: "".concat(prefixCls, "-select"),
- onMouseDown: dragStartHandle,
- onTouchStart: dragStartHandle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Palette, {
- prefixCls: prefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Transform, {
- x: offset.x,
- y: offset.y,
- ref: transformRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Handler, {
- color: color.toRgbString(),
- prefixCls: prefixCls
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-saturation"),
- style: {
- backgroundColor: "hsl(".concat(color.toHsb().h, ",100%, 50%)"),
- backgroundImage: 'linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))'
- }
- })));
- };
- /* harmony default export */ var components_Picker = (Picker);
- ;// ./node_modules/@rc-component/color-picker/es/hooks/useColorState.js
- var useColorState = function useColorState(defaultValue, value) {
- var _useMergedState = (0,rc_util_es.useMergedState)(defaultValue, {
- value: value
- }),
- _useMergedState2 = (0,slicedToArray["default"])(_useMergedState, 2),
- mergedValue = _useMergedState2[0],
- setValue = _useMergedState2[1];
- var color = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return generateColor(mergedValue);
- }, [mergedValue]);
- return [color, setValue];
- };
- /* harmony default export */ var hooks_useColorState = (useColorState);
- ;// ./node_modules/@rc-component/color-picker/es/components/Gradient.js
- var Gradient = function Gradient(_ref) {
- var colors = _ref.colors,
- children = _ref.children,
- _ref$direction = _ref.direction,
- direction = _ref$direction === void 0 ? 'to right' : _ref$direction,
- type = _ref.type,
- prefixCls = _ref.prefixCls;
- var gradientColors = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return colors.map(function (color, idx) {
- var result = generateColor(color);
- if (type === 'alpha' && idx === colors.length - 1) {
- result = new Color(result.setA(1));
- }
- return result.toRgbString();
- }).join(',');
- }, [colors, type]);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-gradient"),
- style: {
- position: 'absolute',
- inset: 0,
- background: "linear-gradient(".concat(direction, ", ").concat(gradientColors, ")")
- }
- }, children);
- };
- /* harmony default export */ var components_Gradient = (Gradient);
- ;// ./node_modules/@rc-component/color-picker/es/components/Slider.js
- var Slider = function Slider(props) {
- var prefixCls = props.prefixCls,
- colors = props.colors,
- disabled = props.disabled,
- onChange = props.onChange,
- onChangeComplete = props.onChangeComplete,
- color = props.color,
- type = props.type;
- var sliderRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var transformRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- var colorRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(color);
- var getValue = function getValue(c) {
- return type === 'hue' ? c.getHue() : c.a * 100;
- };
- var onDragChange = (0,rc_util_es.useEvent)(function (offsetValue) {
- var calcColor = calculateColor({
- offset: offsetValue,
- targetRef: transformRef,
- containerRef: sliderRef,
- color: color,
- type: type
- });
- colorRef.current = calcColor;
- onChange(getValue(calcColor));
- });
- var _useColorDrag = hooks_useColorDrag({
- color: color,
- targetRef: transformRef,
- containerRef: sliderRef,
- calculate: function calculate() {
- return calcOffset(color, type);
- },
- onDragChange: onDragChange,
- onDragChangeComplete: function onDragChangeComplete() {
- onChangeComplete(getValue(colorRef.current));
- },
- direction: 'x',
- disabledDrag: disabled
- }),
- _useColorDrag2 = (0,slicedToArray["default"])(_useColorDrag, 2),
- offset = _useColorDrag2[0],
- dragStartHandle = _useColorDrag2[1];
- var handleColor = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- if (type === 'hue') {
- var hsb = color.toHsb();
- hsb.s = 1;
- hsb.b = 1;
- hsb.a = 1;
- var lightColor = new Color(hsb);
- return lightColor;
- }
- return color;
- }, [color, type]);
- // ========================= Gradient =========================
- var gradientList = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useMemo(function () {
- return colors.map(function (info) {
- return "".concat(info.color, " ").concat(info.percent, "%");
- });
- }, [colors]);
- // ========================== Render ==========================
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- ref: sliderRef,
- className: classnames_default()("".concat(prefixCls, "-slider"), "".concat(prefixCls, "-slider-").concat(type)),
- onMouseDown: dragStartHandle,
- onTouchStart: dragStartHandle
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Palette, {
- prefixCls: prefixCls
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Transform, {
- x: offset.x,
- y: offset.y,
- ref: transformRef
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Handler, {
- size: "small",
- color: handleColor.toHexString(),
- prefixCls: prefixCls
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Gradient, {
- colors: gradientList,
- type: type,
- prefixCls: prefixCls
- })));
- };
- /* harmony default export */ var components_Slider = (Slider);
- ;// ./node_modules/@rc-component/color-picker/es/hooks/useComponent.js
- function useComponent(components) {
- return external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- var _ref = components || {},
- slider = _ref.slider;
- return [slider || components_Slider];
- }, [components]);
- }
- ;// ./node_modules/@rc-component/color-picker/es/ColorPicker.js
- var HUE_COLORS = [{
- color: 'rgb(255, 0, 0)',
- percent: 0
- }, {
- color: 'rgb(255, 255, 0)',
- percent: 17
- }, {
- color: 'rgb(0, 255, 0)',
- percent: 33
- }, {
- color: 'rgb(0, 255, 255)',
- percent: 50
- }, {
- color: 'rgb(0, 0, 255)',
- percent: 67
- }, {
- color: 'rgb(255, 0, 255)',
- percent: 83
- }, {
- color: 'rgb(255, 0, 0)',
- percent: 100
- }];
- var ColorPicker = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
- var value = props.value,
- defaultValue = props.defaultValue,
- _props$prefixCls = props.prefixCls,
- prefixCls = _props$prefixCls === void 0 ? ColorPickerPrefixCls : _props$prefixCls,
- onChange = props.onChange,
- onChangeComplete = props.onChangeComplete,
- className = props.className,
- style = props.style,
- panelRender = props.panelRender,
- _props$disabledAlpha = props.disabledAlpha,
- disabledAlpha = _props$disabledAlpha === void 0 ? false : _props$disabledAlpha,
- _props$disabled = props.disabled,
- disabled = _props$disabled === void 0 ? false : _props$disabled,
- components = props.components;
- // ========================== Components ==========================
- var _useComponent = useComponent(components),
- _useComponent2 = (0,slicedToArray["default"])(_useComponent, 1),
- Slider = _useComponent2[0];
- // ============================ Color =============================
- var _useColorState = hooks_useColorState(defaultValue || defaultColor, value),
- _useColorState2 = (0,slicedToArray["default"])(_useColorState, 2),
- colorValue = _useColorState2[0],
- setColorValue = _useColorState2[1];
- var alphaColor = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
- return colorValue.setA(1).toRgbString();
- }, [colorValue]);
- // ============================ Events ============================
- var handleChange = function handleChange(data, type) {
- if (!value) {
- setColorValue(data);
- }
- onChange === null || onChange === void 0 || onChange(data, type);
- };
- // Convert
- var getHueColor = function getHueColor(hue) {
- return new Color(colorValue.setHue(hue));
- };
- var getAlphaColor = function getAlphaColor(alpha) {
- return new Color(colorValue.setA(alpha / 100));
- };
- // Slider change
- var onHueChange = function onHueChange(hue) {
- handleChange(getHueColor(hue), {
- type: 'hue',
- value: hue
- });
- };
- var onAlphaChange = function onAlphaChange(alpha) {
- handleChange(getAlphaColor(alpha), {
- type: 'alpha',
- value: alpha
- });
- };
- // Complete
- var onHueChangeComplete = function onHueChangeComplete(hue) {
- if (onChangeComplete) {
- onChangeComplete(getHueColor(hue));
- }
- };
- var onAlphaChangeComplete = function onAlphaChangeComplete(alpha) {
- if (onChangeComplete) {
- onChangeComplete(getAlphaColor(alpha));
- }
- };
- // ============================ Render ============================
- var mergeCls = classnames_default()("".concat(prefixCls, "-panel"), className, (0,defineProperty["default"])({}, "".concat(prefixCls, "-panel-disabled"), disabled));
- var sharedSliderProps = {
- prefixCls: prefixCls,
- disabled: disabled,
- color: colorValue
- };
- var defaultPanel = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_Picker, (0,esm_extends["default"])({
- onChange: handleChange
- }, sharedSliderProps, {
- onChangeComplete: onChangeComplete
- })), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: "".concat(prefixCls, "-slider-container")
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: classnames_default()("".concat(prefixCls, "-slider-group"), (0,defineProperty["default"])({}, "".concat(prefixCls, "-slider-group-disabled-alpha"), disabledAlpha))
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Slider, (0,esm_extends["default"])({}, sharedSliderProps, {
- type: "hue",
- colors: HUE_COLORS,
- min: 0,
- max: 359,
- value: colorValue.getHue(),
- onChange: onHueChange,
- onChangeComplete: onHueChangeComplete
- })), !disabledAlpha && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(Slider, (0,esm_extends["default"])({}, sharedSliderProps, {
- type: "alpha",
- colors: [{
- percent: 0,
- color: 'rgba(255, 0, 4, 0)'
- }, {
- percent: 100,
- color: alphaColor
- }],
- min: 0,
- max: 100,
- value: colorValue.a * 100,
- onChange: onAlphaChange,
- onChangeComplete: onAlphaChangeComplete
- }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(components_ColorBlock, {
- color: colorValue.toRgbString(),
- prefixCls: prefixCls
- })));
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
- className: mergeCls,
- style: style,
- ref: ref
- }, typeof panelRender === 'function' ? panelRender(defaultPanel) : defaultPanel);
- });
- if (true) {
- ColorPicker.displayName = 'ColorPicker';
- }
- /* harmony default export */ var es_ColorPicker = (ColorPicker);
- ;// ./node_modules/@rc-component/color-picker/es/interface.js
- ;// ./node_modules/@rc-component/color-picker/es/index.js
- /* harmony default export */ var color_picker_es = (es_ColorPicker);
- /***/ }),
- /***/ "./node_modules/classnames/index.js":
- /*!******************************************!*\
- !*** ./node_modules/classnames/index.js ***!
- \******************************************/
- /***/ (function(module, exports) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- /* global define */
- (function () {
- 'use strict';
- var hasOwn = {}.hasOwnProperty;
- function classNames () {
- var classes = '';
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (arg) {
- classes = appendClass(classes, parseValue(arg));
- }
- }
- return classes;
- }
- function parseValue (arg) {
- if (typeof arg === 'string' || typeof arg === 'number') {
- return arg;
- }
- if (typeof arg !== 'object') {
- return '';
- }
- if (Array.isArray(arg)) {
- return classNames.apply(null, arg);
- }
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
- return arg.toString();
- }
- var classes = '';
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes = appendClass(classes, key);
- }
- }
- return classes;
- }
- function appendClass (value, newClass) {
- if (!newClass) {
- return value;
- }
-
- if (value) {
- return value + ' ' + newClass;
- }
-
- return value + newClass;
- }
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else // removed by dead control flow
- {}
- }());
- /***/ }),
- /***/ "./node_modules/copy-to-clipboard/index.js":
- /*!*************************************************!*\
- !*** ./node_modules/copy-to-clipboard/index.js ***!
- \*************************************************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- var deselectCurrent = __webpack_require__(/*! toggle-selection */ "./node_modules/toggle-selection/index.js");
- var clipboardToIE11Formatting = {
- "text/plain": "Text",
- "text/html": "Url",
- "default": "Text"
- }
- var defaultMessage = "Copy to clipboard: #{key}, Enter";
- function format(message) {
- var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
- return message.replace(/#{\s*key\s*}/g, copyKey);
- }
- function copy(text, options) {
- var debug,
- message,
- reselectPrevious,
- range,
- selection,
- mark,
- success = false;
- if (!options) {
- options = {};
- }
- debug = options.debug || false;
- try {
- reselectPrevious = deselectCurrent();
- range = document.createRange();
- selection = document.getSelection();
- mark = document.createElement("span");
- mark.textContent = text;
- // avoid screen readers from reading out loud the text
- mark.ariaHidden = "true"
- // reset user styles for span element
- mark.style.all = "unset";
- // prevents scrolling to the end of the page
- mark.style.position = "fixed";
- mark.style.top = 0;
- mark.style.clip = "rect(0, 0, 0, 0)";
- // used to preserve spaces and line breaks
- mark.style.whiteSpace = "pre";
- // do not inherit user-select (it may be `none`)
- mark.style.webkitUserSelect = "text";
- mark.style.MozUserSelect = "text";
- mark.style.msUserSelect = "text";
- mark.style.userSelect = "text";
- mark.addEventListener("copy", function(e) {
- e.stopPropagation();
- if (options.format) {
- e.preventDefault();
- if (typeof e.clipboardData === "undefined") { // IE 11
- debug && console.warn("unable to use e.clipboardData");
- debug && console.warn("trying IE specific stuff");
- window.clipboardData.clearData();
- var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]
- window.clipboardData.setData(format, text);
- } else { // all other browsers
- e.clipboardData.clearData();
- e.clipboardData.setData(options.format, text);
- }
- }
- if (options.onCopy) {
- e.preventDefault();
- options.onCopy(e.clipboardData);
- }
- });
- document.body.appendChild(mark);
- range.selectNodeContents(mark);
- selection.addRange(range);
- var successful = document.execCommand("copy");
- if (!successful) {
- throw new Error("copy command was unsuccessful");
- }
- success = true;
- } catch (err) {
- debug && console.error("unable to copy using execCommand: ", err);
- debug && console.warn("trying IE specific stuff");
- try {
- window.clipboardData.setData(options.format || "text", text);
- options.onCopy && options.onCopy(window.clipboardData);
- success = true;
- } catch (err) {
- debug && console.error("unable to copy using clipboardData: ", err);
- debug && console.error("falling back to prompt");
- message = format("message" in options ? options.message : defaultMessage);
- window.prompt(message, text);
- }
- } finally {
- if (selection) {
- if (typeof selection.removeRange == "function") {
- selection.removeRange(range);
- } else {
- selection.removeAllRanges();
- }
- }
- if (mark) {
- document.body.removeChild(mark);
- }
- reselectPrevious();
- }
- return success;
- }
- module.exports = copy;
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/advancedFormat.js":
- /*!*****************************************************!*\
- !*** ./node_modules/dayjs/plugin/advancedFormat.js ***!
- \*****************************************************/
- /***/ (function(module) {
- !function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return n.bind(this)(a)}}}));
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/customParseFormat.js":
- /*!********************************************************!*\
- !*** ./node_modules/dayjs/plugin/customParseFormat.js ***!
- \********************************************************/
- /***/ (function(module) {
- !function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,s={},a=function(e){return(e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},c={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,f("seconds")],ss:[i,f("seconds")],m:[i,f("minutes")],mm:[i,f("minutes")],H:[i,f("hours")],h:[i,f("hours")],HH:[i,f("hours")],hh:[i,f("hours")],D:[i,f("day")],DD:[r,f("day")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],w:[i,f("week")],ww:[r,f("week")],M:[i,f("month")],MM:[r,f("month")],MMM:[o,function(e){var t=u("months"),n=(u("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(e){var t=u("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,f("year")],YY:[r,function(e){this.year=a(e)}],YYYY:[/\d{4}/,f("year")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if("string"==typeof i)r+=i.length;else{var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if("string"==typeof a){var f=!0===o[2],h=!0===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date("")}}(t,a,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),s={}}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(""))}else i.call(this,e)}}}));
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/localeData.js":
- /*!*************************************************!*\
- !*** ./node_modules/dayjs/plugin/localeData.js ***!
- \*************************************************/
- /***/ (function(module) {
- !function(n,e){ true?module.exports=e():0}(this,(function(){"use strict";return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return{months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return{firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)}}}));
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/weekOfYear.js":
- /*!*************************************************!*\
- !*** ./node_modules/dayjs/plugin/weekOfYear.js ***!
- \*************************************************/
- /***/ (function(module) {
- !function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}));
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/weekYear.js":
- /*!***********************************************!*\
- !*** ./node_modules/dayjs/plugin/weekYear.js ***!
- \***********************************************/
- /***/ (function(module) {
- !function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return 1===t&&11===e?n+1:0===e&&t>=52?n-1:n}}}));
- /***/ }),
- /***/ "./node_modules/dayjs/plugin/weekday.js":
- /*!**********************************************!*\
- !*** ./node_modules/dayjs/plugin/weekday.js ***!
- \**********************************************/
- /***/ (function(module) {
- !function(e,t){ true?module.exports=t():0}(this,(function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day")}}}));
- /***/ }),
- /***/ "./node_modules/json2mq/index.js":
- /*!***************************************!*\
- !*** ./node_modules/json2mq/index.js ***!
- \***************************************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var camel2hyphen = __webpack_require__(/*! string-convert/camel2hyphen */ "./node_modules/string-convert/camel2hyphen.js");
- var isDimension = function (feature) {
- var re = /[height|width]$/;
- return re.test(feature);
- };
- var obj2mq = function (obj) {
- var mq = '';
- var features = Object.keys(obj);
- features.forEach(function (feature, index) {
- var value = obj[feature];
- feature = camel2hyphen(feature);
- // Add px to dimension features
- if (isDimension(feature) && typeof value === 'number') {
- value = value + 'px';
- }
- if (value === true) {
- mq += feature;
- } else if (value === false) {
- mq += 'not ' + feature;
- } else {
- mq += '(' + feature + ': ' + value + ')';
- }
- if (index < features.length-1) {
- mq += ' and '
- }
- });
- return mq;
- };
- var json2mq = function (query) {
- var mq = '';
- if (typeof query === 'string') {
- return query;
- }
- // Handling array of media queries
- if (query instanceof Array) {
- query.forEach(function (q, index) {
- mq += obj2mq(q);
- if (index < query.length-1) {
- mq += ', '
- }
- });
- return mq;
- }
- // Handling single media query
- return obj2mq(query);
- };
- module.exports = json2mq;
- /***/ }),
- /***/ "./node_modules/rc-motion/es/index.js":
- /*!*********************************************************!*\
- !*** ./node_modules/rc-motion/es/index.js + 13 modules ***!
- \*********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, {
- CSSMotionList: function() { return /* reexport */ CSSMotionList; },
- Provider: function() { return /* reexport */ MotionProvider; },
- "default": function() { return /* binding */ rc_motion_es; }
- });
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
- var defineProperty = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
- var objectSpread2 = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
- var slicedToArray = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
- var esm_typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/typeof.js");
- // EXTERNAL MODULE: ./node_modules/classnames/index.js
- var classnames = __webpack_require__("./node_modules/classnames/index.js");
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/findDOMNode.js
- var findDOMNode = __webpack_require__("./node_modules/rc-util/es/Dom/findDOMNode.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/ref.js
- var es_ref = __webpack_require__("./node_modules/rc-util/es/ref.js");
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("react");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
- var objectWithoutProperties = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js");
- ;// ./node_modules/rc-motion/es/context.js
- var _excluded = ["children"];
- var Context = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext({});
- function MotionProvider(_ref) {
- var children = _ref.children,
- props = (0,objectWithoutProperties["default"])(_ref, _excluded);
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Context.Provider, {
- value: props
- }, children);
- }
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
- var classCallCheck = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
- var createClass = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createClass.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
- var inherits = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/inherits.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
- var createSuper = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/createSuper.js");
- ;// ./node_modules/rc-motion/es/DomWrapper.js
- var DomWrapper = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(DomWrapper, _React$Component);
- var _super = (0,createSuper["default"])(DomWrapper);
- function DomWrapper() {
- (0,classCallCheck["default"])(this, DomWrapper);
- return _super.apply(this, arguments);
- }
- (0,createClass["default"])(DomWrapper, [{
- key: "render",
- value: function render() {
- return this.props.children;
- }
- }]);
- return DomWrapper;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- /* harmony default export */ var es_DomWrapper = (DomWrapper);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/index.js
- var es = __webpack_require__("./node_modules/rc-util/es/index.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useState.js
- var useState = __webpack_require__("./node_modules/rc-util/es/hooks/useState.js");
- // EXTERNAL MODULE: ./node_modules/rc-util/es/hooks/useEvent.js
- var useEvent = __webpack_require__("./node_modules/rc-util/es/hooks/useEvent.js");
- ;// ./node_modules/rc-util/es/hooks/useSyncState.js
- /**
- * Same as React.useState but will always get latest state.
- * This is useful when React merge multiple state updates into one.
- * e.g. onTransitionEnd trigger multiple event at once will be merged state update in React.
- */
- function useSyncState(defaultValue) {
- var _React$useReducer = external_root_React_commonjs2_react_commonjs_react_amd_react_.useReducer(function (x) {
- return x + 1;
- }, 0),
- _React$useReducer2 = (0,slicedToArray["default"])(_React$useReducer, 2),
- forceUpdate = _React$useReducer2[1];
- var currentValueRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(defaultValue);
- var getValue = (0,useEvent["default"])(function () {
- return currentValueRef.current;
- });
- var setValue = (0,useEvent["default"])(function (updater) {
- currentValueRef.current = typeof updater === 'function' ? updater(currentValueRef.current) : updater;
- forceUpdate();
- });
- return [getValue, setValue];
- }
- ;// ./node_modules/rc-motion/es/interface.js
- var STATUS_NONE = 'none';
- var STATUS_APPEAR = 'appear';
- var STATUS_ENTER = 'enter';
- var STATUS_LEAVE = 'leave';
- var STEP_NONE = 'none';
- var STEP_PREPARE = 'prepare';
- var STEP_START = 'start';
- var STEP_ACTIVE = 'active';
- var STEP_ACTIVATED = 'end';
- /**
- * Used for disabled motion case.
- * Prepare stage will still work but start & active will be skipped.
- */
- var STEP_PREPARED = 'prepared';
- // EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/canUseDom.js
- var canUseDom = __webpack_require__("./node_modules/rc-util/es/Dom/canUseDom.js");
- ;// ./node_modules/rc-motion/es/util/motion.js
- // ================= Transition =================
- // Event wrapper. Copy from react source code
- function makePrefixMap(styleProp, eventName) {
- var prefixes = {};
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
- prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName);
- prefixes["Moz".concat(styleProp)] = "moz".concat(eventName);
- prefixes["ms".concat(styleProp)] = "MS".concat(eventName);
- prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase());
- return prefixes;
- }
- function getVendorPrefixes(domSupport, win) {
- var prefixes = {
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
- };
- if (domSupport) {
- if (!('AnimationEvent' in win)) {
- delete prefixes.animationend.animation;
- }
- if (!('TransitionEvent' in win)) {
- delete prefixes.transitionend.transition;
- }
- }
- return prefixes;
- }
- var vendorPrefixes = getVendorPrefixes((0,canUseDom["default"])(), typeof window !== 'undefined' ? window : {});
- var style = {};
- if ((0,canUseDom["default"])()) {
- var _document$createEleme = document.createElement('div');
- style = _document$createEleme.style;
- }
- var prefixedEventNames = {};
- function getVendorPrefixedEventName(eventName) {
- if (prefixedEventNames[eventName]) {
- return prefixedEventNames[eventName];
- }
- var prefixMap = vendorPrefixes[eventName];
- if (prefixMap) {
- var stylePropList = Object.keys(prefixMap);
- var len = stylePropList.length;
- for (var i = 0; i < len; i += 1) {
- var styleProp = stylePropList[i];
- if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
- prefixedEventNames[eventName] = prefixMap[styleProp];
- return prefixedEventNames[eventName];
- }
- }
- }
- return '';
- }
- var internalAnimationEndName = getVendorPrefixedEventName('animationend');
- var internalTransitionEndName = getVendorPrefixedEventName('transitionend');
- var supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
- var animationEndName = internalAnimationEndName || 'animationend';
- var transitionEndName = internalTransitionEndName || 'transitionend';
- function getTransitionName(transitionName, transitionType) {
- if (!transitionName) return null;
- if ((0,esm_typeof["default"])(transitionName) === 'object') {
- var type = transitionType.replace(/-\w/g, function (match) {
- return match[1].toUpperCase();
- });
- return transitionName[type];
- }
- return "".concat(transitionName, "-").concat(transitionType);
- }
- ;// ./node_modules/rc-motion/es/hooks/useDomMotionEvents.js
- /* harmony default export */ var useDomMotionEvents = (function (onInternalMotionEnd) {
- var cacheElementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // Remove events
- function removeMotionEvents(element) {
- if (element) {
- element.removeEventListener(transitionEndName, onInternalMotionEnd);
- element.removeEventListener(animationEndName, onInternalMotionEnd);
- }
- }
- // Patch events
- function patchMotionEvents(element) {
- if (cacheElementRef.current && cacheElementRef.current !== element) {
- removeMotionEvents(cacheElementRef.current);
- }
- if (element && element !== cacheElementRef.current) {
- element.addEventListener(transitionEndName, onInternalMotionEnd);
- element.addEventListener(animationEndName, onInternalMotionEnd);
- // Save as cache in case dom removed trigger by `motionDeadline`
- cacheElementRef.current = element;
- }
- }
- // Clean up when removed
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- removeMotionEvents(cacheElementRef.current);
- };
- }, []);
- return [patchMotionEvents, removeMotionEvents];
- });
- ;// ./node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js
- // It's safe to use `useLayoutEffect` but the warning is annoying
- var useIsomorphicLayoutEffect = (0,canUseDom["default"])() ? external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect : external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect;
- /* harmony default export */ var hooks_useIsomorphicLayoutEffect = (useIsomorphicLayoutEffect);
- // EXTERNAL MODULE: ./node_modules/rc-util/es/raf.js
- var raf = __webpack_require__("./node_modules/rc-util/es/raf.js");
- ;// ./node_modules/rc-motion/es/hooks/useNextFrame.js
- /* harmony default export */ var useNextFrame = (function () {
- var nextFrameRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(null);
- function cancelNextFrame() {
- raf["default"].cancel(nextFrameRef.current);
- }
- function nextFrame(callback) {
- var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
- cancelNextFrame();
- var nextFrameId = (0,raf["default"])(function () {
- if (delay <= 1) {
- callback({
- isCanceled: function isCanceled() {
- return nextFrameId !== nextFrameRef.current;
- }
- });
- } else {
- nextFrame(callback, delay - 1);
- }
- });
- nextFrameRef.current = nextFrameId;
- }
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- cancelNextFrame();
- };
- }, []);
- return [nextFrame, cancelNextFrame];
- });
- ;// ./node_modules/rc-motion/es/hooks/useStepQueue.js
- var FULL_STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
- var SIMPLE_STEP_QUEUE = [STEP_PREPARE, STEP_PREPARED];
- /** Skip current step */
- var SkipStep = false;
- /** Current step should be update in */
- var DoStep = true;
- function isActive(step) {
- return step === STEP_ACTIVE || step === STEP_ACTIVATED;
- }
- /* harmony default export */ var useStepQueue = (function (status, prepareOnly, callback) {
- var _useState = (0,useState["default"])(STEP_NONE),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- step = _useState2[0],
- setStep = _useState2[1];
- var _useNextFrame = useNextFrame(),
- _useNextFrame2 = (0,slicedToArray["default"])(_useNextFrame, 2),
- nextFrame = _useNextFrame2[0],
- cancelNextFrame = _useNextFrame2[1];
- function startQueue() {
- setStep(STEP_PREPARE, true);
- }
- var STEP_QUEUE = prepareOnly ? SIMPLE_STEP_QUEUE : FULL_STEP_QUEUE;
- hooks_useIsomorphicLayoutEffect(function () {
- if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
- var index = STEP_QUEUE.indexOf(step);
- var nextStep = STEP_QUEUE[index + 1];
- var result = callback(step);
- if (result === SkipStep) {
- // Skip when no needed
- setStep(nextStep, true);
- } else if (nextStep) {
- // Do as frame for step update
- nextFrame(function (info) {
- function doNext() {
- // Skip since current queue is ood
- if (info.isCanceled()) return;
- setStep(nextStep, true);
- }
- if (result === true) {
- doNext();
- } else {
- // Only promise should be async
- Promise.resolve(result).then(doNext);
- }
- });
- }
- }
- }, [status, step]);
- external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect(function () {
- return function () {
- cancelNextFrame();
- };
- }, []);
- return [startQueue, step];
- });
- ;// ./node_modules/rc-motion/es/hooks/useStatus.js
- function useStatus(supportMotion, visible, getElement, _ref) {
- var _ref$motionEnter = _ref.motionEnter,
- motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter,
- _ref$motionAppear = _ref.motionAppear,
- motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear,
- _ref$motionLeave = _ref.motionLeave,
- motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave,
- motionDeadline = _ref.motionDeadline,
- motionLeaveImmediately = _ref.motionLeaveImmediately,
- onAppearPrepare = _ref.onAppearPrepare,
- onEnterPrepare = _ref.onEnterPrepare,
- onLeavePrepare = _ref.onLeavePrepare,
- onAppearStart = _ref.onAppearStart,
- onEnterStart = _ref.onEnterStart,
- onLeaveStart = _ref.onLeaveStart,
- onAppearActive = _ref.onAppearActive,
- onEnterActive = _ref.onEnterActive,
- onLeaveActive = _ref.onLeaveActive,
- onAppearEnd = _ref.onAppearEnd,
- onEnterEnd = _ref.onEnterEnd,
- onLeaveEnd = _ref.onLeaveEnd,
- onVisibleChanged = _ref.onVisibleChanged;
- // Used for outer render usage to avoid `visible: false & status: none` to render nothing
- var _useState = (0,useState["default"])(),
- _useState2 = (0,slicedToArray["default"])(_useState, 2),
- asyncVisible = _useState2[0],
- setAsyncVisible = _useState2[1];
- var _useSyncState = useSyncState(STATUS_NONE),
- _useSyncState2 = (0,slicedToArray["default"])(_useSyncState, 2),
- getStatus = _useSyncState2[0],
- setStatus = _useSyncState2[1];
- var _useState3 = (0,useState["default"])(null),
- _useState4 = (0,slicedToArray["default"])(_useState3, 2),
- style = _useState4[0],
- setStyle = _useState4[1];
- var currentStatus = getStatus();
- var mountedRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- var deadlineRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // =========================== Dom Node ===========================
- function getDomElement() {
- return getElement();
- }
- // ========================== Motion End ==========================
- var activeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
- /**
- * Clean up status & style
- */
- function updateMotionEndStatus() {
- setStatus(STATUS_NONE);
- setStyle(null, true);
- }
- var onInternalMotionEnd = (0,es.useEvent)(function (event) {
- var status = getStatus();
- // Do nothing since not in any transition status.
- // This may happen when `motionDeadline` trigger.
- if (status === STATUS_NONE) {
- return;
- }
- var element = getDomElement();
- if (event && !event.deadline && event.target !== element) {
- // event exists
- // not initiated by deadline
- // transitionEnd not fired by inner elements
- return;
- }
- var currentActive = activeRef.current;
- var canEnd;
- if (status === STATUS_APPEAR && currentActive) {
- canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event);
- } else if (status === STATUS_ENTER && currentActive) {
- canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event);
- } else if (status === STATUS_LEAVE && currentActive) {
- canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event);
- }
- // Only update status when `canEnd` and not destroyed
- if (currentActive && canEnd !== false) {
- updateMotionEndStatus();
- }
- });
- var _useDomMotionEvents = useDomMotionEvents(onInternalMotionEnd),
- _useDomMotionEvents2 = (0,slicedToArray["default"])(_useDomMotionEvents, 1),
- patchMotionEvents = _useDomMotionEvents2[0];
- // ============================= Step =============================
- var getEventHandlers = function getEventHandlers(targetStatus) {
- switch (targetStatus) {
- case STATUS_APPEAR:
- return (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, STEP_PREPARE, onAppearPrepare), STEP_START, onAppearStart), STEP_ACTIVE, onAppearActive);
- case STATUS_ENTER:
- return (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, STEP_PREPARE, onEnterPrepare), STEP_START, onEnterStart), STEP_ACTIVE, onEnterActive);
- case STATUS_LEAVE:
- return (0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, STEP_PREPARE, onLeavePrepare), STEP_START, onLeaveStart), STEP_ACTIVE, onLeaveActive);
- default:
- return {};
- }
- };
- var eventHandlers = external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo(function () {
- return getEventHandlers(currentStatus);
- }, [currentStatus]);
- var _useStepQueue = useStepQueue(currentStatus, !supportMotion, function (newStep) {
- // Only prepare step can be skip
- if (newStep === STEP_PREPARE) {
- var onPrepare = eventHandlers[STEP_PREPARE];
- if (!onPrepare) {
- return SkipStep;
- }
- return onPrepare(getDomElement());
- }
- // Rest step is sync update
- if (step in eventHandlers) {
- var _eventHandlers$step;
- setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null);
- }
- if (step === STEP_ACTIVE && currentStatus !== STATUS_NONE) {
- // Patch events when motion needed
- patchMotionEvents(getDomElement());
- if (motionDeadline > 0) {
- clearTimeout(deadlineRef.current);
- deadlineRef.current = setTimeout(function () {
- onInternalMotionEnd({
- deadline: true
- });
- }, motionDeadline);
- }
- }
- if (step === STEP_PREPARED) {
- updateMotionEndStatus();
- }
- return DoStep;
- }),
- _useStepQueue2 = (0,slicedToArray["default"])(_useStepQueue, 2),
- startStep = _useStepQueue2[0],
- step = _useStepQueue2[1];
- var active = isActive(step);
- activeRef.current = active;
- // ============================ Status ============================
- var visibleRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
- // Update with new status
- hooks_useIsomorphicLayoutEffect(function () {
- // When use Suspense, the `visible` will repeat trigger,
- // But not real change of the `visible`, we need to skip it.
- // https://github.com/ant-design/ant-design/issues/44379
- if (mountedRef.current && visibleRef.current === visible) {
- return;
- }
- setAsyncVisible(visible);
- var isMounted = mountedRef.current;
- mountedRef.current = true;
- // if (!supportMotion) {
- // return;
- // }
- var nextStatus;
- // Appear
- if (!isMounted && visible && motionAppear) {
- nextStatus = STATUS_APPEAR;
- }
- // Enter
- if (isMounted && visible && motionEnter) {
- nextStatus = STATUS_ENTER;
- }
- // Leave
- if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
- nextStatus = STATUS_LEAVE;
- }
- var nextEventHandlers = getEventHandlers(nextStatus);
- // Update to next status
- if (nextStatus && (supportMotion || nextEventHandlers[STEP_PREPARE])) {
- setStatus(nextStatus);
- startStep();
- } else {
- // Set back in case no motion but prev status has prepare step
- setStatus(STATUS_NONE);
- }
- visibleRef.current = visible;
- }, [visible]);
- // ============================ Effect ============================
- // Reset when motion changed
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- if (
- // Cancel appear
- currentStatus === STATUS_APPEAR && !motionAppear ||
- // Cancel enter
- currentStatus === STATUS_ENTER && !motionEnter ||
- // Cancel leave
- currentStatus === STATUS_LEAVE && !motionLeave) {
- setStatus(STATUS_NONE);
- }
- }, [motionAppear, motionEnter, motionLeave]);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- return function () {
- mountedRef.current = false;
- clearTimeout(deadlineRef.current);
- };
- }, []);
- // Trigger `onVisibleChanged`
- var firstMountChangeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(false);
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
- // [visible & motion not end] => [!visible & motion end] still need trigger onVisibleChanged
- if (asyncVisible) {
- firstMountChangeRef.current = true;
- }
- if (asyncVisible !== undefined && currentStatus === STATUS_NONE) {
- // Skip first render is invisible since it's nothing changed
- if (firstMountChangeRef.current || asyncVisible) {
- onVisibleChanged === null || onVisibleChanged === void 0 || onVisibleChanged(asyncVisible);
- }
- firstMountChangeRef.current = true;
- }
- }, [asyncVisible, currentStatus]);
- // ============================ Styles ============================
- var mergedStyle = style;
- if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
- mergedStyle = (0,objectSpread2["default"])({
- transition: 'none'
- }, mergedStyle);
- }
- return [currentStatus, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible];
- }
- ;// ./node_modules/rc-motion/es/CSSMotion.js
- /* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */
- /**
- * `transitionSupport` is used for none transition test case.
- * Default we use browser transition event support check.
- */
- function genCSSMotion(config) {
- var transitionSupport = config;
- if ((0,esm_typeof["default"])(config) === 'object') {
- transitionSupport = config.transitionSupport;
- }
- function isSupportTransition(props, contextMotion) {
- return !!(props.motionName && transitionSupport && contextMotion !== false);
- }
- var CSSMotion = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef(function (props, ref) {
- var _props$visible = props.visible,
- visible = _props$visible === void 0 ? true : _props$visible,
- _props$removeOnLeave = props.removeOnLeave,
- removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,
- forceRender = props.forceRender,
- children = props.children,
- motionName = props.motionName,
- leavedClassName = props.leavedClassName,
- eventProps = props.eventProps;
- var _React$useContext = external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext(Context),
- contextMotion = _React$useContext.motion;
- var supportMotion = isSupportTransition(props, contextMotion);
- // Ref to the react node, it may be a HTMLElement
- var nodeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- // Ref to the dom wrapper in case ref can not pass to HTMLElement
- var wrapperNodeRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)();
- function getDomElement() {
- try {
- // Here we're avoiding call for findDOMNode since it's deprecated
- // in strict mode. We're calling it only when node ref is not
- // an instance of DOM HTMLElement. Otherwise use
- // findDOMNode as a final resort
- return nodeRef.current instanceof HTMLElement ? nodeRef.current : (0,findDOMNode["default"])(wrapperNodeRef.current);
- } catch (e) {
- // Only happen when `motionDeadline` trigger but element removed.
- return null;
- }
- }
- var _useStatus = useStatus(supportMotion, visible, getDomElement, props),
- _useStatus2 = (0,slicedToArray["default"])(_useStatus, 4),
- status = _useStatus2[0],
- statusStep = _useStatus2[1],
- statusStyle = _useStatus2[2],
- mergedVisible = _useStatus2[3];
- // Record whether content has rendered
- // Will return null for un-rendered even when `removeOnLeave={false}`
- var renderedRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef(mergedVisible);
- if (mergedVisible) {
- renderedRef.current = true;
- }
- // ====================== Refs ======================
- var setNodeRef = external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback(function (node) {
- nodeRef.current = node;
- (0,es_ref.fillRef)(ref, node);
- }, [ref]);
- // ===================== Render =====================
- var motionChildren;
- var mergedProps = (0,objectSpread2["default"])((0,objectSpread2["default"])({}, eventProps), {}, {
- visible: visible
- });
- if (!children) {
- // No children
- motionChildren = null;
- } else if (status === STATUS_NONE) {
- // Stable children
- if (mergedVisible) {
- motionChildren = children((0,objectSpread2["default"])({}, mergedProps), setNodeRef);
- } else if (!removeOnLeave && renderedRef.current && leavedClassName) {
- motionChildren = children((0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedProps), {}, {
- className: leavedClassName
- }), setNodeRef);
- } else if (forceRender || !removeOnLeave && !leavedClassName) {
- motionChildren = children((0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedProps), {}, {
- style: {
- display: 'none'
- }
- }), setNodeRef);
- } else {
- motionChildren = null;
- }
- } else {
- // In motion
- var statusSuffix;
- if (statusStep === STEP_PREPARE) {
- statusSuffix = 'prepare';
- } else if (isActive(statusStep)) {
- statusSuffix = 'active';
- } else if (statusStep === STEP_START) {
- statusSuffix = 'start';
- }
- var motionCls = getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix));
- motionChildren = children((0,objectSpread2["default"])((0,objectSpread2["default"])({}, mergedProps), {}, {
- className: classnames_default()(getTransitionName(motionName, status), (0,defineProperty["default"])((0,defineProperty["default"])({}, motionCls, motionCls && statusSuffix), motionName, typeof motionName === 'string')),
- style: statusStyle
- }), setNodeRef);
- }
- // Auto inject ref if child node not have `ref` props
- if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(motionChildren) && (0,es_ref.supportRef)(motionChildren)) {
- var originNodeRef = (0,es_ref.getNodeRef)(motionChildren);
- if (!originNodeRef) {
- motionChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement(motionChildren, {
- ref: setNodeRef
- });
- }
- }
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(es_DomWrapper, {
- ref: wrapperNodeRef
- }, motionChildren);
- });
- CSSMotion.displayName = 'CSSMotion';
- return CSSMotion;
- }
- /* harmony default export */ var es_CSSMotion = (genCSSMotion(supportTransition));
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
- var esm_extends = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/extends.js");
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
- var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
- ;// ./node_modules/rc-motion/es/util/diff.js
- var STATUS_ADD = 'add';
- var STATUS_KEEP = 'keep';
- var STATUS_REMOVE = 'remove';
- var STATUS_REMOVED = 'removed';
- function wrapKeyToObject(key) {
- var keyObj;
- if (key && (0,esm_typeof["default"])(key) === 'object' && 'key' in key) {
- keyObj = key;
- } else {
- keyObj = {
- key: key
- };
- }
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, keyObj), {}, {
- key: String(keyObj.key)
- });
- }
- function parseKeys() {
- var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return keys.map(wrapKeyToObject);
- }
- function diffKeys() {
- var prevKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var currentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var list = [];
- var currentIndex = 0;
- var currentLen = currentKeys.length;
- var prevKeyObjects = parseKeys(prevKeys);
- var currentKeyObjects = parseKeys(currentKeys);
- // Check prev keys to insert or keep
- prevKeyObjects.forEach(function (keyObj) {
- var hit = false;
- for (var i = currentIndex; i < currentLen; i += 1) {
- var currentKeyObj = currentKeyObjects[i];
- if (currentKeyObj.key === keyObj.key) {
- // New added keys should add before current key
- if (currentIndex < i) {
- list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function (obj) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, obj), {}, {
- status: STATUS_ADD
- });
- }));
- currentIndex = i;
- }
- list.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, currentKeyObj), {}, {
- status: STATUS_KEEP
- }));
- currentIndex += 1;
- hit = true;
- break;
- }
- }
- // If not hit, it means key is removed
- if (!hit) {
- list.push((0,objectSpread2["default"])((0,objectSpread2["default"])({}, keyObj), {}, {
- status: STATUS_REMOVE
- }));
- }
- });
- // Add rest to the list
- if (currentIndex < currentLen) {
- list = list.concat(currentKeyObjects.slice(currentIndex).map(function (obj) {
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, obj), {}, {
- status: STATUS_ADD
- });
- }));
- }
- /**
- * Merge same key when it remove and add again:
- * [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
- */
- var keys = {};
- list.forEach(function (_ref) {
- var key = _ref.key;
- keys[key] = (keys[key] || 0) + 1;
- });
- var duplicatedKeys = Object.keys(keys).filter(function (key) {
- return keys[key] > 1;
- });
- duplicatedKeys.forEach(function (matchKey) {
- // Remove `STATUS_REMOVE` node.
- list = list.filter(function (_ref2) {
- var key = _ref2.key,
- status = _ref2.status;
- return key !== matchKey || status !== STATUS_REMOVE;
- });
- // Update `STATUS_ADD` to `STATUS_KEEP`
- list.forEach(function (node) {
- if (node.key === matchKey) {
- // eslint-disable-next-line no-param-reassign
- node.status = STATUS_KEEP;
- }
- });
- });
- return list;
- }
- ;// ./node_modules/rc-motion/es/CSSMotionList.js
- var CSSMotionList_excluded = ["component", "children", "onVisibleChanged", "onAllRemoved"],
- _excluded2 = ["status"];
- /* eslint react/prop-types: 0 */
- var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearPrepare', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];
- /**
- * Generate a CSSMotionList component with config
- * @param transitionSupport No need since CSSMotionList no longer depends on transition support
- * @param CSSMotion CSSMotion component
- */
- function genCSSMotionList(transitionSupport) {
- var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : es_CSSMotion;
- var CSSMotionList = /*#__PURE__*/function (_React$Component) {
- (0,inherits["default"])(CSSMotionList, _React$Component);
- var _super = (0,createSuper["default"])(CSSMotionList);
- function CSSMotionList() {
- var _this;
- (0,classCallCheck["default"])(this, CSSMotionList);
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(args));
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "state", {
- keyEntities: []
- });
- // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.
- (0,defineProperty["default"])((0,assertThisInitialized["default"])(_this), "removeKey", function (removeKey) {
- _this.setState(function (prevState) {
- var nextKeyEntities = prevState.keyEntities.map(function (entity) {
- if (entity.key !== removeKey) return entity;
- return (0,objectSpread2["default"])((0,objectSpread2["default"])({}, entity), {}, {
- status: STATUS_REMOVED
- });
- });
- return {
- keyEntities: nextKeyEntities
- };
- }, function () {
- var keyEntities = _this.state.keyEntities;
- var restKeysCount = keyEntities.filter(function (_ref) {
- var status = _ref.status;
- return status !== STATUS_REMOVED;
- }).length;
- if (restKeysCount === 0 && _this.props.onAllRemoved) {
- _this.props.onAllRemoved();
- }
- });
- });
- return _this;
- }
- (0,createClass["default"])(CSSMotionList, [{
- key: "render",
- value: function render() {
- var _this2 = this;
- var keyEntities = this.state.keyEntities;
- var _this$props = this.props,
- component = _this$props.component,
- children = _this$props.children,
- _onVisibleChanged = _this$props.onVisibleChanged,
- onAllRemoved = _this$props.onAllRemoved,
- restProps = (0,objectWithoutProperties["default"])(_this$props, CSSMotionList_excluded);
- var Component = component || external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment;
- var motionProps = {};
- MOTION_PROP_NAMES.forEach(function (prop) {
- motionProps[prop] = restProps[prop];
- delete restProps[prop];
- });
- delete restProps.keys;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(Component, restProps, keyEntities.map(function (_ref2, index) {
- var status = _ref2.status,
- eventProps = (0,objectWithoutProperties["default"])(_ref2, _excluded2);
- var visible = status === STATUS_ADD || status === STATUS_KEEP;
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.createElement(CSSMotion, (0,esm_extends["default"])({}, motionProps, {
- key: eventProps.key,
- visible: visible,
- eventProps: eventProps,
- onVisibleChanged: function onVisibleChanged(changedVisible) {
- _onVisibleChanged === null || _onVisibleChanged === void 0 || _onVisibleChanged(changedVisible, {
- key: eventProps.key
- });
- if (!changedVisible) {
- _this2.removeKey(eventProps.key);
- }
- }
- }), function (props, ref) {
- return children((0,objectSpread2["default"])((0,objectSpread2["default"])({}, props), {}, {
- index: index
- }), ref);
- });
- }));
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function getDerivedStateFromProps(_ref3, _ref4) {
- var keys = _ref3.keys;
- var keyEntities = _ref4.keyEntities;
- var parsedKeyObjects = parseKeys(keys);
- var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
- return {
- keyEntities: mixedKeyEntities.filter(function (entity) {
- var prevEntity = keyEntities.find(function (_ref5) {
- var key = _ref5.key;
- return entity.key === key;
- });
- // Remove if already mark as removed
- if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
- return false;
- }
- return true;
- })
- };
- }
- }]);
- return CSSMotionList;
- }(external_root_React_commonjs2_react_commonjs_react_amd_react_.Component);
- (0,defineProperty["default"])(CSSMotionList, "defaultProps", {
- component: 'div'
- });
- return CSSMotionList;
- }
- /* harmony default export */ var CSSMotionList = (genCSSMotionList(supportTransition));
- ;// ./node_modules/rc-motion/es/index.js
- /* harmony default export */ var rc_motion_es = (es_CSSMotion);
- /***/ }),
- /***/ "./node_modules/rc-pagination/es/locale/en_US.js":
- /*!*******************************************************!*\
- !*** ./node_modules/rc-pagination/es/locale/en_US.js ***!
- \*******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- var locale = {
- // Options
- items_per_page: '/ page',
- jump_to: 'Go to',
- jump_to_confirm: 'confirm',
- page: 'Page',
- // Pagination
- prev_page: 'Previous Page',
- next_page: 'Next Page',
- prev_5: 'Previous 5 Pages',
- next_5: 'Next 5 Pages',
- prev_3: 'Previous 3 Pages',
- next_3: 'Next 3 Pages',
- page_size: 'Page Size'
- };
- /* harmony default export */ __webpack_exports__["default"] = (locale);
- /***/ }),
- /***/ "./node_modules/rc-pagination/es/locale/zh_CN.js":
- /*!*******************************************************!*\
- !*** ./node_modules/rc-pagination/es/locale/zh_CN.js ***!
- \*******************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- var locale = {
- // Options
- items_per_page: '条/页',
- jump_to: '跳至',
- jump_to_confirm: '确定',
- page: '页',
- // Pagination
- prev_page: '上一页',
- next_page: '下一页',
- prev_5: '向前 5 页',
- next_5: '向后 5 页',
- prev_3: '向前 3 页',
- next_3: '向后 3 页',
- page_size: '页码'
- };
- /* harmony default export */ __webpack_exports__["default"] = (locale);
- /***/ }),
- /***/ "./node_modules/rc-picker/es/locale/common.js":
- /*!****************************************************!*\
- !*** ./node_modules/rc-picker/es/locale/common.js ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ commonLocale: function() { return /* binding */ commonLocale; }
- /* harmony export */ });
- var commonLocale = {
- yearFormat: 'YYYY',
- dayFormat: 'D',
- cellMeridiemFormat: 'A',
- monthBeforeYear: true
- };
- /***/ }),
- /***/ "./node_modules/rc-util/es/Children/toArray.js":
- /*!*****************************************************!*\
- !*** ./node_modules/rc-util/es/Children/toArray.js ***!
- \*****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ toArray; }
- /* harmony export */ });
- /* harmony import */ var _React_isFragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../React/isFragment */ "./node_modules/rc-util/es/React/isFragment.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- function toArray(children) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var ret = [];
- react__WEBPACK_IMPORTED_MODULE_1___default().Children.forEach(children, function (child) {
- if ((child === undefined || child === null) && !option.keepEmpty) {
- return;
- }
- if (Array.isArray(child)) {
- ret = ret.concat(toArray(child));
- } else if ((0,_React_isFragment__WEBPACK_IMPORTED_MODULE_0__["default"])(child) && child.props) {
- ret = ret.concat(toArray(child.props.children, option));
- } else {
- ret.push(child);
- }
- });
- return ret;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/Dom/canUseDom.js":
- /*!**************************************************!*\
- !*** ./node_modules/rc-util/es/Dom/canUseDom.js ***!
- \**************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ canUseDom; }
- /* harmony export */ });
- function canUseDom() {
- return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/Dom/contains.js":
- /*!*************************************************!*\
- !*** ./node_modules/rc-util/es/Dom/contains.js ***!
- \*************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ contains; }
- /* harmony export */ });
- function contains(root, n) {
- if (!root) {
- return false;
- }
- // Use native if support
- if (root.contains) {
- return root.contains(n);
- }
- // `document.contains` not support with IE11
- var node = n;
- while (node) {
- if (node === root) {
- return true;
- }
- node = node.parentNode;
- }
- return false;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/Dom/dynamicCSS.js":
- /*!***************************************************!*\
- !*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
- \***************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ removeCSS: function() { return /* binding */ removeCSS; },
- /* harmony export */ updateCSS: function() { return /* binding */ updateCSS; }
- /* harmony export */ });
- /* unused harmony exports injectCSS, clearContainerCache */
- /* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- /* harmony import */ var _canUseDom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./canUseDom */ "./node_modules/rc-util/es/Dom/canUseDom.js");
- /* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contains */ "./node_modules/rc-util/es/Dom/contains.js");
- var APPEND_ORDER = 'data-rc-order';
- var APPEND_PRIORITY = 'data-rc-priority';
- var MARK_KEY = "rc-util-key";
- var containerCache = new Map();
- function getMark() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- mark = _ref.mark;
- if (mark) {
- return mark.startsWith('data-') ? mark : "data-".concat(mark);
- }
- return MARK_KEY;
- }
- function getContainer(option) {
- if (option.attachTo) {
- return option.attachTo;
- }
- var head = document.querySelector('head');
- return head || document.body;
- }
- function getOrder(prepend) {
- if (prepend === 'queue') {
- return 'prependQueue';
- }
- return prepend ? 'prepend' : 'append';
- }
- /**
- * Find style which inject by rc-util
- */
- function findStyles(container) {
- return Array.from((containerCache.get(container) || container).children).filter(function (node) {
- return node.tagName === 'STYLE';
- });
- }
- function injectCSS(css) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (!(0,_canUseDom__WEBPACK_IMPORTED_MODULE_1__["default"])()) {
- return null;
- }
- var csp = option.csp,
- prepend = option.prepend,
- _option$priority = option.priority,
- priority = _option$priority === void 0 ? 0 : _option$priority;
- var mergedOrder = getOrder(prepend);
- var isPrependQueue = mergedOrder === 'prependQueue';
- var styleNode = document.createElement('style');
- styleNode.setAttribute(APPEND_ORDER, mergedOrder);
- if (isPrependQueue && priority) {
- styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
- }
- if (csp !== null && csp !== void 0 && csp.nonce) {
- styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
- }
- styleNode.innerHTML = css;
- var container = getContainer(option);
- var firstChild = container.firstChild;
- if (prepend) {
- // If is queue `prepend`, it will prepend first style and then append rest style
- if (isPrependQueue) {
- var existStyle = (option.styles || findStyles(container)).filter(function (node) {
- // Ignore style which not injected by rc-util with prepend
- if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
- return false;
- }
- // Ignore style which priority less then new style
- var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
- return priority >= nodePriority;
- });
- if (existStyle.length) {
- container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
- return styleNode;
- }
- }
- // Use `insertBefore` as `prepend`
- container.insertBefore(styleNode, firstChild);
- } else {
- container.appendChild(styleNode);
- }
- return styleNode;
- }
- function findExistNode(key) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var container = getContainer(option);
- return (option.styles || findStyles(container)).find(function (node) {
- return node.getAttribute(getMark(option)) === key;
- });
- }
- function removeCSS(key) {
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var existNode = findExistNode(key, option);
- if (existNode) {
- var container = getContainer(option);
- container.removeChild(existNode);
- }
- }
- /**
- * qiankun will inject `appendChild` to insert into other
- */
- function syncRealContainer(container, option) {
- var cachedRealContainer = containerCache.get(container);
- // Find real container when not cached or cached container removed
- if (!cachedRealContainer || !(0,_contains__WEBPACK_IMPORTED_MODULE_2__["default"])(document, cachedRealContainer)) {
- var placeholderStyle = injectCSS('', option);
- var parentNode = placeholderStyle.parentNode;
- containerCache.set(container, parentNode);
- container.removeChild(placeholderStyle);
- }
- }
- /**
- * manually clear container cache to avoid global cache in unit testes
- */
- function clearContainerCache() {
- containerCache.clear();
- }
- function updateCSS(css, key) {
- var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- var container = getContainer(originOption);
- var styles = findStyles(container);
- var option = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, originOption), {}, {
- styles: styles
- });
- // Sync real parent
- syncRealContainer(container, option);
- var existNode = findExistNode(key, option);
- if (existNode) {
- var _option$csp, _option$csp2;
- if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
- var _option$csp3;
- existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
- }
- if (existNode.innerHTML !== css) {
- existNode.innerHTML = css;
- }
- return existNode;
- }
- var newNode = injectCSS(css, option);
- newNode.setAttribute(getMark(option), key);
- return newNode;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/Dom/findDOMNode.js":
- /*!****************************************************!*\
- !*** ./node_modules/rc-util/es/Dom/findDOMNode.js ***!
- \****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ findDOMNode; },
- /* harmony export */ getDOM: function() { return /* binding */ getDOM; },
- /* harmony export */ isDOM: function() { return /* binding */ isDOM; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
- function isDOM(node) {
- // https://developer.mozilla.org/en-US/docs/Web/API/Element
- // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement
- return node instanceof HTMLElement || node instanceof SVGElement;
- }
- /**
- * Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
- */
- function getDOM(node) {
- if (node && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(node) === 'object' && isDOM(node.nativeElement)) {
- return node.nativeElement;
- }
- if (isDOM(node)) {
- return node;
- }
- return null;
- }
- /**
- * Return if a node is a DOM node. Else will return by `findDOMNode`
- */
- function findDOMNode(node) {
- var domNode = getDOM(node);
- if (domNode) {
- return domNode;
- }
- if (node instanceof (react__WEBPACK_IMPORTED_MODULE_1___default().Component)) {
- var _ReactDOM$findDOMNode;
- return (_ReactDOM$findDOMNode = (react_dom__WEBPACK_IMPORTED_MODULE_2___default().findDOMNode)) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call((react_dom__WEBPACK_IMPORTED_MODULE_2___default()), node);
- }
- return null;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/Dom/shadow.js":
- /*!***********************************************!*\
- !*** ./node_modules/rc-util/es/Dom/shadow.js ***!
- \***********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ getShadowRoot: function() { return /* binding */ getShadowRoot; }
- /* harmony export */ });
- /* unused harmony export inShadow */
- function getRoot(ele) {
- var _ele$getRootNode;
- return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele);
- }
- /**
- * Check if is in shadowRoot
- */
- function inShadow(ele) {
- return getRoot(ele) instanceof ShadowRoot;
- }
- /**
- * Return shadowRoot if possible
- */
- function getShadowRoot(ele) {
- return inShadow(ele) ? getRoot(ele) : null;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/KeyCode.js":
- /*!********************************************!*\
- !*** ./node_modules/rc-util/es/KeyCode.js ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- /**
- * @ignore
- * some key-codes definition and utils from closure-library
- * @author yiminghe@gmail.com
- */
- var KeyCode = {
- /**
- * MAC_ENTER
- */
- MAC_ENTER: 3,
- /**
- * BACKSPACE
- */
- BACKSPACE: 8,
- /**
- * TAB
- */
- TAB: 9,
- /**
- * NUMLOCK on FF/Safari Mac
- */
- NUM_CENTER: 12,
- // NUMLOCK on FF/Safari Mac
- /**
- * ENTER
- */
- ENTER: 13,
- /**
- * SHIFT
- */
- SHIFT: 16,
- /**
- * CTRL
- */
- CTRL: 17,
- /**
- * ALT
- */
- ALT: 18,
- /**
- * PAUSE
- */
- PAUSE: 19,
- /**
- * CAPS_LOCK
- */
- CAPS_LOCK: 20,
- /**
- * ESC
- */
- ESC: 27,
- /**
- * SPACE
- */
- SPACE: 32,
- /**
- * PAGE_UP
- */
- PAGE_UP: 33,
- // also NUM_NORTH_EAST
- /**
- * PAGE_DOWN
- */
- PAGE_DOWN: 34,
- // also NUM_SOUTH_EAST
- /**
- * END
- */
- END: 35,
- // also NUM_SOUTH_WEST
- /**
- * HOME
- */
- HOME: 36,
- // also NUM_NORTH_WEST
- /**
- * LEFT
- */
- LEFT: 37,
- // also NUM_WEST
- /**
- * UP
- */
- UP: 38,
- // also NUM_NORTH
- /**
- * RIGHT
- */
- RIGHT: 39,
- // also NUM_EAST
- /**
- * DOWN
- */
- DOWN: 40,
- // also NUM_SOUTH
- /**
- * PRINT_SCREEN
- */
- PRINT_SCREEN: 44,
- /**
- * INSERT
- */
- INSERT: 45,
- // also NUM_INSERT
- /**
- * DELETE
- */
- DELETE: 46,
- // also NUM_DELETE
- /**
- * ZERO
- */
- ZERO: 48,
- /**
- * ONE
- */
- ONE: 49,
- /**
- * TWO
- */
- TWO: 50,
- /**
- * THREE
- */
- THREE: 51,
- /**
- * FOUR
- */
- FOUR: 52,
- /**
- * FIVE
- */
- FIVE: 53,
- /**
- * SIX
- */
- SIX: 54,
- /**
- * SEVEN
- */
- SEVEN: 55,
- /**
- * EIGHT
- */
- EIGHT: 56,
- /**
- * NINE
- */
- NINE: 57,
- /**
- * QUESTION_MARK
- */
- QUESTION_MARK: 63,
- // needs localization
- /**
- * A
- */
- A: 65,
- /**
- * B
- */
- B: 66,
- /**
- * C
- */
- C: 67,
- /**
- * D
- */
- D: 68,
- /**
- * E
- */
- E: 69,
- /**
- * F
- */
- F: 70,
- /**
- * G
- */
- G: 71,
- /**
- * H
- */
- H: 72,
- /**
- * I
- */
- I: 73,
- /**
- * J
- */
- J: 74,
- /**
- * K
- */
- K: 75,
- /**
- * L
- */
- L: 76,
- /**
- * M
- */
- M: 77,
- /**
- * N
- */
- N: 78,
- /**
- * O
- */
- O: 79,
- /**
- * P
- */
- P: 80,
- /**
- * Q
- */
- Q: 81,
- /**
- * R
- */
- R: 82,
- /**
- * S
- */
- S: 83,
- /**
- * T
- */
- T: 84,
- /**
- * U
- */
- U: 85,
- /**
- * V
- */
- V: 86,
- /**
- * W
- */
- W: 87,
- /**
- * X
- */
- X: 88,
- /**
- * Y
- */
- Y: 89,
- /**
- * Z
- */
- Z: 90,
- /**
- * META
- */
- META: 91,
- // WIN_KEY_LEFT
- /**
- * WIN_KEY_RIGHT
- */
- WIN_KEY_RIGHT: 92,
- /**
- * CONTEXT_MENU
- */
- CONTEXT_MENU: 93,
- /**
- * NUM_ZERO
- */
- NUM_ZERO: 96,
- /**
- * NUM_ONE
- */
- NUM_ONE: 97,
- /**
- * NUM_TWO
- */
- NUM_TWO: 98,
- /**
- * NUM_THREE
- */
- NUM_THREE: 99,
- /**
- * NUM_FOUR
- */
- NUM_FOUR: 100,
- /**
- * NUM_FIVE
- */
- NUM_FIVE: 101,
- /**
- * NUM_SIX
- */
- NUM_SIX: 102,
- /**
- * NUM_SEVEN
- */
- NUM_SEVEN: 103,
- /**
- * NUM_EIGHT
- */
- NUM_EIGHT: 104,
- /**
- * NUM_NINE
- */
- NUM_NINE: 105,
- /**
- * NUM_MULTIPLY
- */
- NUM_MULTIPLY: 106,
- /**
- * NUM_PLUS
- */
- NUM_PLUS: 107,
- /**
- * NUM_MINUS
- */
- NUM_MINUS: 109,
- /**
- * NUM_PERIOD
- */
- NUM_PERIOD: 110,
- /**
- * NUM_DIVISION
- */
- NUM_DIVISION: 111,
- /**
- * F1
- */
- F1: 112,
- /**
- * F2
- */
- F2: 113,
- /**
- * F3
- */
- F3: 114,
- /**
- * F4
- */
- F4: 115,
- /**
- * F5
- */
- F5: 116,
- /**
- * F6
- */
- F6: 117,
- /**
- * F7
- */
- F7: 118,
- /**
- * F8
- */
- F8: 119,
- /**
- * F9
- */
- F9: 120,
- /**
- * F10
- */
- F10: 121,
- /**
- * F11
- */
- F11: 122,
- /**
- * F12
- */
- F12: 123,
- /**
- * NUMLOCK
- */
- NUMLOCK: 144,
- /**
- * SEMICOLON
- */
- SEMICOLON: 186,
- // needs localization
- /**
- * DASH
- */
- DASH: 189,
- // needs localization
- /**
- * EQUALS
- */
- EQUALS: 187,
- // needs localization
- /**
- * COMMA
- */
- COMMA: 188,
- // needs localization
- /**
- * PERIOD
- */
- PERIOD: 190,
- // needs localization
- /**
- * SLASH
- */
- SLASH: 191,
- // needs localization
- /**
- * APOSTROPHE
- */
- APOSTROPHE: 192,
- // needs localization
- /**
- * SINGLE_QUOTE
- */
- SINGLE_QUOTE: 222,
- // needs localization
- /**
- * OPEN_SQUARE_BRACKET
- */
- OPEN_SQUARE_BRACKET: 219,
- // needs localization
- /**
- * BACKSLASH
- */
- BACKSLASH: 220,
- // needs localization
- /**
- * CLOSE_SQUARE_BRACKET
- */
- CLOSE_SQUARE_BRACKET: 221,
- // needs localization
- /**
- * WIN_KEY
- */
- WIN_KEY: 224,
- /**
- * MAC_FF_META
- */
- MAC_FF_META: 224,
- // Firefox (Gecko) fires this for the meta key instead of 91
- /**
- * WIN_IME
- */
- WIN_IME: 229,
- // ======================== Function ========================
- /**
- * whether text and modified key is entered at the same time.
- */
- isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
- var keyCode = e.keyCode;
- if (e.altKey && !e.ctrlKey || e.metaKey ||
- // Function keys don't generate text
- keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
- return false;
- }
- // The following keys are quite harmless, even in combination with
- // CTRL, ALT or SHIFT.
- switch (keyCode) {
- case KeyCode.ALT:
- case KeyCode.CAPS_LOCK:
- case KeyCode.CONTEXT_MENU:
- case KeyCode.CTRL:
- case KeyCode.DOWN:
- case KeyCode.END:
- case KeyCode.ESC:
- case KeyCode.HOME:
- case KeyCode.INSERT:
- case KeyCode.LEFT:
- case KeyCode.MAC_FF_META:
- case KeyCode.META:
- case KeyCode.NUMLOCK:
- case KeyCode.NUM_CENTER:
- case KeyCode.PAGE_DOWN:
- case KeyCode.PAGE_UP:
- case KeyCode.PAUSE:
- case KeyCode.PRINT_SCREEN:
- case KeyCode.RIGHT:
- case KeyCode.SHIFT:
- case KeyCode.UP:
- case KeyCode.WIN_KEY:
- case KeyCode.WIN_KEY_RIGHT:
- return false;
- default:
- return true;
- }
- },
- /**
- * whether character is entered.
- */
- isCharacterKey: function isCharacterKey(keyCode) {
- if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
- return true;
- }
- if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
- return true;
- }
- if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
- return true;
- }
- // Safari sends zero key code for non-latin characters.
- if (window.navigator.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
- return true;
- }
- switch (keyCode) {
- case KeyCode.SPACE:
- case KeyCode.QUESTION_MARK:
- case KeyCode.NUM_PLUS:
- case KeyCode.NUM_MINUS:
- case KeyCode.NUM_PERIOD:
- case KeyCode.NUM_DIVISION:
- case KeyCode.SEMICOLON:
- case KeyCode.DASH:
- case KeyCode.EQUALS:
- case KeyCode.COMMA:
- case KeyCode.PERIOD:
- case KeyCode.SLASH:
- case KeyCode.APOSTROPHE:
- case KeyCode.SINGLE_QUOTE:
- case KeyCode.OPEN_SQUARE_BRACKET:
- case KeyCode.BACKSLASH:
- case KeyCode.CLOSE_SQUARE_BRACKET:
- return true;
- default:
- return false;
- }
- }
- };
- /* harmony default export */ __webpack_exports__["default"] = (KeyCode);
- /***/ }),
- /***/ "./node_modules/rc-util/es/React/isFragment.js":
- /*!*****************************************************!*\
- !*** ./node_modules/rc-util/es/React/isFragment.js ***!
- \*****************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ isFragment; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- var REACT_ELEMENT_TYPE_18 = Symbol.for('react.element');
- var REACT_ELEMENT_TYPE_19 = Symbol.for('react.transitional.element');
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
- /**
- * Compatible with React 18 or 19 to check if node is a Fragment.
- */
- function isFragment(object) {
- return (
- // Base object type
- object && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(object) === 'object' && (
- // React Element type
- object.$$typeof === REACT_ELEMENT_TYPE_18 || object.$$typeof === REACT_ELEMENT_TYPE_19) &&
- // React Fragment type
- object.type === REACT_FRAGMENT_TYPE
- );
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/hooks/useEvent.js":
- /*!***************************************************!*\
- !*** ./node_modules/rc-util/es/hooks/useEvent.js ***!
- \***************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useEvent; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- function useEvent(callback) {
- var fnRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
- fnRef.current = callback;
- var memoFn = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () {
- var _fnRef$current;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
- }, []);
- return memoFn;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/hooks/useLayoutEffect.js":
- /*!**********************************************************!*\
- !*** ./node_modules/rc-util/es/hooks/useLayoutEffect.js ***!
- \**********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ useLayoutUpdateEffect: function() { return /* binding */ useLayoutUpdateEffect; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _Dom_canUseDom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Dom/canUseDom */ "./node_modules/rc-util/es/Dom/canUseDom.js");
- /**
- * Wrap `React.useLayoutEffect` which will not throw warning message in test env
- */
- var useInternalLayoutEffect = true && (0,_Dom_canUseDom__WEBPACK_IMPORTED_MODULE_1__["default"])() ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
- var useLayoutEffect = function useLayoutEffect(callback, deps) {
- var firstMountRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(true);
- useInternalLayoutEffect(function () {
- return callback(firstMountRef.current);
- }, deps);
- // We tell react that first mount has passed
- useInternalLayoutEffect(function () {
- firstMountRef.current = false;
- return function () {
- firstMountRef.current = true;
- };
- }, []);
- };
- var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
- useLayoutEffect(function (firstMount) {
- if (!firstMount) {
- return callback();
- }
- }, deps);
- };
- /* harmony default export */ __webpack_exports__["default"] = (useLayoutEffect);
- /***/ }),
- /***/ "./node_modules/rc-util/es/hooks/useMemo.js":
- /*!**************************************************!*\
- !*** ./node_modules/rc-util/es/hooks/useMemo.js ***!
- \**************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useMemo; }
- /* harmony export */ });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- function useMemo(getValue, condition, shouldUpdate) {
- var cacheRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef({});
- if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
- cacheRef.current.value = getValue();
- cacheRef.current.condition = condition;
- }
- return cacheRef.current.value;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/hooks/useMergedState.js":
- /*!*********************************************************!*\
- !*** ./node_modules/rc-util/es/hooks/useMergedState.js ***!
- \*********************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useMergedState; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- /* harmony import */ var _useEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useEvent */ "./node_modules/rc-util/es/hooks/useEvent.js");
- /* harmony import */ var _useLayoutEffect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useLayoutEffect */ "./node_modules/rc-util/es/hooks/useLayoutEffect.js");
- /* harmony import */ var _useState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./useState */ "./node_modules/rc-util/es/hooks/useState.js");
- /** We only think `undefined` is empty */
- function hasValue(value) {
- return value !== undefined;
- }
- /**
- * Similar to `useState` but will use props value if provided.
- * Note that internal use rc-util `useState` hook.
- */
- function useMergedState(defaultStateValue, option) {
- var _ref = option || {},
- defaultValue = _ref.defaultValue,
- value = _ref.value,
- onChange = _ref.onChange,
- postState = _ref.postState;
- // ======================= Init =======================
- var _useState = (0,_useState__WEBPACK_IMPORTED_MODULE_3__["default"])(function () {
- if (hasValue(value)) {
- return value;
- } else if (hasValue(defaultValue)) {
- return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
- } else {
- return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
- }
- }),
- _useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState, 2),
- innerValue = _useState2[0],
- setInnerValue = _useState2[1];
- var mergedValue = value !== undefined ? value : innerValue;
- var postMergedValue = postState ? postState(mergedValue) : mergedValue;
- // ====================== Change ======================
- var onChangeFn = (0,_useEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(onChange);
- var _useState3 = (0,_useState__WEBPACK_IMPORTED_MODULE_3__["default"])([mergedValue]),
- _useState4 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_useState3, 2),
- prevValue = _useState4[0],
- setPrevValue = _useState4[1];
- (0,_useLayoutEffect__WEBPACK_IMPORTED_MODULE_2__.useLayoutUpdateEffect)(function () {
- var prev = prevValue[0];
- if (innerValue !== prev) {
- onChangeFn(innerValue, prev);
- }
- }, [prevValue]);
- // Sync value back to `undefined` when it from control to un-control
- (0,_useLayoutEffect__WEBPACK_IMPORTED_MODULE_2__.useLayoutUpdateEffect)(function () {
- if (!hasValue(value)) {
- setInnerValue(value);
- }
- }, [value]);
- // ====================== Update ======================
- var triggerChange = (0,_useEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(function (updater, ignoreDestroy) {
- setInnerValue(updater, ignoreDestroy);
- setPrevValue([mergedValue], ignoreDestroy);
- });
- return [postMergedValue, triggerChange];
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/hooks/useState.js":
- /*!***************************************************!*\
- !*** ./node_modules/rc-util/es/hooks/useState.js ***!
- \***************************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ useSafeState; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /**
- * Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
- * We do not make this auto is to avoid real memory leak.
- * Developer should confirm it's safe to ignore themselves.
- */
- function useSafeState(defaultValue) {
- var destroyRef = react__WEBPACK_IMPORTED_MODULE_1__.useRef(false);
- var _React$useState = react__WEBPACK_IMPORTED_MODULE_1__.useState(defaultValue),
- _React$useState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_React$useState, 2),
- value = _React$useState2[0],
- setValue = _React$useState2[1];
- react__WEBPACK_IMPORTED_MODULE_1__.useEffect(function () {
- destroyRef.current = false;
- return function () {
- destroyRef.current = true;
- };
- }, []);
- function safeSetState(updater, ignoreDestroy) {
- if (ignoreDestroy && destroyRef.current) {
- return;
- }
- setValue(updater);
- }
- return [value, safeSetState];
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/index.js":
- /*!******************************************!*\
- !*** ./node_modules/rc-util/es/index.js ***!
- \******************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ get: function() { return /* reexport safe */ _utils_get__WEBPACK_IMPORTED_MODULE_3__["default"]; },
- /* harmony export */ set: function() { return /* reexport safe */ _utils_set__WEBPACK_IMPORTED_MODULE_4__["default"]; },
- /* harmony export */ useEvent: function() { return /* reexport safe */ _hooks_useEvent__WEBPACK_IMPORTED_MODULE_0__["default"]; },
- /* harmony export */ useMergedState: function() { return /* reexport safe */ _hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__["default"]; },
- /* harmony export */ warning: function() { return /* reexport safe */ _warning__WEBPACK_IMPORTED_MODULE_5__["default"]; }
- /* harmony export */ });
- /* harmony import */ var _hooks_useEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hooks/useEvent */ "./node_modules/rc-util/es/hooks/useEvent.js");
- /* harmony import */ var _hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hooks/useMergedState */ "./node_modules/rc-util/es/hooks/useMergedState.js");
- /* harmony import */ var _ref__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ref */ "./node_modules/rc-util/es/ref.js");
- /* harmony import */ var _utils_get__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/get */ "./node_modules/rc-util/es/utils/get.js");
- /* harmony import */ var _utils_set__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/set */ "./node_modules/rc-util/es/utils/set.js");
- /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./warning */ "./node_modules/rc-util/es/warning.js");
- /***/ }),
- /***/ "./node_modules/rc-util/es/isEqual.js":
- /*!********************************************!*\
- !*** ./node_modules/rc-util/es/isEqual.js ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- /* harmony import */ var _warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./warning */ "./node_modules/rc-util/es/warning.js");
- /**
- * Deeply compares two object literals.
- * @param obj1 object 1
- * @param obj2 object 2
- * @param shallow shallow compare
- * @returns
- */
- function isEqual(obj1, obj2) {
- var shallow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
- var refSet = new Set();
- function deepEqual(a, b) {
- var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
- var circular = refSet.has(a);
- (0,_warning__WEBPACK_IMPORTED_MODULE_1__["default"])(!circular, 'Warning: There may be circular references');
- if (circular) {
- return false;
- }
- if (a === b) {
- return true;
- }
- if (shallow && level > 1) {
- return false;
- }
- refSet.add(a);
- var newLevel = level + 1;
- if (Array.isArray(a)) {
- if (!Array.isArray(b) || a.length !== b.length) {
- return false;
- }
- for (var i = 0; i < a.length; i++) {
- if (!deepEqual(a[i], b[i], newLevel)) {
- return false;
- }
- }
- return true;
- }
- if (a && b && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(a) === 'object' && (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(b) === 'object') {
- var keys = Object.keys(a);
- if (keys.length !== Object.keys(b).length) {
- return false;
- }
- return keys.every(function (key) {
- return deepEqual(a[key], b[key], newLevel);
- });
- }
- // other
- return false;
- }
- return deepEqual(obj1, obj2);
- }
- /* harmony default export */ __webpack_exports__["default"] = (isEqual);
- /***/ }),
- /***/ "./node_modules/rc-util/es/omit.js":
- /*!*****************************************!*\
- !*** ./node_modules/rc-util/es/omit.js ***!
- \*****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ omit; }
- /* harmony export */ });
- function omit(obj, fields) {
- var clone = Object.assign({}, obj);
- if (Array.isArray(fields)) {
- fields.forEach(function (key) {
- delete clone[key];
- });
- }
- return clone;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/pickAttrs.js":
- /*!**********************************************!*\
- !*** ./node_modules/rc-util/es/pickAttrs.js ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ pickAttrs; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- var attributes = "accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap";
- var eventsName = "onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError";
- var propList = "".concat(attributes, " ").concat(eventsName).split(/[\s\n]+/);
- /* eslint-enable max-len */
- var ariaPrefix = 'aria-';
- var dataPrefix = 'data-';
- function match(key, prefix) {
- return key.indexOf(prefix) === 0;
- }
- /**
- * Picker props from exist props with filter
- * @param props Passed props
- * @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
- */
- function pickAttrs(props) {
- var ariaOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var mergedConfig;
- if (ariaOnly === false) {
- mergedConfig = {
- aria: true,
- data: true,
- attr: true
- };
- } else if (ariaOnly === true) {
- mergedConfig = {
- aria: true
- };
- } else {
- mergedConfig = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, ariaOnly);
- }
- var attrs = {};
- Object.keys(props).forEach(function (key) {
- if (
- // Aria
- mergedConfig.aria && (key === 'role' || match(key, ariaPrefix)) ||
- // Data
- mergedConfig.data && match(key, dataPrefix) ||
- // Attr
- mergedConfig.attr && propList.includes(key)) {
- attrs[key] = props[key];
- }
- });
- return attrs;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/raf.js":
- /*!****************************************!*\
- !*** ./node_modules/rc-util/es/raf.js ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__) {
- "use strict";
- var raf = function raf(callback) {
- return +setTimeout(callback, 16);
- };
- var caf = function caf(num) {
- return clearTimeout(num);
- };
- if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
- raf = function raf(callback) {
- return window.requestAnimationFrame(callback);
- };
- caf = function caf(handle) {
- return window.cancelAnimationFrame(handle);
- };
- }
- var rafUUID = 0;
- var rafIds = new Map();
- function cleanup(id) {
- rafIds.delete(id);
- }
- var wrapperRaf = function wrapperRaf(callback) {
- var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
- rafUUID += 1;
- var id = rafUUID;
- function callRef(leftTimes) {
- if (leftTimes === 0) {
- // Clean up
- cleanup(id);
- // Trigger
- callback();
- } else {
- // Next raf
- var realId = raf(function () {
- callRef(leftTimes - 1);
- });
- // Bind real raf id
- rafIds.set(id, realId);
- }
- }
- callRef(times);
- return id;
- };
- wrapperRaf.cancel = function (id) {
- var realId = rafIds.get(id);
- cleanup(id);
- return caf(realId);
- };
- if (true) {
- wrapperRaf.ids = function () {
- return rafIds;
- };
- }
- /* harmony default export */ __webpack_exports__["default"] = (wrapperRaf);
- /***/ }),
- /***/ "./node_modules/rc-util/es/ref.js":
- /*!****************************************!*\
- !*** ./node_modules/rc-util/es/ref.js ***!
- \****************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ composeRef: function() { return /* binding */ composeRef; },
- /* harmony export */ fillRef: function() { return /* binding */ fillRef; },
- /* harmony export */ getNodeRef: function() { return /* binding */ getNodeRef; },
- /* harmony export */ supportNodeRef: function() { return /* binding */ supportNodeRef; },
- /* harmony export */ supportRef: function() { return /* binding */ supportRef; },
- /* harmony export */ useComposeRef: function() { return /* binding */ useComposeRef; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-is */ "./node_modules/rc-util/node_modules/react-is/index.js");
- /* harmony import */ var _hooks_useMemo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks/useMemo */ "./node_modules/rc-util/es/hooks/useMemo.js");
- /* harmony import */ var _React_isFragment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./React/isFragment */ "./node_modules/rc-util/es/React/isFragment.js");
- var ReactMajorVersion = Number(react__WEBPACK_IMPORTED_MODULE_1__.version.split('.')[0]);
- var fillRef = function fillRef(ref, node) {
- if (typeof ref === 'function') {
- ref(node);
- } else if ((0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(ref) === 'object' && ref && 'current' in ref) {
- ref.current = node;
- }
- };
- /**
- * Merge refs into one ref function to support ref passing.
- */
- var composeRef = function composeRef() {
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
- refs[_key] = arguments[_key];
- }
- var refList = refs.filter(Boolean);
- if (refList.length <= 1) {
- return refList[0];
- }
- return function (node) {
- refs.forEach(function (ref) {
- fillRef(ref, node);
- });
- };
- };
- var useComposeRef = function useComposeRef() {
- for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- refs[_key2] = arguments[_key2];
- }
- return (0,_hooks_useMemo__WEBPACK_IMPORTED_MODULE_3__["default"])(function () {
- return composeRef.apply(void 0, refs);
- }, refs, function (prev, next) {
- return prev.length !== next.length || prev.every(function (ref, i) {
- return ref !== next[i];
- });
- });
- };
- var supportRef = function supportRef(nodeOrComponent) {
- var _type$prototype, _nodeOrComponent$prot;
- if (!nodeOrComponent) {
- return false;
- }
- // React 19 no need `forwardRef` anymore. So just pass if is a React element.
- if (isReactElement(nodeOrComponent) && ReactMajorVersion >= 19) {
- return true;
- }
- var type = (0,react_is__WEBPACK_IMPORTED_MODULE_2__.isMemo)(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
- // Function component node
- if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== react_is__WEBPACK_IMPORTED_MODULE_2__.ForwardRef) {
- return false;
- }
- // Class component
- if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== react_is__WEBPACK_IMPORTED_MODULE_2__.ForwardRef) {
- return false;
- }
- return true;
- };
- function isReactElement(node) {
- return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(node) && !(0,_React_isFragment__WEBPACK_IMPORTED_MODULE_4__["default"])(node);
- }
- var supportNodeRef = function supportNodeRef(node) {
- return isReactElement(node) && supportRef(node);
- };
- /**
- * In React 19. `ref` is not a property from node.
- * But a property from `props.ref`.
- * To check if `props.ref` exist or fallback to `ref`.
- */
- var getNodeRef = function getNodeRef(node) {
- if (node && isReactElement(node)) {
- var ele = node;
- // Source from:
- // https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/getReactNodeRef/getReactNodeRef.ts
- return ele.props.propertyIsEnumerable('ref') ? ele.props.ref : ele.ref;
- }
- return null;
- };
- /***/ }),
- /***/ "./node_modules/rc-util/es/utils/get.js":
- /*!**********************************************!*\
- !*** ./node_modules/rc-util/es/utils/get.js ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ get; }
- /* harmony export */ });
- function get(entity, path) {
- var current = entity;
- for (var i = 0; i < path.length; i += 1) {
- if (current === null || current === undefined) {
- return undefined;
- }
- current = current[path[i]];
- }
- return current;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/utils/set.js":
- /*!**********************************************!*\
- !*** ./node_modules/rc-util/es/utils/set.js ***!
- \**********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": function() { return /* binding */ set; },
- /* harmony export */ merge: function() { return /* binding */ merge; }
- /* harmony export */ });
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
- /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toConsumableArray */ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js");
- /* harmony import */ var _babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toArray */ "./node_modules/@babel/runtime/helpers/esm/toArray.js");
- /* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./get */ "./node_modules/rc-util/es/utils/get.js");
- function internalSet(entity, paths, value, removeIfUndefined) {
- if (!paths.length) {
- return value;
- }
- var _paths = (0,_babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_3__["default"])(paths),
- path = _paths[0],
- restPath = _paths.slice(1);
- var clone;
- if (!entity && typeof path === 'number') {
- clone = [];
- } else if (Array.isArray(entity)) {
- clone = (0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(entity);
- } else {
- clone = (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["default"])({}, entity);
- }
- // Delete prop if `removeIfUndefined` and value is undefined
- if (removeIfUndefined && value === undefined && restPath.length === 1) {
- delete clone[path][restPath[0]];
- } else {
- clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
- }
- return clone;
- }
- function set(entity, paths, value) {
- var removeIfUndefined = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- // Do nothing if `removeIfUndefined` and parent object not exist
- if (paths.length && removeIfUndefined && value === undefined && !(0,_get__WEBPACK_IMPORTED_MODULE_4__["default"])(entity, paths.slice(0, -1))) {
- return entity;
- }
- return internalSet(entity, paths, value, removeIfUndefined);
- }
- function isObject(obj) {
- return (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(obj) === 'object' && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
- }
- function createEmpty(source) {
- return Array.isArray(source) ? [] : {};
- }
- var keys = typeof Reflect === 'undefined' ? Object.keys : Reflect.ownKeys;
- /**
- * Merge objects which will create
- */
- function merge() {
- for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
- sources[_key] = arguments[_key];
- }
- var clone = createEmpty(sources[0]);
- sources.forEach(function (src) {
- function internalMerge(path, parentLoopSet) {
- var loopSet = new Set(parentLoopSet);
- var value = (0,_get__WEBPACK_IMPORTED_MODULE_4__["default"])(src, path);
- var isArr = Array.isArray(value);
- if (isArr || isObject(value)) {
- // Only add not loop obj
- if (!loopSet.has(value)) {
- loopSet.add(value);
- var originValue = (0,_get__WEBPACK_IMPORTED_MODULE_4__["default"])(clone, path);
- if (isArr) {
- // Array will always be override
- clone = set(clone, path, []);
- } else if (!originValue || (0,_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["default"])(originValue) !== 'object') {
- // Init container if not exist
- clone = set(clone, path, createEmpty(value));
- }
- keys(value).forEach(function (key) {
- internalMerge([].concat((0,_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__["default"])(path), [key]), loopSet);
- });
- }
- } else {
- clone = set(clone, path, value);
- }
- }
- internalMerge([]);
- });
- return clone;
- }
- /***/ }),
- /***/ "./node_modules/rc-util/es/warning.js":
- /*!********************************************!*\
- !*** ./node_modules/rc-util/es/warning.js ***!
- \********************************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ noteOnce: function() { return /* binding */ noteOnce; },
- /* harmony export */ resetWarned: function() { return /* binding */ resetWarned; },
- /* harmony export */ warning: function() { return /* binding */ warning; }
- /* harmony export */ });
- /* unused harmony exports preMessage, note, call, warningOnce */
- /* eslint-disable no-console */
- var warned = {};
- var preWarningFns = [];
- /**
- * Pre warning enable you to parse content before console.error.
- * Modify to null will prevent warning.
- */
- var preMessage = function preMessage(fn) {
- preWarningFns.push(fn);
- };
- /**
- * Warning if condition not match.
- * @param valid Condition
- * @param message Warning message
- * @example
- * ```js
- * warning(false, 'some error'); // print some error
- * warning(true, 'some error'); // print nothing
- * warning(1 === 2, 'some error'); // print some error
- * ```
- */
- function warning(valid, message) {
- if ( true && !valid && console !== undefined) {
- var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
- return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
- }, message);
- if (finalMessage) {
- console.error("Warning: ".concat(finalMessage));
- }
- }
- }
- /** @see Similar to {@link warning} */
- function note(valid, message) {
- if ( true && !valid && console !== undefined) {
- var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
- return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
- }, message);
- if (finalMessage) {
- console.warn("Note: ".concat(finalMessage));
- }
- }
- }
- function resetWarned() {
- warned = {};
- }
- function call(method, valid, message) {
- if (!valid && !warned[message]) {
- method(false, message);
- warned[message] = true;
- }
- }
- /** @see Same as {@link warning}, but only warn once for the same message */
- function warningOnce(valid, message) {
- call(warning, valid, message);
- }
- /** @see Same as {@link warning}, but only warn once for the same message */
- function noteOnce(valid, message) {
- call(note, valid, message);
- }
- warningOnce.preMessage = preMessage;
- warningOnce.resetWarned = resetWarned;
- warningOnce.noteOnce = noteOnce;
- /* harmony default export */ __webpack_exports__["default"] = (warningOnce);
- /***/ }),
- /***/ "./node_modules/rc-util/node_modules/react-is/cjs/react-is.development.js":
- /*!********************************************************************************!*\
- !*** ./node_modules/rc-util/node_modules/react-is/cjs/react-is.development.js ***!
- \********************************************************************************/
- /***/ (function(__unused_webpack_module, exports) {
- "use strict";
- var __webpack_unused_export__;
- /**
- * @license React
- * react-is.development.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.
- */
- if (true) {
- (function() {
- 'use strict';
- // ATTENTION
- // When adding new symbols to this file,
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
- // The Symbol used to tag the ReactElement-like types.
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
- var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
- // -----------------------------------------------------------------------------
- var enableScopeAPI = false; // Experimental Create Event Handle API.
- var enableCacheElement = false;
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
- // stuff. Intended to enable React core members to more easily debug scheduling
- // issues in DEV builds.
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
- var REACT_MODULE_REFERENCE;
- {
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
- }
- function isValidElementType(type) {
- if (typeof type === 'string' || typeof type === 'function') {
- return true;
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
- return true;
- }
- if (typeof type === 'object' && type !== null) {
- if (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 || // This needs to include all possible module reference object
- // types supported by any Flight configuration anywhere since
- // we don't know which Flight build this will end up being used
- // with.
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
- return true;
- }
- }
- return false;
- }
- 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_FRAGMENT_TYPE:
- case REACT_PROFILER_TYPE:
- case REACT_STRICT_MODE_TYPE:
- case REACT_SUSPENSE_TYPE:
- case REACT_SUSPENSE_LIST_TYPE:
- return type;
- default:
- var $$typeofType = type && type.$$typeof;
- switch ($$typeofType) {
- case REACT_SERVER_CONTEXT_TYPE:
- 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 undefined;
- }
- 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 SuspenseList = REACT_SUSPENSE_LIST_TYPE;
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
- var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
- function isAsyncMode(object) {
- {
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
- }
- }
- return false;
- }
- function isConcurrentMode(object) {
- {
- if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
- hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
- console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
- }
- }
- return false;
- }
- 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;
- }
- function isSuspenseList(object) {
- return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
- }
- __webpack_unused_export__ = ContextConsumer;
- __webpack_unused_export__ = ContextProvider;
- __webpack_unused_export__ = Element;
- exports.ForwardRef = ForwardRef;
- __webpack_unused_export__ = Fragment;
- __webpack_unused_export__ = Lazy;
- __webpack_unused_export__ = Memo;
- __webpack_unused_export__ = Portal;
- __webpack_unused_export__ = Profiler;
- __webpack_unused_export__ = StrictMode;
- __webpack_unused_export__ = Suspense;
- __webpack_unused_export__ = SuspenseList;
- __webpack_unused_export__ = isAsyncMode;
- __webpack_unused_export__ = isConcurrentMode;
- __webpack_unused_export__ = isContextConsumer;
- __webpack_unused_export__ = isContextProvider;
- __webpack_unused_export__ = isElement;
- __webpack_unused_export__ = isForwardRef;
- __webpack_unused_export__ = isFragment;
- __webpack_unused_export__ = isLazy;
- exports.isMemo = isMemo;
- __webpack_unused_export__ = isPortal;
- __webpack_unused_export__ = isProfiler;
- __webpack_unused_export__ = isStrictMode;
- __webpack_unused_export__ = isSuspense;
- __webpack_unused_export__ = isSuspenseList;
- __webpack_unused_export__ = isValidElementType;
- __webpack_unused_export__ = typeOf;
- })();
- }
- /***/ }),
- /***/ "./node_modules/rc-util/node_modules/react-is/index.js":
- /*!*************************************************************!*\
- !*** ./node_modules/rc-util/node_modules/react-is/index.js ***!
- \*************************************************************/
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- "use strict";
- if (false) // removed by dead control flow
- {} else {
- module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/rc-util/node_modules/react-is/cjs/react-is.development.js");
- }
- /***/ }),
- /***/ "./node_modules/string-convert/camel2hyphen.js":
- /*!*****************************************************!*\
- !*** ./node_modules/string-convert/camel2hyphen.js ***!
- \*****************************************************/
- /***/ (function(module) {
- var camel2hyphen = function (str) {
- return str
- .replace(/[A-Z]/g, function (match) {
- return '-' + match.toLowerCase();
- })
- .toLowerCase();
- };
- module.exports = camel2hyphen;
- /***/ }),
- /***/ "./node_modules/toggle-selection/index.js":
- /*!************************************************!*\
- !*** ./node_modules/toggle-selection/index.js ***!
- \************************************************/
- /***/ (function(module) {
- module.exports = function () {
- var selection = document.getSelection();
- if (!selection.rangeCount) {
- return function () {};
- }
- var active = document.activeElement;
- var ranges = [];
- for (var i = 0; i < selection.rangeCount; i++) {
- ranges.push(selection.getRangeAt(i));
- }
- switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
- case 'INPUT':
- case 'TEXTAREA':
- active.blur();
- break;
- default:
- active = null;
- break;
- }
- selection.removeAllRanges();
- return function () {
- selection.type === 'Caret' &&
- selection.removeAllRanges();
- if (!selection.rangeCount) {
- ranges.forEach(function(range) {
- selection.addRange(range);
- });
- }
- active &&
- active.focus();
- };
- };
- /***/ }),
- /***/ "dayjs":
- /*!**************************************************************************************!*\
- !*** external {"root":"dayjs","commonjs2":"dayjs","commonjs":"dayjs","amd":"dayjs"} ***!
- \**************************************************************************************/
- /***/ (function(module) {
- "use strict";
- module.exports = __WEBPACK_EXTERNAL_MODULE_dayjs__;
- /***/ }),
- /***/ "react":
- /*!**************************************************************************************!*\
- !*** external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} ***!
- \**************************************************************************************/
- /***/ (function(module) {
- "use strict";
- module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
- /***/ }),
- /***/ "react-dom":
- /*!*****************************************************************************************************!*\
- !*** external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom"} ***!
- \*****************************************************************************************************/
- /***/ (function(module) {
- "use strict";
- module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom__;
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
- /******/ if (cachedModule !== undefined) {
- /******/ return cachedModule.exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ id: moduleId,
- /******/ loaded: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.loaded = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/compat get default export */
- /******/ !function() {
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function() { return module['default']; } :
- /******/ function() { return module; };
- /******/ __webpack_require__.d(getter, { a: getter });
- /******/ return getter;
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/define property getters */
- /******/ !function() {
- /******/ // define getter functions for harmony exports
- /******/ __webpack_require__.d = function(exports, definition) {
- /******/ for(var key in definition) {
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/global */
- /******/ !function() {
- /******/ __webpack_require__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ }();
- /******/
- /******/ /* webpack/runtime/harmony module decorator */
- /******/ !function() {
- /******/ __webpack_require__.hmd = function(module) {
- /******/ module = Object.create(module);
- /******/ if (!module.children) module.children = [];
- /******/ Object.defineProperty(module, 'exports', {
- /******/ enumerable: true,
- /******/ set: function() {
- /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
- /******/ }
- /******/ });
- /******/ return module;
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ !function() {
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
- /******/ }();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ !function() {
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ }();
- /******/
- /************************************************************************/
- /******/
- /******/ // startup
- /******/ // Load entry module and return exports
- /******/ // This entry module used 'module' so it can't be inlined
- /******/ var __webpack_exports__ = __webpack_require__("./index.js");
- /******/
- /******/ return __webpack_exports__;
- /******/ })()
- ;
- });
- //# sourceMappingURL=antd.js.map
|