| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240 |
- import { ɵɵdefineInjectable, Injectable, Directive, Input, ContentChildren, Component, ViewEncapsulation, Output, Optional, Host, TemplateRef, EventEmitter, NgModule, ChangeDetectionStrategy, Renderer2, ElementRef, forwardRef, ChangeDetectorRef, Inject, PLATFORM_ID, NgZone, HostListener, LOCALE_ID, ɵɵinject, ViewChild, ViewContainerRef, ComponentFactoryResolver, ContentChild, Injector, ApplicationRef, RendererFactory2, INJECTOR, Attribute, InjectionToken } from '@angular/core';
- import { CommonModule, isPlatformBrowser, getLocaleDayNames, FormStyle, TranslationWidth, getLocaleMonthNames, formatDate, DOCUMENT, getLocaleDayPeriods } from '@angular/common';
- import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
- import { __read, __extends, __assign, __values } from 'tslib';
- import { combineLatest, timer, NEVER, Subject, BehaviorSubject, fromEvent, merge, race, Observable } from 'rxjs';
- import { map, startWith, distinctUntilChanged, switchMap, takeUntil, filter, take, tap, withLatestFrom, delay, share } from 'rxjs/operators';
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @param {?} value
- * @return {?}
- */
- function toInteger(value) {
- return parseInt("" + value, 10);
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function toString(value) {
- return (value !== undefined && value !== null) ? "" + value : '';
- }
- /**
- * @param {?} value
- * @param {?} max
- * @param {?=} min
- * @return {?}
- */
- function getValueInRange(value, max, min) {
- if (min === void 0) { min = 0; }
- return Math.max(Math.min(value, max), min);
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function isString(value) {
- return typeof value === 'string';
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function isNumber(value) {
- return !isNaN(toInteger(value));
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function isInteger(value) {
- return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function isDefined(value) {
- return value !== undefined && value !== null;
- }
- /**
- * @param {?} value
- * @return {?}
- */
- function padNumber(value) {
- if (isNumber(value)) {
- return ("0" + value).slice(-2);
- }
- else {
- return '';
- }
- }
- /**
- * @param {?} text
- * @return {?}
- */
- function regExpEscape(text) {
- return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
- }
- /**
- * @param {?} element
- * @param {?} className
- * @return {?}
- */
- function hasClassName(element, className) {
- return element && element.className && element.className.split &&
- element.className.split(/\s+/).indexOf(className) >= 0;
- }
- if (typeof Element !== 'undefined' && !Element.prototype.closest) {
- // Polyfill for ie10+
- if (!Element.prototype.matches) {
- // IE uses the non-standard name: msMatchesSelector
- Element.prototype.matches = ((/** @type {?} */ (Element.prototype))).msMatchesSelector || Element.prototype.webkitMatchesSelector;
- }
- Element.prototype.closest = (/**
- * @param {?} s
- * @return {?}
- */
- function (s) {
- /** @type {?} */
- var el = this;
- if (!document.documentElement.contains(el)) {
- return null;
- }
- do {
- if (el.matches(s)) {
- return el;
- }
- el = el.parentElement || el.parentNode;
- } while (el !== null && el.nodeType === 1);
- return null;
- });
- }
- /**
- * @param {?} element
- * @param {?} selector
- * @return {?}
- */
- function closest(element, selector) {
- if (!selector) {
- return null;
- }
- return element.closest(selector);
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [NgbAccordion](#/components/accordion/api#NgbAccordion) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all accordions used in the application.
- */
- var NgbAccordionConfig = /** @class */ (function () {
- function NgbAccordionConfig() {
- this.closeOthers = false;
- }
- NgbAccordionConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbAccordionConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbAccordionConfig_Factory() { return new NgbAccordionConfig(); }, token: NgbAccordionConfig, providedIn: "root" });
- return NgbAccordionConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextId = 0;
- /**
- * A directive that wraps an accordion panel header with any HTML markup and a toggling button
- * marked with [`NgbPanelToggle`](#/components/accordion/api#NgbPanelToggle).
- * See the [header customization demo](#/components/accordion/examples#header) for more details.
- *
- * You can also use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to customize only the panel title.
- *
- * \@since 4.1.0
- */
- var NgbPanelHeader = /** @class */ (function () {
- function NgbPanelHeader(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPanelHeader.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPanelHeader]' },] }
- ];
- /** @nocollapse */
- NgbPanelHeader.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPanelHeader;
- }());
- /**
- * A directive that wraps only the panel title with HTML markup inside.
- *
- * You can also use [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader) to customize the full panel header.
- */
- var NgbPanelTitle = /** @class */ (function () {
- function NgbPanelTitle(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPanelTitle.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPanelTitle]' },] }
- ];
- /** @nocollapse */
- NgbPanelTitle.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPanelTitle;
- }());
- /**
- * A directive that wraps the accordion panel content.
- */
- var NgbPanelContent = /** @class */ (function () {
- function NgbPanelContent(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPanelContent.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPanelContent]' },] }
- ];
- /** @nocollapse */
- NgbPanelContent.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPanelContent;
- }());
- /**
- * A directive that wraps an individual accordion panel with title and collapsible content.
- */
- var NgbPanel = /** @class */ (function () {
- function NgbPanel() {
- /**
- * If `true`, the panel is disabled an can't be toggled.
- */
- this.disabled = false;
- /**
- * An optional id for the panel that must be unique on the page.
- *
- * If not provided, it will be auto-generated in the `ngb-panel-xxx` format.
- */
- this.id = "ngb-panel-" + nextId++;
- this.isOpen = false;
- }
- /**
- * @return {?}
- */
- NgbPanel.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
- // only @ContentChildren allows us to specify the {descendants: false} option.
- // Without {descendants: false} we are hitting bugs described in:
- // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
- this.titleTpl = this.titleTpls.first;
- this.headerTpl = this.headerTpls.first;
- this.contentTpl = this.contentTpls.first;
- };
- NgbPanel.decorators = [
- { type: Directive, args: [{ selector: 'ngb-panel' },] }
- ];
- NgbPanel.propDecorators = {
- disabled: [{ type: Input }],
- id: [{ type: Input }],
- title: [{ type: Input }],
- type: [{ type: Input }],
- titleTpls: [{ type: ContentChildren, args: [NgbPanelTitle, { descendants: false },] }],
- headerTpls: [{ type: ContentChildren, args: [NgbPanelHeader, { descendants: false },] }],
- contentTpls: [{ type: ContentChildren, args: [NgbPanelContent, { descendants: false },] }]
- };
- return NgbPanel;
- }());
- /**
- * Accordion is a collection of collapsible panels (bootstrap cards).
- *
- * It can ensure only one panel is opened at a time and allows to customize panel
- * headers.
- */
- var NgbAccordion = /** @class */ (function () {
- function NgbAccordion(config) {
- /**
- * An array or comma separated strings of panel ids that should be opened **initially**.
- *
- * For subsequent changes use methods like `expand()`, `collapse()`, etc. and
- * the `(panelChange)` event.
- */
- this.activeIds = [];
- /**
- * If `true`, panel content will be detached from DOM and not simply hidden when the panel is collapsed.
- */
- this.destroyOnHide = true;
- /**
- * Event emitted right before the panel toggle happens.
- *
- * See [NgbPanelChangeEvent](#/components/accordion/api#NgbPanelChangeEvent) for payload details.
- */
- this.panelChange = new EventEmitter();
- this.type = config.type;
- this.closeOtherPanels = config.closeOthers;
- }
- /**
- * Checks if a panel with a given id is expanded.
- */
- /**
- * Checks if a panel with a given id is expanded.
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype.isExpanded = /**
- * Checks if a panel with a given id is expanded.
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) { return this.activeIds.indexOf(panelId) > -1; };
- /**
- * Expands a panel with a given id.
- *
- * Has no effect if the panel is already expanded or disabled.
- */
- /**
- * Expands a panel with a given id.
- *
- * Has no effect if the panel is already expanded or disabled.
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype.expand = /**
- * Expands a panel with a given id.
- *
- * Has no effect if the panel is already expanded or disabled.
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) { this._changeOpenState(this._findPanelById(panelId), true); };
- /**
- * Expands all panels, if `[closeOthers]` is `false`.
- *
- * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
- */
- /**
- * Expands all panels, if `[closeOthers]` is `false`.
- *
- * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
- * @return {?}
- */
- NgbAccordion.prototype.expandAll = /**
- * Expands all panels, if `[closeOthers]` is `false`.
- *
- * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
- * @return {?}
- */
- function () {
- var _this = this;
- if (this.closeOtherPanels) {
- if (this.activeIds.length === 0 && this.panels.length) {
- this._changeOpenState(this.panels.first, true);
- }
- }
- else {
- this.panels.forEach((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) { return _this._changeOpenState(panel, true); }));
- }
- };
- /**
- * Collapses a panel with the given id.
- *
- * Has no effect if the panel is already collapsed or disabled.
- */
- /**
- * Collapses a panel with the given id.
- *
- * Has no effect if the panel is already collapsed or disabled.
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype.collapse = /**
- * Collapses a panel with the given id.
- *
- * Has no effect if the panel is already collapsed or disabled.
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) { this._changeOpenState(this._findPanelById(panelId), false); };
- /**
- * Collapses all opened panels.
- */
- /**
- * Collapses all opened panels.
- * @return {?}
- */
- NgbAccordion.prototype.collapseAll = /**
- * Collapses all opened panels.
- * @return {?}
- */
- function () {
- var _this = this;
- this.panels.forEach((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) { _this._changeOpenState(panel, false); }));
- };
- /**
- * Toggles a panel with the given id.
- *
- * Has no effect if the panel is disabled.
- */
- /**
- * Toggles a panel with the given id.
- *
- * Has no effect if the panel is disabled.
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype.toggle = /**
- * Toggles a panel with the given id.
- *
- * Has no effect if the panel is disabled.
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) {
- /** @type {?} */
- var panel = this._findPanelById(panelId);
- if (panel) {
- this._changeOpenState(panel, !panel.isOpen);
- }
- };
- /**
- * @return {?}
- */
- NgbAccordion.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- var _this = this;
- // active id updates
- if (isString(this.activeIds)) {
- this.activeIds = this.activeIds.split(/\s*,\s*/);
- }
- // update panels open states
- this.panels.forEach((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) { return panel.isOpen = !panel.disabled && _this.activeIds.indexOf(panel.id) > -1; }));
- // closeOthers updates
- if (this.activeIds.length > 1 && this.closeOtherPanels) {
- this._closeOthers(this.activeIds[0]);
- this._updateActiveIds();
- }
- };
- /**
- * @private
- * @param {?} panel
- * @param {?} nextState
- * @return {?}
- */
- NgbAccordion.prototype._changeOpenState = /**
- * @private
- * @param {?} panel
- * @param {?} nextState
- * @return {?}
- */
- function (panel, nextState) {
- if (panel && !panel.disabled && panel.isOpen !== nextState) {
- /** @type {?} */
- var defaultPrevented_1 = false;
- this.panelChange.emit({ panelId: panel.id, nextState: nextState, preventDefault: (/**
- * @return {?}
- */
- function () { defaultPrevented_1 = true; }) });
- if (!defaultPrevented_1) {
- panel.isOpen = nextState;
- if (nextState && this.closeOtherPanels) {
- this._closeOthers(panel.id);
- }
- this._updateActiveIds();
- }
- }
- };
- /**
- * @private
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype._closeOthers = /**
- * @private
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) {
- this.panels.forEach((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) {
- if (panel.id !== panelId) {
- panel.isOpen = false;
- }
- }));
- };
- /**
- * @private
- * @param {?} panelId
- * @return {?}
- */
- NgbAccordion.prototype._findPanelById = /**
- * @private
- * @param {?} panelId
- * @return {?}
- */
- function (panelId) { return this.panels.find((/**
- * @param {?} p
- * @return {?}
- */
- function (p) { return p.id === panelId; })); };
- /**
- * @private
- * @return {?}
- */
- NgbAccordion.prototype._updateActiveIds = /**
- * @private
- * @return {?}
- */
- function () {
- this.activeIds = this.panels.filter((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) { return panel.isOpen && !panel.disabled; })).map((/**
- * @param {?} panel
- * @return {?}
- */
- function (panel) { return panel.id; }));
- };
- NgbAccordion.decorators = [
- { type: Component, args: [{
- selector: 'ngb-accordion',
- exportAs: 'ngbAccordion',
- encapsulation: ViewEncapsulation.None,
- host: { 'class': 'accordion', 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels' },
- template: "\n <ng-template #t ngbPanelHeader let-panel>\n <button class=\"btn btn-link\" [ngbPanelToggle]=\"panel\">\n {{panel.title}}<ng-template [ngTemplateOutlet]=\"panel.titleTpl?.templateRef\"></ng-template>\n </button>\n </ng-template>\n <ng-template ngFor let-panel [ngForOf]=\"panels\">\n <div class=\"card\">\n <div role=\"tab\" id=\"{{panel.id}}-header\" [class]=\"'card-header ' + (panel.type ? 'bg-'+panel.type: type ? 'bg-'+type : '')\">\n <ng-template [ngTemplateOutlet]=\"panel.headerTpl?.templateRef || t\"\n [ngTemplateOutletContext]=\"{$implicit: panel, opened: panel.isOpen}\"></ng-template>\n </div>\n <div id=\"{{panel.id}}\" role=\"tabpanel\" [attr.aria-labelledby]=\"panel.id + '-header'\"\n class=\"collapse\" [class.show]=\"panel.isOpen\" *ngIf=\"!destroyOnHide || panel.isOpen\">\n <div class=\"card-body\">\n <ng-template [ngTemplateOutlet]=\"panel.contentTpl?.templateRef\"></ng-template>\n </div>\n </div>\n </div>\n </ng-template>\n "
- }] }
- ];
- /** @nocollapse */
- NgbAccordion.ctorParameters = function () { return [
- { type: NgbAccordionConfig }
- ]; };
- NgbAccordion.propDecorators = {
- panels: [{ type: ContentChildren, args: [NgbPanel,] }],
- activeIds: [{ type: Input }],
- closeOtherPanels: [{ type: Input, args: ['closeOthers',] }],
- destroyOnHide: [{ type: Input }],
- type: [{ type: Input }],
- panelChange: [{ type: Output }]
- };
- return NgbAccordion;
- }());
- /**
- * A directive to put on a button that toggles panel opening and closing.
- *
- * To be used inside the [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader)
- *
- * \@since 4.1.0
- */
- var NgbPanelToggle = /** @class */ (function () {
- function NgbPanelToggle(accordion, panel) {
- this.accordion = accordion;
- this.panel = panel;
- }
- Object.defineProperty(NgbPanelToggle.prototype, "ngbPanelToggle", {
- set: /**
- * @param {?} panel
- * @return {?}
- */
- function (panel) {
- if (panel) {
- this.panel = panel;
- }
- },
- enumerable: true,
- configurable: true
- });
- NgbPanelToggle.decorators = [
- { type: Directive, args: [{
- selector: 'button[ngbPanelToggle]',
- host: {
- 'type': 'button',
- '[disabled]': 'panel.disabled',
- '[class.collapsed]': '!panel.isOpen',
- '[attr.aria-expanded]': 'panel.isOpen',
- '[attr.aria-controls]': 'panel.id',
- '(click)': 'accordion.toggle(panel.id)'
- }
- },] }
- ];
- /** @nocollapse */
- NgbPanelToggle.ctorParameters = function () { return [
- { type: NgbAccordion },
- { type: NgbPanel, decorators: [{ type: Optional }, { type: Host }] }
- ]; };
- NgbPanelToggle.propDecorators = {
- ngbPanelToggle: [{ type: Input }]
- };
- return NgbPanelToggle;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_ACCORDION_DIRECTIVES = [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle];
- var NgbAccordionModule = /** @class */ (function () {
- function NgbAccordionModule() {
- }
- NgbAccordionModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule] },] }
- ];
- return NgbAccordionModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [NgbAlert](#/components/alert/api#NgbAlert) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all alerts used in the application.
- */
- var NgbAlertConfig = /** @class */ (function () {
- function NgbAlertConfig() {
- this.dismissible = true;
- this.type = 'warning';
- }
- NgbAlertConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbAlertConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbAlertConfig_Factory() { return new NgbAlertConfig(); }, token: NgbAlertConfig, providedIn: "root" });
- return NgbAlertConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Alert is a component to provide contextual feedback messages for user.
- *
- * It supports several alert types and can be dismissed.
- */
- var NgbAlert = /** @class */ (function () {
- function NgbAlert(config, _renderer, _element) {
- this._renderer = _renderer;
- this._element = _element;
- /**
- * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.
- */
- this.close = new EventEmitter();
- this.dismissible = config.dismissible;
- this.type = config.type;
- }
- /**
- * @return {?}
- */
- NgbAlert.prototype.closeHandler = /**
- * @return {?}
- */
- function () { this.close.emit(null); };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbAlert.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- /** @type {?} */
- var typeChange = changes['type'];
- if (typeChange && !typeChange.firstChange) {
- this._renderer.removeClass(this._element.nativeElement, "alert-" + typeChange.previousValue);
- this._renderer.addClass(this._element.nativeElement, "alert-" + typeChange.currentValue);
- }
- };
- /**
- * @return {?}
- */
- NgbAlert.prototype.ngOnInit = /**
- * @return {?}
- */
- function () { this._renderer.addClass(this._element.nativeElement, "alert-" + this.type); };
- NgbAlert.decorators = [
- { type: Component, args: [{
- selector: 'ngb-alert',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: { 'role': 'alert', 'class': 'alert', '[class.alert-dismissible]': 'dismissible' },
- template: "\n <ng-content></ng-content>\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.alert.close\"\n (click)=\"closeHandler()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n ",
- styles: ["ngb-alert{display:block}"]
- }] }
- ];
- /** @nocollapse */
- NgbAlert.ctorParameters = function () { return [
- { type: NgbAlertConfig },
- { type: Renderer2 },
- { type: ElementRef }
- ]; };
- NgbAlert.propDecorators = {
- dismissible: [{ type: Input }],
- type: [{ type: Input }],
- close: [{ type: Output }]
- };
- return NgbAlert;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbAlertModule = /** @class */ (function () {
- function NgbAlertModule() {
- }
- NgbAlertModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbAlert], exports: [NgbAlert], imports: [CommonModule], entryComponents: [NgbAlert] },] }
- ];
- return NgbAlertModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbButtonLabel = /** @class */ (function () {
- function NgbButtonLabel() {
- }
- NgbButtonLabel.decorators = [
- { type: Directive, args: [{
- selector: '[ngbButtonLabel]',
- host: { '[class.btn]': 'true', '[class.active]': 'active', '[class.disabled]': 'disabled', '[class.focus]': 'focused' }
- },] }
- ];
- return NgbButtonLabel;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_CHECKBOX_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbCheckBox; })),
- multi: true
- };
- /**
- * Allows to easily create Bootstrap-style checkbox buttons.
- *
- * Integrates with forms, so the value of a checked button is bound to the underlying form control
- * either in a reactive or template-driven way.
- */
- var NgbCheckBox = /** @class */ (function () {
- function NgbCheckBox(_label, _cd) {
- this._label = _label;
- this._cd = _cd;
- /**
- * If `true`, the checkbox button will be disabled
- */
- this.disabled = false;
- /**
- * The form control value when the checkbox is checked.
- */
- this.valueChecked = true;
- /**
- * The form control value when the checkbox is unchecked.
- */
- this.valueUnChecked = false;
- this.onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.onTouched = (/**
- * @return {?}
- */
- function () { });
- }
- Object.defineProperty(NgbCheckBox.prototype, "focused", {
- set: /**
- * @param {?} isFocused
- * @return {?}
- */
- function (isFocused) {
- this._label.focused = isFocused;
- if (!isFocused) {
- this.onTouched();
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} $event
- * @return {?}
- */
- NgbCheckBox.prototype.onInputChange = /**
- * @param {?} $event
- * @return {?}
- */
- function ($event) {
- /** @type {?} */
- var modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;
- this.onChange(modelToPropagate);
- this.onTouched();
- this.writeValue(modelToPropagate);
- };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbCheckBox.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbCheckBox.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onTouched = fn; };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbCheckBox.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) {
- this.disabled = isDisabled;
- this._label.disabled = isDisabled;
- };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbCheckBox.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this.checked = value === this.valueChecked;
- this._label.active = this.checked;
- // label won't be updated, if it is inside the OnPush component when [ngModel] changes
- this._cd.markForCheck();
- };
- NgbCheckBox.decorators = [
- { type: Directive, args: [{
- selector: '[ngbButton][type=checkbox]',
- host: {
- '[checked]': 'checked',
- '[disabled]': 'disabled',
- '(change)': 'onInputChange($event)',
- '(focus)': 'focused = true',
- '(blur)': 'focused = false'
- },
- providers: [NGB_CHECKBOX_VALUE_ACCESSOR]
- },] }
- ];
- /** @nocollapse */
- NgbCheckBox.ctorParameters = function () { return [
- { type: NgbButtonLabel },
- { type: ChangeDetectorRef }
- ]; };
- NgbCheckBox.propDecorators = {
- disabled: [{ type: Input }],
- valueChecked: [{ type: Input }],
- valueUnChecked: [{ type: Input }]
- };
- return NgbCheckBox;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_RADIO_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbRadioGroup; })),
- multi: true
- };
- /** @type {?} */
- var nextId$1 = 0;
- /**
- * Allows to easily create Bootstrap-style radio buttons.
- *
- * Integrates with forms, so the value of a checked button is bound to the underlying form control
- * either in a reactive or template-driven way.
- */
- var NgbRadioGroup = /** @class */ (function () {
- function NgbRadioGroup() {
- this._radios = new Set();
- this._value = null;
- /**
- * Name of the radio group applied to radio input elements.
- *
- * Will be applied to all radio input elements inside the group,
- * unless [`NgbRadio`](#/components/buttons/api#NgbRadio)'s specify names themselves.
- *
- * If not provided, will be generated in the `ngb-radio-xx` format.
- */
- this.name = "ngb-radio-" + nextId$1++;
- this.onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.onTouched = (/**
- * @return {?}
- */
- function () { });
- }
- Object.defineProperty(NgbRadioGroup.prototype, "disabled", {
- get: /**
- * @return {?}
- */
- function () { return this._disabled; },
- set: /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) { this.setDisabledState(isDisabled); },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} radio
- * @return {?}
- */
- NgbRadioGroup.prototype.onRadioChange = /**
- * @param {?} radio
- * @return {?}
- */
- function (radio) {
- this.writeValue(radio.value);
- this.onChange(radio.value);
- };
- /**
- * @return {?}
- */
- NgbRadioGroup.prototype.onRadioValueUpdate = /**
- * @return {?}
- */
- function () { this._updateRadiosValue(); };
- /**
- * @param {?} radio
- * @return {?}
- */
- NgbRadioGroup.prototype.register = /**
- * @param {?} radio
- * @return {?}
- */
- function (radio) { this._radios.add(radio); };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbRadioGroup.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbRadioGroup.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onTouched = fn; };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbRadioGroup.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) {
- this._disabled = isDisabled;
- this._updateRadiosDisabled();
- };
- /**
- * @param {?} radio
- * @return {?}
- */
- NgbRadioGroup.prototype.unregister = /**
- * @param {?} radio
- * @return {?}
- */
- function (radio) { this._radios.delete(radio); };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbRadioGroup.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._value = value;
- this._updateRadiosValue();
- };
- /**
- * @private
- * @return {?}
- */
- NgbRadioGroup.prototype._updateRadiosValue = /**
- * @private
- * @return {?}
- */
- function () {
- var _this = this;
- this._radios.forEach((/**
- * @param {?} radio
- * @return {?}
- */
- function (radio) { return radio.updateValue(_this._value); }));
- };
- /**
- * @private
- * @return {?}
- */
- NgbRadioGroup.prototype._updateRadiosDisabled = /**
- * @private
- * @return {?}
- */
- function () { this._radios.forEach((/**
- * @param {?} radio
- * @return {?}
- */
- function (radio) { return radio.updateDisabled(); })); };
- NgbRadioGroup.decorators = [
- { type: Directive, args: [{ selector: '[ngbRadioGroup]', host: { 'role': 'radiogroup' }, providers: [NGB_RADIO_VALUE_ACCESSOR] },] }
- ];
- NgbRadioGroup.propDecorators = {
- name: [{ type: Input }]
- };
- return NgbRadioGroup;
- }());
- /**
- * A directive that marks an input of type "radio" as a part of the
- * [`NgbRadioGroup`](#/components/buttons/api#NgbRadioGroup).
- */
- var NgbRadio = /** @class */ (function () {
- function NgbRadio(_group, _label, _renderer, _element, _cd) {
- this._group = _group;
- this._label = _label;
- this._renderer = _renderer;
- this._element = _element;
- this._cd = _cd;
- this._value = null;
- this._group.register(this);
- this.updateDisabled();
- }
- Object.defineProperty(NgbRadio.prototype, "value", {
- get: /**
- * @return {?}
- */
- function () { return this._value; },
- /**
- * The form control value when current radio button is checked.
- */
- set: /**
- * The form control value when current radio button is checked.
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._value = value;
- /** @type {?} */
- var stringValue = value ? value.toString() : '';
- this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);
- this._group.onRadioValueUpdate();
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbRadio.prototype, "disabled", {
- get: /**
- * @return {?}
- */
- function () { return this._group.disabled || this._disabled; },
- /**
- * If `true`, current radio button will be disabled.
- */
- set: /**
- * If `true`, current radio button will be disabled.
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) {
- this._disabled = isDisabled !== false;
- this.updateDisabled();
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbRadio.prototype, "focused", {
- set: /**
- * @param {?} isFocused
- * @return {?}
- */
- function (isFocused) {
- if (this._label) {
- this._label.focused = isFocused;
- }
- if (!isFocused) {
- this._group.onTouched();
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbRadio.prototype, "checked", {
- get: /**
- * @return {?}
- */
- function () { return this._checked; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbRadio.prototype, "nameAttr", {
- get: /**
- * @return {?}
- */
- function () { return this.name || this._group.name; },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- NgbRadio.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () { this._group.unregister(this); };
- /**
- * @return {?}
- */
- NgbRadio.prototype.onChange = /**
- * @return {?}
- */
- function () { this._group.onRadioChange(this); };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbRadio.prototype.updateValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- // label won't be updated, if it is inside the OnPush component when [ngModel] changes
- if (this.value !== value) {
- this._cd.markForCheck();
- }
- this._checked = this.value === value;
- this._label.active = this._checked;
- };
- /**
- * @return {?}
- */
- NgbRadio.prototype.updateDisabled = /**
- * @return {?}
- */
- function () { this._label.disabled = this.disabled; };
- NgbRadio.decorators = [
- { type: Directive, args: [{
- selector: '[ngbButton][type=radio]',
- host: {
- '[checked]': 'checked',
- '[disabled]': 'disabled',
- '[name]': 'nameAttr',
- '(change)': 'onChange()',
- '(focus)': 'focused = true',
- '(blur)': 'focused = false'
- }
- },] }
- ];
- /** @nocollapse */
- NgbRadio.ctorParameters = function () { return [
- { type: NgbRadioGroup },
- { type: NgbButtonLabel },
- { type: Renderer2 },
- { type: ElementRef },
- { type: ChangeDetectorRef }
- ]; };
- NgbRadio.propDecorators = {
- name: [{ type: Input }],
- value: [{ type: Input, args: ['value',] }],
- disabled: [{ type: Input, args: ['disabled',] }]
- };
- return NgbRadio;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_BUTTON_DIRECTIVES = [NgbButtonLabel, NgbCheckBox, NgbRadioGroup, NgbRadio];
- var NgbButtonsModule = /** @class */ (function () {
- function NgbButtonsModule() {
- }
- NgbButtonsModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_BUTTON_DIRECTIVES, exports: NGB_BUTTON_DIRECTIVES },] }
- ];
- return NgbButtonsModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [NgbCarousel](#/components/carousel/api#NgbCarousel) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all carousels used in the application.
- */
- var NgbCarouselConfig = /** @class */ (function () {
- function NgbCarouselConfig() {
- this.interval = 5000;
- this.wrap = true;
- this.keyboard = true;
- this.pauseOnHover = true;
- this.showNavigationArrows = true;
- this.showNavigationIndicators = true;
- }
- NgbCarouselConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbCarouselConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbCarouselConfig_Factory() { return new NgbCarouselConfig(); }, token: NgbCarouselConfig, providedIn: "root" });
- return NgbCarouselConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextId$2 = 0;
- /**
- * A directive that wraps the individual carousel slide.
- */
- var NgbSlide = /** @class */ (function () {
- function NgbSlide(tplRef) {
- this.tplRef = tplRef;
- /**
- * Slide id that must be unique for the entire document.
- *
- * If not provided, will be generated in the `ngb-slide-xx` format.
- */
- this.id = "ngb-slide-" + nextId$2++;
- }
- NgbSlide.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbSlide]' },] }
- ];
- /** @nocollapse */
- NgbSlide.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- NgbSlide.propDecorators = {
- id: [{ type: Input }]
- };
- return NgbSlide;
- }());
- /**
- * Carousel is a component to easily create and control slideshows.
- *
- * Allows to set intervals, change the way user interacts with the slides and provides a programmatic API.
- */
- var NgbCarousel = /** @class */ (function () {
- function NgbCarousel(config, _platformId, _ngZone, _cd) {
- this._platformId = _platformId;
- this._ngZone = _ngZone;
- this._cd = _cd;
- this.NgbSlideEventSource = NgbSlideEventSource;
- this._destroy$ = new Subject();
- this._interval$ = new BehaviorSubject(0);
- this._mouseHover$ = new BehaviorSubject(false);
- this._pauseOnHover$ = new BehaviorSubject(false);
- this._pause$ = new BehaviorSubject(false);
- this._wrap$ = new BehaviorSubject(false);
- /**
- * An event emitted right after the slide transition is completed.
- *
- * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.
- */
- this.slide = new EventEmitter();
- this.interval = config.interval;
- this.wrap = config.wrap;
- this.keyboard = config.keyboard;
- this.pauseOnHover = config.pauseOnHover;
- this.showNavigationArrows = config.showNavigationArrows;
- this.showNavigationIndicators = config.showNavigationIndicators;
- }
- Object.defineProperty(NgbCarousel.prototype, "interval", {
- get: /**
- * @return {?}
- */
- function () { return this._interval$.value; },
- /**
- * Time in milliseconds before the next slide is shown.
- */
- set: /**
- * Time in milliseconds before the next slide is shown.
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._interval$.next(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbCarousel.prototype, "wrap", {
- get: /**
- * @return {?}
- */
- function () { return this._wrap$.value; },
- /**
- * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
- */
- set: /**
- * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._wrap$.next(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbCarousel.prototype, "pauseOnHover", {
- get: /**
- * @return {?}
- */
- function () { return this._pauseOnHover$.value; },
- /**
- * If `true`, will pause slide switching when mouse cursor hovers the slide.
- *
- * @since 2.2.0
- */
- set: /**
- * If `true`, will pause slide switching when mouse cursor hovers the slide.
- *
- * \@since 2.2.0
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._pauseOnHover$.next(value);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- NgbCarousel.prototype.mouseEnter = /**
- * @return {?}
- */
- function () {
- this._mouseHover$.next(true);
- };
- /**
- * @return {?}
- */
- NgbCarousel.prototype.mouseLeave = /**
- * @return {?}
- */
- function () {
- this._mouseHover$.next(false);
- };
- /**
- * @return {?}
- */
- NgbCarousel.prototype.ngAfterContentInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- // setInterval() doesn't play well with SSR and protractor,
- // so we should run it in the browser and outside Angular
- if (isPlatformBrowser(this._platformId)) {
- this._ngZone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var hasNextSlide$ = combineLatest(_this.slide.pipe(map((/**
- * @param {?} slideEvent
- * @return {?}
- */
- function (slideEvent) { return slideEvent.current; })), startWith(_this.activeId)), _this._wrap$, _this.slides.changes.pipe(startWith(null)))
- .pipe(map((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var _b = __read(_a, 2), currentSlideId = _b[0], wrap = _b[1];
- /** @type {?} */
- var slideArr = _this.slides.toArray();
- /** @type {?} */
- var currentSlideIdx = _this._getSlideIdxById(currentSlideId);
- return wrap ? slideArr.length > 1 : currentSlideIdx < slideArr.length - 1;
- })), distinctUntilChanged());
- combineLatest(_this._pause$, _this._pauseOnHover$, _this._mouseHover$, _this._interval$, hasNextSlide$)
- .pipe(map((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var _b = __read(_a, 5), pause = _b[0], pauseOnHover = _b[1], mouseHover = _b[2], interval = _b[3], hasNextSlide = _b[4];
- return ((pause || (pauseOnHover && mouseHover) || !hasNextSlide) ? 0 : interval);
- })), distinctUntilChanged(), switchMap((/**
- * @param {?} interval
- * @return {?}
- */
- function (interval) { return interval > 0 ? timer(interval, interval) : NEVER; })), takeUntil(_this._destroy$))
- .subscribe((/**
- * @return {?}
- */
- function () { return _this._ngZone.run((/**
- * @return {?}
- */
- function () { return _this.next(NgbSlideEventSource.TIMER); })); }));
- }));
- }
- this.slides.changes.pipe(takeUntil(this._destroy$)).subscribe((/**
- * @return {?}
- */
- function () { return _this._cd.markForCheck(); }));
- };
- /**
- * @return {?}
- */
- NgbCarousel.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var activeSlide = this._getSlideById(this.activeId);
- this.activeId = activeSlide ? activeSlide.id : (this.slides.length ? this.slides.first.id : null);
- };
- /**
- * @return {?}
- */
- NgbCarousel.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () { this._destroy$.next(); };
- /**
- * Navigates to a slide with the specified identifier.
- */
- /**
- * Navigates to a slide with the specified identifier.
- * @param {?} slideId
- * @param {?=} source
- * @return {?}
- */
- NgbCarousel.prototype.select = /**
- * Navigates to a slide with the specified identifier.
- * @param {?} slideId
- * @param {?=} source
- * @return {?}
- */
- function (slideId, source) {
- this._cycleToSelected(slideId, this._getSlideEventDirection(this.activeId, slideId), source);
- };
- /**
- * Navigates to the previous slide.
- */
- /**
- * Navigates to the previous slide.
- * @param {?=} source
- * @return {?}
- */
- NgbCarousel.prototype.prev = /**
- * Navigates to the previous slide.
- * @param {?=} source
- * @return {?}
- */
- function (source) {
- this._cycleToSelected(this._getPrevSlide(this.activeId), NgbSlideEventDirection.RIGHT, source);
- };
- /**
- * Navigates to the next slide.
- */
- /**
- * Navigates to the next slide.
- * @param {?=} source
- * @return {?}
- */
- NgbCarousel.prototype.next = /**
- * Navigates to the next slide.
- * @param {?=} source
- * @return {?}
- */
- function (source) {
- this._cycleToSelected(this._getNextSlide(this.activeId), NgbSlideEventDirection.LEFT, source);
- };
- /**
- * Pauses cycling through the slides.
- */
- /**
- * Pauses cycling through the slides.
- * @return {?}
- */
- NgbCarousel.prototype.pause = /**
- * Pauses cycling through the slides.
- * @return {?}
- */
- function () { this._pause$.next(true); };
- /**
- * Restarts cycling through the slides from left to right.
- */
- /**
- * Restarts cycling through the slides from left to right.
- * @return {?}
- */
- NgbCarousel.prototype.cycle = /**
- * Restarts cycling through the slides from left to right.
- * @return {?}
- */
- function () { this._pause$.next(false); };
- /**
- * @private
- * @param {?} slideIdx
- * @param {?} direction
- * @param {?=} source
- * @return {?}
- */
- NgbCarousel.prototype._cycleToSelected = /**
- * @private
- * @param {?} slideIdx
- * @param {?} direction
- * @param {?=} source
- * @return {?}
- */
- function (slideIdx, direction, source) {
- /** @type {?} */
- var selectedSlide = this._getSlideById(slideIdx);
- if (selectedSlide && selectedSlide.id !== this.activeId) {
- this.slide.emit({ prev: this.activeId, current: selectedSlide.id, direction: direction, paused: this._pause$.value, source: source });
- this.activeId = selectedSlide.id;
- }
- // we get here after the interval fires or any external API call like next(), prev() or select()
- this._cd.markForCheck();
- };
- /**
- * @private
- * @param {?} currentActiveSlideId
- * @param {?} nextActiveSlideId
- * @return {?}
- */
- NgbCarousel.prototype._getSlideEventDirection = /**
- * @private
- * @param {?} currentActiveSlideId
- * @param {?} nextActiveSlideId
- * @return {?}
- */
- function (currentActiveSlideId, nextActiveSlideId) {
- /** @type {?} */
- var currentActiveSlideIdx = this._getSlideIdxById(currentActiveSlideId);
- /** @type {?} */
- var nextActiveSlideIdx = this._getSlideIdxById(nextActiveSlideId);
- return currentActiveSlideIdx > nextActiveSlideIdx ? NgbSlideEventDirection.RIGHT : NgbSlideEventDirection.LEFT;
- };
- /**
- * @private
- * @param {?} slideId
- * @return {?}
- */
- NgbCarousel.prototype._getSlideById = /**
- * @private
- * @param {?} slideId
- * @return {?}
- */
- function (slideId) { return this.slides.find((/**
- * @param {?} slide
- * @return {?}
- */
- function (slide) { return slide.id === slideId; })); };
- /**
- * @private
- * @param {?} slideId
- * @return {?}
- */
- NgbCarousel.prototype._getSlideIdxById = /**
- * @private
- * @param {?} slideId
- * @return {?}
- */
- function (slideId) {
- return this.slides.toArray().indexOf(this._getSlideById(slideId));
- };
- /**
- * @private
- * @param {?} currentSlideId
- * @return {?}
- */
- NgbCarousel.prototype._getNextSlide = /**
- * @private
- * @param {?} currentSlideId
- * @return {?}
- */
- function (currentSlideId) {
- /** @type {?} */
- var slideArr = this.slides.toArray();
- /** @type {?} */
- var currentSlideIdx = this._getSlideIdxById(currentSlideId);
- /** @type {?} */
- var isLastSlide = currentSlideIdx === slideArr.length - 1;
- return isLastSlide ? (this.wrap ? slideArr[0].id : slideArr[slideArr.length - 1].id) :
- slideArr[currentSlideIdx + 1].id;
- };
- /**
- * @private
- * @param {?} currentSlideId
- * @return {?}
- */
- NgbCarousel.prototype._getPrevSlide = /**
- * @private
- * @param {?} currentSlideId
- * @return {?}
- */
- function (currentSlideId) {
- /** @type {?} */
- var slideArr = this.slides.toArray();
- /** @type {?} */
- var currentSlideIdx = this._getSlideIdxById(currentSlideId);
- /** @type {?} */
- var isFirstSlide = currentSlideIdx === 0;
- return isFirstSlide ? (this.wrap ? slideArr[slideArr.length - 1].id : slideArr[0].id) :
- slideArr[currentSlideIdx - 1].id;
- };
- NgbCarousel.decorators = [
- { type: Component, args: [{
- selector: 'ngb-carousel',
- exportAs: 'ngbCarousel',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: {
- 'class': 'carousel slide',
- '[style.display]': '"block"',
- 'tabIndex': '0',
- '(keydown.arrowLeft)': 'keyboard && prev(NgbSlideEventSource.ARROW_LEFT)',
- '(keydown.arrowRight)': 'keyboard && next(NgbSlideEventSource.ARROW_RIGHT)'
- },
- template: "\n <ol class=\"carousel-indicators\" *ngIf=\"showNavigationIndicators\">\n <li *ngFor=\"let slide of slides\" [id]=\"slide.id\" [class.active]=\"slide.id === activeId\"\n (click)=\"select(slide.id, NgbSlideEventSource.INDICATOR)\"></li>\n </ol>\n <div class=\"carousel-inner\">\n <div *ngFor=\"let slide of slides\" class=\"carousel-item\" [class.active]=\"slide.id === activeId\">\n <ng-template [ngTemplateOutlet]=\"slide.tplRef\"></ng-template>\n </div>\n </div>\n <a class=\"carousel-control-prev\" role=\"button\" (click)=\"prev(NgbSlideEventSource.ARROW_LEFT)\" *ngIf=\"showNavigationArrows\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.previous\">Previous</span>\n </a>\n <a class=\"carousel-control-next\" role=\"button\" (click)=\"next(NgbSlideEventSource.ARROW_RIGHT)\" *ngIf=\"showNavigationArrows\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.next\">Next</span>\n </a>\n "
- }] }
- ];
- /** @nocollapse */
- NgbCarousel.ctorParameters = function () { return [
- { type: NgbCarouselConfig },
- { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
- { type: NgZone },
- { type: ChangeDetectorRef }
- ]; };
- NgbCarousel.propDecorators = {
- slides: [{ type: ContentChildren, args: [NgbSlide,] }],
- activeId: [{ type: Input }],
- interval: [{ type: Input }],
- wrap: [{ type: Input }],
- keyboard: [{ type: Input }],
- pauseOnHover: [{ type: Input }],
- showNavigationArrows: [{ type: Input }],
- showNavigationIndicators: [{ type: Input }],
- slide: [{ type: Output }],
- mouseEnter: [{ type: HostListener, args: ['mouseenter',] }],
- mouseLeave: [{ type: HostListener, args: ['mouseleave',] }]
- };
- return NgbCarousel;
- }());
- /** @enum {string} */
- var NgbSlideEventDirection = {
- LEFT: (/** @type {?} */ ('left')),
- RIGHT: (/** @type {?} */ ('right')),
- };
- /** @enum {string} */
- var NgbSlideEventSource = {
- TIMER: 'timer',
- ARROW_LEFT: 'arrowLeft',
- ARROW_RIGHT: 'arrowRight',
- INDICATOR: 'indicator',
- };
- /** @type {?} */
- var NGB_CAROUSEL_DIRECTIVES = [NgbCarousel, NgbSlide];
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbCarouselModule = /** @class */ (function () {
- function NgbCarouselModule() {
- }
- NgbCarouselModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_CAROUSEL_DIRECTIVES, exports: NGB_CAROUSEL_DIRECTIVES, imports: [CommonModule] },] }
- ];
- return NgbCarouselModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A directive to provide a simple way of hiding and showing elements on the page.
- */
- var NgbCollapse = /** @class */ (function () {
- function NgbCollapse() {
- /**
- * If `true`, will collapse the element or show it otherwise.
- */
- this.collapsed = false;
- }
- NgbCollapse.decorators = [
- { type: Directive, args: [{
- selector: '[ngbCollapse]',
- exportAs: 'ngbCollapse',
- host: { '[class.collapse]': 'true', '[class.show]': '!collapsed' }
- },] }
- ];
- NgbCollapse.propDecorators = {
- collapsed: [{ type: Input, args: ['ngbCollapse',] }]
- };
- return NgbCollapse;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbCollapseModule = /** @class */ (function () {
- function NgbCollapseModule() {
- }
- NgbCollapseModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbCollapse], exports: [NgbCollapse] },] }
- ];
- return NgbCollapseModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A simple class that represents a date that datepicker also uses internally.
- *
- * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,
- * like `.equals()`, `.before()`, etc.
- *
- * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
- *
- * In many cases it is simpler to manipulate these objects together with
- * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- *
- * \@since 3.0.0
- */
- var /**
- * A simple class that represents a date that datepicker also uses internally.
- *
- * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,
- * like `.equals()`, `.before()`, etc.
- *
- * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
- *
- * In many cases it is simpler to manipulate these objects together with
- * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- *
- * \@since 3.0.0
- */
- NgbDate = /** @class */ (function () {
- function NgbDate(year, month, day) {
- this.year = isInteger(year) ? year : null;
- this.month = isInteger(month) ? month : null;
- this.day = isInteger(day) ? day : null;
- }
- /**
- * A **static method** that creates a new date object from the `NgbDateStruct`,
- *
- * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
- *
- * If the `date` is already of `NgbDate` type, the method will return the same object.
- */
- /**
- * A **static method** that creates a new date object from the `NgbDateStruct`,
- *
- * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
- *
- * If the `date` is already of `NgbDate` type, the method will return the same object.
- * @param {?} date
- * @return {?}
- */
- NgbDate.from = /**
- * A **static method** that creates a new date object from the `NgbDateStruct`,
- *
- * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
- *
- * If the `date` is already of `NgbDate` type, the method will return the same object.
- * @param {?} date
- * @return {?}
- */
- function (date) {
- if (date instanceof NgbDate) {
- return date;
- }
- return date ? new NgbDate(date.year, date.month, date.day) : null;
- };
- /**
- * Checks if the current date is equal to another date.
- */
- /**
- * Checks if the current date is equal to another date.
- * @param {?} other
- * @return {?}
- */
- NgbDate.prototype.equals = /**
- * Checks if the current date is equal to another date.
- * @param {?} other
- * @return {?}
- */
- function (other) {
- return other && this.year === other.year && this.month === other.month && this.day === other.day;
- };
- /**
- * Checks if the current date is before another date.
- */
- /**
- * Checks if the current date is before another date.
- * @param {?} other
- * @return {?}
- */
- NgbDate.prototype.before = /**
- * Checks if the current date is before another date.
- * @param {?} other
- * @return {?}
- */
- function (other) {
- if (!other) {
- return false;
- }
- if (this.year === other.year) {
- if (this.month === other.month) {
- return this.day === other.day ? false : this.day < other.day;
- }
- else {
- return this.month < other.month;
- }
- }
- else {
- return this.year < other.year;
- }
- };
- /**
- * Checks if the current date is after another date.
- */
- /**
- * Checks if the current date is after another date.
- * @param {?} other
- * @return {?}
- */
- NgbDate.prototype.after = /**
- * Checks if the current date is after another date.
- * @param {?} other
- * @return {?}
- */
- function (other) {
- if (!other) {
- return false;
- }
- if (this.year === other.year) {
- if (this.month === other.month) {
- return this.day === other.day ? false : this.day > other.day;
- }
- else {
- return this.month > other.month;
- }
- }
- else {
- return this.year > other.year;
- }
- };
- return NgbDate;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @param {?} jsDate
- * @return {?}
- */
- function fromJSDate(jsDate) {
- return new NgbDate(jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());
- }
- /**
- * @param {?} date
- * @return {?}
- */
- function toJSDate(date) {
- /** @type {?} */
- var jsDate = new Date(date.year, date.month - 1, date.day, 12);
- // this is done avoid 30 -> 1930 conversion
- if (!isNaN(jsDate.getTime())) {
- jsDate.setFullYear(date.year);
- }
- return jsDate;
- }
- /**
- * @return {?}
- */
- function NGB_DATEPICKER_CALENDAR_FACTORY() {
- return new NgbCalendarGregorian();
- }
- /**
- * A service that represents the calendar used by the datepicker.
- *
- * The default implementation uses the Gregorian calendar. You can inject it in your own
- * implementations if necessary to simplify `NgbDate` calculations.
- * @abstract
- */
- var NgbCalendar = /** @class */ (function () {
- function NgbCalendar() {
- }
- NgbCalendar.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_CALENDAR_FACTORY },] }
- ];
- /** @nocollapse */ NgbCalendar.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_CALENDAR_FACTORY, token: NgbCalendar, providedIn: "root" });
- return NgbCalendar;
- }());
- var NgbCalendarGregorian = /** @class */ (function (_super) {
- __extends(NgbCalendarGregorian, _super);
- function NgbCalendarGregorian() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getDaysPerWeek = /**
- * @return {?}
- */
- function () { return 7; };
- /**
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getMonths = /**
- * @return {?}
- */
- function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
- /**
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getWeeksPerMonth = /**
- * @return {?}
- */
- function () { return 6; };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getNext = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- /** @type {?} */
- var jsDate = toJSDate(date);
- /** @type {?} */
- var checkMonth = true;
- /** @type {?} */
- var expectedMonth = jsDate.getMonth();
- switch (period) {
- case 'y':
- jsDate.setFullYear(jsDate.getFullYear() + number);
- break;
- case 'm':
- expectedMonth += number;
- jsDate.setMonth(expectedMonth);
- expectedMonth = expectedMonth % 12;
- if (expectedMonth < 0) {
- expectedMonth = expectedMonth + 12;
- }
- break;
- case 'd':
- jsDate.setDate(jsDate.getDate() + number);
- checkMonth = false;
- break;
- default:
- return date;
- }
- if (checkMonth && jsDate.getMonth() !== expectedMonth) {
- // this means the destination month has less days than the initial month
- // let's go back to the end of the previous month:
- jsDate.setDate(0);
- }
- return fromJSDate(jsDate);
- };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getPrev = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- return this.getNext(date, period, -number);
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getWeekday = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var jsDate = toJSDate(date);
- /** @type {?} */
- var day = jsDate.getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- };
- /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getWeekNumber = /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function (week, firstDayOfWeek) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
- /** @type {?} */
- var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- /** @type {?} */
- var date = week[thursdayIndex];
- /** @type {?} */
- var jsDate = toJSDate(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- // Thursday
- /** @type {?} */
- var time = jsDate.getTime();
- jsDate.setMonth(0); // Compare with Jan 1
- jsDate.setDate(1);
- return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;
- };
- /**
- * @return {?}
- */
- NgbCalendarGregorian.prototype.getToday = /**
- * @return {?}
- */
- function () { return fromJSDate(new Date()); };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarGregorian.prototype.isValid = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- if (!date || !isInteger(date.year) || !isInteger(date.month) || !isInteger(date.day)) {
- return false;
- }
- // year 0 doesn't exist in Gregorian calendar
- if (date.year === 0) {
- return false;
- }
- /** @type {?} */
- var jsDate = toJSDate(date);
- return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&
- jsDate.getDate() === date.day;
- };
- NgbCalendarGregorian.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarGregorian;
- }(NgbCalendar));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @param {?} prev
- * @param {?} next
- * @return {?}
- */
- function isChangedDate(prev, next) {
- return !dateComparator(prev, next);
- }
- /**
- * @param {?} prev
- * @param {?} next
- * @return {?}
- */
- function isChangedMonth(prev, next) {
- return !prev && !next ? false : !prev || !next ? true : prev.year !== next.year || prev.month !== next.month;
- }
- /**
- * @param {?} prev
- * @param {?} next
- * @return {?}
- */
- function dateComparator(prev, next) {
- return (!prev && !next) || (!!prev && !!next && prev.equals(next));
- }
- /**
- * @param {?} minDate
- * @param {?} maxDate
- * @return {?}
- */
- function checkMinBeforeMax(minDate, maxDate) {
- if (maxDate && minDate && maxDate.before(minDate)) {
- throw new Error("'maxDate' " + maxDate + " should be greater than 'minDate' " + minDate);
- }
- }
- /**
- * @param {?} date
- * @param {?} minDate
- * @param {?} maxDate
- * @return {?}
- */
- function checkDateInRange(date, minDate, maxDate) {
- if (date && minDate && date.before(minDate)) {
- return minDate;
- }
- if (date && maxDate && date.after(maxDate)) {
- return maxDate;
- }
- return date;
- }
- /**
- * @param {?} date
- * @param {?} state
- * @return {?}
- */
- function isDateSelectable(date, state) {
- var minDate = state.minDate, maxDate = state.maxDate, disabled = state.disabled, markDisabled = state.markDisabled;
- // clang-format off
- return !(!isDefined(date) ||
- disabled ||
- (markDisabled && markDisabled(date, { year: date.year, month: date.month })) ||
- (minDate && date.before(minDate)) ||
- (maxDate && date.after(maxDate)));
- // clang-format on
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} minDate
- * @param {?} maxDate
- * @return {?}
- */
- function generateSelectBoxMonths(calendar, date, minDate, maxDate) {
- if (!date) {
- return [];
- }
- /** @type {?} */
- var months = calendar.getMonths(date.year);
- if (minDate && date.year === minDate.year) {
- /** @type {?} */
- var index = months.findIndex((/**
- * @param {?} month
- * @return {?}
- */
- function (month) { return month === minDate.month; }));
- months = months.slice(index);
- }
- if (maxDate && date.year === maxDate.year) {
- /** @type {?} */
- var index = months.findIndex((/**
- * @param {?} month
- * @return {?}
- */
- function (month) { return month === maxDate.month; }));
- months = months.slice(0, index + 1);
- }
- return months;
- }
- /**
- * @param {?} date
- * @param {?} minDate
- * @param {?} maxDate
- * @return {?}
- */
- function generateSelectBoxYears(date, minDate, maxDate) {
- if (!date) {
- return [];
- }
- /** @type {?} */
- var start = minDate ? Math.max(minDate.year, date.year - 500) : date.year - 10;
- /** @type {?} */
- var end = maxDate ? Math.min(maxDate.year, date.year + 500) : date.year + 10;
- /** @type {?} */
- var length = end - start + 1;
- /** @type {?} */
- var numbers = Array(length);
- for (var i = 0; i < length; i++) {
- numbers[i] = start + i;
- }
- return numbers;
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} maxDate
- * @return {?}
- */
- function nextMonthDisabled(calendar, date, maxDate) {
- /** @type {?} */
- var nextDate = Object.assign(calendar.getNext(date, 'm'), { day: 1 });
- return maxDate && nextDate.after(maxDate);
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} minDate
- * @return {?}
- */
- function prevMonthDisabled(calendar, date, minDate) {
- /** @type {?} */
- var prevDate = Object.assign(calendar.getPrev(date, 'm'), { day: 1 });
- return minDate && (prevDate.year === minDate.year && prevDate.month < minDate.month ||
- prevDate.year < minDate.year && minDate.month === 1);
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} state
- * @param {?} i18n
- * @param {?} force
- * @return {?}
- */
- function buildMonths(calendar, date, state, i18n, force) {
- var displayMonths = state.displayMonths, months = state.months;
- // move old months to a temporary array
- /** @type {?} */
- var monthsToReuse = months.splice(0, months.length);
- // generate new first dates, nullify or reuse months
- /** @type {?} */
- var firstDates = Array.from({ length: displayMonths }, (/**
- * @param {?} _
- * @param {?} i
- * @return {?}
- */
- function (_, i) {
- /** @type {?} */
- var firstDate = Object.assign(calendar.getNext(date, 'm', i), { day: 1 });
- months[i] = null;
- if (!force) {
- /** @type {?} */
- var reusedIndex = monthsToReuse.findIndex((/**
- * @param {?} month
- * @return {?}
- */
- function (month) { return month.firstDate.equals(firstDate); }));
- // move reused month back to months
- if (reusedIndex !== -1) {
- months[i] = monthsToReuse.splice(reusedIndex, 1)[0];
- }
- }
- return firstDate;
- }));
- // rebuild nullified months
- firstDates.forEach((/**
- * @param {?} firstDate
- * @param {?} i
- * @return {?}
- */
- function (firstDate, i) {
- if (months[i] === null) {
- months[i] = buildMonth(calendar, firstDate, state, i18n, monthsToReuse.shift() || (/** @type {?} */ ({})));
- }
- }));
- return months;
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} state
- * @param {?} i18n
- * @param {?=} month
- * @return {?}
- */
- function buildMonth(calendar, date, state, i18n, month) {
- if (month === void 0) { month = (/** @type {?} */ ({})); }
- var dayTemplateData = state.dayTemplateData, minDate = state.minDate, maxDate = state.maxDate, firstDayOfWeek = state.firstDayOfWeek, markDisabled = state.markDisabled, outsideDays = state.outsideDays;
- /** @type {?} */
- var calendarToday = calendar.getToday();
- month.firstDate = null;
- month.lastDate = null;
- month.number = date.month;
- month.year = date.year;
- month.weeks = month.weeks || [];
- month.weekdays = month.weekdays || [];
- date = getFirstViewDate(calendar, date, firstDayOfWeek);
- // month has weeks
- for (var week = 0; week < calendar.getWeeksPerMonth(); week++) {
- /** @type {?} */
- var weekObject = month.weeks[week];
- if (!weekObject) {
- weekObject = month.weeks[week] = { number: 0, days: [], collapsed: true };
- }
- /** @type {?} */
- var days = weekObject.days;
- // week has days
- for (var day = 0; day < calendar.getDaysPerWeek(); day++) {
- if (week === 0) {
- month.weekdays[day] = calendar.getWeekday(date);
- }
- /** @type {?} */
- var newDate = new NgbDate(date.year, date.month, date.day);
- /** @type {?} */
- var nextDate = calendar.getNext(newDate);
- /** @type {?} */
- var ariaLabel = i18n.getDayAriaLabel(newDate);
- // marking date as disabled
- /** @type {?} */
- var disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));
- if (!disabled && markDisabled) {
- disabled = markDisabled(newDate, { month: month.number, year: month.year });
- }
- // today
- /** @type {?} */
- var today = newDate.equals(calendarToday);
- // adding user-provided data to the context
- /** @type {?} */
- var contextUserData = dayTemplateData ? dayTemplateData(newDate, { month: month.number, year: month.year }) : undefined;
- // saving first date of the month
- if (month.firstDate === null && newDate.month === month.number) {
- month.firstDate = newDate;
- }
- // saving last date of the month
- if (newDate.month === month.number && nextDate.month !== month.number) {
- month.lastDate = newDate;
- }
- /** @type {?} */
- var dayObject = days[day];
- if (!dayObject) {
- dayObject = days[day] = (/** @type {?} */ ({}));
- }
- dayObject.date = newDate;
- dayObject.context = Object.assign(dayObject.context || {}, {
- $implicit: newDate,
- date: newDate,
- data: contextUserData,
- currentMonth: month.number,
- currentYear: month.year, disabled: disabled,
- focused: false,
- selected: false, today: today
- });
- dayObject.tabindex = -1;
- dayObject.ariaLabel = ariaLabel;
- dayObject.hidden = false;
- date = nextDate;
- }
- weekObject.number = calendar.getWeekNumber(days.map((/**
- * @param {?} day
- * @return {?}
- */
- function (day) { return day.date; })), firstDayOfWeek);
- // marking week as collapsed
- weekObject.collapsed = outsideDays === 'collapsed' && days[0].date.month !== month.number &&
- days[days.length - 1].date.month !== month.number;
- }
- return month;
- }
- /**
- * @param {?} calendar
- * @param {?} date
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function getFirstViewDate(calendar, date, firstDayOfWeek) {
- /** @type {?} */
- var daysPerWeek = calendar.getDaysPerWeek();
- /** @type {?} */
- var firstMonthDate = new NgbDate(date.year, date.month, 1);
- /** @type {?} */
- var dayOfWeek = calendar.getWeekday(firstMonthDate) % daysPerWeek;
- return calendar.getPrev(firstMonthDate, 'd', (daysPerWeek + dayOfWeek - firstDayOfWeek) % daysPerWeek);
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @param {?} locale
- * @return {?}
- */
- function NGB_DATEPICKER_18N_FACTORY(locale) {
- return new NgbDatepickerI18nDefault(locale);
- }
- /**
- * A service supplying i18n data to the datepicker component.
- *
- * The default implementation of this service uses the Angular locale and registered locale data for
- * weekdays and month names (as explained in the Angular i18n guide).
- *
- * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year
- * numerals. For other static labels the datepicker uses the default Angular i18n.
- *
- * See the [i18n demo](#/components/datepicker/examples#i18n) and
- * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define
- * a custom provider for i18n.
- * @abstract
- */
- var NgbDatepickerI18n = /** @class */ (function () {
- function NgbDatepickerI18n() {
- }
- /**
- * Returns the textual representation of a day that is rendered in a day cell.
- *
- * @since 3.0.0
- */
- /**
- * Returns the textual representation of a day that is rendered in a day cell.
- *
- * \@since 3.0.0
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerI18n.prototype.getDayNumerals = /**
- * Returns the textual representation of a day that is rendered in a day cell.
- *
- * \@since 3.0.0
- * @param {?} date
- * @return {?}
- */
- function (date) { return "" + date.day; };
- /**
- * Returns the textual representation of a week number rendered by datepicker.
- *
- * @since 3.0.0
- */
- /**
- * Returns the textual representation of a week number rendered by datepicker.
- *
- * \@since 3.0.0
- * @param {?} weekNumber
- * @return {?}
- */
- NgbDatepickerI18n.prototype.getWeekNumerals = /**
- * Returns the textual representation of a week number rendered by datepicker.
- *
- * \@since 3.0.0
- * @param {?} weekNumber
- * @return {?}
- */
- function (weekNumber) { return "" + weekNumber; };
- /**
- * Returns the textual representation of a year that is rendered in the datepicker year select box.
- *
- * @since 3.0.0
- */
- /**
- * Returns the textual representation of a year that is rendered in the datepicker year select box.
- *
- * \@since 3.0.0
- * @param {?} year
- * @return {?}
- */
- NgbDatepickerI18n.prototype.getYearNumerals = /**
- * Returns the textual representation of a year that is rendered in the datepicker year select box.
- *
- * \@since 3.0.0
- * @param {?} year
- * @return {?}
- */
- function (year) { return "" + year; };
- NgbDatepickerI18n.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_18N_FACTORY, deps: [LOCALE_ID] },] }
- ];
- /** @nocollapse */ NgbDatepickerI18n.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerI18n_Factory() { return NGB_DATEPICKER_18N_FACTORY(ɵɵinject(LOCALE_ID)); }, token: NgbDatepickerI18n, providedIn: "root" });
- return NgbDatepickerI18n;
- }());
- var NgbDatepickerI18nDefault = /** @class */ (function (_super) {
- __extends(NgbDatepickerI18nDefault, _super);
- function NgbDatepickerI18nDefault(_locale) {
- var _this = _super.call(this) || this;
- _this._locale = _locale;
- /** @type {?} */
- var weekdaysStartingOnSunday = getLocaleDayNames(_locale, FormStyle.Standalone, TranslationWidth.Short);
- _this._weekdaysShort = weekdaysStartingOnSunday.map((/**
- * @param {?} day
- * @param {?} index
- * @return {?}
- */
- function (day, index) { return weekdaysStartingOnSunday[(index + 1) % 7]; }));
- _this._monthsShort = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Abbreviated);
- _this._monthsFull = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Wide);
- return _this;
- }
- /**
- * @param {?} weekday
- * @return {?}
- */
- NgbDatepickerI18nDefault.prototype.getWeekdayShortName = /**
- * @param {?} weekday
- * @return {?}
- */
- function (weekday) { return this._weekdaysShort[weekday - 1]; };
- /**
- * @param {?} month
- * @return {?}
- */
- NgbDatepickerI18nDefault.prototype.getMonthShortName = /**
- * @param {?} month
- * @return {?}
- */
- function (month) { return this._monthsShort[month - 1]; };
- /**
- * @param {?} month
- * @return {?}
- */
- NgbDatepickerI18nDefault.prototype.getMonthFullName = /**
- * @param {?} month
- * @return {?}
- */
- function (month) { return this._monthsFull[month - 1]; };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerI18nDefault.prototype.getDayAriaLabel = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var jsDate = new Date(date.year, date.month - 1, date.day);
- return formatDate(jsDate, 'fullDate', this._locale);
- };
- NgbDatepickerI18nDefault.decorators = [
- { type: Injectable }
- ];
- /** @nocollapse */
- NgbDatepickerI18nDefault.ctorParameters = function () { return [
- { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
- ]; };
- return NgbDatepickerI18nDefault;
- }(NgbDatepickerI18n));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerService = /** @class */ (function () {
- function NgbDatepickerService(_calendar, _i18n) {
- var _this = this;
- this._calendar = _calendar;
- this._i18n = _i18n;
- this._VALIDATORS = {
- dayTemplateData: (/**
- * @param {?} dayTemplateData
- * @return {?}
- */
- function (dayTemplateData) {
- if (_this._state.dayTemplateData !== dayTemplateData) {
- return { dayTemplateData: dayTemplateData };
- }
- }),
- displayMonths: (/**
- * @param {?} displayMonths
- * @return {?}
- */
- function (displayMonths) {
- displayMonths = toInteger(displayMonths);
- if (isInteger(displayMonths) && displayMonths > 0 && _this._state.displayMonths !== displayMonths) {
- return { displayMonths: displayMonths };
- }
- }),
- disabled: (/**
- * @param {?} disabled
- * @return {?}
- */
- function (disabled) {
- if (_this._state.disabled !== disabled) {
- return { disabled: disabled };
- }
- }),
- firstDayOfWeek: (/**
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function (firstDayOfWeek) {
- firstDayOfWeek = toInteger(firstDayOfWeek);
- if (isInteger(firstDayOfWeek) && firstDayOfWeek >= 0 && _this._state.firstDayOfWeek !== firstDayOfWeek) {
- return { firstDayOfWeek: firstDayOfWeek };
- }
- }),
- focusVisible: (/**
- * @param {?} focusVisible
- * @return {?}
- */
- function (focusVisible) {
- if (_this._state.focusVisible !== focusVisible && !_this._state.disabled) {
- return { focusVisible: focusVisible };
- }
- }),
- markDisabled: (/**
- * @param {?} markDisabled
- * @return {?}
- */
- function (markDisabled) {
- if (_this._state.markDisabled !== markDisabled) {
- return { markDisabled: markDisabled };
- }
- }),
- maxDate: (/**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var maxDate = _this.toValidDate(date, null);
- if (isChangedDate(_this._state.maxDate, maxDate)) {
- return { maxDate: maxDate };
- }
- }),
- minDate: (/**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var minDate = _this.toValidDate(date, null);
- if (isChangedDate(_this._state.minDate, minDate)) {
- return { minDate: minDate };
- }
- }),
- navigation: (/**
- * @param {?} navigation
- * @return {?}
- */
- function (navigation) {
- if (_this._state.navigation !== navigation) {
- return { navigation: navigation };
- }
- }),
- outsideDays: (/**
- * @param {?} outsideDays
- * @return {?}
- */
- function (outsideDays) {
- if (_this._state.outsideDays !== outsideDays) {
- return { outsideDays: outsideDays };
- }
- })
- };
- this._model$ = new Subject();
- this._dateSelect$ = new Subject();
- this._state = {
- disabled: false,
- displayMonths: 1,
- firstDayOfWeek: 1,
- focusVisible: false,
- months: [],
- navigation: 'select',
- outsideDays: 'visible',
- prevDisabled: false,
- nextDisabled: false,
- selectBoxes: { years: [], months: [] },
- selectedDate: null
- };
- }
- Object.defineProperty(NgbDatepickerService.prototype, "model$", {
- get: /**
- * @return {?}
- */
- function () { return this._model$.pipe(filter((/**
- * @param {?} model
- * @return {?}
- */
- function (model) { return model.months.length > 0; }))); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbDatepickerService.prototype, "dateSelect$", {
- get: /**
- * @return {?}
- */
- function () { return this._dateSelect$.pipe(filter((/**
- * @param {?} date
- * @return {?}
- */
- function (date) { return date !== null; }))); },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} options
- * @return {?}
- */
- NgbDatepickerService.prototype.set = /**
- * @param {?} options
- * @return {?}
- */
- function (options) {
- var _this = this;
- /** @type {?} */
- var patch = Object.keys(options)
- .map((/**
- * @param {?} key
- * @return {?}
- */
- function (key) { return _this._VALIDATORS[key](options[key]); }))
- .reduce((/**
- * @param {?} obj
- * @param {?} part
- * @return {?}
- */
- function (obj, part) { return (__assign({}, obj, part)); }), {});
- if (Object.keys(patch).length > 0) {
- this._nextState(patch);
- }
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerService.prototype.focus = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- if (!this._state.disabled && this._calendar.isValid(date) && isChangedDate(this._state.focusDate, date)) {
- this._nextState({ focusDate: date });
- }
- };
- /**
- * @return {?}
- */
- NgbDatepickerService.prototype.focusSelect = /**
- * @return {?}
- */
- function () {
- if (isDateSelectable(this._state.focusDate, this._state)) {
- this.select(this._state.focusDate, { emitEvent: true });
- }
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerService.prototype.open = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var firstDate = this.toValidDate(date, this._calendar.getToday());
- if (!this._state.disabled && (!this._state.firstDate || isChangedMonth(this._state.firstDate, date))) {
- this._nextState({ firstDate: firstDate });
- }
- };
- /**
- * @param {?} date
- * @param {?=} options
- * @return {?}
- */
- NgbDatepickerService.prototype.select = /**
- * @param {?} date
- * @param {?=} options
- * @return {?}
- */
- function (date, options) {
- if (options === void 0) { options = {}; }
- /** @type {?} */
- var selectedDate = this.toValidDate(date, null);
- if (!this._state.disabled) {
- if (isChangedDate(this._state.selectedDate, selectedDate)) {
- this._nextState({ selectedDate: selectedDate });
- }
- if (options.emitEvent && isDateSelectable(selectedDate, this._state)) {
- this._dateSelect$.next(selectedDate);
- }
- }
- };
- /**
- * @param {?} date
- * @param {?=} defaultValue
- * @return {?}
- */
- NgbDatepickerService.prototype.toValidDate = /**
- * @param {?} date
- * @param {?=} defaultValue
- * @return {?}
- */
- function (date, defaultValue) {
- /** @type {?} */
- var ngbDate = NgbDate.from(date);
- if (defaultValue === undefined) {
- defaultValue = this._calendar.getToday();
- }
- return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;
- };
- /**
- * @private
- * @param {?} patch
- * @return {?}
- */
- NgbDatepickerService.prototype._nextState = /**
- * @private
- * @param {?} patch
- * @return {?}
- */
- function (patch) {
- /** @type {?} */
- var newState = this._updateState(patch);
- this._patchContexts(newState);
- this._state = newState;
- this._model$.next(this._state);
- };
- /**
- * @private
- * @param {?} state
- * @return {?}
- */
- NgbDatepickerService.prototype._patchContexts = /**
- * @private
- * @param {?} state
- * @return {?}
- */
- function (state) {
- var months = state.months, displayMonths = state.displayMonths, selectedDate = state.selectedDate, focusDate = state.focusDate, focusVisible = state.focusVisible, disabled = state.disabled, outsideDays = state.outsideDays;
- state.months.forEach((/**
- * @param {?} month
- * @return {?}
- */
- function (month) {
- month.weeks.forEach((/**
- * @param {?} week
- * @return {?}
- */
- function (week) {
- week.days.forEach((/**
- * @param {?} day
- * @return {?}
- */
- function (day) {
- // patch focus flag
- if (focusDate) {
- day.context.focused = focusDate.equals(day.date) && focusVisible;
- }
- // calculating tabindex
- day.tabindex = !disabled && day.date.equals(focusDate) && focusDate.month === month.number ? 0 : -1;
- // override context disabled
- if (disabled === true) {
- day.context.disabled = true;
- }
- // patch selection flag
- if (selectedDate !== undefined) {
- day.context.selected = selectedDate !== null && selectedDate.equals(day.date);
- }
- // visibility
- if (month.number !== day.date.month) {
- day.hidden = outsideDays === 'hidden' || outsideDays === 'collapsed' ||
- (displayMonths > 1 && day.date.after(months[0].firstDate) &&
- day.date.before(months[displayMonths - 1].lastDate));
- }
- }));
- }));
- }));
- };
- /**
- * @private
- * @param {?} patch
- * @return {?}
- */
- NgbDatepickerService.prototype._updateState = /**
- * @private
- * @param {?} patch
- * @return {?}
- */
- function (patch) {
- // patching fields
- /** @type {?} */
- var state = Object.assign({}, this._state, patch);
- /** @type {?} */
- var startDate = state.firstDate;
- // min/max dates changed
- if ('minDate' in patch || 'maxDate' in patch) {
- checkMinBeforeMax(state.minDate, state.maxDate);
- state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
- state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
- startDate = state.focusDate;
- }
- // disabled
- if ('disabled' in patch) {
- state.focusVisible = false;
- }
- // initial rebuild via 'select()'
- if ('selectedDate' in patch && this._state.months.length === 0) {
- startDate = state.selectedDate;
- }
- // terminate early if only focus visibility was changed
- if ('focusVisible' in patch) {
- return state;
- }
- // focus date changed
- if ('focusDate' in patch) {
- state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
- startDate = state.focusDate;
- // nothing to rebuild if only focus changed and it is still visible
- if (state.months.length !== 0 && !state.focusDate.before(state.firstDate) &&
- !state.focusDate.after(state.lastDate)) {
- return state;
- }
- }
- // first date changed
- if ('firstDate' in patch) {
- state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
- startDate = state.firstDate;
- }
- // rebuilding months
- if (startDate) {
- /** @type {?} */
- var forceRebuild = 'dayTemplateData' in patch || 'firstDayOfWeek' in patch || 'markDisabled' in patch ||
- 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch || 'outsideDays' in patch;
- /** @type {?} */
- var months = buildMonths(this._calendar, startDate, state, this._i18n, forceRebuild);
- // updating months and boundary dates
- state.months = months;
- state.firstDate = months.length > 0 ? months[0].firstDate : undefined;
- state.lastDate = months.length > 0 ? months[months.length - 1].lastDate : undefined;
- // reset selected date if 'markDisabled' returns true
- if ('selectedDate' in patch && !isDateSelectable(state.selectedDate, state)) {
- state.selectedDate = null;
- }
- // adjusting focus after months were built
- if ('firstDate' in patch) {
- if (state.focusDate === undefined || state.focusDate.before(state.firstDate) ||
- state.focusDate.after(state.lastDate)) {
- state.focusDate = startDate;
- }
- }
- // adjusting months/years for the select box navigation
- /** @type {?} */
- var yearChanged = !this._state.firstDate || this._state.firstDate.year !== state.firstDate.year;
- /** @type {?} */
- var monthChanged = !this._state.firstDate || this._state.firstDate.month !== state.firstDate.month;
- if (state.navigation === 'select') {
- // years -> boundaries (min/max were changed)
- if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.years.length === 0 || yearChanged) {
- state.selectBoxes.years = generateSelectBoxYears(state.firstDate, state.minDate, state.maxDate);
- }
- // months -> when current year or boundaries change
- if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.months.length === 0 || yearChanged) {
- state.selectBoxes.months =
- generateSelectBoxMonths(this._calendar, state.firstDate, state.minDate, state.maxDate);
- }
- }
- else {
- state.selectBoxes = { years: [], months: [] };
- }
- // updating navigation arrows -> boundaries change (min/max) or month/year changes
- if ((state.navigation === 'arrows' || state.navigation === 'select') &&
- (monthChanged || yearChanged || 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch)) {
- state.prevDisabled = state.disabled || prevMonthDisabled(this._calendar, state.firstDate, state.minDate);
- state.nextDisabled = state.disabled || nextMonthDisabled(this._calendar, state.lastDate, state.maxDate);
- }
- }
- return state;
- };
- NgbDatepickerService.decorators = [
- { type: Injectable }
- ];
- /** @nocollapse */
- NgbDatepickerService.ctorParameters = function () { return [
- { type: NgbCalendar },
- { type: NgbDatepickerI18n }
- ]; };
- return NgbDatepickerService;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @enum {number} */
- var Key = {
- Tab: 9,
- Enter: 13,
- Escape: 27,
- Space: 32,
- PageUp: 33,
- PageDown: 34,
- End: 35,
- Home: 36,
- ArrowLeft: 37,
- ArrowUp: 38,
- ArrowRight: 39,
- ArrowDown: 40,
- };
- Key[Key.Tab] = 'Tab';
- Key[Key.Enter] = 'Enter';
- Key[Key.Escape] = 'Escape';
- Key[Key.Space] = 'Space';
- Key[Key.PageUp] = 'PageUp';
- Key[Key.PageDown] = 'PageDown';
- Key[Key.End] = 'End';
- Key[Key.Home] = 'Home';
- Key[Key.ArrowLeft] = 'ArrowLeft';
- Key[Key.ArrowUp] = 'ArrowUp';
- Key[Key.ArrowRight] = 'ArrowRight';
- Key[Key.ArrowDown] = 'ArrowDown';
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A service that represents the keyboard navigation.
- *
- * Default keyboard shortcuts [are documented in the overview](#/components/datepicker/overview#keyboard-shortcuts)
- *
- * \@since 5.2.0
- */
- var NgbDatepickerKeyboardService = /** @class */ (function () {
- function NgbDatepickerKeyboardService() {
- }
- /**
- * Processes a keyboard event.
- */
- /**
- * Processes a keyboard event.
- * @param {?} event
- * @param {?} datepicker
- * @param {?} calendar
- * @return {?}
- */
- NgbDatepickerKeyboardService.prototype.processKey = /**
- * Processes a keyboard event.
- * @param {?} event
- * @param {?} datepicker
- * @param {?} calendar
- * @return {?}
- */
- function (event, datepicker, calendar) {
- /** @type {?} */
- var state = datepicker.state;
- // tslint:disable-next-line:deprecation
- switch (event.which) {
- case Key.PageUp:
- datepicker.focusDate(calendar.getPrev(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));
- break;
- case Key.PageDown:
- datepicker.focusDate(calendar.getNext(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));
- break;
- case Key.End:
- datepicker.focusDate(event.shiftKey ? state.maxDate : state.lastDate);
- break;
- case Key.Home:
- datepicker.focusDate(event.shiftKey ? state.minDate : state.firstDate);
- break;
- case Key.ArrowLeft:
- datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', 1));
- break;
- case Key.ArrowUp:
- datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', calendar.getDaysPerWeek()));
- break;
- case Key.ArrowRight:
- datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', 1));
- break;
- case Key.ArrowDown:
- datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', calendar.getDaysPerWeek()));
- break;
- case Key.Enter:
- case Key.Space:
- datepicker.focusSelect();
- break;
- default:
- return;
- }
- event.preventDefault();
- event.stopPropagation();
- };
- NgbDatepickerKeyboardService.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbDatepickerKeyboardService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerKeyboardService_Factory() { return new NgbDatepickerKeyboardService(); }, token: NgbDatepickerKeyboardService, providedIn: "root" });
- return NgbDatepickerKeyboardService;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @enum {number} */
- var NavigationEvent = {
- PREV: 0,
- NEXT: 1,
- };
- NavigationEvent[NavigationEvent.PREV] = 'PREV';
- NavigationEvent[NavigationEvent.NEXT] = 'NEXT';
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbDatepicker`](#/components/datepicker/api#NgbDatepicker) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the datepickers used in the application.
- */
- var NgbDatepickerConfig = /** @class */ (function () {
- function NgbDatepickerConfig() {
- this.displayMonths = 1;
- this.firstDayOfWeek = 1;
- this.navigation = 'select';
- this.outsideDays = 'visible';
- this.showWeekdays = true;
- this.showWeekNumbers = false;
- }
- NgbDatepickerConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbDatepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerConfig_Factory() { return new NgbDatepickerConfig(); }, token: NgbDatepickerConfig, providedIn: "root" });
- return NgbDatepickerConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @return {?}
- */
- function NGB_DATEPICKER_DATE_ADAPTER_FACTORY() {
- return new NgbDateStructAdapter();
- }
- /**
- * An abstract service that does the conversion between the internal datepicker `NgbDateStruct` model and
- * any provided user date model `D`, ex. a string, a native date, etc.
- *
- * The adapter is used **only** for conversion when binding datepicker to a form control,
- * ex. `[(ngModel)]="userDateModel"`. Here `userDateModel` can be of any type.
- *
- * The default datepicker implementation assumes we use `NgbDateStruct` as a user model.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details
- * and the [custom adapter demo](#/components/datepicker/examples#adapter) for an example.
- * @abstract
- * @template D
- */
- var NgbDateAdapter = /** @class */ (function () {
- function NgbDateAdapter() {
- }
- NgbDateAdapter.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY },] }
- ];
- /** @nocollapse */ NgbDateAdapter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY, token: NgbDateAdapter, providedIn: "root" });
- return NgbDateAdapter;
- }());
- var NgbDateStructAdapter = /** @class */ (function (_super) {
- __extends(NgbDateStructAdapter, _super);
- function NgbDateStructAdapter() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- */
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- * @param {?} date
- * @return {?}
- */
- NgbDateStructAdapter.prototype.fromModel = /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
- { year: date.year, month: date.month, day: date.day } :
- null;
- };
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- */
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- * @param {?} date
- * @return {?}
- */
- NgbDateStructAdapter.prototype.toModel = /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
- { year: date.year, month: date.month, day: date.day } :
- null;
- };
- NgbDateStructAdapter.decorators = [
- { type: Injectable }
- ];
- return NgbDateStructAdapter;
- }(NgbDateAdapter));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_DATEPICKER_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbDatepicker; })),
- multi: true
- };
- /**
- * A highly configurable component that helps you with selecting calendar dates.
- *
- * `NgbDatepicker` is meant to be displayed inline on a page or put inside a popup.
- */
- var NgbDatepicker = /** @class */ (function () {
- function NgbDatepicker(_service, _calendar, i18n, config, _keyboardService, cd, _elementRef, _ngbDateAdapter, _ngZone) {
- var _this = this;
- this._service = _service;
- this._calendar = _calendar;
- this.i18n = i18n;
- this._keyboardService = _keyboardService;
- this._elementRef = _elementRef;
- this._ngbDateAdapter = _ngbDateAdapter;
- this._ngZone = _ngZone;
- this._destroyed$ = new Subject();
- this._publicState = (/** @type {?} */ ({}));
- /**
- * An event emitted right before the navigation happens and displayed month changes.
- *
- * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
- */
- this.navigate = new EventEmitter();
- /**
- * An event emitted when user selects a date using keyboard or mouse.
- *
- * The payload of the event is currently selected `NgbDate`.
- *
- * \@since 5.2.0
- */
- this.dateSelect = new EventEmitter();
- /**
- * An event emitted when user selects a date using keyboard or mouse.
- *
- * The payload of the event is currently selected `NgbDate`.
- *
- * Please use 'dateSelect' output instead, this will be deprecated in version 6.0 due to collision with native
- * 'select' event.
- */
- this.select = this.dateSelect;
- this.onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.onTouched = (/**
- * @return {?}
- */
- function () { });
- ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
- 'maxDate', 'navigation', 'outsideDays', 'showWeekdays', 'showWeekNumbers', 'startDate']
- .forEach((/**
- * @param {?} input
- * @return {?}
- */
- function (input) { return _this[input] = config[input]; }));
- _service.dateSelect$.pipe(takeUntil(this._destroyed$)).subscribe((/**
- * @param {?} date
- * @return {?}
- */
- function (date) { _this.dateSelect.emit(date); }));
- _service.model$.pipe(takeUntil(this._destroyed$)).subscribe((/**
- * @param {?} model
- * @return {?}
- */
- function (model) {
- /** @type {?} */
- var newDate = model.firstDate;
- /** @type {?} */
- var oldDate = _this.model ? _this.model.firstDate : null;
- // update public state
- _this._publicState = {
- maxDate: model.maxDate,
- minDate: model.minDate,
- firstDate: model.firstDate,
- lastDate: model.lastDate,
- focusedDate: model.focusDate
- };
- /** @type {?} */
- var navigationPrevented = false;
- // emitting navigation event if the first month changes
- if (!newDate.equals(oldDate)) {
- _this.navigate.emit({
- current: oldDate ? { year: oldDate.year, month: oldDate.month } : null,
- next: { year: newDate.year, month: newDate.month },
- preventDefault: (/**
- * @return {?}
- */
- function () { return navigationPrevented = true; })
- });
- // can't prevent the very first navigation
- if (navigationPrevented && oldDate !== null) {
- _this._service.open(oldDate);
- return;
- }
- }
- /** @type {?} */
- var newSelectedDate = model.selectedDate;
- /** @type {?} */
- var newFocusedDate = model.focusDate;
- /** @type {?} */
- var oldFocusedDate = _this.model ? _this.model.focusDate : null;
- _this.model = model;
- // handling selection change
- if (isChangedDate(newSelectedDate, _this._controlValue)) {
- _this._controlValue = newSelectedDate;
- _this.onTouched();
- _this.onChange(_this._ngbDateAdapter.toModel(newSelectedDate));
- }
- // handling focus change
- if (isChangedDate(newFocusedDate, oldFocusedDate) && oldFocusedDate && model.focusVisible) {
- _this.focus();
- }
- cd.markForCheck();
- }));
- }
- Object.defineProperty(NgbDatepicker.prototype, "state", {
- /**
- * Returns the readonly public state of the datepicker
- *
- * @since 5.2.0
- */
- get: /**
- * Returns the readonly public state of the datepicker
- *
- * \@since 5.2.0
- * @return {?}
- */
- function () { return this._publicState; },
- enumerable: true,
- configurable: true
- });
- /**
- * Focuses on given date.
- */
- /**
- * Focuses on given date.
- * @param {?} date
- * @return {?}
- */
- NgbDatepicker.prototype.focusDate = /**
- * Focuses on given date.
- * @param {?} date
- * @return {?}
- */
- function (date) { this._service.focus(NgbDate.from(date)); };
- /**
- * Selects focused date.
- */
- /**
- * Selects focused date.
- * @return {?}
- */
- NgbDatepicker.prototype.focusSelect = /**
- * Selects focused date.
- * @return {?}
- */
- function () { this._service.focusSelect(); };
- /**
- * @return {?}
- */
- NgbDatepicker.prototype.focus = /**
- * @return {?}
- */
- function () {
- var _this = this;
- this._ngZone.onStable.asObservable().pipe(take(1)).subscribe((/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var elementToFocus = _this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');
- if (elementToFocus) {
- elementToFocus.focus();
- }
- }));
- };
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- */
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- * @param {?=} date
- * @return {?}
- */
- NgbDatepicker.prototype.navigateTo = /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- * @param {?=} date
- * @return {?}
- */
- function (date) {
- this._service.open(NgbDate.from(date ? date.day ? (/** @type {?} */ (date)) : __assign({}, date, { day: 1 }) : null));
- };
- /**
- * @return {?}
- */
- NgbDatepicker.prototype.ngAfterViewInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- this._ngZone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var focusIns$ = fromEvent(_this._monthsEl.nativeElement, 'focusin');
- /** @type {?} */
- var focusOuts$ = fromEvent(_this._monthsEl.nativeElement, 'focusout');
- var nativeElement = _this._elementRef.nativeElement;
- // we're changing 'focusVisible' only when entering or leaving months view
- // and ignoring all focus events where both 'target' and 'related' target are day cells
- merge(focusIns$, focusOuts$)
- .pipe(filter((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var target = _a.target, relatedTarget = _a.relatedTarget;
- return !(hasClassName(target, 'ngb-dp-day') && hasClassName(relatedTarget, 'ngb-dp-day') &&
- nativeElement.contains((/** @type {?} */ (target))) && nativeElement.contains((/** @type {?} */ (relatedTarget))));
- })), takeUntil(_this._destroyed$))
- .subscribe((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var type = _a.type;
- return _this._ngZone.run((/**
- * @return {?}
- */
- function () { return _this._service.set({ focusVisible: type === 'focusin' }); }));
- }));
- }));
- };
- /**
- * @return {?}
- */
- NgbDatepicker.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () { this._destroyed$.next(); };
- /**
- * @return {?}
- */
- NgbDatepicker.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- if (this.model === undefined) {
- /** @type {?} */
- var inputs_1 = {};
- ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
- 'outsideDays']
- .forEach((/**
- * @param {?} name
- * @return {?}
- */
- function (name) { return inputs_1[name] = _this[name]; }));
- this._service.set(inputs_1);
- this.navigateTo(this.startDate);
- }
- };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbDatepicker.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- var _this = this;
- /** @type {?} */
- var inputs = {};
- ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
- 'outsideDays']
- .filter((/**
- * @param {?} name
- * @return {?}
- */
- function (name) { return name in changes; }))
- .forEach((/**
- * @param {?} name
- * @return {?}
- */
- function (name) { return inputs[name] = _this[name]; }));
- this._service.set(inputs);
- if ('startDate' in changes) {
- var _a = changes.startDate, currentValue = _a.currentValue, previousValue = _a.previousValue;
- if (isChangedMonth(previousValue, currentValue)) {
- this.navigateTo(this.startDate);
- }
- }
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepicker.prototype.onDateSelect = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- this._service.focus(date);
- this._service.select(date, { emitEvent: true });
- };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbDatepicker.prototype.onKeyDown = /**
- * @param {?} event
- * @return {?}
- */
- function (event) { this._keyboardService.processKey(event, this, this._calendar); };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepicker.prototype.onNavigateDateSelect = /**
- * @param {?} date
- * @return {?}
- */
- function (date) { this._service.open(date); };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbDatepicker.prototype.onNavigateEvent = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- switch (event) {
- case NavigationEvent.PREV:
- this._service.open(this._calendar.getPrev(this.model.firstDate, 'm', 1));
- break;
- case NavigationEvent.NEXT:
- this._service.open(this._calendar.getNext(this.model.firstDate, 'm', 1));
- break;
- }
- };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbDatepicker.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbDatepicker.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onTouched = fn; };
- /**
- * @param {?} disabled
- * @return {?}
- */
- NgbDatepicker.prototype.setDisabledState = /**
- * @param {?} disabled
- * @return {?}
- */
- function (disabled) { this._service.set({ disabled: disabled }); };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbDatepicker.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._controlValue = NgbDate.from(this._ngbDateAdapter.fromModel(value));
- this._service.select(this._controlValue);
- };
- NgbDatepicker.decorators = [
- { type: Component, args: [{
- exportAs: 'ngbDatepicker',
- selector: 'ngb-datepicker',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- template: "\n <ng-template #dt let-date=\"date\" let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\" let-focused=\"focused\">\n <div ngbDatepickerDayView\n [date]=\"date\"\n [currentMonth]=\"currentMonth\"\n [selected]=\"selected\"\n [disabled]=\"disabled\"\n [focused]=\"focused\">\n </div>\n </ng-template>\n\n <div class=\"ngb-dp-header\">\n <ngb-datepicker-navigation *ngIf=\"navigation !== 'none'\"\n [date]=\"model.firstDate\"\n [months]=\"model.months\"\n [disabled]=\"model.disabled\"\n [showSelect]=\"model.navigation === 'select'\"\n [prevDisabled]=\"model.prevDisabled\"\n [nextDisabled]=\"model.nextDisabled\"\n [selectBoxes]=\"model.selectBoxes\"\n (navigate)=\"onNavigateEvent($event)\"\n (select)=\"onNavigateDateSelect($event)\">\n </ngb-datepicker-navigation>\n </div>\n\n <div #months class=\"ngb-dp-months\" (keydown)=\"onKeyDown($event)\">\n <ng-template ngFor let-month [ngForOf]=\"model.months\" let-i=\"index\">\n <div class=\"ngb-dp-month\">\n <div *ngIf=\"navigation === 'none' || (displayMonths > 1 && navigation === 'select')\"\n class=\"ngb-dp-month-name\">\n {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}\n </div>\n <ngb-datepicker-month-view\n [month]=\"month\"\n [dayTemplate]=\"dayTemplate || dt\"\n [showWeekdays]=\"showWeekdays\"\n [showWeekNumbers]=\"showWeekNumbers\"\n (select)=\"onDateSelect($event)\">\n </ngb-datepicker-month-view>\n </div>\n </ng-template>\n </div>\n\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\n ",
- providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NgbDatepickerService],
- styles: ["ngb-datepicker{border:1px solid #dfdfdf;border-radius:.25rem;display:inline-block}ngb-datepicker-month-view{pointer-events:auto}ngb-datepicker.dropdown-menu{padding:0}.ngb-dp-body{z-index:1050}.ngb-dp-header{border-bottom:0;border-radius:.25rem .25rem 0 0;padding-top:.25rem;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-months{display:-ms-flexbox;display:flex}.ngb-dp-month{pointer-events:none}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,.ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-left:1rem}.ngb-dp-month:last-child .ngb-dp-week{padding-right:.25rem}.ngb-dp-month:first-child .ngb-dp-week{padding-left:.25rem}.ngb-dp-month .ngb-dp-week:last-child{padding-bottom:.25rem}"]
- }] }
- ];
- /** @nocollapse */
- NgbDatepicker.ctorParameters = function () { return [
- { type: NgbDatepickerService },
- { type: NgbCalendar },
- { type: NgbDatepickerI18n },
- { type: NgbDatepickerConfig },
- { type: NgbDatepickerKeyboardService },
- { type: ChangeDetectorRef },
- { type: ElementRef },
- { type: NgbDateAdapter },
- { type: NgZone }
- ]; };
- NgbDatepicker.propDecorators = {
- _monthsEl: [{ type: ViewChild, args: ['months', { static: true },] }],
- dayTemplate: [{ type: Input }],
- dayTemplateData: [{ type: Input }],
- displayMonths: [{ type: Input }],
- firstDayOfWeek: [{ type: Input }],
- footerTemplate: [{ type: Input }],
- markDisabled: [{ type: Input }],
- maxDate: [{ type: Input }],
- minDate: [{ type: Input }],
- navigation: [{ type: Input }],
- outsideDays: [{ type: Input }],
- showWeekdays: [{ type: Input }],
- showWeekNumbers: [{ type: Input }],
- startDate: [{ type: Input }],
- navigate: [{ type: Output }],
- dateSelect: [{ type: Output }],
- select: [{ type: Output }]
- };
- return NgbDatepicker;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerMonthView = /** @class */ (function () {
- function NgbDatepickerMonthView(i18n) {
- this.i18n = i18n;
- this.select = new EventEmitter();
- }
- /**
- * @param {?} day
- * @return {?}
- */
- NgbDatepickerMonthView.prototype.doSelect = /**
- * @param {?} day
- * @return {?}
- */
- function (day) {
- if (!day.context.disabled && !day.hidden) {
- this.select.emit(day.date);
- }
- };
- NgbDatepickerMonthView.decorators = [
- { type: Component, args: [{
- selector: 'ngb-datepicker-month-view',
- host: { 'role': 'grid' },
- encapsulation: ViewEncapsulation.None,
- template: "\n <div *ngIf=\"showWeekdays\" class=\"ngb-dp-week ngb-dp-weekdays\" role=\"row\">\n <div *ngIf=\"showWeekNumbers\" class=\"ngb-dp-weekday ngb-dp-showweek\"></div>\n <div *ngFor=\"let w of month.weekdays\" class=\"ngb-dp-weekday small\" role=\"columnheader\">\n {{ i18n.getWeekdayShortName(w) }}\n </div>\n </div>\n <ng-template ngFor let-week [ngForOf]=\"month.weeks\">\n <div *ngIf=\"!week.collapsed\" class=\"ngb-dp-week\" role=\"row\">\n <div *ngIf=\"showWeekNumbers\" class=\"ngb-dp-week-number small text-muted\">{{ i18n.getWeekNumerals(week.number) }}</div>\n <div *ngFor=\"let day of week.days\" (click)=\"doSelect(day); $event.preventDefault()\" class=\"ngb-dp-day\" role=\"gridcell\"\n [class.disabled]=\"day.context.disabled\"\n [tabindex]=\"day.tabindex\"\n [class.hidden]=\"day.hidden\"\n [class.ngb-dp-today]=\"day.context.today\"\n [attr.aria-label]=\"day.ariaLabel\">\n <ng-template [ngIf]=\"!day.hidden\">\n <ng-template [ngTemplateOutlet]=\"dayTemplate\" [ngTemplateOutletContext]=\"day.context\"></ng-template>\n </ng-template>\n </div>\n </div>\n </ng-template>\n ",
- styles: ["ngb-datepicker-month-view{display:block}.ngb-dp-week-number,.ngb-dp-weekday{line-height:2rem;text-align:center;font-style:italic}.ngb-dp-weekday{color:#5bc0de;color:var(--info)}.ngb-dp-week{border-radius:.25rem;display:-ms-flexbox;display:flex}.ngb-dp-weekdays{border-bottom:1px solid rgba(0,0,0,.125);border-radius:0;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-day,.ngb-dp-week-number,.ngb-dp-weekday{width:2rem;height:2rem}.ngb-dp-day{cursor:pointer}.ngb-dp-day.disabled,.ngb-dp-day.hidden{cursor:default}.ngb-dp-day[tabindex=\"0\"]{z-index:1}"]
- }] }
- ];
- /** @nocollapse */
- NgbDatepickerMonthView.ctorParameters = function () { return [
- { type: NgbDatepickerI18n }
- ]; };
- NgbDatepickerMonthView.propDecorators = {
- dayTemplate: [{ type: Input }],
- month: [{ type: Input }],
- showWeekdays: [{ type: Input }],
- showWeekNumbers: [{ type: Input }],
- select: [{ type: Output }]
- };
- return NgbDatepickerMonthView;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerNavigation = /** @class */ (function () {
- function NgbDatepickerNavigation(i18n) {
- this.i18n = i18n;
- this.navigation = NavigationEvent;
- this.months = [];
- this.navigate = new EventEmitter();
- this.select = new EventEmitter();
- }
- /**
- * @param {?} event
- * @return {?}
- */
- NgbDatepickerNavigation.prototype.onClickPrev = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- ((/** @type {?} */ (event.currentTarget))).focus();
- this.navigate.emit(this.navigation.PREV);
- };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbDatepickerNavigation.prototype.onClickNext = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- ((/** @type {?} */ (event.currentTarget))).focus();
- this.navigate.emit(this.navigation.NEXT);
- };
- NgbDatepickerNavigation.decorators = [
- { type: Component, args: [{
- selector: 'ngb-datepicker-navigation',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- template: "\n <div class=\"ngb-dp-arrow\">\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickPrev($event)\" [disabled]=\"prevDisabled\"\n i18n-aria-label=\"@@ngb.datepicker.previous-month\" aria-label=\"Previous month\"\n i18n-title=\"@@ngb.datepicker.previous-month\" title=\"Previous month\">\n <span class=\"ngb-dp-navigation-chevron\"></span>\n </button>\n </div>\n <ngb-datepicker-navigation-select *ngIf=\"showSelect\" class=\"ngb-dp-navigation-select\"\n [date]=\"date\"\n [disabled] = \"disabled\"\n [months]=\"selectBoxes.months\"\n [years]=\"selectBoxes.years\"\n (select)=\"select.emit($event)\">\n </ngb-datepicker-navigation-select>\n\n <ng-template *ngIf=\"!showSelect\" ngFor let-month [ngForOf]=\"months\" let-i=\"index\">\n <div class=\"ngb-dp-arrow\" *ngIf=\"i > 0\"></div>\n <div class=\"ngb-dp-month-name\">\n {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}\n </div>\n <div class=\"ngb-dp-arrow\" *ngIf=\"i !== months.length - 1\"></div>\n </ng-template>\n <div class=\"ngb-dp-arrow right\">\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickNext($event)\" [disabled]=\"nextDisabled\"\n i18n-aria-label=\"@@ngb.datepicker.next-month\" aria-label=\"Next month\"\n i18n-title=\"@@ngb.datepicker.next-month\" title=\"Next month\">\n <span class=\"ngb-dp-navigation-chevron\"></span>\n </button>\n </div>\n ",
- styles: ["ngb-datepicker-navigation{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-dp-navigation-chevron{border-style:solid;border-width:.2em .2em 0 0;display:inline-block;width:.75em;height:.75em;margin-left:.25em;margin-right:.15em;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.right .ngb-dp-navigation-chevron{-webkit-transform:rotate(45deg);transform:rotate(45deg);margin-left:.15em;margin-right:.25em}.ngb-dp-arrow{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;padding-right:0;padding-left:0;margin:0;width:2rem;height:2rem}.ngb-dp-arrow.right{-ms-flex-pack:end;justify-content:flex-end}.ngb-dp-arrow-btn{padding:0 .25rem;margin:0 .5rem;border:none;background-color:transparent;z-index:1}.ngb-dp-arrow-btn:focus{outline-width:1px;outline-style:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.ngb-dp-arrow-btn:focus{outline-style:solid}}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-navigation-select{display:-ms-flexbox;display:flex;-ms-flex:1 1 9rem;flex:1 1 9rem}"]
- }] }
- ];
- /** @nocollapse */
- NgbDatepickerNavigation.ctorParameters = function () { return [
- { type: NgbDatepickerI18n }
- ]; };
- NgbDatepickerNavigation.propDecorators = {
- date: [{ type: Input }],
- disabled: [{ type: Input }],
- months: [{ type: Input }],
- showSelect: [{ type: Input }],
- prevDisabled: [{ type: Input }],
- nextDisabled: [{ type: Input }],
- selectBoxes: [{ type: Input }],
- navigate: [{ type: Output }],
- select: [{ type: Output }]
- };
- return NgbDatepickerNavigation;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var isContainedIn = (/**
- * @param {?} element
- * @param {?=} array
- * @return {?}
- */
- function (element, array) {
- return array ? array.some((/**
- * @param {?} item
- * @return {?}
- */
- function (item) { return item.contains(element); })) : false;
- });
- /** @type {?} */
- var matchesSelectorIfAny = (/**
- * @param {?} element
- * @param {?=} selector
- * @return {?}
- */
- function (element, selector) {
- return !selector || closest(element, selector) != null;
- });
- // we'll have to use 'touch' events instead of 'mouse' events on iOS and add a more significant delay
- // to avoid re-opening when handling (click) on a toggling element
- // TODO: use proper Angular platform detection when NgbAutoClose becomes a service and we can inject PLATFORM_ID
- /** @type {?} */
- var iOS = false;
- if (typeof navigator !== 'undefined') {
- iOS = !!navigator.userAgent && /iPad|iPhone|iPod/.test(navigator.userAgent);
- }
- // setting 'ngbAutoClose' synchronously on iOS results in immediate popup closing
- // when tapping on the triggering element
- /** @type {?} */
- var wrapAsyncForiOS = (/**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { return iOS ? (/**
- * @return {?}
- */
- function () { return setTimeout((/**
- * @return {?}
- */
- function () { return fn(); }), 100); }) : fn; });
- /**
- * @param {?} zone
- * @param {?} document
- * @param {?} type
- * @param {?} close
- * @param {?} closed$
- * @param {?} insideElements
- * @param {?=} ignoreElements
- * @param {?=} insideSelector
- * @return {?}
- */
- function ngbAutoClose(zone, document, type, close, closed$, insideElements, ignoreElements, insideSelector) {
- // closing on ESC and outside clicks
- if (type) {
- zone.runOutsideAngular(wrapAsyncForiOS((/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var shouldCloseOnClick = (/**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- /** @type {?} */
- var element = (/** @type {?} */ (event.target));
- if (event.button === 2 || isContainedIn(element, ignoreElements)) {
- return false;
- }
- if (type === 'inside') {
- return isContainedIn(element, insideElements) && matchesSelectorIfAny(element, insideSelector);
- }
- else if (type === 'outside') {
- return !isContainedIn(element, insideElements);
- }
- else /* if (type === true) */ {
- return matchesSelectorIfAny(element, insideSelector) || !isContainedIn(element, insideElements);
- }
- });
- /** @type {?} */
- var escapes$ = fromEvent(document, 'keydown')
- .pipe(takeUntil(closed$),
- // tslint:disable-next-line:deprecation
- filter((/**
- * @param {?} e
- * @return {?}
- */
- function (e) { return e.which === Key.Escape; })), tap((/**
- * @param {?} e
- * @return {?}
- */
- function (e) { return e.preventDefault(); })));
- // we have to pre-calculate 'shouldCloseOnClick' on 'mousedown/touchstart',
- // because on 'mouseup/touchend' DOM nodes might be detached
- /** @type {?} */
- var mouseDowns$ = fromEvent(document, 'mousedown').pipe(map(shouldCloseOnClick), takeUntil(closed$));
- /** @type {?} */
- var closeableClicks$ = (/** @type {?} */ (fromEvent(document, 'mouseup')
- .pipe(withLatestFrom(mouseDowns$), filter((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var _b = __read(_a, 2), _ = _b[0], shouldClose = _b[1];
- return shouldClose;
- })), delay(0), takeUntil(closed$))));
- race([escapes$, closeableClicks$]).subscribe((/**
- * @return {?}
- */
- function () { return zone.run(close); }));
- })));
- }
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var FOCUSABLE_ELEMENTS_SELECTOR = [
- 'a[href]', 'button:not([disabled])', 'input:not([disabled]):not([type="hidden"])', 'select:not([disabled])',
- 'textarea:not([disabled])', '[contenteditable]', '[tabindex]:not([tabindex="-1"])'
- ].join(', ');
- /**
- * Returns first and last focusable elements inside of a given element based on specific CSS selector
- * @param {?} element
- * @return {?}
- */
- function getFocusableBoundaryElements(element) {
- /** @type {?} */
- var list = Array.from((/** @type {?} */ (element.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR))))
- .filter((/**
- * @param {?} el
- * @return {?}
- */
- function (el) { return el.tabIndex !== -1; }));
- return [list[0], list[list.length - 1]];
- }
- /**
- * Function that enforces browser focus to be trapped inside a DOM element.
- *
- * Works only for clicks inside the element and navigation with 'Tab', ignoring clicks outside of the element
- *
- * \@param zone Angular zone
- * \@param element The element around which focus will be trapped inside
- * \@param stopFocusTrap$ The observable stream. When completed the focus trap will clean up listeners
- * and free internal resources
- * \@param refocusOnClick Put the focus back to the last focused element whenever a click occurs on element (default to
- * false)
- * @type {?}
- */
- var ngbFocusTrap = (/**
- * @param {?} zone
- * @param {?} element
- * @param {?} stopFocusTrap$
- * @param {?=} refocusOnClick
- * @return {?}
- */
- function (zone, element, stopFocusTrap$, refocusOnClick) {
- if (refocusOnClick === void 0) { refocusOnClick = false; }
- zone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- // last focused element
- /** @type {?} */
- var lastFocusedElement$ = fromEvent(element, 'focusin').pipe(takeUntil(stopFocusTrap$), map((/**
- * @param {?} e
- * @return {?}
- */
- function (e) { return e.target; })));
- // 'tab' / 'shift+tab' stream
- fromEvent(element, 'keydown')
- .pipe(takeUntil(stopFocusTrap$),
- // tslint:disable:deprecation
- filter((/**
- * @param {?} e
- * @return {?}
- */
- function (e) { return e.which === Key.Tab; })),
- // tslint:enable:deprecation
- withLatestFrom(lastFocusedElement$))
- .subscribe((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var _b = __read(_a, 2), tabEvent = _b[0], focusedElement = _b[1];
- var _c = __read(getFocusableBoundaryElements(element), 2), first = _c[0], last = _c[1];
- if ((focusedElement === first || focusedElement === element) && tabEvent.shiftKey) {
- last.focus();
- tabEvent.preventDefault();
- }
- if (focusedElement === last && !tabEvent.shiftKey) {
- first.focus();
- tabEvent.preventDefault();
- }
- }));
- // inside click
- if (refocusOnClick) {
- fromEvent(element, 'click')
- .pipe(takeUntil(stopFocusTrap$), withLatestFrom(lastFocusedElement$), map((/**
- * @param {?} arr
- * @return {?}
- */
- function (arr) { return (/** @type {?} */ (arr[1])); })))
- .subscribe((/**
- * @param {?} lastFocusedElement
- * @return {?}
- */
- function (lastFocusedElement) { return lastFocusedElement.focus(); }));
- }
- }));
- });
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- // previous version:
- // https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
- var
- // previous version:
- // https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
- Positioning = /** @class */ (function () {
- function Positioning() {
- }
- /**
- * @private
- * @param {?} element
- * @return {?}
- */
- Positioning.prototype.getAllStyles = /**
- * @private
- * @param {?} element
- * @return {?}
- */
- function (element) { return window.getComputedStyle(element); };
- /**
- * @private
- * @param {?} element
- * @param {?} prop
- * @return {?}
- */
- Positioning.prototype.getStyle = /**
- * @private
- * @param {?} element
- * @param {?} prop
- * @return {?}
- */
- function (element, prop) { return this.getAllStyles(element)[prop]; };
- /**
- * @private
- * @param {?} element
- * @return {?}
- */
- Positioning.prototype.isStaticPositioned = /**
- * @private
- * @param {?} element
- * @return {?}
- */
- function (element) {
- return (this.getStyle(element, 'position') || 'static') === 'static';
- };
- /**
- * @private
- * @param {?} element
- * @return {?}
- */
- Positioning.prototype.offsetParent = /**
- * @private
- * @param {?} element
- * @return {?}
- */
- function (element) {
- /** @type {?} */
- var offsetParentEl = (/** @type {?} */ (element.offsetParent)) || document.documentElement;
- while (offsetParentEl && offsetParentEl !== document.documentElement && this.isStaticPositioned(offsetParentEl)) {
- offsetParentEl = (/** @type {?} */ (offsetParentEl.offsetParent));
- }
- return offsetParentEl || document.documentElement;
- };
- /**
- * @param {?} element
- * @param {?=} round
- * @return {?}
- */
- Positioning.prototype.position = /**
- * @param {?} element
- * @param {?=} round
- * @return {?}
- */
- function (element, round) {
- if (round === void 0) { round = true; }
- /** @type {?} */
- var elPosition;
- /** @type {?} */
- var parentOffset = { width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0 };
- if (this.getStyle(element, 'position') === 'fixed') {
- elPosition = element.getBoundingClientRect();
- elPosition = {
- top: elPosition.top,
- bottom: elPosition.bottom,
- left: elPosition.left,
- right: elPosition.right,
- height: elPosition.height,
- width: elPosition.width
- };
- }
- else {
- /** @type {?} */
- var offsetParentEl = this.offsetParent(element);
- elPosition = this.offset(element, false);
- if (offsetParentEl !== document.documentElement) {
- parentOffset = this.offset(offsetParentEl, false);
- }
- parentOffset.top += offsetParentEl.clientTop;
- parentOffset.left += offsetParentEl.clientLeft;
- }
- elPosition.top -= parentOffset.top;
- elPosition.bottom -= parentOffset.top;
- elPosition.left -= parentOffset.left;
- elPosition.right -= parentOffset.left;
- if (round) {
- elPosition.top = Math.round(elPosition.top);
- elPosition.bottom = Math.round(elPosition.bottom);
- elPosition.left = Math.round(elPosition.left);
- elPosition.right = Math.round(elPosition.right);
- }
- return elPosition;
- };
- /**
- * @param {?} element
- * @param {?=} round
- * @return {?}
- */
- Positioning.prototype.offset = /**
- * @param {?} element
- * @param {?=} round
- * @return {?}
- */
- function (element, round) {
- if (round === void 0) { round = true; }
- /** @type {?} */
- var elBcr = element.getBoundingClientRect();
- /** @type {?} */
- var viewportOffset = {
- top: window.pageYOffset - document.documentElement.clientTop,
- left: window.pageXOffset - document.documentElement.clientLeft
- };
- /** @type {?} */
- var elOffset = {
- height: elBcr.height || element.offsetHeight,
- width: elBcr.width || element.offsetWidth,
- top: elBcr.top + viewportOffset.top,
- bottom: elBcr.bottom + viewportOffset.top,
- left: elBcr.left + viewportOffset.left,
- right: elBcr.right + viewportOffset.left
- };
- if (round) {
- elOffset.height = Math.round(elOffset.height);
- elOffset.width = Math.round(elOffset.width);
- elOffset.top = Math.round(elOffset.top);
- elOffset.bottom = Math.round(elOffset.bottom);
- elOffset.left = Math.round(elOffset.left);
- elOffset.right = Math.round(elOffset.right);
- }
- return elOffset;
- };
- /*
- Return false if the element to position is outside the viewport
- */
- /*
- Return false if the element to position is outside the viewport
- */
- /**
- * @param {?} hostElement
- * @param {?} targetElement
- * @param {?} placement
- * @param {?=} appendToBody
- * @return {?}
- */
- Positioning.prototype.positionElements = /*
- Return false if the element to position is outside the viewport
- */
- /**
- * @param {?} hostElement
- * @param {?} targetElement
- * @param {?} placement
- * @param {?=} appendToBody
- * @return {?}
- */
- function (hostElement, targetElement, placement, appendToBody) {
- var _a = __read(placement.split('-'), 2), _b = _a[0], placementPrimary = _b === void 0 ? 'top' : _b, _c = _a[1], placementSecondary = _c === void 0 ? 'center' : _c;
- /** @type {?} */
- var hostElPosition = appendToBody ? this.offset(hostElement, false) : this.position(hostElement, false);
- /** @type {?} */
- var targetElStyles = this.getAllStyles(targetElement);
- /** @type {?} */
- var marginTop = parseFloat(targetElStyles.marginTop);
- /** @type {?} */
- var marginBottom = parseFloat(targetElStyles.marginBottom);
- /** @type {?} */
- var marginLeft = parseFloat(targetElStyles.marginLeft);
- /** @type {?} */
- var marginRight = parseFloat(targetElStyles.marginRight);
- /** @type {?} */
- var topPosition = 0;
- /** @type {?} */
- var leftPosition = 0;
- switch (placementPrimary) {
- case 'top':
- topPosition = (hostElPosition.top - (targetElement.offsetHeight + marginTop + marginBottom));
- break;
- case 'bottom':
- topPosition = (hostElPosition.top + hostElPosition.height);
- break;
- case 'left':
- leftPosition = (hostElPosition.left - (targetElement.offsetWidth + marginLeft + marginRight));
- break;
- case 'right':
- leftPosition = (hostElPosition.left + hostElPosition.width);
- break;
- }
- switch (placementSecondary) {
- case 'top':
- topPosition = hostElPosition.top;
- break;
- case 'bottom':
- topPosition = hostElPosition.top + hostElPosition.height - targetElement.offsetHeight;
- break;
- case 'left':
- leftPosition = hostElPosition.left;
- break;
- case 'right':
- leftPosition = hostElPosition.left + hostElPosition.width - targetElement.offsetWidth;
- break;
- case 'center':
- if (placementPrimary === 'top' || placementPrimary === 'bottom') {
- leftPosition = (hostElPosition.left + hostElPosition.width / 2 - targetElement.offsetWidth / 2);
- }
- else {
- topPosition = (hostElPosition.top + hostElPosition.height / 2 - targetElement.offsetHeight / 2);
- }
- break;
- }
- /// The translate3d/gpu acceleration render a blurry text on chrome, the next line is commented until a browser fix
- // targetElement.style.transform = `translate3d(${Math.round(leftPosition)}px, ${Math.floor(topPosition)}px, 0px)`;
- targetElement.style.transform = "translate(" + Math.round(leftPosition) + "px, " + Math.round(topPosition) + "px)";
- // Check if the targetElement is inside the viewport
- /** @type {?} */
- var targetElBCR = targetElement.getBoundingClientRect();
- /** @type {?} */
- var html = document.documentElement;
- /** @type {?} */
- var windowHeight = window.innerHeight || html.clientHeight;
- /** @type {?} */
- var windowWidth = window.innerWidth || html.clientWidth;
- return targetElBCR.left >= 0 && targetElBCR.top >= 0 && targetElBCR.right <= windowWidth &&
- targetElBCR.bottom <= windowHeight;
- };
- return Positioning;
- }());
- /** @type {?} */
- var placementSeparator = /\s+/;
- /** @type {?} */
- var positionService = new Positioning();
- /*
- * Accept the placement array and applies the appropriate placement dependent on the viewport.
- * Returns the applied placement.
- * In case of auto placement, placements are selected in order
- * 'top', 'bottom', 'left', 'right',
- * 'top-left', 'top-right',
- * 'bottom-left', 'bottom-right',
- * 'left-top', 'left-bottom',
- * 'right-top', 'right-bottom'.
- * */
- /**
- * @param {?} hostElement
- * @param {?} targetElement
- * @param {?} placement
- * @param {?=} appendToBody
- * @param {?=} baseClass
- * @return {?}
- */
- function positionElements(hostElement, targetElement, placement, appendToBody, baseClass) {
- var e_1, _a;
- /** @type {?} */
- var placementVals = Array.isArray(placement) ? placement : (/** @type {?} */ (placement.split(placementSeparator)));
- /** @type {?} */
- var allowedPlacements = [
- 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'left-top', 'left-bottom',
- 'right-top', 'right-bottom'
- ];
- /** @type {?} */
- var classList = targetElement.classList;
- /** @type {?} */
- var addClassesToTarget = (/**
- * @param {?} targetPlacement
- * @return {?}
- */
- function (targetPlacement) {
- var _a = __read(targetPlacement.split('-'), 2), primary = _a[0], secondary = _a[1];
- /** @type {?} */
- var classes = [];
- if (baseClass) {
- classes.push(baseClass + "-" + primary);
- if (secondary) {
- classes.push(baseClass + "-" + primary + "-" + secondary);
- }
- classes.forEach((/**
- * @param {?} classname
- * @return {?}
- */
- function (classname) { classList.add(classname); }));
- }
- return classes;
- });
- // Remove old placement classes to avoid issues
- if (baseClass) {
- allowedPlacements.forEach((/**
- * @param {?} placementToRemove
- * @return {?}
- */
- function (placementToRemove) { classList.remove(baseClass + "-" + placementToRemove); }));
- }
- // replace auto placement with other placements
- /** @type {?} */
- var hasAuto = placementVals.findIndex((/**
- * @param {?} val
- * @return {?}
- */
- function (val) { return val === 'auto'; }));
- if (hasAuto >= 0) {
- allowedPlacements.forEach((/**
- * @param {?} obj
- * @return {?}
- */
- function (obj) {
- if (placementVals.find((/**
- * @param {?} val
- * @return {?}
- */
- function (val) { return val.search('^' + obj) !== -1; })) == null) {
- placementVals.splice(hasAuto++, 1, (/** @type {?} */ (obj)));
- }
- }));
- }
- // coordinates where to position
- // Required for transform:
- /** @type {?} */
- var style = targetElement.style;
- style.position = 'absolute';
- style.top = '0';
- style.left = '0';
- style['will-change'] = 'transform';
- /** @type {?} */
- var testPlacement;
- /** @type {?} */
- var isInViewport = false;
- try {
- for (var placementVals_1 = __values(placementVals), placementVals_1_1 = placementVals_1.next(); !placementVals_1_1.done; placementVals_1_1 = placementVals_1.next()) {
- testPlacement = placementVals_1_1.value;
- /** @type {?} */
- var addedClasses = addClassesToTarget(testPlacement);
- if (positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody)) {
- isInViewport = true;
- break;
- }
- // Remove the baseClasses for further calculation
- if (baseClass) {
- addedClasses.forEach((/**
- * @param {?} classname
- * @return {?}
- */
- function (classname) { classList.remove(classname); }));
- }
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (placementVals_1_1 && !placementVals_1_1.done && (_a = placementVals_1.return)) _a.call(placementVals_1);
- }
- finally { if (e_1) throw e_1.error; }
- }
- if (!isInViewport) {
- // If nothing match, the first placement is the default one
- testPlacement = placementVals[0];
- addClassesToTarget(testPlacement);
- positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody);
- }
- return testPlacement;
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @return {?}
- */
- function NGB_DATEPICKER_PARSER_FORMATTER_FACTORY() {
- return new NgbDateISOParserFormatter();
- }
- /**
- * An abstract service for parsing and formatting dates for the
- * [`NgbInputDatepicker`](#/components/datepicker/api#NgbInputDatepicker) directive.
- * Converts between the internal `NgbDateStruct` model presentation and a `string` that is displayed in the
- * input element.
- *
- * When user types something in the input this service attempts to parse it into a `NgbDateStruct` object.
- * And vice versa, when users selects a date in the calendar with the mouse, it must be displayed as a `string`
- * in the input.
- *
- * Default implementation uses the ISO 8601 format, but you can provide another implementation via DI
- * to use an alternative string format or a custom parsing logic.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- * @abstract
- */
- var NgbDateParserFormatter = /** @class */ (function () {
- function NgbDateParserFormatter() {
- }
- NgbDateParserFormatter.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY },] }
- ];
- /** @nocollapse */ NgbDateParserFormatter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY, token: NgbDateParserFormatter, providedIn: "root" });
- return NgbDateParserFormatter;
- }());
- var NgbDateISOParserFormatter = /** @class */ (function (_super) {
- __extends(NgbDateISOParserFormatter, _super);
- function NgbDateISOParserFormatter() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @param {?} value
- * @return {?}
- */
- NgbDateISOParserFormatter.prototype.parse = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- if (value) {
- /** @type {?} */
- var dateParts = value.trim().split('-');
- if (dateParts.length === 1 && isNumber(dateParts[0])) {
- return { year: toInteger(dateParts[0]), month: null, day: null };
- }
- else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {
- return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: null };
- }
- else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) {
- return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: toInteger(dateParts[2]) };
- }
- }
- return null;
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDateISOParserFormatter.prototype.format = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return date ?
- date.year + "-" + (isNumber(date.month) ? padNumber(date.month) : '') + "-" + (isNumber(date.day) ? padNumber(date.day) : '') :
- '';
- };
- NgbDateISOParserFormatter.decorators = [
- { type: Injectable }
- ];
- return NgbDateISOParserFormatter;
- }(NgbDateParserFormatter));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbDatepickerInput`](#/components/datepicker/api#NgbDatepicker) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the datepicker inputs used in the application.
- *
- * \@since 5.2.0
- */
- var NgbInputDatepickerConfig = /** @class */ (function (_super) {
- __extends(NgbInputDatepickerConfig, _super);
- function NgbInputDatepickerConfig() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.autoClose = true;
- _this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
- _this.restoreFocus = true;
- return _this;
- }
- NgbInputDatepickerConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbInputDatepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbInputDatepickerConfig_Factory() { return new NgbInputDatepickerConfig(); }, token: NgbInputDatepickerConfig, providedIn: "root" });
- return NgbInputDatepickerConfig;
- }(NgbDatepickerConfig));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_DATEPICKER_VALUE_ACCESSOR$1 = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbInputDatepicker; })),
- multi: true
- };
- /** @type {?} */
- var NGB_DATEPICKER_VALIDATOR = {
- provide: NG_VALIDATORS,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbInputDatepicker; })),
- multi: true
- };
- /**
- * A directive that allows to stick a datepicker popup to an input field.
- *
- * Manages interaction with the input field itself, does value formatting and provides forms integration.
- */
- var NgbInputDatepicker = /** @class */ (function () {
- function NgbInputDatepicker(_parserFormatter, _elRef, _vcRef, _renderer, _cfr, _ngZone, _calendar, _dateAdapter, _document, _changeDetector, config) {
- var _this = this;
- this._parserFormatter = _parserFormatter;
- this._elRef = _elRef;
- this._vcRef = _vcRef;
- this._renderer = _renderer;
- this._cfr = _cfr;
- this._ngZone = _ngZone;
- this._calendar = _calendar;
- this._dateAdapter = _dateAdapter;
- this._document = _document;
- this._changeDetector = _changeDetector;
- this._cRef = null;
- this._disabled = false;
- this._elWithFocus = null;
- /**
- * An event emitted when user selects a date using keyboard or mouse.
- *
- * The payload of the event is currently selected `NgbDate`.
- *
- * \@since 1.1.1
- */
- this.dateSelect = new EventEmitter();
- /**
- * Event emitted right after the navigation happens and displayed month changes.
- *
- * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
- */
- this.navigate = new EventEmitter();
- /**
- * An event fired after closing datepicker window.
- *
- * \@since 4.2.0
- */
- this.closed = new EventEmitter();
- this._onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this._onTouched = (/**
- * @return {?}
- */
- function () { });
- this._validatorChange = (/**
- * @return {?}
- */
- function () { });
- ['autoClose', 'container', 'positionTarget', 'placement'].forEach((/**
- * @param {?} input
- * @return {?}
- */
- function (input) { return _this[input] = config[input]; }));
- this._zoneSubscription = _ngZone.onStable.subscribe((/**
- * @return {?}
- */
- function () { return _this._updatePopupPosition(); }));
- }
- Object.defineProperty(NgbInputDatepicker.prototype, "disabled", {
- get: /**
- * @return {?}
- */
- function () {
- return this._disabled;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._disabled = value === '' || (value && value !== 'false');
- if (this.isOpen()) {
- this._cRef.instance.setDisabledState(this._disabled);
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbInputDatepicker.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbInputDatepicker.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._onTouched = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbInputDatepicker.prototype.registerOnValidatorChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._validatorChange = fn; };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbInputDatepicker.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) { this.disabled = isDisabled; };
- /**
- * @param {?} c
- * @return {?}
- */
- NgbInputDatepicker.prototype.validate = /**
- * @param {?} c
- * @return {?}
- */
- function (c) {
- /** @type {?} */
- var value = c.value;
- if (value === null || value === undefined) {
- return null;
- }
- /** @type {?} */
- var ngbDate = this._fromDateStruct(this._dateAdapter.fromModel(value));
- if (!this._calendar.isValid(ngbDate)) {
- return { 'ngbDate': { invalid: c.value } };
- }
- if (this.minDate && ngbDate.before(NgbDate.from(this.minDate))) {
- return { 'ngbDate': { requiredBefore: this.minDate } };
- }
- if (this.maxDate && ngbDate.after(NgbDate.from(this.maxDate))) {
- return { 'ngbDate': { requiredAfter: this.maxDate } };
- }
- };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbInputDatepicker.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._model = this._fromDateStruct(this._dateAdapter.fromModel(value));
- this._writeModelValue(this._model);
- };
- /**
- * @param {?} value
- * @param {?=} updateView
- * @return {?}
- */
- NgbInputDatepicker.prototype.manualDateChange = /**
- * @param {?} value
- * @param {?=} updateView
- * @return {?}
- */
- function (value, updateView) {
- if (updateView === void 0) { updateView = false; }
- /** @type {?} */
- var inputValueChanged = value !== this._inputValue;
- if (inputValueChanged) {
- this._inputValue = value;
- this._model = this._fromDateStruct(this._parserFormatter.parse(value));
- }
- if (inputValueChanged || !updateView) {
- this._onChange(this._model ? this._dateAdapter.toModel(this._model) : (value === '' ? null : value));
- }
- if (updateView && this._model) {
- this._writeModelValue(this._model);
- }
- };
- /**
- * @return {?}
- */
- NgbInputDatepicker.prototype.isOpen = /**
- * @return {?}
- */
- function () { return !!this._cRef; };
- /**
- * Opens the datepicker popup.
- *
- * If the related form control contains a valid date, the corresponding month will be opened.
- */
- /**
- * Opens the datepicker popup.
- *
- * If the related form control contains a valid date, the corresponding month will be opened.
- * @return {?}
- */
- NgbInputDatepicker.prototype.open = /**
- * Opens the datepicker popup.
- *
- * If the related form control contains a valid date, the corresponding month will be opened.
- * @return {?}
- */
- function () {
- var _this = this;
- if (!this.isOpen()) {
- /** @type {?} */
- var cf = this._cfr.resolveComponentFactory(NgbDatepicker);
- this._cRef = this._vcRef.createComponent(cf);
- this._applyPopupStyling(this._cRef.location.nativeElement);
- this._applyDatepickerInputs(this._cRef.instance);
- this._subscribeForDatepickerOutputs(this._cRef.instance);
- this._cRef.instance.ngOnInit();
- this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model));
- // date selection event handling
- this._cRef.instance.registerOnChange((/**
- * @param {?} selectedDate
- * @return {?}
- */
- function (selectedDate) {
- _this.writeValue(selectedDate);
- _this._onChange(selectedDate);
- _this._onTouched();
- }));
- this._cRef.changeDetectorRef.detectChanges();
- this._cRef.instance.setDisabledState(this.disabled);
- if (this.container === 'body') {
- window.document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);
- }
- // focus handling
- this._elWithFocus = this._document.activeElement;
- ngbFocusTrap(this._ngZone, this._cRef.location.nativeElement, this.closed, true);
- this._cRef.instance.focus();
- ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
- * @return {?}
- */
- function () { return _this.close(); }), this.closed, [], [this._elRef.nativeElement, this._cRef.location.nativeElement]);
- }
- };
- /**
- * Closes the datepicker popup.
- */
- /**
- * Closes the datepicker popup.
- * @return {?}
- */
- NgbInputDatepicker.prototype.close = /**
- * Closes the datepicker popup.
- * @return {?}
- */
- function () {
- if (this.isOpen()) {
- this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));
- this._cRef = null;
- this.closed.emit();
- this._changeDetector.markForCheck();
- // restore focus
- /** @type {?} */
- var elementToFocus = this._elWithFocus;
- if (isString(this.restoreFocus)) {
- elementToFocus = this._document.querySelector(this.restoreFocus);
- }
- else if (this.restoreFocus !== undefined) {
- elementToFocus = this.restoreFocus;
- }
- // in IE document.activeElement can contain an object without 'focus()' sometimes
- if (elementToFocus && elementToFocus['focus']) {
- elementToFocus.focus();
- }
- else {
- this._document.body.focus();
- }
- }
- };
- /**
- * Toggles the datepicker popup.
- */
- /**
- * Toggles the datepicker popup.
- * @return {?}
- */
- NgbInputDatepicker.prototype.toggle = /**
- * Toggles the datepicker popup.
- * @return {?}
- */
- function () {
- if (this.isOpen()) {
- this.close();
- }
- else {
- this.open();
- }
- };
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- */
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- * @param {?=} date
- * @return {?}
- */
- NgbInputDatepicker.prototype.navigateTo = /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- * @param {?=} date
- * @return {?}
- */
- function (date) {
- if (this.isOpen()) {
- this._cRef.instance.navigateTo(date);
- }
- };
- /**
- * @return {?}
- */
- NgbInputDatepicker.prototype.onBlur = /**
- * @return {?}
- */
- function () { this._onTouched(); };
- /**
- * @return {?}
- */
- NgbInputDatepicker.prototype.onFocus = /**
- * @return {?}
- */
- function () { this._elWithFocus = this._elRef.nativeElement; };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbInputDatepicker.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- if (changes['minDate'] || changes['maxDate']) {
- this._validatorChange();
- if (this.isOpen()) {
- if (changes['minDate']) {
- this._cRef.instance.minDate = this._dateAdapter.toModel(changes.minDate.currentValue);
- }
- if (changes['maxDate']) {
- this._cRef.instance.maxDate = this._dateAdapter.toModel(changes.maxDate.currentValue);
- }
- this._cRef.instance.ngOnChanges(changes);
- }
- }
- };
- /**
- * @return {?}
- */
- NgbInputDatepicker.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this.close();
- this._zoneSubscription.unsubscribe();
- };
- /**
- * @private
- * @param {?} datepickerInstance
- * @return {?}
- */
- NgbInputDatepicker.prototype._applyDatepickerInputs = /**
- * @private
- * @param {?} datepickerInstance
- * @return {?}
- */
- function (datepickerInstance) {
- var _this = this;
- ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
- 'maxDate', 'navigation', 'outsideDays', 'showNavigation', 'showWeekdays', 'showWeekNumbers']
- .forEach((/**
- * @param {?} optionName
- * @return {?}
- */
- function (optionName) {
- if (_this[optionName] !== undefined) {
- datepickerInstance[optionName] = _this[optionName];
- }
- }));
- datepickerInstance.startDate = this.startDate || this._model;
- };
- /**
- * @private
- * @param {?} nativeElement
- * @return {?}
- */
- NgbInputDatepicker.prototype._applyPopupStyling = /**
- * @private
- * @param {?} nativeElement
- * @return {?}
- */
- function (nativeElement) {
- this._renderer.addClass(nativeElement, 'dropdown-menu');
- this._renderer.addClass(nativeElement, 'show');
- if (this.container === 'body') {
- this._renderer.addClass(nativeElement, 'ngb-dp-body');
- }
- };
- /**
- * @private
- * @param {?} datepickerInstance
- * @return {?}
- */
- NgbInputDatepicker.prototype._subscribeForDatepickerOutputs = /**
- * @private
- * @param {?} datepickerInstance
- * @return {?}
- */
- function (datepickerInstance) {
- var _this = this;
- datepickerInstance.navigate.subscribe((/**
- * @param {?} navigateEvent
- * @return {?}
- */
- function (navigateEvent) { return _this.navigate.emit(navigateEvent); }));
- datepickerInstance.dateSelect.subscribe((/**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- _this.dateSelect.emit(date);
- if (_this.autoClose === true || _this.autoClose === 'inside') {
- _this.close();
- }
- }));
- };
- /**
- * @private
- * @param {?} model
- * @return {?}
- */
- NgbInputDatepicker.prototype._writeModelValue = /**
- * @private
- * @param {?} model
- * @return {?}
- */
- function (model) {
- /** @type {?} */
- var value = this._parserFormatter.format(model);
- this._inputValue = value;
- this._renderer.setProperty(this._elRef.nativeElement, 'value', value);
- if (this.isOpen()) {
- this._cRef.instance.writeValue(this._dateAdapter.toModel(model));
- this._onTouched();
- }
- };
- /**
- * @private
- * @param {?} date
- * @return {?}
- */
- NgbInputDatepicker.prototype._fromDateStruct = /**
- * @private
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var ngbDate = date ? new NgbDate(date.year, date.month, date.day) : null;
- return this._calendar.isValid(ngbDate) ? ngbDate : null;
- };
- /**
- * @private
- * @return {?}
- */
- NgbInputDatepicker.prototype._updatePopupPosition = /**
- * @private
- * @return {?}
- */
- function () {
- if (!this._cRef) {
- return;
- }
- /** @type {?} */
- var hostElement;
- if (isString(this.positionTarget)) {
- hostElement = this._document.querySelector(this.positionTarget);
- }
- else if (this.positionTarget instanceof HTMLElement) {
- hostElement = this.positionTarget;
- }
- else {
- hostElement = this._elRef.nativeElement;
- }
- if (this.positionTarget && !hostElement) {
- throw new Error('ngbDatepicker could not find element declared in [positionTarget] to position against.');
- }
- positionElements(hostElement, this._cRef.location.nativeElement, this.placement, this.container === 'body');
- };
- NgbInputDatepicker.decorators = [
- { type: Directive, args: [{
- selector: 'input[ngbDatepicker]',
- exportAs: 'ngbDatepicker',
- host: {
- '(input)': 'manualDateChange($event.target.value)',
- '(change)': 'manualDateChange($event.target.value, true)',
- '(focus)': 'onFocus()',
- '(blur)': 'onBlur()',
- '[disabled]': 'disabled'
- },
- providers: [
- NGB_DATEPICKER_VALUE_ACCESSOR$1, NGB_DATEPICKER_VALIDATOR,
- { provide: NgbDatepickerConfig, useExisting: NgbInputDatepickerConfig }
- ],
- },] }
- ];
- /** @nocollapse */
- NgbInputDatepicker.ctorParameters = function () { return [
- { type: NgbDateParserFormatter },
- { type: ElementRef },
- { type: ViewContainerRef },
- { type: Renderer2 },
- { type: ComponentFactoryResolver },
- { type: NgZone },
- { type: NgbCalendar },
- { type: NgbDateAdapter },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: ChangeDetectorRef },
- { type: NgbInputDatepickerConfig }
- ]; };
- NgbInputDatepicker.propDecorators = {
- autoClose: [{ type: Input }],
- dayTemplate: [{ type: Input }],
- dayTemplateData: [{ type: Input }],
- displayMonths: [{ type: Input }],
- firstDayOfWeek: [{ type: Input }],
- footerTemplate: [{ type: Input }],
- markDisabled: [{ type: Input }],
- minDate: [{ type: Input }],
- maxDate: [{ type: Input }],
- navigation: [{ type: Input }],
- outsideDays: [{ type: Input }],
- placement: [{ type: Input }],
- restoreFocus: [{ type: Input }],
- showWeekdays: [{ type: Input }],
- showWeekNumbers: [{ type: Input }],
- startDate: [{ type: Input }],
- container: [{ type: Input }],
- positionTarget: [{ type: Input }],
- dateSelect: [{ type: Output }],
- navigate: [{ type: Output }],
- closed: [{ type: Output }],
- disabled: [{ type: Input }]
- };
- return NgbInputDatepicker;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerDayView = /** @class */ (function () {
- function NgbDatepickerDayView(i18n) {
- this.i18n = i18n;
- }
- /**
- * @return {?}
- */
- NgbDatepickerDayView.prototype.isMuted = /**
- * @return {?}
- */
- function () { return !this.selected && (this.date.month !== this.currentMonth || this.disabled); };
- NgbDatepickerDayView.decorators = [
- { type: Component, args: [{
- selector: '[ngbDatepickerDayView]',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: {
- 'class': 'btn-light',
- '[class.bg-primary]': 'selected',
- '[class.text-white]': 'selected',
- '[class.text-muted]': 'isMuted()',
- '[class.outside]': 'isMuted()',
- '[class.active]': 'focused'
- },
- template: "{{ i18n.getDayNumerals(date) }}",
- styles: ["[ngbDatepickerDayView]{text-align:center;width:2rem;height:2rem;line-height:2rem;border-radius:.25rem;background:0 0}[ngbDatepickerDayView].outside{opacity:.5}"]
- }] }
- ];
- /** @nocollapse */
- NgbDatepickerDayView.ctorParameters = function () { return [
- { type: NgbDatepickerI18n }
- ]; };
- NgbDatepickerDayView.propDecorators = {
- currentMonth: [{ type: Input }],
- date: [{ type: Input }],
- disabled: [{ type: Input }],
- focused: [{ type: Input }],
- selected: [{ type: Input }]
- };
- return NgbDatepickerDayView;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerNavigationSelect = /** @class */ (function () {
- function NgbDatepickerNavigationSelect(i18n, _renderer) {
- this.i18n = i18n;
- this._renderer = _renderer;
- this.select = new EventEmitter();
- this._month = -1;
- this._year = -1;
- }
- /**
- * @param {?} month
- * @return {?}
- */
- NgbDatepickerNavigationSelect.prototype.changeMonth = /**
- * @param {?} month
- * @return {?}
- */
- function (month) { this.select.emit(new NgbDate(this.date.year, toInteger(month), 1)); };
- /**
- * @param {?} year
- * @return {?}
- */
- NgbDatepickerNavigationSelect.prototype.changeYear = /**
- * @param {?} year
- * @return {?}
- */
- function (year) { this.select.emit(new NgbDate(toInteger(year), this.date.month, 1)); };
- /**
- * @return {?}
- */
- NgbDatepickerNavigationSelect.prototype.ngAfterViewChecked = /**
- * @return {?}
- */
- function () {
- if (this.date) {
- if (this.date.month !== this._month) {
- this._month = this.date.month;
- this._renderer.setProperty(this.monthSelect.nativeElement, 'value', this._month);
- }
- if (this.date.year !== this._year) {
- this._year = this.date.year;
- this._renderer.setProperty(this.yearSelect.nativeElement, 'value', this._year);
- }
- }
- };
- NgbDatepickerNavigationSelect.decorators = [
- { type: Component, args: [{
- selector: 'ngb-datepicker-navigation-select',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- template: "\n <select #month\n [disabled]=\"disabled\"\n class=\"custom-select\"\n i18n-aria-label=\"@@ngb.datepicker.select-month\" aria-label=\"Select month\"\n i18n-title=\"@@ngb.datepicker.select-month\" title=\"Select month\"\n (change)=\"changeMonth($event.target.value)\">\n <option *ngFor=\"let m of months\" [attr.aria-label]=\"i18n.getMonthFullName(m, date?.year)\"\n [value]=\"m\">{{ i18n.getMonthShortName(m, date?.year) }}</option>\n </select><select #year\n [disabled]=\"disabled\"\n class=\"custom-select\"\n i18n-aria-label=\"@@ngb.datepicker.select-year\" aria-label=\"Select year\"\n i18n-title=\"@@ngb.datepicker.select-year\" title=\"Select year\"\n (change)=\"changeYear($event.target.value)\">\n <option *ngFor=\"let y of years\" [value]=\"y\">{{ i18n.getYearNumerals(y) }}</option>\n </select>\n ",
- styles: ["ngb-datepicker-navigation-select>.custom-select{-ms-flex:1 1 auto;flex:1 1 auto;padding:0 .5rem;font-size:.875rem;height:1.85rem}ngb-datepicker-navigation-select>.custom-select:focus{z-index:1}ngb-datepicker-navigation-select>.custom-select::-ms-value{background-color:transparent!important}"]
- }] }
- ];
- /** @nocollapse */
- NgbDatepickerNavigationSelect.ctorParameters = function () { return [
- { type: NgbDatepickerI18n },
- { type: Renderer2 }
- ]; };
- NgbDatepickerNavigationSelect.propDecorators = {
- date: [{ type: Input }],
- disabled: [{ type: Input }],
- months: [{ type: Input }],
- years: [{ type: Input }],
- select: [{ type: Output }],
- monthSelect: [{ type: ViewChild, args: ['month', { static: true, read: ElementRef },] }],
- yearSelect: [{ type: ViewChild, args: ['year', { static: true, read: ElementRef },] }]
- };
- return NgbDatepickerNavigationSelect;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @abstract
- */
- var NgbCalendarHijri = /** @class */ (function (_super) {
- __extends(NgbCalendarHijri, _super);
- function NgbCalendarHijri() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @return {?}
- */
- NgbCalendarHijri.prototype.getDaysPerWeek = /**
- * @return {?}
- */
- function () { return 7; };
- /**
- * @return {?}
- */
- NgbCalendarHijri.prototype.getMonths = /**
- * @return {?}
- */
- function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
- /**
- * @return {?}
- */
- NgbCalendarHijri.prototype.getWeeksPerMonth = /**
- * @return {?}
- */
- function () { return 6; };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarHijri.prototype.getNext = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- date = new NgbDate(date.year, date.month, date.day);
- switch (period) {
- case 'y':
- date = this._setYear(date, date.year + number);
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = this._setMonth(date, date.month + number);
- date.day = 1;
- return date;
- case 'd':
- return this._setDay(date, date.day + number);
- default:
- return date;
- }
- };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarHijri.prototype.getPrev = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- return this.getNext(date, period, -number);
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHijri.prototype.getWeekday = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var day = this.toGregorian(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- };
- /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- NgbCalendarHijri.prototype.getWeekNumber = /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function (week, firstDayOfWeek) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
- /** @type {?} */
- var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- /** @type {?} */
- var date = week[thursdayIndex];
- /** @type {?} */
- var jsDate = this.toGregorian(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- // Thursday
- /** @type {?} */
- var time = jsDate.getTime();
- /** @type {?} */
- var MuhDate = this.toGregorian(new NgbDate(date.year, 1, 1));
- return Math.floor(Math.round((time - MuhDate.getTime()) / 86400000) / 7) + 1;
- };
- /**
- * @return {?}
- */
- NgbCalendarHijri.prototype.getToday = /**
- * @return {?}
- */
- function () { return this.fromGregorian(new Date()); };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHijri.prototype.isValid = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day) &&
- !isNaN(this.toGregorian(date).getTime());
- };
- /**
- * @private
- * @param {?} date
- * @param {?} day
- * @return {?}
- */
- NgbCalendarHijri.prototype._setDay = /**
- * @private
- * @param {?} date
- * @param {?} day
- * @return {?}
- */
- function (date, day) {
- day = +day;
- /** @type {?} */
- var mDays = this.getDaysPerMonth(date.month, date.year);
- if (day <= 0) {
- while (day <= 0) {
- date = this._setMonth(date, date.month - 1);
- mDays = this.getDaysPerMonth(date.month, date.year);
- day += mDays;
- }
- }
- else if (day > mDays) {
- while (day > mDays) {
- day -= mDays;
- date = this._setMonth(date, date.month + 1);
- mDays = this.getDaysPerMonth(date.month, date.year);
- }
- }
- date.day = day;
- return date;
- };
- /**
- * @private
- * @param {?} date
- * @param {?} month
- * @return {?}
- */
- NgbCalendarHijri.prototype._setMonth = /**
- * @private
- * @param {?} date
- * @param {?} month
- * @return {?}
- */
- function (date, month) {
- month = +month;
- date.year = date.year + Math.floor((month - 1) / 12);
- date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
- return date;
- };
- /**
- * @private
- * @param {?} date
- * @param {?} year
- * @return {?}
- */
- NgbCalendarHijri.prototype._setYear = /**
- * @private
- * @param {?} date
- * @param {?} year
- * @return {?}
- */
- function (date, year) {
- date.year = +year;
- return date;
- };
- NgbCalendarHijri.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarHijri;
- }(NgbCalendar));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Checks if islamic year is a leap year
- * @param {?} hYear
- * @return {?}
- */
- function isIslamicLeapYear(hYear) {
- return (14 + 11 * hYear) % 30 < 11;
- }
- /**
- * Checks if gregorian years is a leap year
- * @param {?} gDate
- * @return {?}
- */
- function isGregorianLeapYear(gDate) {
- /** @type {?} */
- var year = gDate.getFullYear();
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
- }
- /**
- * Returns the start of Hijri Month.
- * `hMonth` is 0 for Muharram, 1 for Safar, etc.
- * `hYear` is any Hijri hYear.
- * @param {?} hYear
- * @param {?} hMonth
- * @return {?}
- */
- function getIslamicMonthStart(hYear, hMonth) {
- return Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30.0);
- }
- /**
- * Returns the start of Hijri year.
- * `year` is any Hijri year.
- * @param {?} year
- * @return {?}
- */
- function getIslamicYearStart(year) {
- return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);
- }
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- function mod(a, b) {
- return a - b * Math.floor(a / b);
- }
- /**
- * The civil calendar is one type of Hijri calendars used in islamic countries.
- * Uses a fixed cycle of alternating 29- and 30-day months,
- * with a leap day added to the last month of 11 out of every 30 years.
- * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
- * All the calculations here are based on the equations from "Calendrical Calculations" By Edward M. Reingold, Nachum
- * Dershowitz.
- * @type {?}
- */
- var GREGORIAN_EPOCH = 1721425.5;
- /** @type {?} */
- var ISLAMIC_EPOCH = 1948439.5;
- var NgbCalendarIslamicCivil = /** @class */ (function (_super) {
- __extends(NgbCalendarIslamicCivil, _super);
- function NgbCalendarIslamicCivil() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
- * `gDate` is a JS Date to be converted to Hijri.
- */
- /**
- * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
- * `gDate` is a JS Date to be converted to Hijri.
- * @param {?} gDate
- * @return {?}
- */
- NgbCalendarIslamicCivil.prototype.fromGregorian = /**
- * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
- * `gDate` is a JS Date to be converted to Hijri.
- * @param {?} gDate
- * @return {?}
- */
- function (gDate) {
- /** @type {?} */
- var gYear = gDate.getFullYear();
- /** @type {?} */
- var gMonth = gDate.getMonth();
- /** @type {?} */
- var gDay = gDate.getDate();
- /** @type {?} */
- var julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +
- -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
- Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gDate) ? -1 : -2) + gDay);
- julianDay = Math.floor(julianDay) + 0.5;
- /** @type {?} */
- var days = julianDay - ISLAMIC_EPOCH;
- /** @type {?} */
- var hYear = Math.floor((30 * days + 10646) / 10631.0);
- /** @type {?} */
- var hMonth = Math.ceil((days - 29 - getIslamicYearStart(hYear)) / 29.5);
- hMonth = Math.min(hMonth, 11);
- /** @type {?} */
- var hDay = Math.ceil(days - getIslamicMonthStart(hYear, hMonth)) + 1;
- return new NgbDate(hYear, hMonth + 1, hDay);
- };
- /**
- * Returns the equivalent JS date value for a give input islamic(civil) date.
- * `hDate` is an islamic(civil) date to be converted to Gregorian.
- */
- /**
- * Returns the equivalent JS date value for a give input islamic(civil) date.
- * `hDate` is an islamic(civil) date to be converted to Gregorian.
- * @param {?} hDate
- * @return {?}
- */
- NgbCalendarIslamicCivil.prototype.toGregorian = /**
- * Returns the equivalent JS date value for a give input islamic(civil) date.
- * `hDate` is an islamic(civil) date to be converted to Gregorian.
- * @param {?} hDate
- * @return {?}
- */
- function (hDate) {
- /** @type {?} */
- var hYear = hDate.year;
- /** @type {?} */
- var hMonth = hDate.month - 1;
- /** @type {?} */
- var hDay = hDate.day;
- /** @type {?} */
- var julianDay = hDay + Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30) + ISLAMIC_EPOCH - 1;
- /** @type {?} */
- var wjd = Math.floor(julianDay - 0.5) + 0.5;
- /** @type {?} */
- var depoch = wjd - GREGORIAN_EPOCH;
- /** @type {?} */
- var quadricent = Math.floor(depoch / 146097);
- /** @type {?} */
- var dqc = mod(depoch, 146097);
- /** @type {?} */
- var cent = Math.floor(dqc / 36524);
- /** @type {?} */
- var dcent = mod(dqc, 36524);
- /** @type {?} */
- var quad = Math.floor(dcent / 1461);
- /** @type {?} */
- var dquad = mod(dcent, 1461);
- /** @type {?} */
- var yindex = Math.floor(dquad / 365);
- /** @type {?} */
- var year = quadricent * 400 + cent * 100 + quad * 4 + yindex;
- if (!(cent === 4 || yindex === 4)) {
- year++;
- }
- /** @type {?} */
- var gYearStart = GREGORIAN_EPOCH + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400);
- /** @type {?} */
- var yearday = wjd - gYearStart;
- /** @type {?} */
- var tjd = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400) + Math.floor(739 / 12 + (isGregorianLeapYear(new Date(year, 3, 1)) ? -1 : -2) + 1);
- /** @type {?} */
- var leapadj = wjd < tjd ? 0 : isGregorianLeapYear(new Date(year, 3, 1)) ? 1 : 2;
- /** @type {?} */
- var month = Math.floor(((yearday + leapadj) * 12 + 373) / 367);
- /** @type {?} */
- var tjd2 = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400) +
- Math.floor((367 * month - 362) / 12 + (month <= 2 ? 0 : isGregorianLeapYear(new Date(year, month - 1, 1)) ? -1 : -2) +
- 1);
- /** @type {?} */
- var day = wjd - tjd2 + 1;
- return new Date(year, month - 1, day);
- };
- /**
- * Returns the number of days in a specific Hijri month.
- * `month` is 1 for Muharram, 2 for Safar, etc.
- * `year` is any Hijri year.
- */
- /**
- * Returns the number of days in a specific Hijri month.
- * `month` is 1 for Muharram, 2 for Safar, etc.
- * `year` is any Hijri year.
- * @param {?} month
- * @param {?} year
- * @return {?}
- */
- NgbCalendarIslamicCivil.prototype.getDaysPerMonth = /**
- * Returns the number of days in a specific Hijri month.
- * `month` is 1 for Muharram, 2 for Safar, etc.
- * `year` is any Hijri year.
- * @param {?} month
- * @param {?} year
- * @return {?}
- */
- function (month, year) {
- year = year + Math.floor(month / 13);
- month = ((month - 1) % 12) + 1;
- /** @type {?} */
- var length = 29 + month % 2;
- if (month === 12 && isIslamicLeapYear(year)) {
- length++;
- }
- return length;
- };
- NgbCalendarIslamicCivil.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarIslamicCivil;
- }(NgbCalendarHijri));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Umalqura calendar is one type of Hijri calendars used in islamic countries.
- * This Calendar is used by Saudi Arabia for administrative purpose.
- * Unlike tabular calendars, the algorithm involves astronomical calculation, but it's still deterministic.
- * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
- * @type {?}
- */
- var GREGORIAN_FIRST_DATE = new Date(1882, 10, 12);
- /** @type {?} */
- var GREGORIAN_LAST_DATE = new Date(2174, 10, 25);
- /** @type {?} */
- var HIJRI_BEGIN = 1300;
- /** @type {?} */
- var HIJRI_END = 1600;
- /** @type {?} */
- var ONE_DAY = 1000 * 60 * 60 * 24;
- /** @type {?} */
- var MONTH_LENGTH = [
- // 1300-1304
- '101010101010', '110101010100', '111011001001', '011011010100', '011011101010',
- // 1305-1309
- '001101101100', '101010101101', '010101010101', '011010101001', '011110010010',
- // 1310-1314
- '101110101001', '010111010100', '101011011010', '010101011100', '110100101101',
- // 1315-1319
- '011010010101', '011101001010', '101101010100', '101101101010', '010110101101',
- // 1320-1324
- '010010101110', '101001001111', '010100010111', '011010001011', '011010100101',
- // 1325-1329
- '101011010101', '001011010110', '100101011011', '010010011101', '101001001101',
- // 1330-1334
- '110100100110', '110110010101', '010110101100', '100110110110', '001010111010',
- // 1335-1339
- '101001011011', '010100101011', '101010010101', '011011001010', '101011101001',
- // 1340-1344
- '001011110100', '100101110110', '001010110110', '100101010110', '101011001010',
- // 1345-1349
- '101110100100', '101111010010', '010111011001', '001011011100', '100101101101',
- // 1350-1354
- '010101001101', '101010100101', '101101010010', '101110100101', '010110110100',
- // 1355-1359
- '100110110110', '010101010111', '001010010111', '010101001011', '011010100011',
- // 1360-1364
- '011101010010', '101101100101', '010101101010', '101010101011', '010100101011',
- // 1365-1369
- '110010010101', '110101001010', '110110100101', '010111001010', '101011010110',
- // 1370-1374
- '100101010111', '010010101011', '100101001011', '101010100101', '101101010010',
- // 1375-1379
- '101101101010', '010101110101', '001001110110', '100010110111', '010001011011',
- // 1380-1384
- '010101010101', '010110101001', '010110110100', '100111011010', '010011011101',
- // 1385-1389
- '001001101110', '100100110110', '101010101010', '110101010100', '110110110010',
- // 1390-1394
- '010111010101', '001011011010', '100101011011', '010010101011', '101001010101',
- // 1395-1399
- '101101001001', '101101100100', '101101110001', '010110110100', '101010110101',
- // 1400-1404
- '101001010101', '110100100101', '111010010010', '111011001001', '011011010100',
- // 1405-1409
- '101011101001', '100101101011', '010010101011', '101010010011', '110101001001',
- // 1410-1414
- '110110100100', '110110110010', '101010111001', '010010111010', '101001011011',
- // 1415-1419
- '010100101011', '101010010101', '101100101010', '101101010101', '010101011100',
- // 1420-1424
- '010010111101', '001000111101', '100100011101', '101010010101', '101101001010',
- // 1425-1429
- '101101011010', '010101101101', '001010110110', '100100111011', '010010011011',
- // 1430-1434
- '011001010101', '011010101001', '011101010100', '101101101010', '010101101100',
- // 1435-1439
- '101010101101', '010101010101', '101100101001', '101110010010', '101110101001',
- // 1440-1444
- '010111010100', '101011011010', '010101011010', '101010101011', '010110010101',
- // 1445-1449
- '011101001001', '011101100100', '101110101010', '010110110101', '001010110110',
- // 1450-1454
- '101001010110', '111001001101', '101100100101', '101101010010', '101101101010',
- // 1455-1459
- '010110101101', '001010101110', '100100101111', '010010010111', '011001001011',
- // 1460-1464
- '011010100101', '011010101100', '101011010110', '010101011101', '010010011101',
- // 1465-1469
- '101001001101', '110100010110', '110110010101', '010110101010', '010110110101',
- // 1470-1474
- '001011011010', '100101011011', '010010101101', '010110010101', '011011001010',
- // 1475-1479
- '011011100100', '101011101010', '010011110101', '001010110110', '100101010110',
- // 1480-1484
- '101010101010', '101101010100', '101111010010', '010111011001', '001011101010',
- // 1485-1489
- '100101101101', '010010101101', '101010010101', '101101001010', '101110100101',
- // 1490-1494
- '010110110010', '100110110101', '010011010110', '101010010111', '010101000111',
- // 1495-1499
- '011010010011', '011101001001', '101101010101', '010101101010', '101001101011',
- // 1500-1504
- '010100101011', '101010001011', '110101000110', '110110100011', '010111001010',
- // 1505-1509
- '101011010110', '010011011011', '001001101011', '100101001011', '101010100101',
- // 1510-1514
- '101101010010', '101101101001', '010101110101', '000101110110', '100010110111',
- // 1515-1519
- '001001011011', '010100101011', '010101100101', '010110110100', '100111011010',
- // 1520-1524
- '010011101101', '000101101101', '100010110110', '101010100110', '110101010010',
- // 1525-1529
- '110110101001', '010111010100', '101011011010', '100101011011', '010010101011',
- // 1530-1534
- '011001010011', '011100101001', '011101100010', '101110101001', '010110110010',
- // 1535-1539
- '101010110101', '010101010101', '101100100101', '110110010010', '111011001001',
- // 1540-1544
- '011011010010', '101011101001', '010101101011', '010010101011', '101001010101',
- // 1545-1549
- '110100101001', '110101010100', '110110101010', '100110110101', '010010111010',
- // 1550-1554
- '101000111011', '010010011011', '101001001101', '101010101010', '101011010101',
- // 1555-1559
- '001011011010', '100101011101', '010001011110', '101000101110', '110010011010',
- // 1560-1564
- '110101010101', '011010110010', '011010111001', '010010111010', '101001011101',
- // 1565-1569
- '010100101101', '101010010101', '101101010010', '101110101000', '101110110100',
- // 1570-1574
- '010110111001', '001011011010', '100101011010', '101101001010', '110110100100',
- // 1575-1579
- '111011010001', '011011101000', '101101101010', '010101101101', '010100110101',
- // 1580-1584
- '011010010101', '110101001010', '110110101000', '110111010100', '011011011010',
- // 1585-1589
- '010101011011', '001010011101', '011000101011', '101100010101', '101101001010',
- // 1590-1594
- '101110010101', '010110101010', '101010101110', '100100101110', '110010001111',
- // 1595-1599
- '010100100111', '011010010101', '011010101010', '101011010110', '010101011101',
- // 1600
- '001010011101'
- ];
- /**
- * @param {?} date1
- * @param {?} date2
- * @return {?}
- */
- function getDaysDiff(date1, date2) {
- // Ignores the time part in date1 and date2:
- /** @type {?} */
- var time1 = Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate());
- /** @type {?} */
- var time2 = Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate());
- /** @type {?} */
- var diff = Math.abs(time1 - time2);
- return Math.round(diff / ONE_DAY);
- }
- var NgbCalendarIslamicUmalqura = /** @class */ (function (_super) {
- __extends(NgbCalendarIslamicUmalqura, _super);
- function NgbCalendarIslamicUmalqura() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
- * `gdate` is s JS Date to be converted to Hijri.
- */
- /**
- * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
- * `gdate` is s JS Date to be converted to Hijri.
- * @param {?} gDate
- * @return {?}
- */
- NgbCalendarIslamicUmalqura.prototype.fromGregorian = /**
- * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
- * `gdate` is s JS Date to be converted to Hijri.
- * @param {?} gDate
- * @return {?}
- */
- function (gDate) {
- /** @type {?} */
- var hDay = 1;
- /** @type {?} */
- var hMonth = 0;
- /** @type {?} */
- var hYear = 1300;
- /** @type {?} */
- var daysDiff = getDaysDiff(gDate, GREGORIAN_FIRST_DATE);
- if (gDate.getTime() - GREGORIAN_FIRST_DATE.getTime() >= 0 && gDate.getTime() - GREGORIAN_LAST_DATE.getTime() <= 0) {
- /** @type {?} */
- var year = 1300;
- for (var i = 0; i < MONTH_LENGTH.length; i++, year++) {
- for (var j = 0; j < 12; j++) {
- /** @type {?} */
- var numOfDays = +MONTH_LENGTH[i][j] + 29;
- if (daysDiff <= numOfDays) {
- hDay = daysDiff + 1;
- if (hDay > numOfDays) {
- hDay = 1;
- j++;
- }
- if (j > 11) {
- j = 0;
- year++;
- }
- hMonth = j;
- hYear = year;
- return new NgbDate(hYear, hMonth + 1, hDay);
- }
- daysDiff = daysDiff - numOfDays;
- }
- }
- }
- else {
- return _super.prototype.fromGregorian.call(this, gDate);
- }
- };
- /**
- * Converts the current Hijri date to Gregorian.
- */
- /**
- * Converts the current Hijri date to Gregorian.
- * @param {?} hDate
- * @return {?}
- */
- NgbCalendarIslamicUmalqura.prototype.toGregorian = /**
- * Converts the current Hijri date to Gregorian.
- * @param {?} hDate
- * @return {?}
- */
- function (hDate) {
- /** @type {?} */
- var hYear = hDate.year;
- /** @type {?} */
- var hMonth = hDate.month - 1;
- /** @type {?} */
- var hDay = hDate.day;
- /** @type {?} */
- var gDate = new Date(GREGORIAN_FIRST_DATE);
- /** @type {?} */
- var dayDiff = hDay - 1;
- if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
- for (var y = 0; y < hYear - HIJRI_BEGIN; y++) {
- for (var m = 0; m < 12; m++) {
- dayDiff += +MONTH_LENGTH[y][m] + 29;
- }
- }
- for (var m = 0; m < hMonth; m++) {
- dayDiff += +MONTH_LENGTH[hYear - HIJRI_BEGIN][m] + 29;
- }
- gDate.setDate(GREGORIAN_FIRST_DATE.getDate() + dayDiff);
- }
- else {
- gDate = _super.prototype.toGregorian.call(this, hDate);
- }
- return gDate;
- };
- /**
- * Returns the number of days in a specific Hijri hMonth.
- * `hMonth` is 1 for Muharram, 2 for Safar, etc.
- * `hYear` is any Hijri hYear.
- */
- /**
- * Returns the number of days in a specific Hijri hMonth.
- * `hMonth` is 1 for Muharram, 2 for Safar, etc.
- * `hYear` is any Hijri hYear.
- * @param {?} hMonth
- * @param {?} hYear
- * @return {?}
- */
- NgbCalendarIslamicUmalqura.prototype.getDaysPerMonth = /**
- * Returns the number of days in a specific Hijri hMonth.
- * `hMonth` is 1 for Muharram, 2 for Safar, etc.
- * `hYear` is any Hijri hYear.
- * @param {?} hMonth
- * @param {?} hYear
- * @return {?}
- */
- function (hMonth, hYear) {
- if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
- /** @type {?} */
- var pos = hYear - HIJRI_BEGIN;
- return +MONTH_LENGTH[pos][hMonth - 1] + 29;
- }
- return _super.prototype.getDaysPerMonth.call(this, hMonth, hYear);
- };
- NgbCalendarIslamicUmalqura.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarIslamicUmalqura;
- }(NgbCalendarIslamicCivil));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Returns the equivalent JS date value for a give input Jalali date.
- * `jalaliDate` is an Jalali date to be converted to Gregorian.
- * @param {?} jalaliDate
- * @return {?}
- */
- function toGregorian(jalaliDate) {
- /** @type {?} */
- var jdn = jalaliToJulian(jalaliDate.year, jalaliDate.month, jalaliDate.day);
- /** @type {?} */
- var date = julianToGregorian(jdn);
- date.setHours(6, 30, 3, 200);
- return date;
- }
- /**
- * Returns the equivalent jalali date value for a give input Gregorian date.
- * `gdate` is a JS Date to be converted to jalali.
- * utc to local
- * @param {?} gdate
- * @return {?}
- */
- function fromGregorian(gdate) {
- /** @type {?} */
- var g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());
- return julianToJalali(g2d);
- }
- /**
- * @param {?} date
- * @param {?} yearValue
- * @return {?}
- */
- function setJalaliYear(date, yearValue) {
- date.year = +yearValue;
- return date;
- }
- /**
- * @param {?} date
- * @param {?} month
- * @return {?}
- */
- function setJalaliMonth(date, month) {
- month = +month;
- date.year = date.year + Math.floor((month - 1) / 12);
- date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
- return date;
- }
- /**
- * @param {?} date
- * @param {?} day
- * @return {?}
- */
- function setJalaliDay(date, day) {
- /** @type {?} */
- var mDays = getDaysPerMonth(date.month, date.year);
- if (day <= 0) {
- while (day <= 0) {
- date = setJalaliMonth(date, date.month - 1);
- mDays = getDaysPerMonth(date.month, date.year);
- day += mDays;
- }
- }
- else if (day > mDays) {
- while (day > mDays) {
- day -= mDays;
- date = setJalaliMonth(date, date.month + 1);
- mDays = getDaysPerMonth(date.month, date.year);
- }
- }
- date.day = day;
- return date;
- }
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- function mod$1(a, b) {
- return a - b * Math.floor(a / b);
- }
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- function div(a, b) {
- return Math.trunc(a / b);
- }
- /*
- This function determines if the Jalali (Persian) year is
- leap (366-day long) or is the common year (365 days), and
- finds the day in March (Gregorian calendar) of the first
- day of the Jalali year (jalaliYear).
- @param jalaliYear Jalali calendar year (-61 to 3177)
- @return
- leap: number of years since the last leap year (0 to 4)
- gYear: Gregorian year of the beginning of Jalali year
- march: the March day of Farvardin the 1st (1st day of jalaliYear)
- @see: http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm
- @see: http://www.fourmilab.ch/documents/calendar/
- */
- /**
- * @param {?} jalaliYear
- * @return {?}
- */
- function jalCal(jalaliYear) {
- // Jalali years starting the 33-year rule.
- /** @type {?} */
- var breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];
- /** @type {?} */
- var breaksLength = breaks.length;
- /** @type {?} */
- var gYear = jalaliYear + 621;
- /** @type {?} */
- var leapJ = -14;
- /** @type {?} */
- var jp = breaks[0];
- if (jalaliYear < jp || jalaliYear >= breaks[breaksLength - 1]) {
- throw new Error('Invalid Jalali year ' + jalaliYear);
- }
- // Find the limiting years for the Jalali year jalaliYear.
- /** @type {?} */
- var jump;
- for (var i = 1; i < breaksLength; i += 1) {
- /** @type {?} */
- var jm = breaks[i];
- jump = jm - jp;
- if (jalaliYear < jm) {
- break;
- }
- leapJ = leapJ + div(jump, 33) * 8 + div(mod$1(jump, 33), 4);
- jp = jm;
- }
- /** @type {?} */
- var n = jalaliYear - jp;
- // Find the number of leap years from AD 621 to the beginning
- // of the current Jalali year in the Persian calendar.
- leapJ = leapJ + div(n, 33) * 8 + div(mod$1(n, 33) + 3, 4);
- if (mod$1(jump, 33) === 4 && jump - n === 4) {
- leapJ += 1;
- }
- // And the same in the Gregorian calendar (until the year gYear).
- /** @type {?} */
- var leapG = div(gYear, 4) - div((div(gYear, 100) + 1) * 3, 4) - 150;
- // Determine the Gregorian date of Farvardin the 1st.
- /** @type {?} */
- var march = 20 + leapJ - leapG;
- // Find how many years have passed since the last leap year.
- if (jump - n < 6) {
- n = n - jump + div(jump + 4, 33) * 33;
- }
- /** @type {?} */
- var leap = mod$1(mod$1(n + 1, 33) - 1, 4);
- if (leap === -1) {
- leap = 4;
- }
- return { leap: leap, gy: gYear, march: march };
- }
- /*
- Calculates Gregorian and Julian calendar dates from the Julian Day number
- (jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both
- calendars) to some millions years ahead of the present.
- @param jdn Julian Day number
- @return
- gYear: Calendar year (years BC numbered 0, -1, -2, ...)
- gMonth: Calendar month (1 to 12)
- gDay: Calendar day of the month M (1 to 28/29/30/31)
- */
- /**
- * @param {?} julianDayNumber
- * @return {?}
- */
- function julianToGregorian(julianDayNumber) {
- /** @type {?} */
- var j = 4 * julianDayNumber + 139361631;
- j = j + div(div(4 * julianDayNumber + 183187720, 146097) * 3, 4) * 4 - 3908;
- /** @type {?} */
- var i = div(mod$1(j, 1461), 4) * 5 + 308;
- /** @type {?} */
- var gDay = div(mod$1(i, 153), 5) + 1;
- /** @type {?} */
- var gMonth = mod$1(div(i, 153), 12) + 1;
- /** @type {?} */
- var gYear = div(j, 1461) - 100100 + div(8 - gMonth, 6);
- return new Date(gYear, gMonth - 1, gDay);
- }
- /*
- Converts a date of the Jalali calendar to the Julian Day number.
- @param jy Jalali year (1 to 3100)
- @param jm Jalali month (1 to 12)
- @param jd Jalali day (1 to 29/31)
- @return Julian Day number
- */
- /**
- * @param {?} gy
- * @param {?} gm
- * @param {?} gd
- * @return {?}
- */
- function gregorianToJulian(gy, gm, gd) {
- /** @type {?} */
- var d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod$1(gm + 9, 12) + 2, 5) + gd - 34840408;
- d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;
- return d;
- }
- /*
- Converts the Julian Day number to a date in the Jalali calendar.
- @param julianDayNumber Julian Day number
- @return
- jalaliYear: Jalali year (1 to 3100)
- jalaliMonth: Jalali month (1 to 12)
- jalaliDay: Jalali day (1 to 29/31)
- */
- /**
- * @param {?} julianDayNumber
- * @return {?}
- */
- function julianToJalali(julianDayNumber) {
- /** @type {?} */
- var gy = julianToGregorian(julianDayNumber).getFullYear() // Calculate Gregorian year (gy).
- ;
- /** @type {?} */
- var jalaliYear = gy - 621;
- /** @type {?} */
- var r = jalCal(jalaliYear);
- /** @type {?} */
- var gregorianDay = gregorianToJulian(gy, 3, r.march);
- /** @type {?} */
- var jalaliDay;
- /** @type {?} */
- var jalaliMonth;
- /** @type {?} */
- var numberOfDays;
- // Find number of days that passed since 1 Farvardin.
- numberOfDays = julianDayNumber - gregorianDay;
- if (numberOfDays >= 0) {
- if (numberOfDays <= 185) {
- // The first 6 months.
- jalaliMonth = 1 + div(numberOfDays, 31);
- jalaliDay = mod$1(numberOfDays, 31) + 1;
- return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
- }
- else {
- // The remaining months.
- numberOfDays -= 186;
- }
- }
- else {
- // Previous Jalali year.
- jalaliYear -= 1;
- numberOfDays += 179;
- if (r.leap === 1) {
- numberOfDays += 1;
- }
- }
- jalaliMonth = 7 + div(numberOfDays, 30);
- jalaliDay = mod$1(numberOfDays, 30) + 1;
- return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
- }
- /*
- Converts a date of the Jalali calendar to the Julian Day number.
- @param jYear Jalali year (1 to 3100)
- @param jMonth Jalali month (1 to 12)
- @param jDay Jalali day (1 to 29/31)
- @return Julian Day number
- */
- /**
- * @param {?} jYear
- * @param {?} jMonth
- * @param {?} jDay
- * @return {?}
- */
- function jalaliToJulian(jYear, jMonth, jDay) {
- /** @type {?} */
- var r = jalCal(jYear);
- return gregorianToJulian(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;
- }
- /**
- * Returns the number of days in a specific jalali month.
- * @param {?} month
- * @param {?} year
- * @return {?}
- */
- function getDaysPerMonth(month, year) {
- if (month <= 6) {
- return 31;
- }
- if (month <= 11) {
- return 30;
- }
- if (jalCal(year).leap === 0) {
- return 30;
- }
- return 29;
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbCalendarPersian = /** @class */ (function (_super) {
- __extends(NgbCalendarPersian, _super);
- function NgbCalendarPersian() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @return {?}
- */
- NgbCalendarPersian.prototype.getDaysPerWeek = /**
- * @return {?}
- */
- function () { return 7; };
- /**
- * @return {?}
- */
- NgbCalendarPersian.prototype.getMonths = /**
- * @return {?}
- */
- function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
- /**
- * @return {?}
- */
- NgbCalendarPersian.prototype.getWeeksPerMonth = /**
- * @return {?}
- */
- function () { return 6; };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarPersian.prototype.getNext = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- date = new NgbDate(date.year, date.month, date.day);
- switch (period) {
- case 'y':
- date = setJalaliYear(date, date.year + number);
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = setJalaliMonth(date, date.month + number);
- date.day = 1;
- return date;
- case 'd':
- return setJalaliDay(date, date.day + number);
- default:
- return date;
- }
- };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarPersian.prototype.getPrev = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- return this.getNext(date, period, -number);
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarPersian.prototype.getWeekday = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var day = toGregorian(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- };
- /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- NgbCalendarPersian.prototype.getWeekNumber = /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function (week, firstDayOfWeek) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
- /** @type {?} */
- var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- /** @type {?} */
- var date = week[thursdayIndex];
- /** @type {?} */
- var jsDate = toGregorian(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- // Thursday
- /** @type {?} */
- var time = jsDate.getTime();
- /** @type {?} */
- var startDate = toGregorian(new NgbDate(date.year, 1, 1));
- return Math.floor(Math.round((time - startDate.getTime()) / 86400000) / 7) + 1;
- };
- /**
- * @return {?}
- */
- NgbCalendarPersian.prototype.getToday = /**
- * @return {?}
- */
- function () { return fromGregorian(new Date()); };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarPersian.prototype.isValid = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) &&
- !isNaN(toGregorian(date).getTime());
- };
- NgbCalendarPersian.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarPersian;
- }(NgbCalendar));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var PARTS_PER_HOUR = 1080;
- /** @type {?} */
- var PARTS_PER_DAY = 24 * PARTS_PER_HOUR;
- /** @type {?} */
- var PARTS_FRACTIONAL_MONTH = 12 * PARTS_PER_HOUR + 793;
- /** @type {?} */
- var PARTS_PER_MONTH = 29 * PARTS_PER_DAY + PARTS_FRACTIONAL_MONTH;
- /** @type {?} */
- var BAHARAD = 11 * PARTS_PER_HOUR + 204;
- /** @type {?} */
- var HEBREW_DAY_ON_JAN_1_1970 = 2092591;
- /** @type {?} */
- var GREGORIAN_EPOCH$1 = 1721425.5;
- /**
- * @param {?} year
- * @return {?}
- */
- function isGregorianLeapYear$1(year) {
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
- }
- /**
- * @param {?} year
- * @return {?}
- */
- function numberOfFirstDayInYear(year) {
- /** @type {?} */
- var monthsBeforeYear = Math.floor((235 * year - 234) / 19);
- /** @type {?} */
- var fractionalMonthsBeforeYear = monthsBeforeYear * PARTS_FRACTIONAL_MONTH + BAHARAD;
- /** @type {?} */
- var dayNumber = monthsBeforeYear * 29 + Math.floor(fractionalMonthsBeforeYear / PARTS_PER_DAY);
- /** @type {?} */
- var timeOfDay = fractionalMonthsBeforeYear % PARTS_PER_DAY;
- /** @type {?} */
- var dayOfWeek = dayNumber % 7;
- if (dayOfWeek === 2 || dayOfWeek === 4 || dayOfWeek === 6) {
- dayNumber++;
- dayOfWeek = dayNumber % 7;
- }
- if (dayOfWeek === 1 && timeOfDay > 15 * PARTS_PER_HOUR + 204 && !isHebrewLeapYear(year)) {
- dayNumber += 2;
- }
- else if (dayOfWeek === 0 && timeOfDay > 21 * PARTS_PER_HOUR + 589 && isHebrewLeapYear(year - 1)) {
- dayNumber++;
- }
- return dayNumber;
- }
- /**
- * @param {?} month
- * @param {?} year
- * @return {?}
- */
- function getDaysInGregorianMonth(month, year) {
- /** @type {?} */
- var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if (isGregorianLeapYear$1(year)) {
- days[1]++;
- }
- return days[month - 1];
- }
- /**
- * @param {?} year
- * @return {?}
- */
- function getHebrewMonths(year) {
- return isHebrewLeapYear(year) ? 13 : 12;
- }
- /**
- * Returns the number of days in a specific Hebrew year.
- * `year` is any Hebrew year.
- * @param {?} year
- * @return {?}
- */
- function getDaysInHebrewYear(year) {
- return numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
- }
- /**
- * @param {?} year
- * @return {?}
- */
- function isHebrewLeapYear(year) {
- /** @type {?} */
- var b = (year * 12 + 17) % 19;
- return b >= ((b < 0) ? -7 : 12);
- }
- /**
- * Returns the number of days in a specific Hebrew month.
- * `month` is 1 for Nisan, 2 for Iyar etc. Note: Hebrew leap year contains 13 months.
- * `year` is any Hebrew year.
- * @param {?} month
- * @param {?} year
- * @return {?}
- */
- function getDaysInHebrewMonth(month, year) {
- /** @type {?} */
- var yearLength = numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
- /** @type {?} */
- var yearType = (yearLength <= 380 ? yearLength : (yearLength - 30)) - 353;
- /** @type {?} */
- var leapYear = isHebrewLeapYear(year);
- /** @type {?} */
- var daysInMonth = leapYear ? [30, 29, 29, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29] :
- [30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 30, 29];
- if (yearType > 0) {
- daysInMonth[2]++; // Kislev gets an extra day in normal or complete years.
- }
- if (yearType > 1) {
- daysInMonth[1]++; // Heshvan gets an extra day in complete years only.
- }
- return daysInMonth[month - 1];
- }
- /**
- * @param {?} date
- * @return {?}
- */
- function getDayNumberInHebrewYear(date) {
- /** @type {?} */
- var numberOfDay = 0;
- for (var i = 1; i < date.month; i++) {
- numberOfDay += getDaysInHebrewMonth(i, date.year);
- }
- return numberOfDay + date.day;
- }
- /**
- * @param {?} date
- * @param {?} val
- * @return {?}
- */
- function setHebrewMonth(date, val) {
- /** @type {?} */
- var after = val >= 0;
- if (!after) {
- val = -val;
- }
- while (val > 0) {
- if (after) {
- if (val > getHebrewMonths(date.year) - date.month) {
- val -= getHebrewMonths(date.year) - date.month + 1;
- date.year++;
- date.month = 1;
- }
- else {
- date.month += val;
- val = 0;
- }
- }
- else {
- if (val >= date.month) {
- date.year--;
- val -= date.month;
- date.month = getHebrewMonths(date.year);
- }
- else {
- date.month -= val;
- val = 0;
- }
- }
- }
- return date;
- }
- /**
- * @param {?} date
- * @param {?} val
- * @return {?}
- */
- function setHebrewDay(date, val) {
- /** @type {?} */
- var after = val >= 0;
- if (!after) {
- val = -val;
- }
- while (val > 0) {
- if (after) {
- if (val > getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date)) {
- val -= getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date) + 1;
- date.year++;
- date.month = 1;
- date.day = 1;
- }
- else if (val > getDaysInHebrewMonth(date.month, date.year) - date.day) {
- val -= getDaysInHebrewMonth(date.month, date.year) - date.day + 1;
- date.month++;
- date.day = 1;
- }
- else {
- date.day += val;
- val = 0;
- }
- }
- else {
- if (val >= date.day) {
- val -= date.day;
- date.month--;
- if (date.month === 0) {
- date.year--;
- date.month = getHebrewMonths(date.year);
- }
- date.day = getDaysInHebrewMonth(date.month, date.year);
- }
- else {
- date.day -= val;
- val = 0;
- }
- }
- }
- return date;
- }
- /**
- * Returns the equivalent Hebrew date value for a give input Gregorian date.
- * `gdate` is a JS Date to be converted to Hebrew date.
- * @param {?} gdate
- * @return {?}
- */
- function fromGregorian$1(gdate) {
- /** @type {?} */
- var date = new Date(gdate);
- /** @type {?} */
- var gYear = date.getFullYear();
- /** @type {?} */
- var gMonth = date.getMonth();
- /** @type {?} */
- var gDay = date.getDate();
- /** @type {?} */
- var julianDay = GREGORIAN_EPOCH$1 - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) -
- Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
- Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear$1(gYear) ? -1 : -2) + gDay);
- julianDay = Math.floor(julianDay + 0.5);
- /** @type {?} */
- var daysSinceHebEpoch = julianDay - 347997;
- /** @type {?} */
- var monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);
- /** @type {?} */
- var hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;
- /** @type {?} */
- var firstDayOfThisYear = numberOfFirstDayInYear(hYear);
- /** @type {?} */
- var dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
- while (dayOfYear < 1) {
- hYear--;
- firstDayOfThisYear = numberOfFirstDayInYear(hYear);
- dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
- }
- /** @type {?} */
- var hMonth = 1;
- /** @type {?} */
- var hDay = dayOfYear;
- while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {
- hDay -= getDaysInHebrewMonth(hMonth, hYear);
- hMonth++;
- }
- return new NgbDate(hYear, hMonth, hDay);
- }
- /**
- * Returns the equivalent JS date value for a given Hebrew date.
- * `hebrewDate` is an Hebrew date to be converted to Gregorian.
- * @param {?} hebrewDate
- * @return {?}
- */
- function toGregorian$1(hebrewDate) {
- /** @type {?} */
- var hYear = hebrewDate.year;
- /** @type {?} */
- var hMonth = hebrewDate.month;
- /** @type {?} */
- var hDay = hebrewDate.day;
- /** @type {?} */
- var days = numberOfFirstDayInYear(hYear);
- for (var i = 1; i < hMonth; i++) {
- days += getDaysInHebrewMonth(i, hYear);
- }
- days += hDay;
- /** @type {?} */
- var diffDays = days - HEBREW_DAY_ON_JAN_1_1970;
- /** @type {?} */
- var after = diffDays >= 0;
- if (!after) {
- diffDays = -diffDays;
- }
- /** @type {?} */
- var gYear = 1970;
- /** @type {?} */
- var gMonth = 1;
- /** @type {?} */
- var gDay = 1;
- while (diffDays > 0) {
- if (after) {
- if (diffDays >= (isGregorianLeapYear$1(gYear) ? 366 : 365)) {
- diffDays -= isGregorianLeapYear$1(gYear) ? 366 : 365;
- gYear++;
- }
- else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
- diffDays -= getDaysInGregorianMonth(gMonth, gYear);
- gMonth++;
- }
- else {
- gDay += diffDays;
- diffDays = 0;
- }
- }
- else {
- if (diffDays >= (isGregorianLeapYear$1(gYear - 1) ? 366 : 365)) {
- diffDays -= isGregorianLeapYear$1(gYear - 1) ? 366 : 365;
- gYear--;
- }
- else {
- if (gMonth > 1) {
- gMonth--;
- }
- else {
- gMonth = 12;
- gYear--;
- }
- if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
- diffDays -= getDaysInGregorianMonth(gMonth, gYear);
- }
- else {
- gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;
- diffDays = 0;
- }
- }
- }
- }
- return new Date(gYear, gMonth - 1, gDay);
- }
- /**
- * @param {?} numerals
- * @return {?}
- */
- function hebrewNumerals(numerals) {
- if (!numerals) {
- return '';
- }
- /** @type {?} */
- var hArray0_9 = ['', '\u05d0', '\u05d1', '\u05d2', '\u05d3', '\u05d4', '\u05d5', '\u05d6', '\u05d7', '\u05d8'];
- /** @type {?} */
- var hArray10_19 = [
- '\u05d9', '\u05d9\u05d0', '\u05d9\u05d1', '\u05d9\u05d2', '\u05d9\u05d3', '\u05d8\u05d5', '\u05d8\u05d6',
- '\u05d9\u05d6', '\u05d9\u05d7', '\u05d9\u05d8'
- ];
- /** @type {?} */
- var hArray20_90 = ['', '', '\u05db', '\u05dc', '\u05de', '\u05e0', '\u05e1', '\u05e2', '\u05e4', '\u05e6'];
- /** @type {?} */
- var hArray100_900 = [
- '', '\u05e7', '\u05e8', '\u05e9', '\u05ea', '\u05ea\u05e7', '\u05ea\u05e8', '\u05ea\u05e9', '\u05ea\u05ea',
- '\u05ea\u05ea\u05e7'
- ];
- /** @type {?} */
- var hArray1000_9000 = [
- '', '\u05d0', '\u05d1', '\u05d1\u05d0', '\u05d1\u05d1', '\u05d4', '\u05d4\u05d0', '\u05d4\u05d1',
- '\u05d4\u05d1\u05d0', '\u05d4\u05d1\u05d1'
- ];
- /** @type {?} */
- var geresh = '\u05f3';
- /** @type {?} */
- var gershaim = '\u05f4';
- /** @type {?} */
- var mem = 0;
- /** @type {?} */
- var result = [];
- /** @type {?} */
- var step = 0;
- while (numerals > 0) {
- /** @type {?} */
- var m = numerals % 10;
- if (step === 0) {
- mem = m;
- }
- else if (step === 1) {
- if (m !== 1) {
- result.unshift(hArray20_90[m], hArray0_9[mem]);
- }
- else {
- result.unshift(hArray10_19[mem]);
- }
- }
- else if (step === 2) {
- result.unshift(hArray100_900[m]);
- }
- else {
- if (m !== 5) {
- result.unshift(hArray1000_9000[m], geresh, ' ');
- }
- break;
- }
- numerals = Math.floor(numerals / 10);
- if (step === 0 && numerals === 0) {
- result.unshift(hArray0_9[m]);
- }
- step++;
- }
- result = result.join('').split('');
- if (result.length === 1) {
- result.push(geresh);
- }
- else if (result.length > 1) {
- result.splice(result.length - 1, 0, gershaim);
- }
- return result.join('');
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * \@since 3.2.0
- */
- var NgbCalendarHebrew = /** @class */ (function (_super) {
- __extends(NgbCalendarHebrew, _super);
- function NgbCalendarHebrew() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getDaysPerWeek = /**
- * @return {?}
- */
- function () { return 7; };
- /**
- * @param {?=} year
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getMonths = /**
- * @param {?=} year
- * @return {?}
- */
- function (year) {
- if (year && isHebrewLeapYear(year)) {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
- }
- else {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
- }
- };
- /**
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getWeeksPerMonth = /**
- * @return {?}
- */
- function () { return 6; };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHebrew.prototype.isValid = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var b = date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day);
- b = b && date.month > 0 && date.month <= (isHebrewLeapYear(date.year) ? 13 : 12);
- b = b && date.day > 0 && date.day <= getDaysInHebrewMonth(date.month, date.year);
- return b && !isNaN(toGregorian$1(date).getTime());
- };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getNext = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- date = new NgbDate(date.year, date.month, date.day);
- switch (period) {
- case 'y':
- date.year += number;
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = setHebrewMonth(date, number);
- date.day = 1;
- return date;
- case 'd':
- return setHebrewDay(date, number);
- default:
- return date;
- }
- };
- /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getPrev = /**
- * @param {?} date
- * @param {?=} period
- * @param {?=} number
- * @return {?}
- */
- function (date, period, number) {
- if (period === void 0) { period = 'd'; }
- if (number === void 0) { number = 1; }
- return this.getNext(date, period, -number);
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getWeekday = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var day = toGregorian$1(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- };
- /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getWeekNumber = /**
- * @param {?} week
- * @param {?} firstDayOfWeek
- * @return {?}
- */
- function (week, firstDayOfWeek) {
- /** @type {?} */
- var date = week[week.length - 1];
- return Math.ceil(getDayNumberInHebrewYear(date) / 7);
- };
- /**
- * @return {?}
- */
- NgbCalendarHebrew.prototype.getToday = /**
- * @return {?}
- */
- function () { return fromGregorian$1(new Date()); };
- /**
- * @since 3.4.0
- */
- /**
- * \@since 3.4.0
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHebrew.prototype.toGregorian = /**
- * \@since 3.4.0
- * @param {?} date
- * @return {?}
- */
- function (date) { return fromJSDate(toGregorian$1(date)); };
- /**
- * @since 3.4.0
- */
- /**
- * \@since 3.4.0
- * @param {?} date
- * @return {?}
- */
- NgbCalendarHebrew.prototype.fromGregorian = /**
- * \@since 3.4.0
- * @param {?} date
- * @return {?}
- */
- function (date) { return fromGregorian$1(toJSDate(date)); };
- NgbCalendarHebrew.decorators = [
- { type: Injectable }
- ];
- return NgbCalendarHebrew;
- }(NgbCalendar));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var WEEKDAYS = ['שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת', 'ראשון'];
- /** @type {?} */
- var MONTHS = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
- /** @type {?} */
- var MONTHS_LEAP = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר א׳', 'אדר ב׳', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
- /**
- * \@since 3.2.0
- */
- var NgbDatepickerI18nHebrew = /** @class */ (function (_super) {
- __extends(NgbDatepickerI18nHebrew, _super);
- function NgbDatepickerI18nHebrew() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @param {?} month
- * @param {?=} year
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getMonthShortName = /**
- * @param {?} month
- * @param {?=} year
- * @return {?}
- */
- function (month, year) { return this.getMonthFullName(month, year); };
- /**
- * @param {?} month
- * @param {?=} year
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getMonthFullName = /**
- * @param {?} month
- * @param {?=} year
- * @return {?}
- */
- function (month, year) {
- return isHebrewLeapYear(year) ? MONTHS_LEAP[month - 1] : MONTHS[month - 1];
- };
- /**
- * @param {?} weekday
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getWeekdayShortName = /**
- * @param {?} weekday
- * @return {?}
- */
- function (weekday) { return WEEKDAYS[weekday - 1]; };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getDayAriaLabel = /**
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return hebrewNumerals(date.day) + " " + this.getMonthFullName(date.month, date.year) + " " + hebrewNumerals(date.year);
- };
- /**
- * @param {?} date
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getDayNumerals = /**
- * @param {?} date
- * @return {?}
- */
- function (date) { return hebrewNumerals(date.day); };
- /**
- * @param {?} weekNumber
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getWeekNumerals = /**
- * @param {?} weekNumber
- * @return {?}
- */
- function (weekNumber) { return hebrewNumerals(weekNumber); };
- /**
- * @param {?} year
- * @return {?}
- */
- NgbDatepickerI18nHebrew.prototype.getYearNumerals = /**
- * @param {?} year
- * @return {?}
- */
- function (year) { return hebrewNumerals(year); };
- NgbDatepickerI18nHebrew.decorators = [
- { type: Injectable }
- ];
- return NgbDatepickerI18nHebrew;
- }(NgbDatepickerI18n));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * [`NgbDateAdapter`](#/components/datepicker/api#NgbDateAdapter) implementation that uses
- * native javascript dates as a user date model.
- */
- var NgbDateNativeAdapter = /** @class */ (function (_super) {
- __extends(NgbDateNativeAdapter, _super);
- function NgbDateNativeAdapter() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Converts a native `Date` to a `NgbDateStruct`.
- */
- /**
- * Converts a native `Date` to a `NgbDateStruct`.
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeAdapter.prototype.fromModel = /**
- * Converts a native `Date` to a `NgbDateStruct`.
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;
- };
- /**
- * Converts a `NgbDateStruct` to a native `Date`.
- */
- /**
- * Converts a `NgbDateStruct` to a native `Date`.
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeAdapter.prototype.toModel = /**
- * Converts a `NgbDateStruct` to a native `Date`.
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :
- null;
- };
- /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeAdapter.prototype._fromNativeDate = /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() };
- };
- /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeAdapter.prototype._toNativeDate = /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var jsDate = new Date(date.year, date.month - 1, date.day, 12);
- // avoid 30 -> 1930 conversion
- jsDate.setFullYear(date.year);
- return jsDate;
- };
- NgbDateNativeAdapter.decorators = [
- { type: Injectable }
- ];
- return NgbDateNativeAdapter;
- }(NgbDateAdapter));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Same as [`NgbDateNativeAdapter`](#/components/datepicker/api#NgbDateNativeAdapter), but with UTC dates.
- *
- * \@since 3.2.0
- */
- var NgbDateNativeUTCAdapter = /** @class */ (function (_super) {
- __extends(NgbDateNativeUTCAdapter, _super);
- function NgbDateNativeUTCAdapter() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeUTCAdapter.prototype._fromNativeDate = /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- function (date) {
- return { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate() };
- };
- /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- NgbDateNativeUTCAdapter.prototype._toNativeDate = /**
- * @protected
- * @param {?} date
- * @return {?}
- */
- function (date) {
- /** @type {?} */
- var jsDate = new Date(Date.UTC(date.year, date.month - 1, date.day));
- // avoid 30 -> 1930 conversion
- jsDate.setUTCFullYear(date.year);
- return jsDate;
- };
- NgbDateNativeUTCAdapter.decorators = [
- { type: Injectable }
- ];
- return NgbDateNativeUTCAdapter;
- }(NgbDateNativeAdapter));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbDatepickerModule = /** @class */ (function () {
- function NgbDatepickerModule() {
- }
- NgbDatepickerModule.decorators = [
- { type: NgModule, args: [{
- declarations: [
- NgbDatepicker, NgbDatepickerMonthView, NgbDatepickerNavigation, NgbDatepickerNavigationSelect, NgbDatepickerDayView,
- NgbInputDatepicker
- ],
- exports: [NgbDatepicker, NgbInputDatepicker],
- imports: [CommonModule, FormsModule],
- entryComponents: [NgbDatepicker]
- },] }
- ];
- return NgbDatepickerModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbDropdown`](#/components/dropdown/api#NgbDropdown) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the dropdowns used in the application.
- */
- var NgbDropdownConfig = /** @class */ (function () {
- function NgbDropdownConfig() {
- this.autoClose = true;
- this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
- }
- NgbDropdownConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbDropdownConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDropdownConfig_Factory() { return new NgbDropdownConfig(); }, token: NgbDropdownConfig, providedIn: "root" });
- return NgbDropdownConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbNavbar = /** @class */ (function () {
- function NgbNavbar() {
- }
- NgbNavbar.decorators = [
- { type: Directive, args: [{ selector: '.navbar' },] }
- ];
- return NgbNavbar;
- }());
- /**
- * A directive you should put on a dropdown item to enable keyboard navigation.
- * Arrow keys will move focus between items marked with this directive.
- *
- * \@since 4.1.0
- */
- var NgbDropdownItem = /** @class */ (function () {
- function NgbDropdownItem(elementRef) {
- this.elementRef = elementRef;
- this._disabled = false;
- }
- Object.defineProperty(NgbDropdownItem.prototype, "disabled", {
- get: /**
- * @return {?}
- */
- function () { return this._disabled; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._disabled = (/** @type {?} */ (value)) === '' || value === true; // accept an empty attribute as true
- },
- enumerable: true,
- configurable: true
- });
- NgbDropdownItem.decorators = [
- { type: Directive, args: [{ selector: '[ngbDropdownItem]', host: { 'class': 'dropdown-item', '[class.disabled]': 'disabled' } },] }
- ];
- /** @nocollapse */
- NgbDropdownItem.ctorParameters = function () { return [
- { type: ElementRef }
- ]; };
- NgbDropdownItem.propDecorators = {
- disabled: [{ type: Input }]
- };
- return NgbDropdownItem;
- }());
- /**
- * A directive that wraps dropdown menu content and dropdown items.
- */
- var NgbDropdownMenu = /** @class */ (function () {
- function NgbDropdownMenu(dropdown) {
- this.dropdown = dropdown;
- this.placement = 'bottom';
- this.isOpen = false;
- }
- NgbDropdownMenu.decorators = [
- { type: Directive, args: [{
- selector: '[ngbDropdownMenu]',
- host: {
- '[class.dropdown-menu]': 'true',
- '[class.show]': 'dropdown.isOpen()',
- '[attr.x-placement]': 'placement',
- '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
- '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
- '(keydown.Home)': 'dropdown.onKeyDown($event)',
- '(keydown.End)': 'dropdown.onKeyDown($event)',
- '(keydown.Enter)': 'dropdown.onKeyDown($event)',
- '(keydown.Space)': 'dropdown.onKeyDown($event)'
- }
- },] }
- ];
- /** @nocollapse */
- NgbDropdownMenu.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
- * @return {?}
- */
- function () { return NgbDropdown; })),] }] }
- ]; };
- NgbDropdownMenu.propDecorators = {
- menuItems: [{ type: ContentChildren, args: [NgbDropdownItem,] }]
- };
- return NgbDropdownMenu;
- }());
- /**
- * A directive to mark an element to which dropdown menu will be anchored.
- *
- * This is a simple version of the `NgbDropdownToggle` directive.
- * It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support
- * for events other than click.
- *
- * \@since 1.1.0
- */
- var NgbDropdownAnchor = /** @class */ (function () {
- function NgbDropdownAnchor(dropdown, _elementRef) {
- this.dropdown = dropdown;
- this._elementRef = _elementRef;
- this.anchorEl = _elementRef.nativeElement;
- }
- /**
- * @return {?}
- */
- NgbDropdownAnchor.prototype.getNativeElement = /**
- * @return {?}
- */
- function () { return this._elementRef.nativeElement; };
- NgbDropdownAnchor.decorators = [
- { type: Directive, args: [{
- selector: '[ngbDropdownAnchor]',
- host: { 'class': 'dropdown-toggle', 'aria-haspopup': 'true', '[attr.aria-expanded]': 'dropdown.isOpen()' }
- },] }
- ];
- /** @nocollapse */
- NgbDropdownAnchor.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
- * @return {?}
- */
- function () { return NgbDropdown; })),] }] },
- { type: ElementRef }
- ]; };
- return NgbDropdownAnchor;
- }());
- /**
- * A directive to mark an element that will toggle dropdown via the `click` event.
- *
- * You can also use `NgbDropdownAnchor` as an alternative.
- */
- var NgbDropdownToggle = /** @class */ (function (_super) {
- __extends(NgbDropdownToggle, _super);
- function NgbDropdownToggle(dropdown, elementRef) {
- return _super.call(this, dropdown, elementRef) || this;
- }
- NgbDropdownToggle.decorators = [
- { type: Directive, args: [{
- selector: '[ngbDropdownToggle]',
- host: {
- 'class': 'dropdown-toggle',
- 'aria-haspopup': 'true',
- '[attr.aria-expanded]': 'dropdown.isOpen()',
- '(click)': 'dropdown.toggle()',
- '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
- '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
- '(keydown.Home)': 'dropdown.onKeyDown($event)',
- '(keydown.End)': 'dropdown.onKeyDown($event)'
- },
- providers: [{ provide: NgbDropdownAnchor, useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbDropdownToggle; })) }]
- },] }
- ];
- /** @nocollapse */
- NgbDropdownToggle.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
- * @return {?}
- */
- function () { return NgbDropdown; })),] }] },
- { type: ElementRef }
- ]; };
- return NgbDropdownToggle;
- }(NgbDropdownAnchor));
- /**
- * A directive that provides contextual overlays for displaying lists of links and more.
- */
- var NgbDropdown = /** @class */ (function () {
- function NgbDropdown(_changeDetector, config, _document, _ngZone, _elementRef, _renderer, ngbNavbar) {
- var _this = this;
- this._changeDetector = _changeDetector;
- this._document = _document;
- this._ngZone = _ngZone;
- this._elementRef = _elementRef;
- this._renderer = _renderer;
- this._closed$ = new Subject();
- /**
- * Defines whether or not the dropdown menu is opened initially.
- */
- this._open = false;
- /**
- * An event fired when the dropdown is opened or closed.
- *
- * The event payload is a `boolean`:
- * * `true` - the dropdown was opened
- * * `false` - the dropdown was closed
- */
- this.openChange = new EventEmitter();
- this.placement = config.placement;
- this.container = config.container;
- this.autoClose = config.autoClose;
- this.display = ngbNavbar ? 'static' : 'dynamic';
- this._zoneSubscription = _ngZone.onStable.subscribe((/**
- * @return {?}
- */
- function () { _this._positionMenu(); }));
- }
- /**
- * @return {?}
- */
- NgbDropdown.prototype.ngAfterContentInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- this._ngZone.onStable.pipe(take(1)).subscribe((/**
- * @return {?}
- */
- function () {
- _this._applyPlacementClasses();
- if (_this._open) {
- _this._setCloseHandlers();
- }
- }));
- };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbDropdown.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- if (changes.container && this._open) {
- this._applyContainer(this.container);
- }
- if (changes.placement && !changes.placement.isFirstChange) {
- this._applyPlacementClasses();
- }
- };
- /**
- * Checks if the dropdown menu is open.
- */
- /**
- * Checks if the dropdown menu is open.
- * @return {?}
- */
- NgbDropdown.prototype.isOpen = /**
- * Checks if the dropdown menu is open.
- * @return {?}
- */
- function () { return this._open; };
- /**
- * Opens the dropdown menu.
- */
- /**
- * Opens the dropdown menu.
- * @return {?}
- */
- NgbDropdown.prototype.open = /**
- * Opens the dropdown menu.
- * @return {?}
- */
- function () {
- if (!this._open) {
- this._open = true;
- this._applyContainer(this.container);
- this.openChange.emit(true);
- this._setCloseHandlers();
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbDropdown.prototype._setCloseHandlers = /**
- * @private
- * @return {?}
- */
- function () {
- var _this = this;
- /** @type {?} */
- var anchor = this._anchor;
- ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
- * @return {?}
- */
- function () { return _this.close(); }), this._closed$, this._menu ? [this._menuElement.nativeElement] : [], anchor ? [anchor.getNativeElement()] : [], '.dropdown-item,.dropdown-divider');
- };
- /**
- * Closes the dropdown menu.
- */
- /**
- * Closes the dropdown menu.
- * @return {?}
- */
- NgbDropdown.prototype.close = /**
- * Closes the dropdown menu.
- * @return {?}
- */
- function () {
- if (this._open) {
- this._open = false;
- this._resetContainer();
- this._closed$.next();
- this.openChange.emit(false);
- this._changeDetector.markForCheck();
- }
- };
- /**
- * Toggles the dropdown menu.
- */
- /**
- * Toggles the dropdown menu.
- * @return {?}
- */
- NgbDropdown.prototype.toggle = /**
- * Toggles the dropdown menu.
- * @return {?}
- */
- function () {
- if (this.isOpen()) {
- this.close();
- }
- else {
- this.open();
- }
- };
- /**
- * @return {?}
- */
- NgbDropdown.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this._resetContainer();
- this._closed$.next();
- this._zoneSubscription.unsubscribe();
- };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbDropdown.prototype.onKeyDown = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- var _this = this;
- // tslint:disable-next-line:deprecation
- /** @type {?} */
- var key = event.which;
- /** @type {?} */
- var itemElements = this._getMenuElements();
- /** @type {?} */
- var position = -1;
- /** @type {?} */
- var isEventFromItems = false;
- /** @type {?} */
- var itemElement = null;
- /** @type {?} */
- var isEventFromToggle = this._isEventFromToggle(event);
- if (!isEventFromToggle && itemElements.length) {
- itemElements.forEach((/**
- * @param {?} item
- * @param {?} index
- * @return {?}
- */
- function (item, index) {
- if (item.contains((/** @type {?} */ (event.target)))) {
- isEventFromItems = true;
- itemElement = item;
- }
- if (item === _this._document.activeElement) {
- position = index;
- }
- }));
- }
- // closing on Enter / Space
- if (key === Key.Space || key === Key.Enter) {
- if (isEventFromItems && (this.autoClose === true || this.autoClose === 'inside')) {
- // Item is either a button or a link, so click will be triggered by the browser on Enter or Space.
- // So we have to register a one-time click handler that will fire after any user defined click handlers
- // to close the dropdown
- fromEvent(itemElement, 'click').pipe(take(1)).subscribe((/**
- * @return {?}
- */
- function () { return _this.close(); }));
- }
- return;
- }
- // opening / navigating
- if (isEventFromToggle || isEventFromItems) {
- this.open();
- if (itemElements.length) {
- switch (key) {
- case Key.ArrowDown:
- position = Math.min(position + 1, itemElements.length - 1);
- break;
- case Key.ArrowUp:
- if (this._isDropup() && position === -1) {
- position = itemElements.length - 1;
- break;
- }
- position = Math.max(position - 1, 0);
- break;
- case Key.Home:
- position = 0;
- break;
- case Key.End:
- position = itemElements.length - 1;
- break;
- }
- itemElements[position].focus();
- }
- event.preventDefault();
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbDropdown.prototype._isDropup = /**
- * @private
- * @return {?}
- */
- function () { return this._elementRef.nativeElement.classList.contains('dropup'); };
- /**
- * @private
- * @param {?} event
- * @return {?}
- */
- NgbDropdown.prototype._isEventFromToggle = /**
- * @private
- * @param {?} event
- * @return {?}
- */
- function (event) {
- return this._anchor.getNativeElement().contains((/** @type {?} */ (event.target)));
- };
- /**
- * @private
- * @return {?}
- */
- NgbDropdown.prototype._getMenuElements = /**
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var menu = this._menu;
- if (menu == null) {
- return [];
- }
- return menu.menuItems.filter((/**
- * @param {?} item
- * @return {?}
- */
- function (item) { return !item.disabled; })).map((/**
- * @param {?} item
- * @return {?}
- */
- function (item) { return item.elementRef.nativeElement; }));
- };
- /**
- * @private
- * @return {?}
- */
- NgbDropdown.prototype._positionMenu = /**
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var menu = this._menu;
- if (this.isOpen() && menu) {
- this._applyPlacementClasses(this.display === 'dynamic' ?
- positionElements(this._anchor.anchorEl, this._bodyContainer || this._menuElement.nativeElement, this.placement, this.container === 'body') :
- this._getFirstPlacement(this.placement));
- }
- };
- /**
- * @private
- * @param {?} placement
- * @return {?}
- */
- NgbDropdown.prototype._getFirstPlacement = /**
- * @private
- * @param {?} placement
- * @return {?}
- */
- function (placement) {
- return Array.isArray(placement) ? placement[0] : (/** @type {?} */ (placement.split(' ')[0]));
- };
- /**
- * @private
- * @return {?}
- */
- NgbDropdown.prototype._resetContainer = /**
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var renderer = this._renderer;
- /** @type {?} */
- var menuElement = this._menuElement;
- if (menuElement) {
- /** @type {?} */
- var dropdownElement = this._elementRef.nativeElement;
- /** @type {?} */
- var dropdownMenuElement = menuElement.nativeElement;
- renderer.appendChild(dropdownElement, dropdownMenuElement);
- renderer.removeStyle(dropdownMenuElement, 'position');
- renderer.removeStyle(dropdownMenuElement, 'transform');
- }
- if (this._bodyContainer) {
- renderer.removeChild(this._document.body, this._bodyContainer);
- this._bodyContainer = null;
- }
- };
- /**
- * @private
- * @param {?=} container
- * @return {?}
- */
- NgbDropdown.prototype._applyContainer = /**
- * @private
- * @param {?=} container
- * @return {?}
- */
- function (container) {
- if (container === void 0) { container = null; }
- this._resetContainer();
- if (container === 'body') {
- /** @type {?} */
- var renderer = this._renderer;
- /** @type {?} */
- var dropdownMenuElement = this._menuElement.nativeElement;
- /** @type {?} */
- var bodyContainer = this._bodyContainer = this._bodyContainer || renderer.createElement('div');
- // Override some styles to have the positionning working
- renderer.setStyle(bodyContainer, 'position', 'absolute');
- renderer.setStyle(dropdownMenuElement, 'position', 'static');
- renderer.setStyle(bodyContainer, 'z-index', '1050');
- renderer.appendChild(bodyContainer, dropdownMenuElement);
- renderer.appendChild(this._document.body, bodyContainer);
- }
- };
- /**
- * @private
- * @param {?=} placement
- * @return {?}
- */
- NgbDropdown.prototype._applyPlacementClasses = /**
- * @private
- * @param {?=} placement
- * @return {?}
- */
- function (placement) {
- /** @type {?} */
- var menu = this._menu;
- if (menu) {
- if (!placement) {
- placement = this._getFirstPlacement(this.placement);
- }
- /** @type {?} */
- var renderer = this._renderer;
- /** @type {?} */
- var dropdownElement = this._elementRef.nativeElement;
- // remove the current placement classes
- renderer.removeClass(dropdownElement, 'dropup');
- renderer.removeClass(dropdownElement, 'dropdown');
- menu.placement = this.display === 'static' ? null : placement;
- /*
- * apply the new placement
- * in case of top use up-arrow or down-arrow otherwise
- */
- /** @type {?} */
- var dropdownClass = placement.search('^top') !== -1 ? 'dropup' : 'dropdown';
- renderer.addClass(dropdownElement, dropdownClass);
- /** @type {?} */
- var bodyContainer = this._bodyContainer;
- if (bodyContainer) {
- renderer.removeClass(bodyContainer, 'dropup');
- renderer.removeClass(bodyContainer, 'dropdown');
- renderer.addClass(bodyContainer, dropdownClass);
- }
- }
- };
- NgbDropdown.decorators = [
- { type: Directive, args: [{ selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: { '[class.show]': 'isOpen()' } },] }
- ];
- /** @nocollapse */
- NgbDropdown.ctorParameters = function () { return [
- { type: ChangeDetectorRef },
- { type: NgbDropdownConfig },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: NgZone },
- { type: ElementRef },
- { type: Renderer2 },
- { type: NgbNavbar, decorators: [{ type: Optional }] }
- ]; };
- NgbDropdown.propDecorators = {
- _menu: [{ type: ContentChild, args: [NgbDropdownMenu, { static: false },] }],
- _menuElement: [{ type: ContentChild, args: [NgbDropdownMenu, { read: ElementRef, static: false },] }],
- _anchor: [{ type: ContentChild, args: [NgbDropdownAnchor, { static: false },] }],
- autoClose: [{ type: Input }],
- _open: [{ type: Input, args: ['open',] }],
- placement: [{ type: Input }],
- container: [{ type: Input }],
- display: [{ type: Input }],
- openChange: [{ type: Output }]
- };
- return NgbDropdown;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_DROPDOWN_DIRECTIVES = [NgbDropdown, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem, NgbNavbar];
- var NgbDropdownModule = /** @class */ (function () {
- function NgbDropdownModule() {
- }
- NgbDropdownModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_DROPDOWN_DIRECTIVES, exports: NGB_DROPDOWN_DIRECTIVES },] }
- ];
- return NgbDropdownModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all modals used in the application.
- *
- * \@since 3.1.0
- */
- var NgbModalConfig = /** @class */ (function () {
- function NgbModalConfig() {
- this.backdrop = true;
- this.keyboard = true;
- }
- NgbModalConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbModalConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModalConfig_Factory() { return new NgbModalConfig(); }, token: NgbModalConfig, providedIn: "root" });
- return NgbModalConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var ContentRef = /** @class */ (function () {
- function ContentRef(nodes, viewRef, componentRef) {
- this.nodes = nodes;
- this.viewRef = viewRef;
- this.componentRef = componentRef;
- }
- return ContentRef;
- }());
- /**
- * @template T
- */
- var /**
- * @template T
- */
- PopupService = /** @class */ (function () {
- function PopupService(_type, _injector, _viewContainerRef, _renderer, _componentFactoryResolver, _applicationRef) {
- this._type = _type;
- this._injector = _injector;
- this._viewContainerRef = _viewContainerRef;
- this._renderer = _renderer;
- this._componentFactoryResolver = _componentFactoryResolver;
- this._applicationRef = _applicationRef;
- }
- /**
- * @param {?=} content
- * @param {?=} context
- * @return {?}
- */
- PopupService.prototype.open = /**
- * @param {?=} content
- * @param {?=} context
- * @return {?}
- */
- function (content, context) {
- if (!this._windowRef) {
- this._contentRef = this._getContentRef(content, context);
- this._windowRef = this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type), 0, this._injector, this._contentRef.nodes);
- }
- return this._windowRef;
- };
- /**
- * @return {?}
- */
- PopupService.prototype.close = /**
- * @return {?}
- */
- function () {
- if (this._windowRef) {
- this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView));
- this._windowRef = null;
- if (this._contentRef.viewRef) {
- this._applicationRef.detachView(this._contentRef.viewRef);
- this._contentRef.viewRef.destroy();
- this._contentRef = null;
- }
- }
- };
- /**
- * @private
- * @param {?} content
- * @param {?=} context
- * @return {?}
- */
- PopupService.prototype._getContentRef = /**
- * @private
- * @param {?} content
- * @param {?=} context
- * @return {?}
- */
- function (content, context) {
- if (!content) {
- return new ContentRef([]);
- }
- else if (content instanceof TemplateRef) {
- /** @type {?} */
- var viewRef = content.createEmbeddedView(context);
- this._applicationRef.attachView(viewRef);
- return new ContentRef([viewRef.rootNodes], viewRef);
- }
- else {
- return new ContentRef([[this._renderer.createText("" + content)]]);
- }
- };
- return PopupService;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var noop = (/**
- * @return {?}
- */
- function () { });
- /**
- * Utility to handle the scrollbar.
- *
- * It allows to compensate the lack of a vertical scrollbar by adding an
- * equivalent padding on the right of the body, and to remove this compensation.
- */
- var ScrollBar = /** @class */ (function () {
- function ScrollBar(_document) {
- this._document = _document;
- }
- /**
- * To be called right before a potential vertical scrollbar would be removed:
- *
- * - if there was a scrollbar, adds some compensation padding to the body
- * to keep the same layout as when the scrollbar is there
- * - if there was none, there is nothing to do
- *
- * @return a callback used to revert the compensation (noop if there was none,
- * otherwise a function removing the padding)
- */
- /**
- * To be called right before a potential vertical scrollbar would be removed:
- *
- * - if there was a scrollbar, adds some compensation padding to the body
- * to keep the same layout as when the scrollbar is there
- * - if there was none, there is nothing to do
- *
- * @return {?} a callback used to revert the compensation (noop if there was none,
- * otherwise a function removing the padding)
- */
- ScrollBar.prototype.compensate = /**
- * To be called right before a potential vertical scrollbar would be removed:
- *
- * - if there was a scrollbar, adds some compensation padding to the body
- * to keep the same layout as when the scrollbar is there
- * - if there was none, there is nothing to do
- *
- * @return {?} a callback used to revert the compensation (noop if there was none,
- * otherwise a function removing the padding)
- */
- function () {
- /** @type {?} */
- var width = this._getWidth();
- return !this._isPresent(width) ? noop : this._adjustBody(width);
- };
- /**
- * Adds a padding of the given width on the right of the body.
- *
- * @return a callback used to revert the padding to its previous value
- */
- /**
- * Adds a padding of the given width on the right of the body.
- *
- * @private
- * @param {?} scrollbarWidth
- * @return {?} a callback used to revert the padding to its previous value
- */
- ScrollBar.prototype._adjustBody = /**
- * Adds a padding of the given width on the right of the body.
- *
- * @private
- * @param {?} scrollbarWidth
- * @return {?} a callback used to revert the padding to its previous value
- */
- function (scrollbarWidth) {
- /** @type {?} */
- var body = this._document.body;
- /** @type {?} */
- var userSetPaddingStyle = body.style.paddingRight;
- /** @type {?} */
- var actualPadding = parseFloat(window.getComputedStyle(body)['padding-right']);
- body.style['padding-right'] = actualPadding + scrollbarWidth + "px";
- return (/**
- * @return {?}
- */
- function () { return body.style['padding-right'] = userSetPaddingStyle; });
- };
- /**
- * Tells whether a scrollbar is currently present on the body.
- *
- * @return true if scrollbar is present, false otherwise
- */
- /**
- * Tells whether a scrollbar is currently present on the body.
- *
- * @private
- * @param {?} scrollbarWidth
- * @return {?} true if scrollbar is present, false otherwise
- */
- ScrollBar.prototype._isPresent = /**
- * Tells whether a scrollbar is currently present on the body.
- *
- * @private
- * @param {?} scrollbarWidth
- * @return {?} true if scrollbar is present, false otherwise
- */
- function (scrollbarWidth) {
- /** @type {?} */
- var rect = this._document.body.getBoundingClientRect();
- /** @type {?} */
- var bodyToViewportGap = window.innerWidth - (rect.left + rect.right);
- /** @type {?} */
- var uncertainty = 0.1 * scrollbarWidth;
- return bodyToViewportGap >= scrollbarWidth - uncertainty;
- };
- /**
- * Calculates and returns the width of a scrollbar.
- *
- * @return the width of a scrollbar on this page
- */
- /**
- * Calculates and returns the width of a scrollbar.
- *
- * @private
- * @return {?} the width of a scrollbar on this page
- */
- ScrollBar.prototype._getWidth = /**
- * Calculates and returns the width of a scrollbar.
- *
- * @private
- * @return {?} the width of a scrollbar on this page
- */
- function () {
- /** @type {?} */
- var measurer = this._document.createElement('div');
- measurer.className = 'modal-scrollbar-measure';
- /** @type {?} */
- var body = this._document.body;
- body.appendChild(measurer);
- /** @type {?} */
- var width = measurer.getBoundingClientRect().width - measurer.clientWidth;
- body.removeChild(measurer);
- return width;
- };
- ScrollBar.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */
- ScrollBar.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
- ]; };
- /** @nocollapse */ ScrollBar.ngInjectableDef = ɵɵdefineInjectable({ factory: function ScrollBar_Factory() { return new ScrollBar(ɵɵinject(DOCUMENT)); }, token: ScrollBar, providedIn: "root" });
- return ScrollBar;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbModalBackdrop = /** @class */ (function () {
- function NgbModalBackdrop() {
- }
- NgbModalBackdrop.decorators = [
- { type: Component, args: [{
- selector: 'ngb-modal-backdrop',
- encapsulation: ViewEncapsulation.None,
- template: '',
- host: { '[class]': '"modal-backdrop fade show" + (backdropClass ? " " + backdropClass : "")', 'style': 'z-index: 1050' }
- }] }
- ];
- NgbModalBackdrop.propDecorators = {
- backdropClass: [{ type: Input }]
- };
- return NgbModalBackdrop;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A reference to the currently opened (active) modal.
- *
- * Instances of this class can be injected into your component passed as modal content.
- * So you can `.close()` or `.dismiss()` the modal window from your component.
- */
- var /**
- * A reference to the currently opened (active) modal.
- *
- * Instances of this class can be injected into your component passed as modal content.
- * So you can `.close()` or `.dismiss()` the modal window from your component.
- */
- NgbActiveModal = /** @class */ (function () {
- function NgbActiveModal() {
- }
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- */
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- * @param {?=} result
- * @return {?}
- */
- NgbActiveModal.prototype.close = /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- * @param {?=} result
- * @return {?}
- */
- function (result) { };
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- */
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- * @param {?=} reason
- * @return {?}
- */
- NgbActiveModal.prototype.dismiss = /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- * @param {?=} reason
- * @return {?}
- */
- function (reason) { };
- return NgbActiveModal;
- }());
- /**
- * A reference to the newly opened modal returned by the `NgbModal.open()` method.
- */
- var /**
- * A reference to the newly opened modal returned by the `NgbModal.open()` method.
- */
- NgbModalRef = /** @class */ (function () {
- function NgbModalRef(_windowCmptRef, _contentRef, _backdropCmptRef, _beforeDismiss) {
- var _this = this;
- this._windowCmptRef = _windowCmptRef;
- this._contentRef = _contentRef;
- this._backdropCmptRef = _backdropCmptRef;
- this._beforeDismiss = _beforeDismiss;
- _windowCmptRef.instance.dismissEvent.subscribe((/**
- * @param {?} reason
- * @return {?}
- */
- function (reason) { _this.dismiss(reason); }));
- this.result = new Promise((/**
- * @param {?} resolve
- * @param {?} reject
- * @return {?}
- */
- function (resolve, reject) {
- _this._resolve = resolve;
- _this._reject = reject;
- }));
- this.result.then(null, (/**
- * @return {?}
- */
- function () { }));
- }
- Object.defineProperty(NgbModalRef.prototype, "componentInstance", {
- /**
- * The instance of a component used for the modal content.
- *
- * When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.
- */
- get: /**
- * The instance of a component used for the modal content.
- *
- * When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.
- * @return {?}
- */
- function () {
- if (this._contentRef && this._contentRef.componentRef) {
- return this._contentRef.componentRef.instance;
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- */
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- * @param {?=} result
- * @return {?}
- */
- NgbModalRef.prototype.close = /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- * @param {?=} result
- * @return {?}
- */
- function (result) {
- if (this._windowCmptRef) {
- this._resolve(result);
- this._removeModalElements();
- }
- };
- /**
- * @private
- * @param {?=} reason
- * @return {?}
- */
- NgbModalRef.prototype._dismiss = /**
- * @private
- * @param {?=} reason
- * @return {?}
- */
- function (reason) {
- this._reject(reason);
- this._removeModalElements();
- };
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- */
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- * @param {?=} reason
- * @return {?}
- */
- NgbModalRef.prototype.dismiss = /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- * @param {?=} reason
- * @return {?}
- */
- function (reason) {
- var _this = this;
- if (this._windowCmptRef) {
- if (!this._beforeDismiss) {
- this._dismiss(reason);
- }
- else {
- /** @type {?} */
- var dismiss = this._beforeDismiss();
- if (dismiss && dismiss.then) {
- dismiss.then((/**
- * @param {?} result
- * @return {?}
- */
- function (result) {
- if (result !== false) {
- _this._dismiss(reason);
- }
- }), (/**
- * @return {?}
- */
- function () { }));
- }
- else if (dismiss !== false) {
- this._dismiss(reason);
- }
- }
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbModalRef.prototype._removeModalElements = /**
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var windowNativeEl = this._windowCmptRef.location.nativeElement;
- windowNativeEl.parentNode.removeChild(windowNativeEl);
- this._windowCmptRef.destroy();
- if (this._backdropCmptRef) {
- /** @type {?} */
- var backdropNativeEl = this._backdropCmptRef.location.nativeElement;
- backdropNativeEl.parentNode.removeChild(backdropNativeEl);
- this._backdropCmptRef.destroy();
- }
- if (this._contentRef && this._contentRef.viewRef) {
- this._contentRef.viewRef.destroy();
- }
- this._windowCmptRef = null;
- this._backdropCmptRef = null;
- this._contentRef = null;
- };
- return NgbModalRef;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @enum {number} */
- var ModalDismissReasons = {
- BACKDROP_CLICK: 0,
- ESC: 1,
- };
- ModalDismissReasons[ModalDismissReasons.BACKDROP_CLICK] = 'BACKDROP_CLICK';
- ModalDismissReasons[ModalDismissReasons.ESC] = 'ESC';
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbModalWindow = /** @class */ (function () {
- function NgbModalWindow(_document, _elRef, _zone) {
- this._document = _document;
- this._elRef = _elRef;
- this._zone = _zone;
- this._closed$ = new Subject();
- this.backdrop = true;
- this.keyboard = true;
- this.dismissEvent = new EventEmitter();
- }
- /**
- * @param {?} reason
- * @return {?}
- */
- NgbModalWindow.prototype.dismiss = /**
- * @param {?} reason
- * @return {?}
- */
- function (reason) { this.dismissEvent.emit(reason); };
- /**
- * @return {?}
- */
- NgbModalWindow.prototype.ngOnInit = /**
- * @return {?}
- */
- function () { this._elWithFocus = this._document.activeElement; };
- /**
- * @return {?}
- */
- NgbModalWindow.prototype.ngAfterViewInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- var nativeElement = this._elRef.nativeElement;
- this._zone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- fromEvent(nativeElement, 'keydown')
- .pipe(takeUntil(_this._closed$),
- // tslint:disable-next-line:deprecation
- filter((/**
- * @param {?} e
- * @return {?}
- */
- function (e) { return e.which === Key.Escape && _this.keyboard; })))
- .subscribe((/**
- * @param {?} event
- * @return {?}
- */
- function (event) { return requestAnimationFrame((/**
- * @return {?}
- */
- function () {
- if (!event.defaultPrevented) {
- _this._zone.run((/**
- * @return {?}
- */
- function () { return _this.dismiss(ModalDismissReasons.ESC); }));
- }
- })); }));
- // We're listening to 'mousedown' and 'mouseup' to prevent modal from closing when pressing the mouse
- // inside the modal dialog and releasing it outside
- /** @type {?} */
- var preventClose = false;
- fromEvent(_this._dialogEl.nativeElement, 'mousedown')
- .pipe(takeUntil(_this._closed$), tap((/**
- * @return {?}
- */
- function () { return preventClose = false; })), switchMap((/**
- * @return {?}
- */
- function () { return fromEvent(nativeElement, 'mouseup').pipe(takeUntil(_this._closed$), take(1)); })), filter((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var target = _a.target;
- return nativeElement === target;
- })))
- .subscribe((/**
- * @return {?}
- */
- function () { preventClose = true; }));
- // We're listening to 'click' to dismiss modal on modal window click, except when:
- // 1. clicking on modal dialog itself
- // 2. closing was prevented by mousedown/up handlers
- // 3. clicking on scrollbar when the viewport is too small and modal doesn't fit (click is not triggered at all)
- fromEvent(nativeElement, 'click').pipe(takeUntil(_this._closed$)).subscribe((/**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var target = _a.target;
- if (_this.backdrop === true && nativeElement === target && !preventClose) {
- _this._zone.run((/**
- * @return {?}
- */
- function () { return _this.dismiss(ModalDismissReasons.BACKDROP_CLICK); }));
- }
- preventClose = false;
- }));
- }));
- if (!nativeElement.contains(document.activeElement)) {
- /** @type {?} */
- var autoFocusable = (/** @type {?} */ (nativeElement.querySelector("[ngbAutofocus]")));
- /** @type {?} */
- var firstFocusable = getFocusableBoundaryElements(nativeElement)[0];
- /** @type {?} */
- var elementToFocus = autoFocusable || firstFocusable || nativeElement;
- elementToFocus.focus();
- }
- };
- /**
- * @return {?}
- */
- NgbModalWindow.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- var _this = this;
- /** @type {?} */
- var body = this._document.body;
- /** @type {?} */
- var elWithFocus = this._elWithFocus;
- /** @type {?} */
- var elementToFocus;
- if (elWithFocus && elWithFocus['focus'] && body.contains(elWithFocus)) {
- elementToFocus = elWithFocus;
- }
- else {
- elementToFocus = body;
- }
- this._zone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- setTimeout((/**
- * @return {?}
- */
- function () { return elementToFocus.focus(); }));
- _this._elWithFocus = null;
- }));
- this._closed$.next();
- };
- NgbModalWindow.decorators = [
- { type: Component, args: [{
- selector: 'ngb-modal-window',
- host: {
- '[class]': '"modal fade show d-block" + (windowClass ? " " + windowClass : "")',
- 'role': 'dialog',
- 'tabindex': '-1',
- '[attr.aria-modal]': 'true',
- '[attr.aria-labelledby]': 'ariaLabelledBy',
- },
- template: "\n <div #dialog [class]=\"'modal-dialog' + (size ? ' modal-' + size : '') + (centered ? ' modal-dialog-centered' : '') +\n (scrollable ? ' modal-dialog-scrollable' : '')\" role=\"document\">\n <div class=\"modal-content\"><ng-content></ng-content></div>\n </div>\n ",
- encapsulation: ViewEncapsulation.None,
- styles: ["ngb-modal-window .component-host-scrollable{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}"]
- }] }
- ];
- /** @nocollapse */
- NgbModalWindow.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: ElementRef },
- { type: NgZone }
- ]; };
- NgbModalWindow.propDecorators = {
- _dialogEl: [{ type: ViewChild, args: ['dialog', { static: true },] }],
- ariaLabelledBy: [{ type: Input }],
- backdrop: [{ type: Input }],
- centered: [{ type: Input }],
- keyboard: [{ type: Input }],
- scrollable: [{ type: Input }],
- size: [{ type: Input }],
- windowClass: [{ type: Input }],
- dismissEvent: [{ type: Output, args: ['dismiss',] }]
- };
- return NgbModalWindow;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbModalStack = /** @class */ (function () {
- function NgbModalStack(_applicationRef, _injector, _document, _scrollBar, _rendererFactory, _ngZone) {
- var _this = this;
- this._applicationRef = _applicationRef;
- this._injector = _injector;
- this._document = _document;
- this._scrollBar = _scrollBar;
- this._rendererFactory = _rendererFactory;
- this._ngZone = _ngZone;
- this._activeWindowCmptHasChanged = new Subject();
- this._ariaHiddenValues = new Map();
- this._backdropAttributes = ['backdropClass'];
- this._modalRefs = [];
- this._windowAttributes = ['ariaLabelledBy', 'backdrop', 'centered', 'keyboard', 'scrollable', 'size', 'windowClass'];
- this._windowCmpts = [];
- // Trap focus on active WindowCmpt
- this._activeWindowCmptHasChanged.subscribe((/**
- * @return {?}
- */
- function () {
- if (_this._windowCmpts.length) {
- /** @type {?} */
- var activeWindowCmpt = _this._windowCmpts[_this._windowCmpts.length - 1];
- ngbFocusTrap(_this._ngZone, activeWindowCmpt.location.nativeElement, _this._activeWindowCmptHasChanged);
- _this._revertAriaHidden();
- _this._setAriaHidden(activeWindowCmpt.location.nativeElement);
- }
- }));
- }
- /**
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} options
- * @return {?}
- */
- NgbModalStack.prototype.open = /**
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} options
- * @return {?}
- */
- function (moduleCFR, contentInjector, content, options) {
- var _this = this;
- /** @type {?} */
- var containerEl = isDefined(options.container) ? this._document.querySelector(options.container) : this._document.body;
- /** @type {?} */
- var renderer = this._rendererFactory.createRenderer(null, null);
- /** @type {?} */
- var revertPaddingForScrollBar = this._scrollBar.compensate();
- /** @type {?} */
- var removeBodyClass = (/**
- * @return {?}
- */
- function () {
- if (!_this._modalRefs.length) {
- renderer.removeClass(_this._document.body, 'modal-open');
- _this._revertAriaHidden();
- }
- });
- if (!containerEl) {
- throw new Error("The specified modal container \"" + (options.container || 'body') + "\" was not found in the DOM.");
- }
- /** @type {?} */
- var activeModal = new NgbActiveModal();
- /** @type {?} */
- var contentRef = this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal, options);
- /** @type {?} */
- var backdropCmptRef = options.backdrop !== false ? this._attachBackdrop(moduleCFR, containerEl) : null;
- /** @type {?} */
- var windowCmptRef = this._attachWindowComponent(moduleCFR, containerEl, contentRef);
- /** @type {?} */
- var ngbModalRef = new NgbModalRef(windowCmptRef, contentRef, backdropCmptRef, options.beforeDismiss);
- this._registerModalRef(ngbModalRef);
- this._registerWindowCmpt(windowCmptRef);
- ngbModalRef.result.then(revertPaddingForScrollBar, revertPaddingForScrollBar);
- ngbModalRef.result.then(removeBodyClass, removeBodyClass);
- activeModal.close = (/**
- * @param {?} result
- * @return {?}
- */
- function (result) { ngbModalRef.close(result); });
- activeModal.dismiss = (/**
- * @param {?} reason
- * @return {?}
- */
- function (reason) { ngbModalRef.dismiss(reason); });
- this._applyWindowOptions(windowCmptRef.instance, options);
- if (this._modalRefs.length === 1) {
- renderer.addClass(this._document.body, 'modal-open');
- }
- if (backdropCmptRef && backdropCmptRef.instance) {
- this._applyBackdropOptions(backdropCmptRef.instance, options);
- }
- return ngbModalRef;
- };
- /**
- * @param {?=} reason
- * @return {?}
- */
- NgbModalStack.prototype.dismissAll = /**
- * @param {?=} reason
- * @return {?}
- */
- function (reason) { this._modalRefs.forEach((/**
- * @param {?} ngbModalRef
- * @return {?}
- */
- function (ngbModalRef) { return ngbModalRef.dismiss(reason); })); };
- /**
- * @return {?}
- */
- NgbModalStack.prototype.hasOpenModals = /**
- * @return {?}
- */
- function () { return this._modalRefs.length > 0; };
- /**
- * @private
- * @param {?} moduleCFR
- * @param {?} containerEl
- * @return {?}
- */
- NgbModalStack.prototype._attachBackdrop = /**
- * @private
- * @param {?} moduleCFR
- * @param {?} containerEl
- * @return {?}
- */
- function (moduleCFR, containerEl) {
- /** @type {?} */
- var backdropFactory = moduleCFR.resolveComponentFactory(NgbModalBackdrop);
- /** @type {?} */
- var backdropCmptRef = backdropFactory.create(this._injector);
- this._applicationRef.attachView(backdropCmptRef.hostView);
- containerEl.appendChild(backdropCmptRef.location.nativeElement);
- return backdropCmptRef;
- };
- /**
- * @private
- * @param {?} moduleCFR
- * @param {?} containerEl
- * @param {?} contentRef
- * @return {?}
- */
- NgbModalStack.prototype._attachWindowComponent = /**
- * @private
- * @param {?} moduleCFR
- * @param {?} containerEl
- * @param {?} contentRef
- * @return {?}
- */
- function (moduleCFR, containerEl, contentRef) {
- /** @type {?} */
- var windowFactory = moduleCFR.resolveComponentFactory(NgbModalWindow);
- /** @type {?} */
- var windowCmptRef = windowFactory.create(this._injector, contentRef.nodes);
- this._applicationRef.attachView(windowCmptRef.hostView);
- containerEl.appendChild(windowCmptRef.location.nativeElement);
- return windowCmptRef;
- };
- /**
- * @private
- * @param {?} windowInstance
- * @param {?} options
- * @return {?}
- */
- NgbModalStack.prototype._applyWindowOptions = /**
- * @private
- * @param {?} windowInstance
- * @param {?} options
- * @return {?}
- */
- function (windowInstance, options) {
- this._windowAttributes.forEach((/**
- * @param {?} optionName
- * @return {?}
- */
- function (optionName) {
- if (isDefined(options[optionName])) {
- windowInstance[optionName] = options[optionName];
- }
- }));
- };
- /**
- * @private
- * @param {?} backdropInstance
- * @param {?} options
- * @return {?}
- */
- NgbModalStack.prototype._applyBackdropOptions = /**
- * @private
- * @param {?} backdropInstance
- * @param {?} options
- * @return {?}
- */
- function (backdropInstance, options) {
- this._backdropAttributes.forEach((/**
- * @param {?} optionName
- * @return {?}
- */
- function (optionName) {
- if (isDefined(options[optionName])) {
- backdropInstance[optionName] = options[optionName];
- }
- }));
- };
- /**
- * @private
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} activeModal
- * @param {?} options
- * @return {?}
- */
- NgbModalStack.prototype._getContentRef = /**
- * @private
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} activeModal
- * @param {?} options
- * @return {?}
- */
- function (moduleCFR, contentInjector, content, activeModal, options) {
- if (!content) {
- return new ContentRef([]);
- }
- else if (content instanceof TemplateRef) {
- return this._createFromTemplateRef(content, activeModal);
- }
- else if (isString(content)) {
- return this._createFromString(content);
- }
- else {
- return this._createFromComponent(moduleCFR, contentInjector, content, activeModal, options);
- }
- };
- /**
- * @private
- * @param {?} content
- * @param {?} activeModal
- * @return {?}
- */
- NgbModalStack.prototype._createFromTemplateRef = /**
- * @private
- * @param {?} content
- * @param {?} activeModal
- * @return {?}
- */
- function (content, activeModal) {
- /** @type {?} */
- var context = {
- $implicit: activeModal,
- close: /**
- * @param {?} result
- * @return {?}
- */
- function (result) { activeModal.close(result); },
- dismiss: /**
- * @param {?} reason
- * @return {?}
- */
- function (reason) { activeModal.dismiss(reason); }
- };
- /** @type {?} */
- var viewRef = content.createEmbeddedView(context);
- this._applicationRef.attachView(viewRef);
- return new ContentRef([viewRef.rootNodes], viewRef);
- };
- /**
- * @private
- * @param {?} content
- * @return {?}
- */
- NgbModalStack.prototype._createFromString = /**
- * @private
- * @param {?} content
- * @return {?}
- */
- function (content) {
- /** @type {?} */
- var component = this._document.createTextNode("" + content);
- return new ContentRef([[component]]);
- };
- /**
- * @private
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} context
- * @param {?} options
- * @return {?}
- */
- NgbModalStack.prototype._createFromComponent = /**
- * @private
- * @param {?} moduleCFR
- * @param {?} contentInjector
- * @param {?} content
- * @param {?} context
- * @param {?} options
- * @return {?}
- */
- function (moduleCFR, contentInjector, content, context, options) {
- /** @type {?} */
- var contentCmptFactory = moduleCFR.resolveComponentFactory(content);
- /** @type {?} */
- var modalContentInjector = Injector.create({ providers: [{ provide: NgbActiveModal, useValue: context }], parent: contentInjector });
- /** @type {?} */
- var componentRef = contentCmptFactory.create(modalContentInjector);
- /** @type {?} */
- var componentNativeEl = componentRef.location.nativeElement;
- if (options.scrollable) {
- ((/** @type {?} */ (componentNativeEl))).classList.add('component-host-scrollable');
- }
- this._applicationRef.attachView(componentRef.hostView);
- // FIXME: we should here get rid of the component nativeElement
- // and use `[Array.from(componentNativeEl.childNodes)]` instead and remove the above CSS class.
- return new ContentRef([[componentNativeEl]], componentRef.hostView, componentRef);
- };
- /**
- * @private
- * @param {?} element
- * @return {?}
- */
- NgbModalStack.prototype._setAriaHidden = /**
- * @private
- * @param {?} element
- * @return {?}
- */
- function (element) {
- var _this = this;
- /** @type {?} */
- var parent = element.parentElement;
- if (parent && element !== this._document.body) {
- Array.from(parent.children).forEach((/**
- * @param {?} sibling
- * @return {?}
- */
- function (sibling) {
- if (sibling !== element && sibling.nodeName !== 'SCRIPT') {
- _this._ariaHiddenValues.set(sibling, sibling.getAttribute('aria-hidden'));
- sibling.setAttribute('aria-hidden', 'true');
- }
- }));
- this._setAriaHidden(parent);
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbModalStack.prototype._revertAriaHidden = /**
- * @private
- * @return {?}
- */
- function () {
- this._ariaHiddenValues.forEach((/**
- * @param {?} value
- * @param {?} element
- * @return {?}
- */
- function (value, element) {
- if (value) {
- element.setAttribute('aria-hidden', value);
- }
- else {
- element.removeAttribute('aria-hidden');
- }
- }));
- this._ariaHiddenValues.clear();
- };
- /**
- * @private
- * @param {?} ngbModalRef
- * @return {?}
- */
- NgbModalStack.prototype._registerModalRef = /**
- * @private
- * @param {?} ngbModalRef
- * @return {?}
- */
- function (ngbModalRef) {
- var _this = this;
- /** @type {?} */
- var unregisterModalRef = (/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var index = _this._modalRefs.indexOf(ngbModalRef);
- if (index > -1) {
- _this._modalRefs.splice(index, 1);
- }
- });
- this._modalRefs.push(ngbModalRef);
- ngbModalRef.result.then(unregisterModalRef, unregisterModalRef);
- };
- /**
- * @private
- * @param {?} ngbWindowCmpt
- * @return {?}
- */
- NgbModalStack.prototype._registerWindowCmpt = /**
- * @private
- * @param {?} ngbWindowCmpt
- * @return {?}
- */
- function (ngbWindowCmpt) {
- var _this = this;
- this._windowCmpts.push(ngbWindowCmpt);
- this._activeWindowCmptHasChanged.next();
- ngbWindowCmpt.onDestroy((/**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var index = _this._windowCmpts.indexOf(ngbWindowCmpt);
- if (index > -1) {
- _this._windowCmpts.splice(index, 1);
- _this._activeWindowCmptHasChanged.next();
- }
- }));
- };
- NgbModalStack.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */
- NgbModalStack.ctorParameters = function () { return [
- { type: ApplicationRef },
- { type: Injector },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: ScrollBar },
- { type: RendererFactory2 },
- { type: NgZone }
- ]; };
- /** @nocollapse */ NgbModalStack.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModalStack_Factory() { return new NgbModalStack(ɵɵinject(ApplicationRef), ɵɵinject(INJECTOR), ɵɵinject(DOCUMENT), ɵɵinject(ScrollBar), ɵɵinject(RendererFactory2), ɵɵinject(NgZone)); }, token: NgbModalStack, providedIn: "root" });
- return NgbModalStack;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A service for opening modal windows.
- *
- * Creating a modal is straightforward: create a component or a template and pass it as an argument to
- * the `.open()` method.
- */
- var NgbModal = /** @class */ (function () {
- function NgbModal(_moduleCFR, _injector, _modalStack, _config) {
- this._moduleCFR = _moduleCFR;
- this._injector = _injector;
- this._modalStack = _modalStack;
- this._config = _config;
- }
- /**
- * Opens a new modal window with the specified content and supplied options.
- *
- * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
- * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
- * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
- *
- * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
- */
- /**
- * Opens a new modal window with the specified content and supplied options.
- *
- * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
- * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
- * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
- *
- * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
- * @param {?} content
- * @param {?=} options
- * @return {?}
- */
- NgbModal.prototype.open = /**
- * Opens a new modal window with the specified content and supplied options.
- *
- * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
- * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
- * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
- *
- * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
- * @param {?} content
- * @param {?=} options
- * @return {?}
- */
- function (content, options) {
- if (options === void 0) { options = {}; }
- /** @type {?} */
- var combinedOptions = Object.assign({}, this._config, options);
- return this._modalStack.open(this._moduleCFR, this._injector, content, combinedOptions);
- };
- /**
- * Dismisses all currently displayed modal windows with the supplied reason.
- *
- * @since 3.1.0
- */
- /**
- * Dismisses all currently displayed modal windows with the supplied reason.
- *
- * \@since 3.1.0
- * @param {?=} reason
- * @return {?}
- */
- NgbModal.prototype.dismissAll = /**
- * Dismisses all currently displayed modal windows with the supplied reason.
- *
- * \@since 3.1.0
- * @param {?=} reason
- * @return {?}
- */
- function (reason) { this._modalStack.dismissAll(reason); };
- /**
- * Indicates if there are currently any open modal windows in the application.
- *
- * @since 3.3.0
- */
- /**
- * Indicates if there are currently any open modal windows in the application.
- *
- * \@since 3.3.0
- * @return {?}
- */
- NgbModal.prototype.hasOpenModals = /**
- * Indicates if there are currently any open modal windows in the application.
- *
- * \@since 3.3.0
- * @return {?}
- */
- function () { return this._modalStack.hasOpenModals(); };
- NgbModal.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */
- NgbModal.ctorParameters = function () { return [
- { type: ComponentFactoryResolver },
- { type: Injector },
- { type: NgbModalStack },
- { type: NgbModalConfig }
- ]; };
- /** @nocollapse */ NgbModal.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModal_Factory() { return new NgbModal(ɵɵinject(ComponentFactoryResolver), ɵɵinject(INJECTOR), ɵɵinject(NgbModalStack), ɵɵinject(NgbModalConfig)); }, token: NgbModal, providedIn: "root" });
- return NgbModal;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbModalModule = /** @class */ (function () {
- function NgbModalModule() {
- }
- NgbModalModule.decorators = [
- { type: NgModule, args: [{
- declarations: [NgbModalBackdrop, NgbModalWindow],
- entryComponents: [NgbModalBackdrop, NgbModalWindow],
- providers: [NgbModal]
- },] }
- ];
- return NgbModalModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbNav`](#/components/nav/api#NgbNav) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the navs used in the application.
- *
- * \@since 5.2.0
- */
- var NgbNavConfig = /** @class */ (function () {
- function NgbNavConfig() {
- this.destroyOnHide = true;
- this.orientation = 'horizontal';
- this.roles = 'tablist';
- }
- NgbNavConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbNavConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbNavConfig_Factory() { return new NgbNavConfig(); }, token: NgbNavConfig, providedIn: "root" });
- return NgbNavConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var isValidNavId = (/**
- * @param {?} id
- * @return {?}
- */
- function (id) { return isDefined(id) && id !== ''; });
- /** @type {?} */
- var navCounter = 0;
- /**
- * This directive must be used to wrap content to be displayed in the nav.
- *
- * \@since 5.2.0
- */
- var NgbNavContent = /** @class */ (function () {
- function NgbNavContent(templateRef) {
- this.templateRef = templateRef;
- }
- NgbNavContent.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbNavContent]' },] }
- ];
- /** @nocollapse */
- NgbNavContent.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbNavContent;
- }());
- /**
- * The directive used to group nav link and related nav content. As well as set nav identifier and some options.
- *
- * \@since 5.2.0
- */
- var NgbNavItem = /** @class */ (function () {
- function NgbNavItem(nav, elementRef) {
- this.elementRef = elementRef;
- /**
- * If `true`, the current nav item is disabled and can't be toggled by user.
- *
- * Nevertheless disabled nav can be selected programmatically via the `.select()` method and the `[activeId]` binding.
- */
- this.disabled = false;
- // TODO: cf https://github.com/angular/angular/issues/30106
- this._nav = nav;
- }
- /**
- * @return {?}
- */
- NgbNavItem.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
- // only @ContentChildren allows us to specify the {descendants: false} option.
- // Without {descendants: false} we are hitting bugs described in:
- // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
- this.contentTpl = this.contentTpls.first;
- };
- /**
- * @return {?}
- */
- NgbNavItem.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- if (!isDefined(this.domId)) {
- this.domId = "ngb-nav-" + navCounter++;
- }
- };
- Object.defineProperty(NgbNavItem.prototype, "active", {
- get: /**
- * @return {?}
- */
- function () { return this._nav.activeId === this.id; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbNavItem.prototype, "id", {
- get: /**
- * @return {?}
- */
- function () { return isValidNavId(this._id) ? this._id : this.domId; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbNavItem.prototype, "panelDomId", {
- get: /**
- * @return {?}
- */
- function () { return this.domId + "-panel"; },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- NgbNavItem.prototype.isPanelInDom = /**
- * @return {?}
- */
- function () {
- return (isDefined(this.destroyOnHide) ? !this.destroyOnHide : !this._nav.destroyOnHide) || this.active;
- };
- NgbNavItem.decorators = [
- { type: Directive, args: [{ selector: '[ngbNavItem]', exportAs: 'ngbNavItem', host: { '[class.nav-item]': 'true' } },] }
- ];
- /** @nocollapse */
- NgbNavItem.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
- * @return {?}
- */
- function () { return NgbNav; })),] }] },
- { type: ElementRef }
- ]; };
- NgbNavItem.propDecorators = {
- destroyOnHide: [{ type: Input }],
- disabled: [{ type: Input }],
- domId: [{ type: Input }],
- _id: [{ type: Input, args: ['ngbNavItem',] }],
- contentTpls: [{ type: ContentChildren, args: [NgbNavContent, { descendants: false },] }]
- };
- return NgbNavItem;
- }());
- /**
- * A nav directive that helps with implementing tabbed navigation components.
- *
- * \@since 5.2.0
- */
- var NgbNav = /** @class */ (function () {
- function NgbNav(role, config, _cd) {
- this.role = role;
- this._cd = _cd;
- /**
- * The event emitted after the active nav changes
- * The payload of the event is the newly active nav id
- *
- * If you want to prevent nav change, you should use `(navChange)` event
- */
- this.activeIdChange = new EventEmitter();
- /**
- * The nav change event emitted right before the nav change happens on user click.
- *
- * This event won't be emitted if nav is changed programmatically via `[activeId]` or `.select()`.
- *
- * See [`NgbNavChangeEvent`](#/components/nav/api#NgbNavChangeEvent) for payload details.
- */
- this.navChange = new EventEmitter();
- this.destroyOnHide = config.destroyOnHide;
- this.orientation = config.orientation;
- this.roles = config.roles;
- }
- /**
- * @param {?} item
- * @return {?}
- */
- NgbNav.prototype.click = /**
- * @param {?} item
- * @return {?}
- */
- function (item) {
- if (!item.disabled) {
- this._updateActiveId(item.id);
- }
- };
- /**
- * Selects the nav with the given id and shows its associated pane.
- * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
- */
- /**
- * Selects the nav with the given id and shows its associated pane.
- * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
- * @param {?} id
- * @return {?}
- */
- NgbNav.prototype.select = /**
- * Selects the nav with the given id and shows its associated pane.
- * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
- * @param {?} id
- * @return {?}
- */
- function (id) { this._updateActiveId(id, false); };
- /**
- * @return {?}
- */
- NgbNav.prototype.ngAfterContentInit = /**
- * @return {?}
- */
- function () {
- if (!isDefined(this.activeId)) {
- /** @type {?} */
- var nextId = this.items.first ? this.items.first.id : null;
- if (isValidNavId(nextId)) {
- this._updateActiveId(nextId, false);
- this._cd.detectChanges();
- }
- }
- };
- /**
- * @private
- * @param {?} nextId
- * @param {?=} emitNavChange
- * @return {?}
- */
- NgbNav.prototype._updateActiveId = /**
- * @private
- * @param {?} nextId
- * @param {?=} emitNavChange
- * @return {?}
- */
- function (nextId, emitNavChange) {
- if (emitNavChange === void 0) { emitNavChange = true; }
- if (this.activeId !== nextId) {
- /** @type {?} */
- var defaultPrevented_1 = false;
- if (emitNavChange) {
- this.navChange.emit({ activeId: this.activeId, nextId: nextId, preventDefault: (/**
- * @return {?}
- */
- function () { defaultPrevented_1 = true; }) });
- }
- if (!defaultPrevented_1) {
- this.activeId = nextId;
- this.activeIdChange.emit(nextId);
- }
- }
- };
- NgbNav.decorators = [
- { type: Directive, args: [{
- selector: '[ngbNav]',
- exportAs: 'ngbNav',
- host: {
- '[class.nav]': 'true',
- '[class.flex-column]': "orientation === 'vertical'",
- '[attr.aria-orientation]': "orientation === 'vertical' && roles === 'tablist' ? 'vertical' : undefined",
- '[attr.role]': "role ? role : roles ? 'tablist' : undefined",
- }
- },] }
- ];
- /** @nocollapse */
- NgbNav.ctorParameters = function () { return [
- { type: String, decorators: [{ type: Attribute, args: ['role',] }] },
- { type: NgbNavConfig },
- { type: ChangeDetectorRef }
- ]; };
- NgbNav.propDecorators = {
- activeId: [{ type: Input }],
- activeIdChange: [{ type: Output }],
- destroyOnHide: [{ type: Input }],
- orientation: [{ type: Input }],
- roles: [{ type: Input }],
- items: [{ type: ContentChildren, args: [NgbNavItem,] }],
- navChange: [{ type: Output }]
- };
- return NgbNav;
- }());
- /**
- * A directive to put on the nav link.
- *
- * \@since 5.2.0
- */
- var NgbNavLink = /** @class */ (function () {
- function NgbNavLink(role, navItem, nav) {
- this.role = role;
- this.navItem = navItem;
- this.nav = nav;
- }
- /**
- * @return {?}
- */
- NgbNavLink.prototype.hasNavItemClass = /**
- * @return {?}
- */
- function () {
- // with alternative markup we have to add `.nav-item` class, because `ngbNavItem` is on the ng-container
- return this.navItem.elementRef.nativeElement.nodeType === Node.COMMENT_NODE;
- };
- NgbNavLink.decorators = [
- { type: Directive, args: [{
- selector: 'a[ngbNavLink]',
- host: {
- '[id]': 'navItem.domId',
- '[class.nav-link]': 'true',
- '[class.nav-item]': 'hasNavItemClass()',
- '[attr.role]': "role ? role : nav.roles ? 'tab' : undefined",
- 'href': '',
- '[class.active]': 'navItem.active',
- '[class.disabled]': 'navItem.disabled',
- '[attr.tabindex]': 'navItem.disabled ? -1 : undefined',
- '[attr.aria-controls]': 'navItem.isPanelInDom() ? navItem.panelDomId : null',
- '[attr.aria-selected]': 'navItem.active',
- '[attr.aria-disabled]': 'navItem.disabled',
- '(click)': 'nav.click(navItem); $event.preventDefault()'
- }
- },] }
- ];
- /** @nocollapse */
- NgbNavLink.ctorParameters = function () { return [
- { type: String, decorators: [{ type: Attribute, args: ['role',] }] },
- { type: NgbNavItem },
- { type: NgbNav }
- ]; };
- return NgbNavLink;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * The outlet where currently active nav content will be displayed.
- *
- * \@since 5.2.0
- */
- var NgbNavOutlet = /** @class */ (function () {
- function NgbNavOutlet() {
- }
- NgbNavOutlet.decorators = [
- { type: Component, args: [{
- selector: '[ngbNavOutlet]',
- host: { '[class.tab-content]': 'true' },
- encapsulation: ViewEncapsulation.None,
- template: "\n <ng-template ngFor let-item [ngForOf]=\"nav.items\">\n <div class=\"tab-pane\"\n *ngIf=\"item.isPanelInDom()\"\n [id]=\"item.panelDomId\"\n [class.active]=\"item.active\"\n [attr.role]=\"paneRole ? paneRole : nav.roles ? 'tabpanel' : undefined\"\n [attr.aria-labelledby]=\"item.domId\">\n <ng-template [ngTemplateOutlet]=\"item.contentTpl?.templateRef\" [ngTemplateOutletContext]=\"{$implicit: item.active}\"></ng-template>\n </div>\n </ng-template>\n "
- }] }
- ];
- NgbNavOutlet.propDecorators = {
- paneRole: [{ type: Input }],
- nav: [{ type: Input, args: ['ngbNavOutlet',] }]
- };
- return NgbNavOutlet;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_NAV_DIRECTIVES = [NgbNavContent, NgbNav, NgbNavItem, NgbNavLink, NgbNavOutlet];
- var NgbNavModule = /** @class */ (function () {
- function NgbNavModule() {
- }
- NgbNavModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_NAV_DIRECTIVES, exports: NGB_NAV_DIRECTIVES, imports: [CommonModule] },] }
- ];
- return NgbNavModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbPagination`](#/components/pagination/api#NgbPagination) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the paginations used in the application.
- */
- var NgbPaginationConfig = /** @class */ (function () {
- function NgbPaginationConfig() {
- this.disabled = false;
- this.boundaryLinks = false;
- this.directionLinks = true;
- this.ellipses = true;
- this.maxSize = 0;
- this.pageSize = 10;
- this.rotate = false;
- }
- NgbPaginationConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbPaginationConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbPaginationConfig_Factory() { return new NgbPaginationConfig(); }, token: NgbPaginationConfig, providedIn: "root" });
- return NgbPaginationConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A directive to match the 'ellipsis' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationEllipsis = /** @class */ (function () {
- function NgbPaginationEllipsis(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationEllipsis.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationEllipsis]' },] }
- ];
- /** @nocollapse */
- NgbPaginationEllipsis.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationEllipsis;
- }());
- /**
- * A directive to match the 'first' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationFirst = /** @class */ (function () {
- function NgbPaginationFirst(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationFirst.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationFirst]' },] }
- ];
- /** @nocollapse */
- NgbPaginationFirst.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationFirst;
- }());
- /**
- * A directive to match the 'last' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationLast = /** @class */ (function () {
- function NgbPaginationLast(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationLast.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationLast]' },] }
- ];
- /** @nocollapse */
- NgbPaginationLast.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationLast;
- }());
- /**
- * A directive to match the 'next' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationNext = /** @class */ (function () {
- function NgbPaginationNext(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationNext.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationNext]' },] }
- ];
- /** @nocollapse */
- NgbPaginationNext.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationNext;
- }());
- /**
- * A directive to match the page 'number' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationNumber = /** @class */ (function () {
- function NgbPaginationNumber(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationNumber.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationNumber]' },] }
- ];
- /** @nocollapse */
- NgbPaginationNumber.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationNumber;
- }());
- /**
- * A directive to match the 'previous' link template
- *
- * \@since 4.1.0
- */
- var NgbPaginationPrevious = /** @class */ (function () {
- function NgbPaginationPrevious(templateRef) {
- this.templateRef = templateRef;
- }
- NgbPaginationPrevious.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbPaginationPrevious]' },] }
- ];
- /** @nocollapse */
- NgbPaginationPrevious.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbPaginationPrevious;
- }());
- /**
- * A component that displays page numbers and allows to customize them in several ways.
- */
- var NgbPagination = /** @class */ (function () {
- function NgbPagination(config) {
- this.pageCount = 0;
- this.pages = [];
- /**
- * The current page.
- *
- * Page numbers start with `1`.
- */
- this.page = 1;
- /**
- * An event fired when the page is changed. Will fire only if collection size is set and all values are valid.
- *
- * Event payload is the number of the newly selected page.
- *
- * Page numbers start with `1`.
- */
- this.pageChange = new EventEmitter(true);
- this.disabled = config.disabled;
- this.boundaryLinks = config.boundaryLinks;
- this.directionLinks = config.directionLinks;
- this.ellipses = config.ellipses;
- this.maxSize = config.maxSize;
- this.pageSize = config.pageSize;
- this.rotate = config.rotate;
- this.size = config.size;
- }
- /**
- * @return {?}
- */
- NgbPagination.prototype.hasPrevious = /**
- * @return {?}
- */
- function () { return this.page > 1; };
- /**
- * @return {?}
- */
- NgbPagination.prototype.hasNext = /**
- * @return {?}
- */
- function () { return this.page < this.pageCount; };
- /**
- * @return {?}
- */
- NgbPagination.prototype.nextDisabled = /**
- * @return {?}
- */
- function () { return !this.hasNext() || this.disabled; };
- /**
- * @return {?}
- */
- NgbPagination.prototype.previousDisabled = /**
- * @return {?}
- */
- function () { return !this.hasPrevious() || this.disabled; };
- /**
- * @param {?} pageNumber
- * @return {?}
- */
- NgbPagination.prototype.selectPage = /**
- * @param {?} pageNumber
- * @return {?}
- */
- function (pageNumber) { this._updatePages(pageNumber); };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbPagination.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) { this._updatePages(this.page); };
- /**
- * @param {?} pageNumber
- * @return {?}
- */
- NgbPagination.prototype.isEllipsis = /**
- * @param {?} pageNumber
- * @return {?}
- */
- function (pageNumber) { return pageNumber === -1; };
- /**
- * Appends ellipses and first/last page number to the displayed pages
- */
- /**
- * Appends ellipses and first/last page number to the displayed pages
- * @private
- * @param {?} start
- * @param {?} end
- * @return {?}
- */
- NgbPagination.prototype._applyEllipses = /**
- * Appends ellipses and first/last page number to the displayed pages
- * @private
- * @param {?} start
- * @param {?} end
- * @return {?}
- */
- function (start, end) {
- if (this.ellipses) {
- if (start > 0) {
- // The first page will always be included. If the displayed range
- // starts after the third page, then add ellipsis. But if the range
- // starts on the third page, then add the second page instead of
- // an ellipsis, because the ellipsis would only hide a single page.
- if (start > 2) {
- this.pages.unshift(-1);
- }
- else if (start === 2) {
- this.pages.unshift(2);
- }
- this.pages.unshift(1);
- }
- if (end < this.pageCount) {
- // The last page will always be included. If the displayed range
- // ends before the third-last page, then add ellipsis. But if the range
- // ends on third-last page, then add the second-last page instead of
- // an ellipsis, because the ellipsis would only hide a single page.
- if (end < (this.pageCount - 2)) {
- this.pages.push(-1);
- }
- else if (end === (this.pageCount - 2)) {
- this.pages.push(this.pageCount - 1);
- }
- this.pages.push(this.pageCount);
- }
- }
- };
- /**
- * Rotates page numbers based on maxSize items visible.
- * Currently selected page stays in the middle:
- *
- * Ex. for selected page = 6:
- * [5,*6*,7] for maxSize = 3
- * [4,5,*6*,7] for maxSize = 4
- */
- /**
- * Rotates page numbers based on maxSize items visible.
- * Currently selected page stays in the middle:
- *
- * Ex. for selected page = 6:
- * [5,*6*,7] for maxSize = 3
- * [4,5,*6*,7] for maxSize = 4
- * @private
- * @return {?}
- */
- NgbPagination.prototype._applyRotation = /**
- * Rotates page numbers based on maxSize items visible.
- * Currently selected page stays in the middle:
- *
- * Ex. for selected page = 6:
- * [5,*6*,7] for maxSize = 3
- * [4,5,*6*,7] for maxSize = 4
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var start = 0;
- /** @type {?} */
- var end = this.pageCount;
- /** @type {?} */
- var leftOffset = Math.floor(this.maxSize / 2);
- /** @type {?} */
- var rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;
- if (this.page <= leftOffset) {
- // very beginning, no rotation -> [0..maxSize]
- end = this.maxSize;
- }
- else if (this.pageCount - this.page < leftOffset) {
- // very end, no rotation -> [len-maxSize..len]
- start = this.pageCount - this.maxSize;
- }
- else {
- // rotate
- start = this.page - leftOffset - 1;
- end = this.page + rightOffset;
- }
- return [start, end];
- };
- /**
- * Paginates page numbers based on maxSize items per page.
- */
- /**
- * Paginates page numbers based on maxSize items per page.
- * @private
- * @return {?}
- */
- NgbPagination.prototype._applyPagination = /**
- * Paginates page numbers based on maxSize items per page.
- * @private
- * @return {?}
- */
- function () {
- /** @type {?} */
- var page = Math.ceil(this.page / this.maxSize) - 1;
- /** @type {?} */
- var start = page * this.maxSize;
- /** @type {?} */
- var end = start + this.maxSize;
- return [start, end];
- };
- /**
- * @private
- * @param {?} newPageNo
- * @return {?}
- */
- NgbPagination.prototype._setPageInRange = /**
- * @private
- * @param {?} newPageNo
- * @return {?}
- */
- function (newPageNo) {
- /** @type {?} */
- var prevPageNo = this.page;
- this.page = getValueInRange(newPageNo, this.pageCount, 1);
- if (this.page !== prevPageNo && isNumber(this.collectionSize)) {
- this.pageChange.emit(this.page);
- }
- };
- /**
- * @private
- * @param {?} newPage
- * @return {?}
- */
- NgbPagination.prototype._updatePages = /**
- * @private
- * @param {?} newPage
- * @return {?}
- */
- function (newPage) {
- var _a, _b;
- this.pageCount = Math.ceil(this.collectionSize / this.pageSize);
- if (!isNumber(this.pageCount)) {
- this.pageCount = 0;
- }
- // fill-in model needed to render pages
- this.pages.length = 0;
- for (var i = 1; i <= this.pageCount; i++) {
- this.pages.push(i);
- }
- // set page within 1..max range
- this._setPageInRange(newPage);
- // apply maxSize if necessary
- if (this.maxSize > 0 && this.pageCount > this.maxSize) {
- /** @type {?} */
- var start = 0;
- /** @type {?} */
- var end = this.pageCount;
- // either paginating or rotating page numbers
- if (this.rotate) {
- _a = __read(this._applyRotation(), 2), start = _a[0], end = _a[1];
- }
- else {
- _b = __read(this._applyPagination(), 2), start = _b[0], end = _b[1];
- }
- this.pages = this.pages.slice(start, end);
- // adding ellipses
- this._applyEllipses(start, end);
- }
- };
- NgbPagination.decorators = [
- { type: Component, args: [{
- selector: 'ngb-pagination',
- changeDetection: ChangeDetectionStrategy.OnPush,
- host: { 'role': 'navigation' },
- template: "\n <ng-template #first><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.first\">««</span></ng-template>\n <ng-template #previous><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.previous\">«</span></ng-template>\n <ng-template #next><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.next\">»</span></ng-template>\n <ng-template #last><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.last\">»»</span></ng-template>\n <ng-template #ellipsis>...</ng-template>\n <ng-template #defaultNumber let-page let-currentPage=\"currentPage\">\n {{ page }}\n <span *ngIf=\"page === currentPage\" class=\"sr-only\">(current)</span>\n </ng-template>\n <ul [class]=\"'pagination' + (size ? ' pagination-' + size : '')\">\n <li *ngIf=\"boundaryLinks\" class=\"page-item\"\n [class.disabled]=\"previousDisabled()\">\n <a aria-label=\"First\" i18n-aria-label=\"@@ngb.pagination.first-aria\" class=\"page-link\" href\n (click)=\"selectPage(1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplFirst?.templateRef || first\"\n [ngTemplateOutletContext]=\"{disabled: previousDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n\n <li *ngIf=\"directionLinks\" class=\"page-item\"\n [class.disabled]=\"previousDisabled()\">\n <a aria-label=\"Previous\" i18n-aria-label=\"@@ngb.pagination.previous-aria\" class=\"page-link\" href\n (click)=\"selectPage(page-1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplPrevious?.templateRef || previous\"\n [ngTemplateOutletContext]=\"{disabled: previousDisabled()}\"></ng-template>\n </a>\n </li>\n <li *ngFor=\"let pageNumber of pages\" class=\"page-item\" [class.active]=\"pageNumber === page\"\n [class.disabled]=\"isEllipsis(pageNumber) || disabled\" [attr.aria-current]=\"(pageNumber === page ? 'page' : null)\">\n <a *ngIf=\"isEllipsis(pageNumber)\" class=\"page-link\" tabindex=\"-1\" aria-disabled=\"true\">\n <ng-template [ngTemplateOutlet]=\"tplEllipsis?.templateRef || ellipsis\"\n [ngTemplateOutletContext]=\"{disabled: true, currentPage: page}\"></ng-template>\n </a>\n <a *ngIf=\"!isEllipsis(pageNumber)\" class=\"page-link\" href (click)=\"selectPage(pageNumber); $event.preventDefault()\" [attr.tabindex]=\"disabled ? '-1' : null\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplNumber?.templateRef || defaultNumber\"\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pageNumber, currentPage: page}\"></ng-template>\n </a>\n </li>\n <li *ngIf=\"directionLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\n <a aria-label=\"Next\" i18n-aria-label=\"@@ngb.pagination.next-aria\" class=\"page-link\" href\n (click)=\"selectPage(page+1); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplNext?.templateRef || next\"\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n\n <li *ngIf=\"boundaryLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\n <a aria-label=\"Last\" i18n-aria-label=\"@@ngb.pagination.last-aria\" class=\"page-link\" href\n (click)=\"selectPage(pageCount); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplLast?.templateRef || last\"\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n </ul>\n "
- }] }
- ];
- /** @nocollapse */
- NgbPagination.ctorParameters = function () { return [
- { type: NgbPaginationConfig }
- ]; };
- NgbPagination.propDecorators = {
- tplEllipsis: [{ type: ContentChild, args: [NgbPaginationEllipsis, { static: false },] }],
- tplFirst: [{ type: ContentChild, args: [NgbPaginationFirst, { static: false },] }],
- tplLast: [{ type: ContentChild, args: [NgbPaginationLast, { static: false },] }],
- tplNext: [{ type: ContentChild, args: [NgbPaginationNext, { static: false },] }],
- tplNumber: [{ type: ContentChild, args: [NgbPaginationNumber, { static: false },] }],
- tplPrevious: [{ type: ContentChild, args: [NgbPaginationPrevious, { static: false },] }],
- disabled: [{ type: Input }],
- boundaryLinks: [{ type: Input }],
- directionLinks: [{ type: Input }],
- ellipses: [{ type: Input }],
- rotate: [{ type: Input }],
- collectionSize: [{ type: Input }],
- maxSize: [{ type: Input }],
- page: [{ type: Input }],
- pageSize: [{ type: Input }],
- pageChange: [{ type: Output }],
- size: [{ type: Input }]
- };
- return NgbPagination;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var DIRECTIVES = [
- NgbPagination, NgbPaginationEllipsis, NgbPaginationFirst, NgbPaginationLast, NgbPaginationNext, NgbPaginationNumber,
- NgbPaginationPrevious
- ];
- var NgbPaginationModule = /** @class */ (function () {
- function NgbPaginationModule() {
- }
- NgbPaginationModule.decorators = [
- { type: NgModule, args: [{ declarations: DIRECTIVES, exports: DIRECTIVES, imports: [CommonModule] },] }
- ];
- return NgbPaginationModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var Trigger = /** @class */ (function () {
- function Trigger(open, close) {
- this.open = open;
- this.close = close;
- if (!close) {
- this.close = open;
- }
- }
- /**
- * @return {?}
- */
- Trigger.prototype.isManual = /**
- * @return {?}
- */
- function () { return this.open === 'manual' || this.close === 'manual'; };
- return Trigger;
- }());
- /** @type {?} */
- var DEFAULT_ALIASES = {
- 'hover': ['mouseenter', 'mouseleave'],
- 'focus': ['focusin', 'focusout'],
- };
- /**
- * @param {?} triggers
- * @param {?=} aliases
- * @return {?}
- */
- function parseTriggers(triggers, aliases) {
- if (aliases === void 0) { aliases = DEFAULT_ALIASES; }
- /** @type {?} */
- var trimmedTriggers = (triggers || '').trim();
- if (trimmedTriggers.length === 0) {
- return [];
- }
- /** @type {?} */
- var parsedTriggers = trimmedTriggers.split(/\s+/).map((/**
- * @param {?} trigger
- * @return {?}
- */
- function (trigger) { return trigger.split(':'); })).map((/**
- * @param {?} triggerPair
- * @return {?}
- */
- function (triggerPair) {
- /** @type {?} */
- var alias = aliases[triggerPair[0]] || triggerPair;
- return new Trigger(alias[0], alias[1]);
- }));
- /** @type {?} */
- var manualTriggers = parsedTriggers.filter((/**
- * @param {?} triggerPair
- * @return {?}
- */
- function (triggerPair) { return triggerPair.isManual(); }));
- if (manualTriggers.length > 1) {
- throw 'Triggers parse error: only one manual trigger is allowed';
- }
- if (manualTriggers.length === 1 && parsedTriggers.length > 1) {
- throw 'Triggers parse error: manual trigger can\'t be mixed with other triggers';
- }
- return parsedTriggers;
- }
- /**
- * @param {?} renderer
- * @param {?} nativeElement
- * @param {?} triggers
- * @param {?} isOpenedFn
- * @return {?}
- */
- function observeTriggers(renderer, nativeElement, triggers, isOpenedFn) {
- return new Observable((/**
- * @param {?} subscriber
- * @return {?}
- */
- function (subscriber) {
- /** @type {?} */
- var listeners = [];
- /** @type {?} */
- var openFn = (/**
- * @return {?}
- */
- function () { return subscriber.next(true); });
- /** @type {?} */
- var closeFn = (/**
- * @return {?}
- */
- function () { return subscriber.next(false); });
- /** @type {?} */
- var toggleFn = (/**
- * @return {?}
- */
- function () { return subscriber.next(!isOpenedFn()); });
- triggers.forEach((/**
- * @param {?} trigger
- * @return {?}
- */
- function (trigger) {
- if (trigger.open === trigger.close) {
- listeners.push(renderer.listen(nativeElement, trigger.open, toggleFn));
- }
- else {
- listeners.push(renderer.listen(nativeElement, trigger.open, openFn), renderer.listen(nativeElement, trigger.close, closeFn));
- }
- }));
- return (/**
- * @return {?}
- */
- function () { listeners.forEach((/**
- * @param {?} unsubscribeFn
- * @return {?}
- */
- function (unsubscribeFn) { return unsubscribeFn(); })); });
- }));
- }
- /** @type {?} */
- var delayOrNoop = (/**
- * @template T
- * @param {?} time
- * @return {?}
- */
- function (time) { return time > 0 ? delay(time) : (/**
- * @param {?} a
- * @return {?}
- */
- function (a) { return a; }); });
- /**
- * @param {?} openDelay
- * @param {?} closeDelay
- * @param {?} isOpenedFn
- * @return {?}
- */
- function triggerDelay(openDelay, closeDelay, isOpenedFn) {
- return (/**
- * @param {?} input$
- * @return {?}
- */
- function (input$) {
- /** @type {?} */
- var pending = null;
- /** @type {?} */
- var filteredInput$ = input$.pipe(map((/**
- * @param {?} open
- * @return {?}
- */
- function (open) { return ({ open: open }); })), filter((/**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- /** @type {?} */
- var currentlyOpen = isOpenedFn();
- if (currentlyOpen !== event.open && (!pending || pending.open === currentlyOpen)) {
- pending = event;
- return true;
- }
- if (pending && pending.open !== event.open) {
- pending = null;
- }
- return false;
- })), share());
- /** @type {?} */
- var delayedOpen$ = filteredInput$.pipe(filter((/**
- * @param {?} event
- * @return {?}
- */
- function (event) { return event.open; })), delayOrNoop(openDelay));
- /** @type {?} */
- var delayedClose$ = filteredInput$.pipe(filter((/**
- * @param {?} event
- * @return {?}
- */
- function (event) { return !event.open; })), delayOrNoop(closeDelay));
- return merge(delayedOpen$, delayedClose$)
- .pipe(filter((/**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- if (event === pending) {
- pending = null;
- return event.open !== isOpenedFn();
- }
- return false;
- })), map((/**
- * @param {?} event
- * @return {?}
- */
- function (event) { return event.open; })));
- });
- }
- /**
- * @param {?} renderer
- * @param {?} nativeElement
- * @param {?} triggers
- * @param {?} isOpenedFn
- * @param {?} openFn
- * @param {?} closeFn
- * @param {?=} openDelay
- * @param {?=} closeDelay
- * @return {?}
- */
- function listenToTriggers(renderer, nativeElement, triggers, isOpenedFn, openFn, closeFn, openDelay, closeDelay) {
- if (openDelay === void 0) { openDelay = 0; }
- if (closeDelay === void 0) { closeDelay = 0; }
- /** @type {?} */
- var parsedTriggers = parseTriggers(triggers);
- if (parsedTriggers.length === 1 && parsedTriggers[0].isManual()) {
- return (/**
- * @return {?}
- */
- function () { });
- }
- /** @type {?} */
- var subscription = observeTriggers(renderer, nativeElement, parsedTriggers, isOpenedFn)
- .pipe(triggerDelay(openDelay, closeDelay, isOpenedFn))
- .subscribe((/**
- * @param {?} open
- * @return {?}
- */
- function (open) { return (open ? openFn() : closeFn()); }));
- return (/**
- * @return {?}
- */
- function () { return subscription.unsubscribe(); });
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbPopover`](#/components/popover/api#NgbPopover) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the popovers used in the application.
- */
- var NgbPopoverConfig = /** @class */ (function () {
- function NgbPopoverConfig() {
- this.autoClose = true;
- this.placement = 'auto';
- this.triggers = 'click';
- this.disablePopover = false;
- this.openDelay = 0;
- this.closeDelay = 0;
- }
- NgbPopoverConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbPopoverConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbPopoverConfig_Factory() { return new NgbPopoverConfig(); }, token: NgbPopoverConfig, providedIn: "root" });
- return NgbPopoverConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextId$3 = 0;
- var NgbPopoverWindow = /** @class */ (function () {
- function NgbPopoverWindow() {
- }
- /**
- * @return {?}
- */
- NgbPopoverWindow.prototype.isTitleTemplate = /**
- * @return {?}
- */
- function () { return this.title instanceof TemplateRef; };
- NgbPopoverWindow.decorators = [
- { type: Component, args: [{
- selector: 'ngb-popover-window',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: { '[class]': '"popover" + (popoverClass ? " " + popoverClass : "")', 'role': 'tooltip', '[id]': 'id' },
- template: "\n <div class=\"arrow\"></div>\n <h3 class=\"popover-header\" *ngIf=\"title != null\">\n <ng-template #simpleTitle>{{title}}</ng-template>\n <ng-template [ngTemplateOutlet]=\"isTitleTemplate() ? title : simpleTitle\" [ngTemplateOutletContext]=\"context\"></ng-template>\n </h3>\n <div class=\"popover-body\"><ng-content></ng-content></div>",
- styles: ["ngb-popover-window.bs-popover-bottom>.arrow,ngb-popover-window.bs-popover-top>.arrow{left:50%;margin-left:-.5rem}ngb-popover-window.bs-popover-bottom-left>.arrow,ngb-popover-window.bs-popover-top-left>.arrow{left:2em}ngb-popover-window.bs-popover-bottom-right>.arrow,ngb-popover-window.bs-popover-top-right>.arrow{left:auto;right:2em}ngb-popover-window.bs-popover-left>.arrow,ngb-popover-window.bs-popover-right>.arrow{top:50%;margin-top:-.5rem}ngb-popover-window.bs-popover-left-top>.arrow,ngb-popover-window.bs-popover-right-top>.arrow{top:.7em}ngb-popover-window.bs-popover-left-bottom>.arrow,ngb-popover-window.bs-popover-right-bottom>.arrow{top:auto;bottom:.7em}"]
- }] }
- ];
- NgbPopoverWindow.propDecorators = {
- title: [{ type: Input }],
- id: [{ type: Input }],
- popoverClass: [{ type: Input }],
- context: [{ type: Input }]
- };
- return NgbPopoverWindow;
- }());
- /**
- * A lightweight and extensible directive for fancy popover creation.
- */
- var NgbPopover = /** @class */ (function () {
- function NgbPopover(_elementRef, _renderer, injector, componentFactoryResolver, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
- var _this = this;
- this._elementRef = _elementRef;
- this._renderer = _renderer;
- this._ngZone = _ngZone;
- this._document = _document;
- this._changeDetector = _changeDetector;
- /**
- * An event emitted when the popover is shown. Contains no payload.
- */
- this.shown = new EventEmitter();
- /**
- * An event emitted when the popover is hidden. Contains no payload.
- */
- this.hidden = new EventEmitter();
- this._ngbPopoverWindowId = "ngb-popover-" + nextId$3++;
- this.autoClose = config.autoClose;
- this.placement = config.placement;
- this.triggers = config.triggers;
- this.container = config.container;
- this.disablePopover = config.disablePopover;
- this.popoverClass = config.popoverClass;
- this.openDelay = config.openDelay;
- this.closeDelay = config.closeDelay;
- this._popupService = new PopupService(NgbPopoverWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
- this._zoneSubscription = _ngZone.onStable.subscribe((/**
- * @return {?}
- */
- function () {
- if (_this._windowRef) {
- positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body', 'bs-popover');
- }
- }));
- }
- /**
- * @private
- * @return {?}
- */
- NgbPopover.prototype._isDisabled = /**
- * @private
- * @return {?}
- */
- function () {
- if (this.disablePopover) {
- return true;
- }
- if (!this.ngbPopover && !this.popoverTitle) {
- return true;
- }
- return false;
- };
- /**
- * Opens the popover.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the popover template when it is created.
- */
- /**
- * Opens the popover.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the popover template when it is created.
- * @param {?=} context
- * @return {?}
- */
- NgbPopover.prototype.open = /**
- * Opens the popover.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the popover template when it is created.
- * @param {?=} context
- * @return {?}
- */
- function (context) {
- var _this = this;
- if (!this._windowRef && !this._isDisabled()) {
- this._windowRef = this._popupService.open(this.ngbPopover, context);
- this._windowRef.instance.title = this.popoverTitle;
- this._windowRef.instance.context = context;
- this._windowRef.instance.popoverClass = this.popoverClass;
- this._windowRef.instance.id = this._ngbPopoverWindowId;
- this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbPopoverWindowId);
- if (this.container === 'body') {
- this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
- }
- // We need to detect changes, because we don't know where .open() might be called from.
- // Ex. opening popover from one of lifecycle hooks that run after the CD
- // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception
- this._windowRef.changeDetectorRef.detectChanges();
- // We need to mark for check, because popover won't work inside the OnPush component.
- // Ex. when we use expression like `{{ popover.isOpen() : 'opened' : 'closed' }}`
- // inside the template of an OnPush component and we change the popover from
- // open -> closed, the expression in question won't be updated unless we explicitly
- // mark the parent component to be checked.
- this._windowRef.changeDetectorRef.markForCheck();
- ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
- * @return {?}
- */
- function () { return _this.close(); }), this.hidden, [this._windowRef.location.nativeElement]);
- this.shown.emit();
- }
- };
- /**
- * Closes the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- */
- /**
- * Closes the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- * @return {?}
- */
- NgbPopover.prototype.close = /**
- * Closes the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- * @return {?}
- */
- function () {
- if (this._windowRef) {
- this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
- this._popupService.close();
- this._windowRef = null;
- this.hidden.emit();
- this._changeDetector.markForCheck();
- }
- };
- /**
- * Toggles the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- */
- /**
- * Toggles the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- * @return {?}
- */
- NgbPopover.prototype.toggle = /**
- * Toggles the popover.
- *
- * This is considered to be a "manual" triggering of the popover.
- * @return {?}
- */
- function () {
- if (this._windowRef) {
- this.close();
- }
- else {
- this.open();
- }
- };
- /**
- * Returns `true`, if the popover is currently shown.
- */
- /**
- * Returns `true`, if the popover is currently shown.
- * @return {?}
- */
- NgbPopover.prototype.isOpen = /**
- * Returns `true`, if the popover is currently shown.
- * @return {?}
- */
- function () { return this._windowRef != null; };
- /**
- * @return {?}
- */
- NgbPopover.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- this._unregisterListenersFn = listenToTriggers(this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this), this.close.bind(this), +this.openDelay, +this.closeDelay);
- };
- /**
- * @param {?} __0
- * @return {?}
- */
- NgbPopover.prototype.ngOnChanges = /**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var ngbPopover = _a.ngbPopover, popoverTitle = _a.popoverTitle, disablePopover = _a.disablePopover, popoverClass = _a.popoverClass;
- if (popoverClass && this.isOpen()) {
- this._windowRef.instance.popoverClass = popoverClass.currentValue;
- }
- // close popover if title and content become empty, or disablePopover set to true
- if ((ngbPopover || popoverTitle || disablePopover) && this._isDisabled()) {
- this.close();
- }
- };
- /**
- * @return {?}
- */
- NgbPopover.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this.close();
- // This check is needed as it might happen that ngOnDestroy is called before ngOnInit
- // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199
- if (this._unregisterListenersFn) {
- this._unregisterListenersFn();
- }
- this._zoneSubscription.unsubscribe();
- };
- NgbPopover.decorators = [
- { type: Directive, args: [{ selector: '[ngbPopover]', exportAs: 'ngbPopover' },] }
- ];
- /** @nocollapse */
- NgbPopover.ctorParameters = function () { return [
- { type: ElementRef },
- { type: Renderer2 },
- { type: Injector },
- { type: ComponentFactoryResolver },
- { type: ViewContainerRef },
- { type: NgbPopoverConfig },
- { type: NgZone },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: ChangeDetectorRef },
- { type: ApplicationRef }
- ]; };
- NgbPopover.propDecorators = {
- autoClose: [{ type: Input }],
- ngbPopover: [{ type: Input }],
- popoverTitle: [{ type: Input }],
- placement: [{ type: Input }],
- triggers: [{ type: Input }],
- container: [{ type: Input }],
- disablePopover: [{ type: Input }],
- popoverClass: [{ type: Input }],
- openDelay: [{ type: Input }],
- closeDelay: [{ type: Input }],
- shown: [{ type: Output }],
- hidden: [{ type: Output }]
- };
- return NgbPopover;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbPopoverModule = /** @class */ (function () {
- function NgbPopoverModule() {
- }
- NgbPopoverModule.decorators = [
- { type: NgModule, args: [{
- declarations: [NgbPopover, NgbPopoverWindow],
- exports: [NgbPopover],
- imports: [CommonModule],
- entryComponents: [NgbPopoverWindow]
- },] }
- ];
- return NgbPopoverModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbProgressbar`](#/components/progressbar/api#NgbProgressbar) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the progress bars used in the application.
- */
- var NgbProgressbarConfig = /** @class */ (function () {
- function NgbProgressbarConfig() {
- this.max = 100;
- this.animated = false;
- this.striped = false;
- this.showValue = false;
- }
- NgbProgressbarConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbProgressbarConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbProgressbarConfig_Factory() { return new NgbProgressbarConfig(); }, token: NgbProgressbarConfig, providedIn: "root" });
- return NgbProgressbarConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A directive that provides feedback on the progress of a workflow or an action.
- */
- var NgbProgressbar = /** @class */ (function () {
- function NgbProgressbar(config) {
- /**
- * The current value for the progress bar.
- *
- * Should be in the `[0, max]` range.
- */
- this.value = 0;
- this.max = config.max;
- this.animated = config.animated;
- this.striped = config.striped;
- this.textType = config.textType;
- this.type = config.type;
- this.showValue = config.showValue;
- this.height = config.height;
- }
- Object.defineProperty(NgbProgressbar.prototype, "max", {
- get: /**
- * @return {?}
- */
- function () { return this._max; },
- /**
- * The maximal value to be displayed in the progress bar.
- *
- * Should be a positive number. Will default to 100 otherwise.
- */
- set: /**
- * The maximal value to be displayed in the progress bar.
- *
- * Should be a positive number. Will default to 100 otherwise.
- * @param {?} max
- * @return {?}
- */
- function (max) {
- this._max = !isNumber(max) || max <= 0 ? 100 : max;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- NgbProgressbar.prototype.getValue = /**
- * @return {?}
- */
- function () { return getValueInRange(this.value, this.max); };
- /**
- * @return {?}
- */
- NgbProgressbar.prototype.getPercentValue = /**
- * @return {?}
- */
- function () { return 100 * this.getValue() / this.max; };
- NgbProgressbar.decorators = [
- { type: Component, args: [{
- selector: 'ngb-progressbar',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- template: "\n <div class=\"progress\" [style.height]=\"height\">\n <div class=\"progress-bar{{type ? ' bg-' + type : ''}}{{textType ? ' text-' + textType : ''}}\n {{animated ? ' progress-bar-animated' : ''}}{{striped ? ' progress-bar-striped' : ''}}\" role=\"progressbar\" [style.width.%]=\"getPercentValue()\"\n [attr.aria-valuenow]=\"getValue()\" aria-valuemin=\"0\" [attr.aria-valuemax]=\"max\">\n <span *ngIf=\"showValue\" i18n=\"@@ngb.progressbar.value\">{{getPercentValue()}}%</span><ng-content></ng-content>\n </div>\n </div>\n "
- }] }
- ];
- /** @nocollapse */
- NgbProgressbar.ctorParameters = function () { return [
- { type: NgbProgressbarConfig }
- ]; };
- NgbProgressbar.propDecorators = {
- max: [{ type: Input }],
- animated: [{ type: Input }],
- striped: [{ type: Input }],
- showValue: [{ type: Input }],
- textType: [{ type: Input }],
- type: [{ type: Input }],
- value: [{ type: Input }],
- height: [{ type: Input }]
- };
- return NgbProgressbar;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbProgressbarModule = /** @class */ (function () {
- function NgbProgressbarModule() {
- }
- NgbProgressbarModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbProgressbar], exports: [NgbProgressbar], imports: [CommonModule] },] }
- ];
- return NgbProgressbarModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbRating`](#/components/rating/api#NgbRating) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the ratings used in the application.
- */
- var NgbRatingConfig = /** @class */ (function () {
- function NgbRatingConfig() {
- this.max = 10;
- this.readonly = false;
- this.resettable = false;
- }
- NgbRatingConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbRatingConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbRatingConfig_Factory() { return new NgbRatingConfig(); }, token: NgbRatingConfig, providedIn: "root" });
- return NgbRatingConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_RATING_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbRating; })),
- multi: true
- };
- /**
- * A directive that helps visualising and interacting with a star rating bar.
- */
- var NgbRating = /** @class */ (function () {
- function NgbRating(config, _changeDetectorRef) {
- this._changeDetectorRef = _changeDetectorRef;
- this.contexts = [];
- this.disabled = false;
- /**
- * An event emitted when the user is hovering over a given rating.
- *
- * Event payload equals to the rating being hovered over.
- */
- this.hover = new EventEmitter();
- /**
- * An event emitted when the user stops hovering over a given rating.
- *
- * Event payload equals to the rating of the last item being hovered over.
- */
- this.leave = new EventEmitter();
- /**
- * An event emitted when the user selects a new rating.
- *
- * Event payload equals to the newly selected rating.
- */
- this.rateChange = new EventEmitter(true);
- this.onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.onTouched = (/**
- * @return {?}
- */
- function () { });
- this.max = config.max;
- this.readonly = config.readonly;
- }
- /**
- * @return {?}
- */
- NgbRating.prototype.ariaValueText = /**
- * @return {?}
- */
- function () { return this.nextRate + " out of " + this.max; };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbRating.prototype.enter = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- if (!this.readonly && !this.disabled) {
- this._updateState(value);
- }
- this.hover.emit(value);
- };
- /**
- * @return {?}
- */
- NgbRating.prototype.handleBlur = /**
- * @return {?}
- */
- function () { this.onTouched(); };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbRating.prototype.handleClick = /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this.update(this.resettable && this.rate === value ? 0 : value); };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbRating.prototype.handleKeyDown = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- // tslint:disable-next-line:deprecation
- switch (event.which) {
- case Key.ArrowDown:
- case Key.ArrowLeft:
- this.update(this.rate - 1);
- break;
- case Key.ArrowUp:
- case Key.ArrowRight:
- this.update(this.rate + 1);
- break;
- case Key.Home:
- this.update(0);
- break;
- case Key.End:
- this.update(this.max);
- break;
- default:
- return;
- }
- // note 'return' in default case
- event.preventDefault();
- };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbRating.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- if (changes['rate']) {
- this.update(this.rate);
- }
- };
- /**
- * @return {?}
- */
- NgbRating.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- this.contexts = Array.from({ length: this.max }, (/**
- * @param {?} v
- * @param {?} k
- * @return {?}
- */
- function (v, k) { return ({ fill: 0, index: k }); }));
- this._updateState(this.rate);
- };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbRating.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbRating.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onTouched = fn; };
- /**
- * @return {?}
- */
- NgbRating.prototype.reset = /**
- * @return {?}
- */
- function () {
- this.leave.emit(this.nextRate);
- this._updateState(this.rate);
- };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbRating.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) { this.disabled = isDisabled; };
- /**
- * @param {?} value
- * @param {?=} internalChange
- * @return {?}
- */
- NgbRating.prototype.update = /**
- * @param {?} value
- * @param {?=} internalChange
- * @return {?}
- */
- function (value, internalChange) {
- if (internalChange === void 0) { internalChange = true; }
- /** @type {?} */
- var newRate = getValueInRange(value, this.max, 0);
- if (!this.readonly && !this.disabled && this.rate !== newRate) {
- this.rate = newRate;
- this.rateChange.emit(this.rate);
- }
- if (internalChange) {
- this.onChange(this.rate);
- this.onTouched();
- }
- this._updateState(this.rate);
- };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbRating.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this.update(value, false);
- this._changeDetectorRef.markForCheck();
- };
- /**
- * @private
- * @param {?} index
- * @return {?}
- */
- NgbRating.prototype._getFillValue = /**
- * @private
- * @param {?} index
- * @return {?}
- */
- function (index) {
- /** @type {?} */
- var diff = this.nextRate - index;
- if (diff >= 1) {
- return 100;
- }
- if (diff < 1 && diff > 0) {
- return parseInt((diff * 100).toFixed(2), 10);
- }
- return 0;
- };
- /**
- * @private
- * @param {?} nextValue
- * @return {?}
- */
- NgbRating.prototype._updateState = /**
- * @private
- * @param {?} nextValue
- * @return {?}
- */
- function (nextValue) {
- var _this = this;
- this.nextRate = nextValue;
- this.contexts.forEach((/**
- * @param {?} context
- * @param {?} index
- * @return {?}
- */
- function (context, index) { return context.fill = _this._getFillValue(index); }));
- };
- NgbRating.decorators = [
- { type: Component, args: [{
- selector: 'ngb-rating',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: {
- 'class': 'd-inline-flex',
- 'tabindex': '0',
- 'role': 'slider',
- 'aria-valuemin': '0',
- '[attr.aria-valuemax]': 'max',
- '[attr.aria-valuenow]': 'nextRate',
- '[attr.aria-valuetext]': 'ariaValueText()',
- '[attr.aria-disabled]': 'readonly ? true : null',
- '(blur)': 'handleBlur()',
- '(keydown)': 'handleKeyDown($event)',
- '(mouseleave)': 'reset()'
- },
- template: "\n <ng-template #t let-fill=\"fill\">{{ fill === 100 ? '★' : '☆' }}</ng-template>\n <ng-template ngFor [ngForOf]=\"contexts\" let-index=\"index\">\n <span class=\"sr-only\">({{ index < nextRate ? '*' : ' ' }})</span>\n <span (mouseenter)=\"enter(index + 1)\" (click)=\"handleClick(index + 1)\" [style.cursor]=\"readonly || disabled ? 'default' : 'pointer'\">\n <ng-template [ngTemplateOutlet]=\"starTemplate || starTemplateFromContent || t\" [ngTemplateOutletContext]=\"contexts[index]\">\n </ng-template>\n </span>\n </ng-template>\n ",
- providers: [NGB_RATING_VALUE_ACCESSOR]
- }] }
- ];
- /** @nocollapse */
- NgbRating.ctorParameters = function () { return [
- { type: NgbRatingConfig },
- { type: ChangeDetectorRef }
- ]; };
- NgbRating.propDecorators = {
- max: [{ type: Input }],
- rate: [{ type: Input }],
- readonly: [{ type: Input }],
- resettable: [{ type: Input }],
- starTemplate: [{ type: Input }],
- starTemplateFromContent: [{ type: ContentChild, args: [TemplateRef, { static: false },] }],
- hover: [{ type: Output }],
- leave: [{ type: Output }],
- rateChange: [{ type: Output }]
- };
- return NgbRating;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbRatingModule = /** @class */ (function () {
- function NgbRatingModule() {
- }
- NgbRatingModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbRating], exports: [NgbRating], imports: [CommonModule] },] }
- ];
- return NgbRatingModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbTabset`](#/components/tabset/api#NgbTabset) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the tabsets used in the application.
- */
- var NgbTabsetConfig = /** @class */ (function () {
- function NgbTabsetConfig() {
- this.justify = 'start';
- this.orientation = 'horizontal';
- this.type = 'tabs';
- }
- NgbTabsetConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbTabsetConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTabsetConfig_Factory() { return new NgbTabsetConfig(); }, token: NgbTabsetConfig, providedIn: "root" });
- return NgbTabsetConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextId$4 = 0;
- /**
- * A directive to wrap tab titles that need to contain HTML markup or other directives.
- *
- * Alternatively you could use the `NgbTab.title` input for string titles.
- */
- var NgbTabTitle = /** @class */ (function () {
- function NgbTabTitle(templateRef) {
- this.templateRef = templateRef;
- }
- NgbTabTitle.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbTabTitle]' },] }
- ];
- /** @nocollapse */
- NgbTabTitle.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbTabTitle;
- }());
- /**
- * A directive to wrap content to be displayed in a tab.
- */
- var NgbTabContent = /** @class */ (function () {
- function NgbTabContent(templateRef) {
- this.templateRef = templateRef;
- }
- NgbTabContent.decorators = [
- { type: Directive, args: [{ selector: 'ng-template[ngbTabContent]' },] }
- ];
- /** @nocollapse */
- NgbTabContent.ctorParameters = function () { return [
- { type: TemplateRef }
- ]; };
- return NgbTabContent;
- }());
- /**
- * A directive representing an individual tab.
- */
- var NgbTab = /** @class */ (function () {
- function NgbTab() {
- /**
- * The tab identifier.
- *
- * Must be unique for the entire document for proper accessibility support.
- */
- this.id = "ngb-tab-" + nextId$4++;
- /**
- * If `true`, the current tab is disabled and can't be toggled.
- */
- this.disabled = false;
- }
- /**
- * @return {?}
- */
- NgbTab.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
- // only @ContentChildren allows us to specify the {descendants: false} option.
- // Without {descendants: false} we are hitting bugs described in:
- // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
- this.titleTpl = this.titleTpls.first;
- this.contentTpl = this.contentTpls.first;
- };
- NgbTab.decorators = [
- { type: Directive, args: [{ selector: 'ngb-tab' },] }
- ];
- NgbTab.propDecorators = {
- id: [{ type: Input }],
- title: [{ type: Input }],
- disabled: [{ type: Input }],
- titleTpls: [{ type: ContentChildren, args: [NgbTabTitle, { descendants: false },] }],
- contentTpls: [{ type: ContentChildren, args: [NgbTabContent, { descendants: false },] }]
- };
- return NgbTab;
- }());
- /**
- * A component that makes it easy to create tabbed interface.
- */
- var NgbTabset = /** @class */ (function () {
- function NgbTabset(config) {
- /**
- * If `true`, non-visible tabs content will be removed from DOM. Otherwise it will just be hidden.
- */
- this.destroyOnHide = true;
- /**
- * A tab change event emitted right before the tab change happens.
- *
- * See [`NgbTabChangeEvent`](#/components/tabset/api#NgbTabChangeEvent) for payload details.
- */
- this.tabChange = new EventEmitter();
- this.type = config.type;
- this.justify = config.justify;
- this.orientation = config.orientation;
- }
- Object.defineProperty(NgbTabset.prototype, "justify", {
- /**
- * The horizontal alignment of the tabs with flexbox utilities.
- */
- set: /**
- * The horizontal alignment of the tabs with flexbox utilities.
- * @param {?} className
- * @return {?}
- */
- function (className) {
- if (className === 'fill' || className === 'justified') {
- this.justifyClass = "nav-" + className;
- }
- else {
- this.justifyClass = "justify-content-" + className;
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Selects the tab with the given id and shows its associated content panel.
- *
- * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
- * hidden depending on the `destroyOnHide` value.
- */
- /**
- * Selects the tab with the given id and shows its associated content panel.
- *
- * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
- * hidden depending on the `destroyOnHide` value.
- * @param {?} tabId
- * @return {?}
- */
- NgbTabset.prototype.select = /**
- * Selects the tab with the given id and shows its associated content panel.
- *
- * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
- * hidden depending on the `destroyOnHide` value.
- * @param {?} tabId
- * @return {?}
- */
- function (tabId) {
- /** @type {?} */
- var selectedTab = this._getTabById(tabId);
- if (selectedTab && !selectedTab.disabled && this.activeId !== selectedTab.id) {
- /** @type {?} */
- var defaultPrevented_1 = false;
- this.tabChange.emit({ activeId: this.activeId, nextId: selectedTab.id, preventDefault: (/**
- * @return {?}
- */
- function () { defaultPrevented_1 = true; }) });
- if (!defaultPrevented_1) {
- this.activeId = selectedTab.id;
- }
- }
- };
- /**
- * @return {?}
- */
- NgbTabset.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- // auto-correct activeId that might have been set incorrectly as input
- /** @type {?} */
- var activeTab = this._getTabById(this.activeId);
- this.activeId = activeTab ? activeTab.id : (this.tabs.length ? this.tabs.first.id : null);
- };
- /**
- * @private
- * @param {?} id
- * @return {?}
- */
- NgbTabset.prototype._getTabById = /**
- * @private
- * @param {?} id
- * @return {?}
- */
- function (id) {
- /** @type {?} */
- var tabsWithId = this.tabs.filter((/**
- * @param {?} tab
- * @return {?}
- */
- function (tab) { return tab.id === id; }));
- return tabsWithId.length ? tabsWithId[0] : null;
- };
- NgbTabset.decorators = [
- { type: Component, args: [{
- selector: 'ngb-tabset',
- exportAs: 'ngbTabset',
- encapsulation: ViewEncapsulation.None,
- template: "\n <ul [class]=\"'nav nav-' + type + (orientation == 'horizontal'? ' ' + justifyClass : ' flex-column')\" role=\"tablist\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabs\">\n <a [id]=\"tab.id\" class=\"nav-link\" [class.active]=\"tab.id === activeId\" [class.disabled]=\"tab.disabled\"\n href (click)=\"select(tab.id); $event.preventDefault()\" role=\"tab\" [attr.tabindex]=\"(tab.disabled ? '-1': undefined)\"\n [attr.aria-controls]=\"(!destroyOnHide || tab.id === activeId ? tab.id + '-panel' : null)\"\n [attr.aria-selected]=\"tab.id === activeId\" [attr.aria-disabled]=\"tab.disabled\">\n {{tab.title}}<ng-template [ngTemplateOutlet]=\"tab.titleTpl?.templateRef\"></ng-template>\n </a>\n </li>\n </ul>\n <div class=\"tab-content\">\n <ng-template ngFor let-tab [ngForOf]=\"tabs\">\n <div\n class=\"tab-pane {{tab.id === activeId ? 'active' : null}}\"\n *ngIf=\"!destroyOnHide || tab.id === activeId\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tab.id\" id=\"{{tab.id}}-panel\">\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl?.templateRef\"></ng-template>\n </div>\n </ng-template>\n </div>\n "
- }] }
- ];
- /** @nocollapse */
- NgbTabset.ctorParameters = function () { return [
- { type: NgbTabsetConfig }
- ]; };
- NgbTabset.propDecorators = {
- tabs: [{ type: ContentChildren, args: [NgbTab,] }],
- activeId: [{ type: Input }],
- destroyOnHide: [{ type: Input }],
- justify: [{ type: Input }],
- orientation: [{ type: Input }],
- type: [{ type: Input }],
- tabChange: [{ type: Output }]
- };
- return NgbTabset;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_TABSET_DIRECTIVES = [NgbTabset, NgbTab, NgbTabContent, NgbTabTitle];
- var NgbTabsetModule = /** @class */ (function () {
- function NgbTabsetModule() {
- }
- NgbTabsetModule.decorators = [
- { type: NgModule, args: [{ declarations: NGB_TABSET_DIRECTIVES, exports: NGB_TABSET_DIRECTIVES, imports: [CommonModule, NgbNavModule] },] }
- ];
- return NgbTabsetModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbTime = /** @class */ (function () {
- function NgbTime(hour, minute, second) {
- this.hour = toInteger(hour);
- this.minute = toInteger(minute);
- this.second = toInteger(second);
- }
- /**
- * @param {?=} step
- * @return {?}
- */
- NgbTime.prototype.changeHour = /**
- * @param {?=} step
- * @return {?}
- */
- function (step) {
- if (step === void 0) { step = 1; }
- this.updateHour((isNaN(this.hour) ? 0 : this.hour) + step);
- };
- /**
- * @param {?} hour
- * @return {?}
- */
- NgbTime.prototype.updateHour = /**
- * @param {?} hour
- * @return {?}
- */
- function (hour) {
- if (isNumber(hour)) {
- this.hour = (hour < 0 ? 24 + hour : hour) % 24;
- }
- else {
- this.hour = NaN;
- }
- };
- /**
- * @param {?=} step
- * @return {?}
- */
- NgbTime.prototype.changeMinute = /**
- * @param {?=} step
- * @return {?}
- */
- function (step) {
- if (step === void 0) { step = 1; }
- this.updateMinute((isNaN(this.minute) ? 0 : this.minute) + step);
- };
- /**
- * @param {?} minute
- * @return {?}
- */
- NgbTime.prototype.updateMinute = /**
- * @param {?} minute
- * @return {?}
- */
- function (minute) {
- if (isNumber(minute)) {
- this.minute = minute % 60 < 0 ? 60 + minute % 60 : minute % 60;
- this.changeHour(Math.floor(minute / 60));
- }
- else {
- this.minute = NaN;
- }
- };
- /**
- * @param {?=} step
- * @return {?}
- */
- NgbTime.prototype.changeSecond = /**
- * @param {?=} step
- * @return {?}
- */
- function (step) {
- if (step === void 0) { step = 1; }
- this.updateSecond((isNaN(this.second) ? 0 : this.second) + step);
- };
- /**
- * @param {?} second
- * @return {?}
- */
- NgbTime.prototype.updateSecond = /**
- * @param {?} second
- * @return {?}
- */
- function (second) {
- if (isNumber(second)) {
- this.second = second < 0 ? 60 + second % 60 : second % 60;
- this.changeMinute(Math.floor(second / 60));
- }
- else {
- this.second = NaN;
- }
- };
- /**
- * @param {?=} checkSecs
- * @return {?}
- */
- NgbTime.prototype.isValid = /**
- * @param {?=} checkSecs
- * @return {?}
- */
- function (checkSecs) {
- if (checkSecs === void 0) { checkSecs = true; }
- return isNumber(this.hour) && isNumber(this.minute) && (checkSecs ? isNumber(this.second) : true);
- };
- /**
- * @return {?}
- */
- NgbTime.prototype.toString = /**
- * @return {?}
- */
- function () { return (this.hour || 0) + ":" + (this.minute || 0) + ":" + (this.second || 0); };
- return NgbTime;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbTimepicker`](#/components/timepicker/api#NgbTimepicker) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the timepickers used in the application.
- */
- var NgbTimepickerConfig = /** @class */ (function () {
- function NgbTimepickerConfig() {
- this.meridian = false;
- this.spinners = true;
- this.seconds = false;
- this.hourStep = 1;
- this.minuteStep = 1;
- this.secondStep = 1;
- this.disabled = false;
- this.readonlyInputs = false;
- this.size = 'medium';
- }
- NgbTimepickerConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbTimepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTimepickerConfig_Factory() { return new NgbTimepickerConfig(); }, token: NgbTimepickerConfig, providedIn: "root" });
- return NgbTimepickerConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @return {?}
- */
- function NGB_DATEPICKER_TIME_ADAPTER_FACTORY() {
- return new NgbTimeStructAdapter();
- }
- /**
- * An abstract service that does the conversion between the internal timepicker `NgbTimeStruct` model and
- * any provided user time model `T`, ex. a string, a native date, etc.
- *
- * The adapter is used **only** for conversion when binding timepicker to a form control,
- * ex. `[(ngModel)]="userTimeModel"`. Here `userTimeModel` can be of any type.
- *
- * The default timepicker implementation assumes we use `NgbTimeStruct` as a user model.
- *
- * See the [custom time adapter demo](#/components/timepicker/examples#adapter) for an example.
- *
- * \@since 2.2.0
- * @abstract
- * @template T
- */
- var NgbTimeAdapter = /** @class */ (function () {
- function NgbTimeAdapter() {
- }
- NgbTimeAdapter.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_TIME_ADAPTER_FACTORY },] }
- ];
- /** @nocollapse */ NgbTimeAdapter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_TIME_ADAPTER_FACTORY, token: NgbTimeAdapter, providedIn: "root" });
- return NgbTimeAdapter;
- }());
- var NgbTimeStructAdapter = /** @class */ (function (_super) {
- __extends(NgbTimeStructAdapter, _super);
- function NgbTimeStructAdapter() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- */
- /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- * @param {?} time
- * @return {?}
- */
- NgbTimeStructAdapter.prototype.fromModel = /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- * @param {?} time
- * @return {?}
- */
- function (time) {
- return (time && isInteger(time.hour) && isInteger(time.minute)) ?
- { hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : null } :
- null;
- };
- /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- */
- /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- * @param {?} time
- * @return {?}
- */
- NgbTimeStructAdapter.prototype.toModel = /**
- * Converts a NgbTimeStruct value into NgbTimeStruct value
- * @param {?} time
- * @return {?}
- */
- function (time) {
- return (time && isInteger(time.hour) && isInteger(time.minute)) ?
- { hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : null } :
- null;
- };
- NgbTimeStructAdapter.decorators = [
- { type: Injectable }
- ];
- return NgbTimeStructAdapter;
- }(NgbTimeAdapter));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * @param {?} locale
- * @return {?}
- */
- function NGB_TIMEPICKER_I18N_FACTORY(locale) {
- return new NgbTimepickerI18nDefault(locale);
- }
- /**
- * Type of the service supplying day periods (for example, 'AM' and 'PM') to NgbTimepicker component.
- * The default implementation of this service honors the Angular locale, and uses the registered locale data,
- * as explained in the Angular i18n guide.
- * @abstract
- */
- var NgbTimepickerI18n = /** @class */ (function () {
- function NgbTimepickerI18n() {
- }
- NgbTimepickerI18n.decorators = [
- { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_TIMEPICKER_I18N_FACTORY, deps: [LOCALE_ID] },] }
- ];
- /** @nocollapse */ NgbTimepickerI18n.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTimepickerI18n_Factory() { return NGB_TIMEPICKER_I18N_FACTORY(ɵɵinject(LOCALE_ID)); }, token: NgbTimepickerI18n, providedIn: "root" });
- return NgbTimepickerI18n;
- }());
- var NgbTimepickerI18nDefault = /** @class */ (function (_super) {
- __extends(NgbTimepickerI18nDefault, _super);
- function NgbTimepickerI18nDefault(locale) {
- var _this = _super.call(this) || this;
- _this._periods = getLocaleDayPeriods(locale, FormStyle.Standalone, TranslationWidth.Narrow);
- return _this;
- }
- /**
- * @return {?}
- */
- NgbTimepickerI18nDefault.prototype.getMorningPeriod = /**
- * @return {?}
- */
- function () { return this._periods[0]; };
- /**
- * @return {?}
- */
- NgbTimepickerI18nDefault.prototype.getAfternoonPeriod = /**
- * @return {?}
- */
- function () { return this._periods[1]; };
- NgbTimepickerI18nDefault.decorators = [
- { type: Injectable }
- ];
- /** @nocollapse */
- NgbTimepickerI18nDefault.ctorParameters = function () { return [
- { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
- ]; };
- return NgbTimepickerI18nDefault;
- }(NgbTimepickerI18n));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var FILTER_REGEX = /[^0-9]/g;
- /** @type {?} */
- var NGB_TIMEPICKER_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbTimepicker; })),
- multi: true
- };
- /**
- * A directive that helps with wth picking hours, minutes and seconds.
- */
- var NgbTimepicker = /** @class */ (function () {
- function NgbTimepicker(_config, _ngbTimeAdapter, _cd, i18n) {
- this._config = _config;
- this._ngbTimeAdapter = _ngbTimeAdapter;
- this._cd = _cd;
- this.i18n = i18n;
- this.onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.onTouched = (/**
- * @return {?}
- */
- function () { });
- this.meridian = _config.meridian;
- this.spinners = _config.spinners;
- this.seconds = _config.seconds;
- this.hourStep = _config.hourStep;
- this.minuteStep = _config.minuteStep;
- this.secondStep = _config.secondStep;
- this.disabled = _config.disabled;
- this.readonlyInputs = _config.readonlyInputs;
- this.size = _config.size;
- }
- Object.defineProperty(NgbTimepicker.prototype, "hourStep", {
- get: /**
- * @return {?}
- */
- function () { return this._hourStep; },
- /**
- * The number of hours to add/subtract when clicking hour spinners.
- */
- set: /**
- * The number of hours to add/subtract when clicking hour spinners.
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this._hourStep = isInteger(step) ? step : this._config.hourStep;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbTimepicker.prototype, "minuteStep", {
- get: /**
- * @return {?}
- */
- function () { return this._minuteStep; },
- /**
- * The number of minutes to add/subtract when clicking minute spinners.
- */
- set: /**
- * The number of minutes to add/subtract when clicking minute spinners.
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this._minuteStep = isInteger(step) ? step : this._config.minuteStep;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbTimepicker.prototype, "secondStep", {
- get: /**
- * @return {?}
- */
- function () { return this._secondStep; },
- /**
- * The number of seconds to add/subtract when clicking second spinners.
- */
- set: /**
- * The number of seconds to add/subtract when clicking second spinners.
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this._secondStep = isInteger(step) ? step : this._config.secondStep;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} value
- * @return {?}
- */
- NgbTimepicker.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- /** @type {?} */
- var structValue = this._ngbTimeAdapter.fromModel(value);
- this.model = structValue ? new NgbTime(structValue.hour, structValue.minute, structValue.second) : new NgbTime();
- if (!this.seconds && (!structValue || !isNumber(structValue.second))) {
- this.model.second = 0;
- }
- this._cd.markForCheck();
- };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbTimepicker.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbTimepicker.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this.onTouched = fn; };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbTimepicker.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) { this.disabled = isDisabled; };
- /**
- * @param {?} step
- * @return {?}
- */
- NgbTimepicker.prototype.changeHour = /**
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this.model.changeHour(step);
- this.propagateModelChange();
- };
- /**
- * @param {?} step
- * @return {?}
- */
- NgbTimepicker.prototype.changeMinute = /**
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this.model.changeMinute(step);
- this.propagateModelChange();
- };
- /**
- * @param {?} step
- * @return {?}
- */
- NgbTimepicker.prototype.changeSecond = /**
- * @param {?} step
- * @return {?}
- */
- function (step) {
- this.model.changeSecond(step);
- this.propagateModelChange();
- };
- /**
- * @param {?} newVal
- * @return {?}
- */
- NgbTimepicker.prototype.updateHour = /**
- * @param {?} newVal
- * @return {?}
- */
- function (newVal) {
- /** @type {?} */
- var isPM = this.model.hour >= 12;
- /** @type {?} */
- var enteredHour = toInteger(newVal);
- if (this.meridian && (isPM && enteredHour < 12 || !isPM && enteredHour === 12)) {
- this.model.updateHour(enteredHour + 12);
- }
- else {
- this.model.updateHour(enteredHour);
- }
- this.propagateModelChange();
- };
- /**
- * @param {?} newVal
- * @return {?}
- */
- NgbTimepicker.prototype.updateMinute = /**
- * @param {?} newVal
- * @return {?}
- */
- function (newVal) {
- this.model.updateMinute(toInteger(newVal));
- this.propagateModelChange();
- };
- /**
- * @param {?} newVal
- * @return {?}
- */
- NgbTimepicker.prototype.updateSecond = /**
- * @param {?} newVal
- * @return {?}
- */
- function (newVal) {
- this.model.updateSecond(toInteger(newVal));
- this.propagateModelChange();
- };
- /**
- * @return {?}
- */
- NgbTimepicker.prototype.toggleMeridian = /**
- * @return {?}
- */
- function () {
- if (this.meridian) {
- this.changeHour(12);
- }
- };
- /**
- * @param {?} input
- * @return {?}
- */
- NgbTimepicker.prototype.formatInput = /**
- * @param {?} input
- * @return {?}
- */
- function (input) { input.value = input.value.replace(FILTER_REGEX, ''); };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbTimepicker.prototype.formatHour = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- if (isNumber(value)) {
- if (this.meridian) {
- return padNumber(value % 12 === 0 ? 12 : value % 12);
- }
- else {
- return padNumber(value % 24);
- }
- }
- else {
- return padNumber(NaN);
- }
- };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbTimepicker.prototype.formatMinSec = /**
- * @param {?} value
- * @return {?}
- */
- function (value) { return padNumber(value); };
- Object.defineProperty(NgbTimepicker.prototype, "isSmallSize", {
- get: /**
- * @return {?}
- */
- function () { return this.size === 'small'; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(NgbTimepicker.prototype, "isLargeSize", {
- get: /**
- * @return {?}
- */
- function () { return this.size === 'large'; },
- enumerable: true,
- configurable: true
- });
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbTimepicker.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- if (changes['seconds'] && !this.seconds && this.model && !isNumber(this.model.second)) {
- this.model.second = 0;
- this.propagateModelChange(false);
- }
- };
- /**
- * @private
- * @param {?=} touched
- * @return {?}
- */
- NgbTimepicker.prototype.propagateModelChange = /**
- * @private
- * @param {?=} touched
- * @return {?}
- */
- function (touched) {
- if (touched === void 0) { touched = true; }
- if (touched) {
- this.onTouched();
- }
- if (this.model.isValid(this.seconds)) {
- this.onChange(this._ngbTimeAdapter.toModel({ hour: this.model.hour, minute: this.model.minute, second: this.model.second }));
- }
- else {
- this.onChange(this._ngbTimeAdapter.toModel(null));
- }
- };
- NgbTimepicker.decorators = [
- { type: Component, args: [{
- selector: 'ngb-timepicker',
- encapsulation: ViewEncapsulation.None,
- template: "\n <fieldset [disabled]=\"disabled\" [class.disabled]=\"disabled\">\n <div class=\"ngb-tp\">\n <div class=\"ngb-tp-input-container ngb-tp-hour\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(hourStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-hours\">Increment hours</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\"\n [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"HH\" i18n-placeholder=\"@@ngb.timepicker.HH\"\n [value]=\"formatHour(model?.hour)\" (change)=\"updateHour($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Hours\" i18n-aria-label=\"@@ngb.timepicker.hours\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeHour(hourStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeHour(-hourStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(-hourStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-hours\">Decrement hours</span>\n </button>\n </div>\n <div class=\"ngb-tp-spacer\">:</div>\n <div class=\"ngb-tp-input-container ngb-tp-minute\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(minuteStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-minutes\">Increment minutes</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"MM\" i18n-placeholder=\"@@ngb.timepicker.MM\"\n [value]=\"formatMinSec(model?.minute)\" (change)=\"updateMinute($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Minutes\" i18n-aria-label=\"@@ngb.timepicker.minutes\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeMinute(minuteStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeMinute(-minuteStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(-minuteStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-minutes\">Decrement minutes</span>\n </button>\n </div>\n <div *ngIf=\"seconds\" class=\"ngb-tp-spacer\">:</div>\n <div *ngIf=\"seconds\" class=\"ngb-tp-input-container ngb-tp-second\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(secondStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-seconds\">Increment seconds</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"SS\" i18n-placeholder=\"@@ngb.timepicker.SS\"\n [value]=\"formatMinSec(model?.second)\" (change)=\"updateSecond($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Seconds\" i18n-aria-label=\"@@ngb.timepicker.seconds\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeSecond(secondStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeSecond(-secondStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(-secondStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-seconds\">Decrement seconds</span>\n </button>\n </div>\n <div *ngIf=\"meridian\" class=\"ngb-tp-spacer\"></div>\n <div *ngIf=\"meridian\" class=\"ngb-tp-meridian\">\n <button type=\"button\" class=\"btn btn-outline-primary\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\"\n [disabled]=\"disabled\" [class.disabled]=\"disabled\"\n (click)=\"toggleMeridian()\">\n <ng-container *ngIf=\"model?.hour >= 12; else am\" i18n=\"@@ngb.timepicker.PM\">{{ i18n.getAfternoonPeriod() }}</ng-container>\n <ng-template #am i18n=\"@@ngb.timepicker.AM\">{{ i18n.getMorningPeriod() }}</ng-template>\n </button>\n </div>\n </div>\n </fieldset>\n ",
- providers: [NGB_TIMEPICKER_VALUE_ACCESSOR],
- styles: ["ngb-timepicker{font-size:1rem}.ngb-tp{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-tp-input-container{width:4em}.ngb-tp-chevron::before{border-style:solid;border-width:.29em .29em 0 0;content:\"\";display:inline-block;height:.69em;left:.05em;position:relative;top:.15em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);vertical-align:middle;width:.69em}.ngb-tp-chevron.bottom:before{top:-.3em;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ngb-tp-input{text-align:center}.ngb-tp-hour,.ngb-tp-meridian,.ngb-tp-minute,.ngb-tp-second{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ngb-tp-spacer{width:1em;text-align:center}"]
- }] }
- ];
- /** @nocollapse */
- NgbTimepicker.ctorParameters = function () { return [
- { type: NgbTimepickerConfig },
- { type: NgbTimeAdapter },
- { type: ChangeDetectorRef },
- { type: NgbTimepickerI18n }
- ]; };
- NgbTimepicker.propDecorators = {
- meridian: [{ type: Input }],
- spinners: [{ type: Input }],
- seconds: [{ type: Input }],
- hourStep: [{ type: Input }],
- minuteStep: [{ type: Input }],
- secondStep: [{ type: Input }],
- readonlyInputs: [{ type: Input }],
- size: [{ type: Input }]
- };
- return NgbTimepicker;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbTimepickerModule = /** @class */ (function () {
- function NgbTimepickerModule() {
- }
- NgbTimepickerModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbTimepicker], exports: [NgbTimepicker], imports: [CommonModule] },] }
- ];
- return NgbTimepickerModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Configuration service for the NgbToast component. You can inject this service, typically in your root component,
- * and customize the values of its properties in order to provide default values for all the toasts used in the
- * application.
- *
- * \@since 5.0.0
- */
- var NgbToastConfig = /** @class */ (function () {
- function NgbToastConfig() {
- this.autohide = true;
- this.delay = 500;
- this.ariaLive = 'polite';
- }
- NgbToastConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbToastConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbToastConfig_Factory() { return new NgbToastConfig(); }, token: NgbToastConfig, providedIn: "root" });
- return NgbToastConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * This directive allows the usage of HTML markup or other directives
- * inside of the toast's header.
- *
- * \@since 5.0.0
- */
- var NgbToastHeader = /** @class */ (function () {
- function NgbToastHeader() {
- }
- NgbToastHeader.decorators = [
- { type: Directive, args: [{ selector: '[ngbToastHeader]' },] }
- ];
- return NgbToastHeader;
- }());
- /**
- * Toasts provide feedback messages as notifications to the user.
- * Goal is to mimic the push notifications available both on mobile and desktop operating systems.
- *
- * \@since 5.0.0
- */
- var NgbToast = /** @class */ (function () {
- function NgbToast(ariaLive, config) {
- this.ariaLive = ariaLive;
- /**
- * A template like `<ng-template ngbToastHeader></ng-template>` can be
- * used in the projected content to allow markup usage.
- */
- this.contentHeaderTpl = null;
- /**
- * An event fired immediately when toast's `hide()` method has been called.
- * It can only occur in 2 different scenarios:
- * - `autohide` timeout fires
- * - user clicks on a closing cross (×)
- *
- * Additionally this output is purely informative. The toast won't disappear. It's up to the user to take care of
- * that.
- */
- this.hideOutput = new EventEmitter();
- if (this.ariaLive == null) {
- this.ariaLive = config.ariaLive;
- }
- this.delay = config.delay;
- this.autohide = config.autohide;
- }
- /**
- * @return {?}
- */
- NgbToast.prototype.ngAfterContentInit = /**
- * @return {?}
- */
- function () { this._init(); };
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbToast.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- if ('autohide' in changes) {
- this._clearTimeout();
- this._init();
- }
- };
- /**
- * @return {?}
- */
- NgbToast.prototype.hide = /**
- * @return {?}
- */
- function () {
- this._clearTimeout();
- this.hideOutput.emit();
- };
- /**
- * @private
- * @return {?}
- */
- NgbToast.prototype._init = /**
- * @private
- * @return {?}
- */
- function () {
- var _this = this;
- if (this.autohide && !this._timeoutID) {
- this._timeoutID = setTimeout((/**
- * @return {?}
- */
- function () { return _this.hide(); }), this.delay);
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbToast.prototype._clearTimeout = /**
- * @private
- * @return {?}
- */
- function () {
- if (this._timeoutID) {
- clearTimeout(this._timeoutID);
- this._timeoutID = null;
- }
- };
- NgbToast.decorators = [
- { type: Component, args: [{
- selector: 'ngb-toast',
- exportAs: 'ngbToast',
- encapsulation: ViewEncapsulation.None,
- host: {
- 'role': 'alert',
- '[attr.aria-live]': 'ariaLive',
- 'aria-atomic': 'true',
- '[class.toast]': 'true',
- '[class.show]': 'true',
- },
- template: "\n <ng-template #headerTpl>\n <strong class=\"mr-auto\">{{header}}</strong>\n </ng-template>\n <ng-template [ngIf]=\"contentHeaderTpl || header\">\n <div class=\"toast-header\">\n <ng-template [ngTemplateOutlet]=\"contentHeaderTpl || headerTpl\"></ng-template>\n <button type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.toast.close-aria\" (click)=\"hide()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n </ng-template>\n <div class=\"toast-body\">\n <ng-content></ng-content>\n </div>\n ",
- styles: [".ngb-toasts{position:fixed;top:0;right:0;margin:.5em;z-index:1200}ngb-toast .toast-header .close{margin-left:auto;margin-bottom:.25rem}"]
- }] }
- ];
- /** @nocollapse */
- NgbToast.ctorParameters = function () { return [
- { type: String, decorators: [{ type: Attribute, args: ['aria-live',] }] },
- { type: NgbToastConfig }
- ]; };
- NgbToast.propDecorators = {
- delay: [{ type: Input }],
- autohide: [{ type: Input }],
- header: [{ type: Input }],
- contentHeaderTpl: [{ type: ContentChild, args: [NgbToastHeader, { read: TemplateRef, static: true },] }],
- hideOutput: [{ type: Output, args: ['hide',] }]
- };
- return NgbToast;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbToastModule = /** @class */ (function () {
- function NgbToastModule() {
- }
- NgbToastModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbToast, NgbToastHeader], imports: [CommonModule], exports: [NgbToast, NgbToastHeader] },] }
- ];
- return NgbToastModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbTooltip`](#/components/tooltip/api#NgbTooltip) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the tooltips used in the application.
- */
- var NgbTooltipConfig = /** @class */ (function () {
- function NgbTooltipConfig() {
- this.autoClose = true;
- this.placement = 'auto';
- this.triggers = 'hover focus';
- this.disableTooltip = false;
- this.openDelay = 0;
- this.closeDelay = 0;
- }
- NgbTooltipConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbTooltipConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTooltipConfig_Factory() { return new NgbTooltipConfig(); }, token: NgbTooltipConfig, providedIn: "root" });
- return NgbTooltipConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextId$5 = 0;
- var NgbTooltipWindow = /** @class */ (function () {
- function NgbTooltipWindow() {
- }
- NgbTooltipWindow.decorators = [
- { type: Component, args: [{
- selector: 'ngb-tooltip-window',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: { '[class]': '"tooltip show" + (tooltipClass ? " " + tooltipClass : "")', 'role': 'tooltip', '[id]': 'id' },
- template: "<div class=\"arrow\"></div><div class=\"tooltip-inner\"><ng-content></ng-content></div>",
- styles: ["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{top:auto;bottom:.4rem}"]
- }] }
- ];
- NgbTooltipWindow.propDecorators = {
- id: [{ type: Input }],
- tooltipClass: [{ type: Input }]
- };
- return NgbTooltipWindow;
- }());
- /**
- * A lightweight and extensible directive for fancy tooltip creation.
- */
- var NgbTooltip = /** @class */ (function () {
- function NgbTooltip(_elementRef, _renderer, injector, componentFactoryResolver, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
- var _this = this;
- this._elementRef = _elementRef;
- this._renderer = _renderer;
- this._ngZone = _ngZone;
- this._document = _document;
- this._changeDetector = _changeDetector;
- /**
- * An event emitted when the tooltip is shown. Contains no payload.
- */
- this.shown = new EventEmitter();
- /**
- * An event emitted when the popover is hidden. Contains no payload.
- */
- this.hidden = new EventEmitter();
- this._ngbTooltipWindowId = "ngb-tooltip-" + nextId$5++;
- this.autoClose = config.autoClose;
- this.placement = config.placement;
- this.triggers = config.triggers;
- this.container = config.container;
- this.disableTooltip = config.disableTooltip;
- this.tooltipClass = config.tooltipClass;
- this.openDelay = config.openDelay;
- this.closeDelay = config.closeDelay;
- this._popupService = new PopupService(NgbTooltipWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
- this._zoneSubscription = _ngZone.onStable.subscribe((/**
- * @return {?}
- */
- function () {
- if (_this._windowRef) {
- positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body', 'bs-tooltip');
- }
- }));
- }
- Object.defineProperty(NgbTooltip.prototype, "ngbTooltip", {
- get: /**
- * @return {?}
- */
- function () { return this._ngbTooltip; },
- /**
- * The string content or a `TemplateRef` for the content to be displayed in the tooltip.
- *
- * If the content if falsy, the tooltip won't open.
- */
- set: /**
- * The string content or a `TemplateRef` for the content to be displayed in the tooltip.
- *
- * If the content if falsy, the tooltip won't open.
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._ngbTooltip = value;
- if (!value && this._windowRef) {
- this.close();
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Opens the tooltip.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the tooltip template when it is created.
- */
- /**
- * Opens the tooltip.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the tooltip template when it is created.
- * @param {?=} context
- * @return {?}
- */
- NgbTooltip.prototype.open = /**
- * Opens the tooltip.
- *
- * This is considered to be a "manual" triggering.
- * The `context` is an optional value to be injected into the tooltip template when it is created.
- * @param {?=} context
- * @return {?}
- */
- function (context) {
- var _this = this;
- if (!this._windowRef && this._ngbTooltip && !this.disableTooltip) {
- this._windowRef = this._popupService.open(this._ngbTooltip, context);
- this._windowRef.instance.tooltipClass = this.tooltipClass;
- this._windowRef.instance.id = this._ngbTooltipWindowId;
- this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbTooltipWindowId);
- if (this.container === 'body') {
- this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
- }
- // We need to detect changes, because we don't know where .open() might be called from.
- // Ex. opening tooltip from one of lifecycle hooks that run after the CD
- // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception
- this._windowRef.changeDetectorRef.detectChanges();
- // We need to mark for check, because tooltip won't work inside the OnPush component.
- // Ex. when we use expression like `{{ tooltip.isOpen() : 'opened' : 'closed' }}`
- // inside the template of an OnPush component and we change the tooltip from
- // open -> closed, the expression in question won't be updated unless we explicitly
- // mark the parent component to be checked.
- this._windowRef.changeDetectorRef.markForCheck();
- ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
- * @return {?}
- */
- function () { return _this.close(); }), this.hidden, [this._windowRef.location.nativeElement]);
- this.shown.emit();
- }
- };
- /**
- * Closes the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- */
- /**
- * Closes the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- * @return {?}
- */
- NgbTooltip.prototype.close = /**
- * Closes the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- * @return {?}
- */
- function () {
- if (this._windowRef != null) {
- this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
- this._popupService.close();
- this._windowRef = null;
- this.hidden.emit();
- this._changeDetector.markForCheck();
- }
- };
- /**
- * Toggles the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- */
- /**
- * Toggles the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- * @return {?}
- */
- NgbTooltip.prototype.toggle = /**
- * Toggles the tooltip.
- *
- * This is considered to be a "manual" triggering of the tooltip.
- * @return {?}
- */
- function () {
- if (this._windowRef) {
- this.close();
- }
- else {
- this.open();
- }
- };
- /**
- * Returns `true`, if the popover is currently shown.
- */
- /**
- * Returns `true`, if the popover is currently shown.
- * @return {?}
- */
- NgbTooltip.prototype.isOpen = /**
- * Returns `true`, if the popover is currently shown.
- * @return {?}
- */
- function () { return this._windowRef != null; };
- /**
- * @return {?}
- */
- NgbTooltip.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- this._unregisterListenersFn = listenToTriggers(this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this), this.close.bind(this), +this.openDelay, +this.closeDelay);
- };
- /**
- * @param {?} __0
- * @return {?}
- */
- NgbTooltip.prototype.ngOnChanges = /**
- * @param {?} __0
- * @return {?}
- */
- function (_a) {
- var tooltipClass = _a.tooltipClass;
- if (tooltipClass && this.isOpen()) {
- this._windowRef.instance.tooltipClass = tooltipClass.currentValue;
- }
- };
- /**
- * @return {?}
- */
- NgbTooltip.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this.close();
- // This check is needed as it might happen that ngOnDestroy is called before ngOnInit
- // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199
- if (this._unregisterListenersFn) {
- this._unregisterListenersFn();
- }
- this._zoneSubscription.unsubscribe();
- };
- NgbTooltip.decorators = [
- { type: Directive, args: [{ selector: '[ngbTooltip]', exportAs: 'ngbTooltip' },] }
- ];
- /** @nocollapse */
- NgbTooltip.ctorParameters = function () { return [
- { type: ElementRef },
- { type: Renderer2 },
- { type: Injector },
- { type: ComponentFactoryResolver },
- { type: ViewContainerRef },
- { type: NgbTooltipConfig },
- { type: NgZone },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: ChangeDetectorRef },
- { type: ApplicationRef }
- ]; };
- NgbTooltip.propDecorators = {
- autoClose: [{ type: Input }],
- placement: [{ type: Input }],
- triggers: [{ type: Input }],
- container: [{ type: Input }],
- disableTooltip: [{ type: Input }],
- tooltipClass: [{ type: Input }],
- openDelay: [{ type: Input }],
- closeDelay: [{ type: Input }],
- shown: [{ type: Output }],
- hidden: [{ type: Output }],
- ngbTooltip: [{ type: Input }]
- };
- return NgbTooltip;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbTooltipModule = /** @class */ (function () {
- function NgbTooltipModule() {
- }
- NgbTooltipModule.decorators = [
- { type: NgModule, args: [{ declarations: [NgbTooltip, NgbTooltipWindow], exports: [NgbTooltip], entryComponents: [NgbTooltipWindow] },] }
- ];
- return NgbTooltipModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A component that helps with text highlighting.
- *
- * If splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify
- * highlighting:
- *
- * Ex. `result="Alaska"` and `term="as"` will produce `Al<span class="ngb-highlight">as</span>ka`.
- */
- var NgbHighlight = /** @class */ (function () {
- function NgbHighlight() {
- /**
- * The CSS class for `<span>` elements wrapping the `term` inside the `result`.
- */
- this.highlightClass = 'ngb-highlight';
- }
- /**
- * @param {?} changes
- * @return {?}
- */
- NgbHighlight.prototype.ngOnChanges = /**
- * @param {?} changes
- * @return {?}
- */
- function (changes) {
- /** @type {?} */
- var result = toString(this.result);
- /** @type {?} */
- var terms = Array.isArray(this.term) ? this.term : [this.term];
- /** @type {?} */
- var escapedTerms = terms.map((/**
- * @param {?} term
- * @return {?}
- */
- function (term) { return regExpEscape(toString(term)); })).filter((/**
- * @param {?} term
- * @return {?}
- */
- function (term) { return term; }));
- this.parts = escapedTerms.length ? result.split(new RegExp("(" + escapedTerms.join('|') + ")", 'gmi')) : [result];
- };
- NgbHighlight.decorators = [
- { type: Component, args: [{
- selector: 'ngb-highlight',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- template: "<ng-template ngFor [ngForOf]=\"parts\" let-part let-isOdd=\"odd\">" +
- "<span *ngIf=\"isOdd; else even\" [class]=\"highlightClass\">{{part}}</span><ng-template #even>{{part}}</ng-template>" +
- "</ng-template>",
- styles: [".ngb-highlight{font-weight:700}"]
- }] }
- ];
- NgbHighlight.propDecorators = {
- highlightClass: [{ type: Input }],
- result: [{ type: Input }],
- term: [{ type: Input }]
- };
- return NgbHighlight;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbTypeaheadWindow = /** @class */ (function () {
- function NgbTypeaheadWindow() {
- this.activeIdx = 0;
- /**
- * Flag indicating if the first row should be active initially
- */
- this.focusFirst = true;
- /**
- * A function used to format a given result before display. This function should return a formatted string without any
- * HTML markup
- */
- this.formatter = toString;
- /**
- * Event raised when user selects a particular result row
- */
- this.selectEvent = new EventEmitter();
- this.activeChangeEvent = new EventEmitter();
- }
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.hasActive = /**
- * @return {?}
- */
- function () { return this.activeIdx > -1 && this.activeIdx < this.results.length; };
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.getActive = /**
- * @return {?}
- */
- function () { return this.results[this.activeIdx]; };
- /**
- * @param {?} activeIdx
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.markActive = /**
- * @param {?} activeIdx
- * @return {?}
- */
- function (activeIdx) {
- this.activeIdx = activeIdx;
- this._activeChanged();
- };
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.next = /**
- * @return {?}
- */
- function () {
- if (this.activeIdx === this.results.length - 1) {
- this.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;
- }
- else {
- this.activeIdx++;
- }
- this._activeChanged();
- };
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.prev = /**
- * @return {?}
- */
- function () {
- if (this.activeIdx < 0) {
- this.activeIdx = this.results.length - 1;
- }
- else if (this.activeIdx === 0) {
- this.activeIdx = this.focusFirst ? this.results.length - 1 : -1;
- }
- else {
- this.activeIdx--;
- }
- this._activeChanged();
- };
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.resetActive = /**
- * @return {?}
- */
- function () {
- this.activeIdx = this.focusFirst ? 0 : -1;
- this._activeChanged();
- };
- /**
- * @param {?} item
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.select = /**
- * @param {?} item
- * @return {?}
- */
- function (item) { this.selectEvent.emit(item); };
- /**
- * @return {?}
- */
- NgbTypeaheadWindow.prototype.ngOnInit = /**
- * @return {?}
- */
- function () { this.resetActive(); };
- /**
- * @private
- * @return {?}
- */
- NgbTypeaheadWindow.prototype._activeChanged = /**
- * @private
- * @return {?}
- */
- function () {
- this.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);
- };
- NgbTypeaheadWindow.decorators = [
- { type: Component, args: [{
- selector: 'ngb-typeahead-window',
- exportAs: 'ngbTypeaheadWindow',
- encapsulation: ViewEncapsulation.None,
- host: { '(mousedown)': '$event.preventDefault()', 'class': 'dropdown-menu show', 'role': 'listbox', '[id]': 'id' },
- template: "\n <ng-template #rt let-result=\"result\" let-term=\"term\" let-formatter=\"formatter\">\n <ngb-highlight [result]=\"formatter(result)\" [term]=\"term\"></ngb-highlight>\n </ng-template>\n <ng-template ngFor [ngForOf]=\"results\" let-result let-idx=\"index\">\n <button type=\"button\" class=\"dropdown-item\" role=\"option\"\n [id]=\"id + '-' + idx\"\n [class.active]=\"idx === activeIdx\"\n (mouseenter)=\"markActive(idx)\"\n (click)=\"select(result)\">\n <ng-template [ngTemplateOutlet]=\"resultTemplate || rt\"\n [ngTemplateOutletContext]=\"{result: result, term: term, formatter: formatter}\"></ng-template>\n </button>\n </ng-template>\n "
- }] }
- ];
- NgbTypeaheadWindow.propDecorators = {
- id: [{ type: Input }],
- focusFirst: [{ type: Input }],
- results: [{ type: Input }],
- term: [{ type: Input }],
- formatter: [{ type: Input }],
- resultTemplate: [{ type: Input }],
- selectEvent: [{ type: Output, args: ['select',] }],
- activeChangeEvent: [{ type: Output, args: ['activeChange',] }]
- };
- return NgbTypeaheadWindow;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var ARIA_LIVE_DELAY = new InjectionToken('live announcer delay', { providedIn: 'root', factory: ARIA_LIVE_DELAY_FACTORY });
- /**
- * @return {?}
- */
- function ARIA_LIVE_DELAY_FACTORY() {
- return 100;
- }
- /**
- * @param {?} document
- * @param {?=} lazyCreate
- * @return {?}
- */
- function getLiveElement(document, lazyCreate) {
- if (lazyCreate === void 0) { lazyCreate = false; }
- /** @type {?} */
- var element = (/** @type {?} */ (document.body.querySelector('#ngb-live')));
- if (element == null && lazyCreate) {
- element = document.createElement('div');
- element.setAttribute('id', 'ngb-live');
- element.setAttribute('aria-live', 'polite');
- element.setAttribute('aria-atomic', 'true');
- element.classList.add('sr-only');
- document.body.appendChild(element);
- }
- return element;
- }
- var Live = /** @class */ (function () {
- function Live(_document, _delay) {
- this._document = _document;
- this._delay = _delay;
- }
- /**
- * @return {?}
- */
- Live.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- /** @type {?} */
- var element = getLiveElement(this._document);
- if (element) {
- element.parentElement.removeChild(element);
- }
- };
- /**
- * @param {?} message
- * @return {?}
- */
- Live.prototype.say = /**
- * @param {?} message
- * @return {?}
- */
- function (message) {
- /** @type {?} */
- var element = getLiveElement(this._document, true);
- /** @type {?} */
- var delay = this._delay;
- element.textContent = '';
- /** @type {?} */
- var setText = (/**
- * @return {?}
- */
- function () { return element.textContent = message; });
- if (delay === null) {
- setText();
- }
- else {
- setTimeout(setText, delay);
- }
- };
- Live.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */
- Live.ctorParameters = function () { return [
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: undefined, decorators: [{ type: Inject, args: [ARIA_LIVE_DELAY,] }] }
- ]; };
- /** @nocollapse */ Live.ngInjectableDef = ɵɵdefineInjectable({ factory: function Live_Factory() { return new Live(ɵɵinject(DOCUMENT), ɵɵinject(ARIA_LIVE_DELAY)); }, token: Live, providedIn: "root" });
- return Live;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * A configuration service for the [`NgbTypeahead`](#/components/typeahead/api#NgbTypeahead) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the typeaheads used in the application.
- */
- var NgbTypeaheadConfig = /** @class */ (function () {
- function NgbTypeaheadConfig() {
- this.editable = true;
- this.focusFirst = true;
- this.showHint = false;
- this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
- }
- NgbTypeaheadConfig.decorators = [
- { type: Injectable, args: [{ providedIn: 'root' },] }
- ];
- /** @nocollapse */ NgbTypeaheadConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTypeaheadConfig_Factory() { return new NgbTypeaheadConfig(); }, token: NgbTypeaheadConfig, providedIn: "root" });
- return NgbTypeaheadConfig;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_TYPEAHEAD_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef((/**
- * @return {?}
- */
- function () { return NgbTypeahead; })),
- multi: true
- };
- /** @type {?} */
- var nextWindowId = 0;
- /**
- * A directive providing a simple way of creating powerful typeaheads from any text input.
- */
- var NgbTypeahead = /** @class */ (function () {
- function NgbTypeahead(_elementRef, viewContainerRef, _renderer, injector, componentFactoryResolver, config, ngZone, _live, _document, _ngZone, _changeDetector, applicationRef) {
- var _this = this;
- this._elementRef = _elementRef;
- this._renderer = _renderer;
- this._live = _live;
- this._document = _document;
- this._ngZone = _ngZone;
- this._changeDetector = _changeDetector;
- this._closed$ = new Subject();
- /**
- * The value for the `autocomplete` attribute for the `<input>` element.
- *
- * Defaults to `"off"` to disable the native browser autocomplete, but you can override it if necessary.
- *
- * \@since 2.1.0
- */
- this.autocomplete = 'off';
- /**
- * The preferred placement of the typeahead.
- *
- * Possible values are `"top"`, `"top-left"`, `"top-right"`, `"bottom"`, `"bottom-left"`,
- * `"bottom-right"`, `"left"`, `"left-top"`, `"left-bottom"`, `"right"`, `"right-top"`,
- * `"right-bottom"`
- *
- * Accepts an array of strings or a string with space separated possible values.
- *
- * The default order of preference is `"bottom-left bottom-right top-left top-right"`
- *
- * Please see the [positioning overview](#/positioning) for more details.
- */
- this.placement = 'bottom-left';
- /**
- * An event emitted right before an item is selected from the result list.
- *
- * Event payload is of type [`NgbTypeaheadSelectItemEvent`](#/components/typeahead/api#NgbTypeaheadSelectItemEvent).
- */
- this.selectItem = new EventEmitter();
- this.popupId = "ngb-typeahead-" + nextWindowId++;
- this._onTouched = (/**
- * @return {?}
- */
- function () { });
- this._onChange = (/**
- * @param {?} _
- * @return {?}
- */
- function (_) { });
- this.container = config.container;
- this.editable = config.editable;
- this.focusFirst = config.focusFirst;
- this.showHint = config.showHint;
- this.placement = config.placement;
- this._valueChanges = fromEvent(_elementRef.nativeElement, 'input')
- .pipe(map((/**
- * @param {?} $event
- * @return {?}
- */
- function ($event) { return ((/** @type {?} */ ($event.target))).value; })));
- this._resubscribeTypeahead = new BehaviorSubject(null);
- this._popupService = new PopupService(NgbTypeaheadWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
- this._zoneSubscription = ngZone.onStable.subscribe((/**
- * @return {?}
- */
- function () {
- if (_this.isPopupOpen()) {
- positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body');
- }
- }));
- }
- /**
- * @return {?}
- */
- NgbTypeahead.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- /** @type {?} */
- var inputValues$ = this._valueChanges.pipe(tap((/**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- _this._inputValueBackup = _this.showHint ? value : null;
- _this._onChange(_this.editable ? value : undefined);
- })));
- /** @type {?} */
- var results$ = inputValues$.pipe(this.ngbTypeahead);
- /** @type {?} */
- var userInput$ = this._resubscribeTypeahead.pipe(switchMap((/**
- * @return {?}
- */
- function () { return results$; })));
- this._subscription = this._subscribeToUserInput(userInput$);
- };
- /**
- * @return {?}
- */
- NgbTypeahead.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this._closePopup();
- this._unsubscribeFromUserInput();
- this._zoneSubscription.unsubscribe();
- };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbTypeahead.prototype.registerOnChange = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._onChange = fn; };
- /**
- * @param {?} fn
- * @return {?}
- */
- NgbTypeahead.prototype.registerOnTouched = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._onTouched = fn; };
- /**
- * @param {?} value
- * @return {?}
- */
- NgbTypeahead.prototype.writeValue = /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._writeInputValue(this._formatItemForInput(value));
- if (this.showHint) {
- this._inputValueBackup = value;
- }
- };
- /**
- * @param {?} isDisabled
- * @return {?}
- */
- NgbTypeahead.prototype.setDisabledState = /**
- * @param {?} isDisabled
- * @return {?}
- */
- function (isDisabled) {
- this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
- };
- /**
- * Dismisses typeahead popup window
- */
- /**
- * Dismisses typeahead popup window
- * @return {?}
- */
- NgbTypeahead.prototype.dismissPopup = /**
- * Dismisses typeahead popup window
- * @return {?}
- */
- function () {
- if (this.isPopupOpen()) {
- this._resubscribeTypeahead.next(null);
- this._closePopup();
- if (this.showHint && this._inputValueBackup !== null) {
- this._writeInputValue(this._inputValueBackup);
- }
- this._changeDetector.markForCheck();
- }
- };
- /**
- * Returns true if the typeahead popup window is displayed
- */
- /**
- * Returns true if the typeahead popup window is displayed
- * @return {?}
- */
- NgbTypeahead.prototype.isPopupOpen = /**
- * Returns true if the typeahead popup window is displayed
- * @return {?}
- */
- function () { return this._windowRef != null; };
- /**
- * @return {?}
- */
- NgbTypeahead.prototype.handleBlur = /**
- * @return {?}
- */
- function () {
- this._resubscribeTypeahead.next(null);
- this._onTouched();
- };
- /**
- * @param {?} event
- * @return {?}
- */
- NgbTypeahead.prototype.handleKeyDown = /**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- if (!this.isPopupOpen()) {
- return;
- }
- // tslint:disable-next-line:deprecation
- switch (event.which) {
- case Key.ArrowDown:
- event.preventDefault();
- this._windowRef.instance.next();
- this._showHint();
- break;
- case Key.ArrowUp:
- event.preventDefault();
- this._windowRef.instance.prev();
- this._showHint();
- break;
- case Key.Enter:
- case Key.Tab:
- /** @type {?} */
- var result = this._windowRef.instance.getActive();
- if (isDefined(result)) {
- event.preventDefault();
- event.stopPropagation();
- this._selectResult(result);
- }
- this._closePopup();
- break;
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbTypeahead.prototype._openPopup = /**
- * @private
- * @return {?}
- */
- function () {
- var _this = this;
- if (!this.isPopupOpen()) {
- this._inputValueBackup = this._elementRef.nativeElement.value;
- this._windowRef = this._popupService.open();
- this._windowRef.instance.id = this.popupId;
- this._windowRef.instance.selectEvent.subscribe((/**
- * @param {?} result
- * @return {?}
- */
- function (result) { return _this._selectResultClosePopup(result); }));
- this._windowRef.instance.activeChangeEvent.subscribe((/**
- * @param {?} activeId
- * @return {?}
- */
- function (activeId) { return _this.activeDescendant = activeId; }));
- if (this.container === 'body') {
- window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
- }
- this._changeDetector.markForCheck();
- ngbAutoClose(this._ngZone, this._document, 'outside', (/**
- * @return {?}
- */
- function () { return _this.dismissPopup(); }), this._closed$, [this._elementRef.nativeElement, this._windowRef.location.nativeElement]);
- }
- };
- /**
- * @private
- * @return {?}
- */
- NgbTypeahead.prototype._closePopup = /**
- * @private
- * @return {?}
- */
- function () {
- this._closed$.next();
- this._popupService.close();
- this._windowRef = null;
- this.activeDescendant = undefined;
- };
- /**
- * @private
- * @param {?} result
- * @return {?}
- */
- NgbTypeahead.prototype._selectResult = /**
- * @private
- * @param {?} result
- * @return {?}
- */
- function (result) {
- /** @type {?} */
- var defaultPrevented = false;
- this.selectItem.emit({ item: result, preventDefault: (/**
- * @return {?}
- */
- function () { defaultPrevented = true; }) });
- this._resubscribeTypeahead.next(null);
- if (!defaultPrevented) {
- this.writeValue(result);
- this._onChange(result);
- }
- };
- /**
- * @private
- * @param {?} result
- * @return {?}
- */
- NgbTypeahead.prototype._selectResultClosePopup = /**
- * @private
- * @param {?} result
- * @return {?}
- */
- function (result) {
- this._selectResult(result);
- this._closePopup();
- };
- /**
- * @private
- * @return {?}
- */
- NgbTypeahead.prototype._showHint = /**
- * @private
- * @return {?}
- */
- function () {
- if (this.showHint && this._windowRef.instance.hasActive() && this._inputValueBackup != null) {
- /** @type {?} */
- var userInputLowerCase = this._inputValueBackup.toLowerCase();
- /** @type {?} */
- var formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());
- if (userInputLowerCase === formattedVal.substr(0, this._inputValueBackup.length).toLowerCase()) {
- this._writeInputValue(this._inputValueBackup + formattedVal.substr(this._inputValueBackup.length));
- this._elementRef.nativeElement['setSelectionRange'].apply(this._elementRef.nativeElement, [this._inputValueBackup.length, formattedVal.length]);
- }
- else {
- this._writeInputValue(formattedVal);
- }
- }
- };
- /**
- * @private
- * @param {?} item
- * @return {?}
- */
- NgbTypeahead.prototype._formatItemForInput = /**
- * @private
- * @param {?} item
- * @return {?}
- */
- function (item) {
- return item != null && this.inputFormatter ? this.inputFormatter(item) : toString(item);
- };
- /**
- * @private
- * @param {?} value
- * @return {?}
- */
- NgbTypeahead.prototype._writeInputValue = /**
- * @private
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._renderer.setProperty(this._elementRef.nativeElement, 'value', toString(value));
- };
- /**
- * @private
- * @param {?} userInput$
- * @return {?}
- */
- NgbTypeahead.prototype._subscribeToUserInput = /**
- * @private
- * @param {?} userInput$
- * @return {?}
- */
- function (userInput$) {
- var _this = this;
- return userInput$.subscribe((/**
- * @param {?} results
- * @return {?}
- */
- function (results) {
- if (!results || results.length === 0) {
- _this._closePopup();
- }
- else {
- _this._openPopup();
- _this._windowRef.instance.focusFirst = _this.focusFirst;
- _this._windowRef.instance.results = results;
- _this._windowRef.instance.term = _this._elementRef.nativeElement.value;
- if (_this.resultFormatter) {
- _this._windowRef.instance.formatter = _this.resultFormatter;
- }
- if (_this.resultTemplate) {
- _this._windowRef.instance.resultTemplate = _this.resultTemplate;
- }
- _this._windowRef.instance.resetActive();
- // The observable stream we are subscribing to might have async steps
- // and if a component containing typeahead is using the OnPush strategy
- // the change detection turn wouldn't be invoked automatically.
- _this._windowRef.changeDetectorRef.detectChanges();
- _this._showHint();
- }
- // live announcer
- /** @type {?} */
- var count = results ? results.length : 0;
- _this._live.say(count === 0 ? 'No results available' : count + " result" + (count === 1 ? '' : 's') + " available");
- }));
- };
- /**
- * @private
- * @return {?}
- */
- NgbTypeahead.prototype._unsubscribeFromUserInput = /**
- * @private
- * @return {?}
- */
- function () {
- if (this._subscription) {
- this._subscription.unsubscribe();
- }
- this._subscription = null;
- };
- NgbTypeahead.decorators = [
- { type: Directive, args: [{
- selector: 'input[ngbTypeahead]',
- exportAs: 'ngbTypeahead',
- host: {
- '(blur)': 'handleBlur()',
- '[class.open]': 'isPopupOpen()',
- '(keydown)': 'handleKeyDown($event)',
- '[autocomplete]': 'autocomplete',
- 'autocapitalize': 'off',
- 'autocorrect': 'off',
- 'role': 'combobox',
- 'aria-multiline': 'false',
- '[attr.aria-autocomplete]': 'showHint ? "both" : "list"',
- '[attr.aria-activedescendant]': 'activeDescendant',
- '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',
- '[attr.aria-expanded]': 'isPopupOpen()'
- },
- providers: [NGB_TYPEAHEAD_VALUE_ACCESSOR]
- },] }
- ];
- /** @nocollapse */
- NgbTypeahead.ctorParameters = function () { return [
- { type: ElementRef },
- { type: ViewContainerRef },
- { type: Renderer2 },
- { type: Injector },
- { type: ComponentFactoryResolver },
- { type: NgbTypeaheadConfig },
- { type: NgZone },
- { type: Live },
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
- { type: NgZone },
- { type: ChangeDetectorRef },
- { type: ApplicationRef }
- ]; };
- NgbTypeahead.propDecorators = {
- autocomplete: [{ type: Input }],
- container: [{ type: Input }],
- editable: [{ type: Input }],
- focusFirst: [{ type: Input }],
- inputFormatter: [{ type: Input }],
- ngbTypeahead: [{ type: Input }],
- resultFormatter: [{ type: Input }],
- resultTemplate: [{ type: Input }],
- showHint: [{ type: Input }],
- placement: [{ type: Input }],
- selectItem: [{ type: Output }]
- };
- return NgbTypeahead;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var NgbTypeaheadModule = /** @class */ (function () {
- function NgbTypeaheadModule() {
- }
- NgbTypeaheadModule.decorators = [
- { type: NgModule, args: [{
- declarations: [NgbTypeahead, NgbHighlight, NgbTypeaheadWindow],
- exports: [NgbTypeahead, NgbHighlight],
- imports: [CommonModule],
- entryComponents: [NgbTypeaheadWindow]
- },] }
- ];
- return NgbTypeaheadModule;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var NGB_MODULES = [
- NgbAccordionModule, NgbAlertModule, NgbButtonsModule, NgbCarouselModule, NgbCollapseModule, NgbDatepickerModule,
- NgbDropdownModule, NgbModalModule, NgbNavModule, NgbPaginationModule, NgbPopoverModule, NgbProgressbarModule,
- NgbRatingModule, NgbTabsetModule, NgbTimepickerModule, NgbToastModule, NgbTooltipModule, NgbTypeaheadModule
- ];
- var NgbModule = /** @class */ (function () {
- function NgbModule() {
- }
- NgbModule.decorators = [
- { type: NgModule, args: [{ imports: NGB_MODULES, exports: NGB_MODULES },] }
- ];
- return NgbModule;
- }());
- export { ModalDismissReasons, NgbAccordion, NgbAccordionConfig, NgbAccordionModule, NgbActiveModal, NgbAlert, NgbAlertConfig, NgbAlertModule, NgbButtonLabel, NgbButtonsModule, NgbCalendar, NgbCalendarGregorian, NgbCalendarHebrew, NgbCalendarIslamicCivil, NgbCalendarIslamicUmalqura, NgbCalendarPersian, NgbCarousel, NgbCarouselConfig, NgbCarouselModule, NgbCheckBox, NgbCollapse, NgbCollapseModule, NgbDate, NgbDateAdapter, NgbDateNativeAdapter, NgbDateNativeUTCAdapter, NgbDateParserFormatter, NgbDatepicker, NgbDatepickerConfig, NgbDatepickerI18n, NgbDatepickerI18nHebrew, NgbDatepickerKeyboardService, NgbDatepickerModule, NgbDropdown, NgbDropdownAnchor, NgbDropdownConfig, NgbDropdownItem, NgbDropdownMenu, NgbDropdownModule, NgbDropdownToggle, NgbHighlight, NgbInputDatepicker, NgbInputDatepickerConfig, NgbModal, NgbModalConfig, NgbModalModule, NgbModalRef, NgbModule, NgbNav, NgbNavConfig, NgbNavContent, NgbNavItem, NgbNavLink, NgbNavModule, NgbNavOutlet, NgbNavbar, NgbPagination, NgbPaginationConfig, NgbPaginationEllipsis, NgbPaginationFirst, NgbPaginationLast, NgbPaginationModule, NgbPaginationNext, NgbPaginationNumber, NgbPaginationPrevious, NgbPanel, NgbPanelContent, NgbPanelHeader, NgbPanelTitle, NgbPanelToggle, NgbPopover, NgbPopoverConfig, NgbPopoverModule, NgbProgressbar, NgbProgressbarConfig, NgbProgressbarModule, NgbRadio, NgbRadioGroup, NgbRating, NgbRatingConfig, NgbRatingModule, NgbSlide, NgbSlideEventDirection, NgbSlideEventSource, NgbTab, NgbTabContent, NgbTabTitle, NgbTabset, NgbTabsetConfig, NgbTabsetModule, NgbTimeAdapter, NgbTimepicker, NgbTimepickerConfig, NgbTimepickerI18n, NgbTimepickerModule, NgbToast, NgbToastConfig, NgbToastHeader, NgbToastModule, NgbTooltip, NgbTooltipConfig, NgbTooltipModule, NgbTypeahead, NgbTypeaheadConfig, NgbTypeaheadModule, NGB_CAROUSEL_DIRECTIVES as ɵa, NGB_DATEPICKER_CALENDAR_FACTORY as ɵb, Live as ɵba, NgbCalendarHijri as ɵbb, ContentRef as ɵbc, NgbDatepickerMonthView as ɵc, NgbDatepickerDayView as ɵd, NgbDatepickerNavigation as ɵe, NgbDatepickerNavigationSelect as ɵf, NGB_DATEPICKER_18N_FACTORY as ɵg, NgbDatepickerI18nDefault as ɵh, NGB_DATEPICKER_DATE_ADAPTER_FACTORY as ɵi, NgbDateStructAdapter as ɵj, NGB_DATEPICKER_PARSER_FORMATTER_FACTORY as ɵk, NgbDateISOParserFormatter as ɵl, NgbPopoverWindow as ɵm, NGB_DATEPICKER_TIME_ADAPTER_FACTORY as ɵn, NgbTimeStructAdapter as ɵo, NGB_TIMEPICKER_I18N_FACTORY as ɵp, NgbTimepickerI18nDefault as ɵq, NgbTooltipWindow as ɵr, NgbTypeaheadWindow as ɵs, NgbDatepickerService as ɵt, NgbModalBackdrop as ɵu, NgbModalWindow as ɵv, NgbModalStack as ɵw, ScrollBar as ɵx, ARIA_LIVE_DELAY as ɵy, ARIA_LIVE_DELAY_FACTORY as ɵz };
- //# sourceMappingURL=ng-bootstrap.js.map
|