| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308 |
- package app
- // Code generated by go generate; DO NOT EDIT.
- import (
- "fmt"
- "strings"
- )
- // HTMLA is the interface that describes a "a" HTML element.
- type HTMLA interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLA
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLA
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLA
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLA
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLA
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLA
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLA
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLA
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLA
- // Download specifies that the target will be downloaded when a user clicks on the hyperlink.
- Download(v string) HTMLA
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLA
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLA
- // Href specifies the URL of the page the link goes to.
- Href(v string) HTMLA
- // HrefLang specifies the language of the linked document.
- HrefLang(v string) HTMLA
- // ID specifies a unique id for an element.
- ID(v string) HTMLA
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLA
- // Media specifies what media/device the linked document is optimized for.
- Media(v string) HTMLA
- // Ping specifies a list of URLs to be notified if the user follows the hyperlink.
- Ping(v string) HTMLA
- // Rel specifies the relationship between the current document and the linked document.
- Rel(v string) HTMLA
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLA
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLA
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLA
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLA
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLA
- // Target specifies the target for where to open the linked document or where to submit the form.
- Target(v string) HTMLA
- // Title specifies extra information about an element.
- Title(v string) HTMLA
- // Type specifies the type of element.
- Type(v string) HTMLA
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLA
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLA
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLA
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLA
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLA
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLA
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLA
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLA
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLA
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLA
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLA
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLA
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLA
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLA
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLA
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLA
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLA
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLA
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLA
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLA
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLA
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLA
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLA
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLA
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLA
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLA
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLA
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLA
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLA
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLA
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLA
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLA
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLA
- }
- // A returns an HTML element that defines a hyperlink.
- func A() HTMLA {
- e := &htmlA{
- htmlElement: htmlElement{
- tag: "a",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlA struct {
- htmlElement
- }
- func (e *htmlA) Body(v ...UI) HTMLA {
- e.setChildren(v...)
- return e
- }
- func (e *htmlA) Text(v any) HTMLA {
- return e.Body(Text(v))
- }
- func (e *htmlA) AccessKey(v string) HTMLA {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlA) Aria(k string, v any) HTMLA {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlA) Attr(n string, v any) HTMLA {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlA) Class(v ...string) HTMLA {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlA) ContentEditable(v bool) HTMLA {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlA) DataSet(k string, v any) HTMLA {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlA) Dir(v string) HTMLA {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlA) Download(v string) HTMLA {
- e.setAttr("download", v)
- return e
- }
- func (e *htmlA) Draggable(v bool) HTMLA {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlA) Hidden(v bool) HTMLA {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlA) Href(v string) HTMLA {
- e.setAttr("href", v)
- return e
- }
- func (e *htmlA) HrefLang(v string) HTMLA {
- e.setAttr("hreflang", v)
- return e
- }
- func (e *htmlA) ID(v string) HTMLA {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlA) Lang(v string) HTMLA {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlA) Media(v string) HTMLA {
- e.setAttr("media", v)
- return e
- }
- func (e *htmlA) Ping(v string) HTMLA {
- e.setAttr("ping", v)
- return e
- }
- func (e *htmlA) Rel(v string) HTMLA {
- e.setAttr("rel", v)
- return e
- }
- func (e *htmlA) Role(v string) HTMLA {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlA) Spellcheck(v bool) HTMLA {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlA) Style(k, v string) HTMLA {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlA) Styles(s map[string]string) HTMLA {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlA) TabIndex(v int) HTMLA {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlA) Target(v string) HTMLA {
- e.setAttr("target", v)
- return e
- }
- func (e *htmlA) Title(v string) HTMLA {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlA) Type(v string) HTMLA {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlA) On(event string, h EventHandler, scope ...any) HTMLA {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlA) OnBlur(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlA) OnChange(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlA) OnClick(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlA) OnContextMenu(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlA) OnCopy(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlA) OnCut(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlA) OnDblClick(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlA) OnDrag(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlA) OnDragEnd(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlA) OnDragEnter(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlA) OnDragLeave(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlA) OnDragOver(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlA) OnDragStart(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlA) OnDrop(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlA) OnFocus(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlA) OnInput(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlA) OnInvalid(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlA) OnKeyDown(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlA) OnKeyPress(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlA) OnKeyUp(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlA) OnMouseDown(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlA) OnMouseMove(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlA) OnMouseOut(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlA) OnMouseOver(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlA) OnMouseUp(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlA) OnPaste(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlA) OnReset(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlA) OnScroll(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlA) OnSearch(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlA) OnSelect(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlA) OnSubmit(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlA) OnWheel(h EventHandler, scope ...any) HTMLA {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLAbbr is the interface that describes a "abbr" HTML element.
- type HTMLAbbr interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLAbbr
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLAbbr
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLAbbr
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLAbbr
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLAbbr
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLAbbr
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLAbbr
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLAbbr
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLAbbr
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLAbbr
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLAbbr
- // ID specifies a unique id for an element.
- ID(v string) HTMLAbbr
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLAbbr
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLAbbr
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLAbbr
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLAbbr
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLAbbr
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLAbbr
- // Title specifies extra information about an element.
- Title(v string) HTMLAbbr
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLAbbr
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLAbbr
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLAbbr
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLAbbr
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLAbbr
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLAbbr
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLAbbr
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLAbbr
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLAbbr
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLAbbr
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLAbbr
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLAbbr
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLAbbr
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLAbbr
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLAbbr
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLAbbr
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLAbbr
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLAbbr
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLAbbr
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLAbbr
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLAbbr
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLAbbr
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLAbbr
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLAbbr
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLAbbr
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLAbbr
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLAbbr
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLAbbr
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLAbbr
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLAbbr
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLAbbr
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLAbbr
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLAbbr
- }
- // Abbr returns an HTML element that defines an abbreviation or an acronym.
- func Abbr() HTMLAbbr {
- e := &htmlAbbr{
- htmlElement: htmlElement{
- tag: "abbr",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlAbbr struct {
- htmlElement
- }
- func (e *htmlAbbr) Body(v ...UI) HTMLAbbr {
- e.setChildren(v...)
- return e
- }
- func (e *htmlAbbr) Text(v any) HTMLAbbr {
- return e.Body(Text(v))
- }
- func (e *htmlAbbr) AccessKey(v string) HTMLAbbr {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlAbbr) Aria(k string, v any) HTMLAbbr {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAbbr) Attr(n string, v any) HTMLAbbr {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlAbbr) Class(v ...string) HTMLAbbr {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlAbbr) ContentEditable(v bool) HTMLAbbr {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlAbbr) DataSet(k string, v any) HTMLAbbr {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAbbr) Dir(v string) HTMLAbbr {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlAbbr) Draggable(v bool) HTMLAbbr {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlAbbr) Hidden(v bool) HTMLAbbr {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlAbbr) ID(v string) HTMLAbbr {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlAbbr) Lang(v string) HTMLAbbr {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlAbbr) Role(v string) HTMLAbbr {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlAbbr) Spellcheck(v bool) HTMLAbbr {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlAbbr) Style(k, v string) HTMLAbbr {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlAbbr) Styles(s map[string]string) HTMLAbbr {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlAbbr) TabIndex(v int) HTMLAbbr {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlAbbr) Title(v string) HTMLAbbr {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlAbbr) On(event string, h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlAbbr) OnBlur(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnChange(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnClick(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnContextMenu(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnCopy(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnCut(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDblClick(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDrag(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDragEnd(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDragEnter(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDragLeave(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDragOver(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDragStart(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnDrop(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnFocus(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnInput(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnInvalid(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnKeyDown(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnKeyPress(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnKeyUp(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnMouseDown(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnMouseMove(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnMouseOut(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnMouseOver(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnMouseUp(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnPaste(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnReset(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnScroll(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnSearch(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnSelect(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnSubmit(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlAbbr) OnWheel(h EventHandler, scope ...any) HTMLAbbr {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLAddress is the interface that describes a "address" HTML element.
- type HTMLAddress interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLAddress
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLAddress
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLAddress
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLAddress
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLAddress
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLAddress
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLAddress
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLAddress
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLAddress
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLAddress
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLAddress
- // ID specifies a unique id for an element.
- ID(v string) HTMLAddress
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLAddress
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLAddress
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLAddress
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLAddress
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLAddress
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLAddress
- // Title specifies extra information about an element.
- Title(v string) HTMLAddress
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLAddress
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLAddress
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLAddress
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLAddress
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLAddress
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLAddress
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLAddress
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLAddress
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLAddress
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLAddress
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLAddress
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLAddress
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLAddress
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLAddress
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLAddress
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLAddress
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLAddress
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLAddress
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLAddress
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLAddress
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLAddress
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLAddress
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLAddress
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLAddress
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLAddress
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLAddress
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLAddress
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLAddress
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLAddress
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLAddress
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLAddress
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLAddress
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLAddress
- }
- // Address returns an HTML element that defines contact information for the author/owner of a document.
- func Address() HTMLAddress {
- e := &htmlAddress{
- htmlElement: htmlElement{
- tag: "address",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlAddress struct {
- htmlElement
- }
- func (e *htmlAddress) Body(v ...UI) HTMLAddress {
- e.setChildren(v...)
- return e
- }
- func (e *htmlAddress) Text(v any) HTMLAddress {
- return e.Body(Text(v))
- }
- func (e *htmlAddress) AccessKey(v string) HTMLAddress {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlAddress) Aria(k string, v any) HTMLAddress {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAddress) Attr(n string, v any) HTMLAddress {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlAddress) Class(v ...string) HTMLAddress {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlAddress) ContentEditable(v bool) HTMLAddress {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlAddress) DataSet(k string, v any) HTMLAddress {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAddress) Dir(v string) HTMLAddress {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlAddress) Draggable(v bool) HTMLAddress {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlAddress) Hidden(v bool) HTMLAddress {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlAddress) ID(v string) HTMLAddress {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlAddress) Lang(v string) HTMLAddress {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlAddress) Role(v string) HTMLAddress {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlAddress) Spellcheck(v bool) HTMLAddress {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlAddress) Style(k, v string) HTMLAddress {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlAddress) Styles(s map[string]string) HTMLAddress {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlAddress) TabIndex(v int) HTMLAddress {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlAddress) Title(v string) HTMLAddress {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlAddress) On(event string, h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlAddress) OnBlur(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlAddress) OnChange(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlAddress) OnClick(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlAddress) OnContextMenu(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlAddress) OnCopy(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlAddress) OnCut(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDblClick(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDrag(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDragEnd(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDragEnter(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDragLeave(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDragOver(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDragStart(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlAddress) OnDrop(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlAddress) OnFocus(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlAddress) OnInput(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlAddress) OnInvalid(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlAddress) OnKeyDown(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlAddress) OnKeyPress(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlAddress) OnKeyUp(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlAddress) OnMouseDown(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlAddress) OnMouseMove(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlAddress) OnMouseOut(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlAddress) OnMouseOver(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlAddress) OnMouseUp(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlAddress) OnPaste(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlAddress) OnReset(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlAddress) OnScroll(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlAddress) OnSearch(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlAddress) OnSelect(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlAddress) OnSubmit(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlAddress) OnWheel(h EventHandler, scope ...any) HTMLAddress {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLArea is the interface that describes a "area" HTML element.
- type HTMLArea interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLArea
- // Alt specifies an alternate text when the original element fails to display.
- Alt(v string) HTMLArea
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLArea
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLArea
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLArea
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLArea
- // Coords specifies the coordinates of the area.
- Coords(v string) HTMLArea
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLArea
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLArea
- // Download specifies that the target will be downloaded when a user clicks on the hyperlink.
- Download(v string) HTMLArea
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLArea
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLArea
- // Href specifies the URL of the page the link goes to.
- Href(v string) HTMLArea
- // HrefLang specifies the language of the linked document.
- HrefLang(v string) HTMLArea
- // ID specifies a unique id for an element.
- ID(v string) HTMLArea
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLArea
- // Media specifies what media/device the linked document is optimized for.
- Media(v string) HTMLArea
- // Rel specifies the relationship between the current document and the linked document.
- Rel(v string) HTMLArea
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLArea
- // Shape specifies the shape of the area.
- Shape(v string) HTMLArea
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLArea
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLArea
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLArea
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLArea
- // Target specifies the target for where to open the linked document or where to submit the form.
- Target(v string) HTMLArea
- // Title specifies extra information about an element.
- Title(v string) HTMLArea
- // Type specifies the type of element.
- Type(v string) HTMLArea
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLArea
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLArea
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLArea
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLArea
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLArea
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLArea
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLArea
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLArea
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLArea
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLArea
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLArea
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLArea
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLArea
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLArea
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLArea
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLArea
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLArea
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLArea
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLArea
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLArea
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLArea
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLArea
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLArea
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLArea
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLArea
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLArea
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLArea
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLArea
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLArea
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLArea
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLArea
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLArea
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLArea
- }
- // Area returns an HTML element that defines an area inside an image-map.
- func Area() HTMLArea {
- e := &htmlArea{
- htmlElement: htmlElement{
- tag: "area",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlArea struct {
- htmlElement
- }
- func (e *htmlArea) AccessKey(v string) HTMLArea {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlArea) Alt(v string) HTMLArea {
- e.setAttr("alt", v)
- return e
- }
- func (e *htmlArea) Aria(k string, v any) HTMLArea {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlArea) Attr(n string, v any) HTMLArea {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlArea) Class(v ...string) HTMLArea {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlArea) ContentEditable(v bool) HTMLArea {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlArea) Coords(v string) HTMLArea {
- e.setAttr("coords", v)
- return e
- }
- func (e *htmlArea) DataSet(k string, v any) HTMLArea {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlArea) Dir(v string) HTMLArea {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlArea) Download(v string) HTMLArea {
- e.setAttr("download", v)
- return e
- }
- func (e *htmlArea) Draggable(v bool) HTMLArea {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlArea) Hidden(v bool) HTMLArea {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlArea) Href(v string) HTMLArea {
- e.setAttr("href", v)
- return e
- }
- func (e *htmlArea) HrefLang(v string) HTMLArea {
- e.setAttr("hreflang", v)
- return e
- }
- func (e *htmlArea) ID(v string) HTMLArea {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlArea) Lang(v string) HTMLArea {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlArea) Media(v string) HTMLArea {
- e.setAttr("media", v)
- return e
- }
- func (e *htmlArea) Rel(v string) HTMLArea {
- e.setAttr("rel", v)
- return e
- }
- func (e *htmlArea) Role(v string) HTMLArea {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlArea) Shape(v string) HTMLArea {
- e.setAttr("shape", v)
- return e
- }
- func (e *htmlArea) Spellcheck(v bool) HTMLArea {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlArea) Style(k, v string) HTMLArea {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlArea) Styles(s map[string]string) HTMLArea {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlArea) TabIndex(v int) HTMLArea {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlArea) Target(v string) HTMLArea {
- e.setAttr("target", v)
- return e
- }
- func (e *htmlArea) Title(v string) HTMLArea {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlArea) Type(v string) HTMLArea {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlArea) On(event string, h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlArea) OnBlur(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlArea) OnChange(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlArea) OnClick(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlArea) OnContextMenu(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlArea) OnCopy(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlArea) OnCut(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlArea) OnDblClick(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlArea) OnDrag(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlArea) OnDragEnd(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlArea) OnDragEnter(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlArea) OnDragLeave(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlArea) OnDragOver(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlArea) OnDragStart(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlArea) OnDrop(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlArea) OnFocus(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlArea) OnInput(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlArea) OnInvalid(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlArea) OnKeyDown(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlArea) OnKeyPress(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlArea) OnKeyUp(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlArea) OnMouseDown(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlArea) OnMouseMove(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlArea) OnMouseOut(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlArea) OnMouseOver(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlArea) OnMouseUp(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlArea) OnPaste(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlArea) OnReset(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlArea) OnScroll(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlArea) OnSearch(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlArea) OnSelect(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlArea) OnSubmit(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlArea) OnWheel(h EventHandler, scope ...any) HTMLArea {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLArticle is the interface that describes a "article" HTML element.
- type HTMLArticle interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLArticle
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLArticle
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLArticle
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLArticle
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLArticle
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLArticle
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLArticle
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLArticle
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLArticle
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLArticle
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLArticle
- // ID specifies a unique id for an element.
- ID(v string) HTMLArticle
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLArticle
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLArticle
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLArticle
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLArticle
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLArticle
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLArticle
- // Title specifies extra information about an element.
- Title(v string) HTMLArticle
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLArticle
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLArticle
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLArticle
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLArticle
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLArticle
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLArticle
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLArticle
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLArticle
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLArticle
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLArticle
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLArticle
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLArticle
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLArticle
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLArticle
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLArticle
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLArticle
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLArticle
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLArticle
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLArticle
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLArticle
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLArticle
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLArticle
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLArticle
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLArticle
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLArticle
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLArticle
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLArticle
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLArticle
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLArticle
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLArticle
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLArticle
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLArticle
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLArticle
- }
- // Article returns an HTML element that defines an article.
- func Article() HTMLArticle {
- e := &htmlArticle{
- htmlElement: htmlElement{
- tag: "article",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlArticle struct {
- htmlElement
- }
- func (e *htmlArticle) Body(v ...UI) HTMLArticle {
- e.setChildren(v...)
- return e
- }
- func (e *htmlArticle) Text(v any) HTMLArticle {
- return e.Body(Text(v))
- }
- func (e *htmlArticle) AccessKey(v string) HTMLArticle {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlArticle) Aria(k string, v any) HTMLArticle {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlArticle) Attr(n string, v any) HTMLArticle {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlArticle) Class(v ...string) HTMLArticle {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlArticle) ContentEditable(v bool) HTMLArticle {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlArticle) DataSet(k string, v any) HTMLArticle {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlArticle) Dir(v string) HTMLArticle {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlArticle) Draggable(v bool) HTMLArticle {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlArticle) Hidden(v bool) HTMLArticle {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlArticle) ID(v string) HTMLArticle {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlArticle) Lang(v string) HTMLArticle {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlArticle) Role(v string) HTMLArticle {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlArticle) Spellcheck(v bool) HTMLArticle {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlArticle) Style(k, v string) HTMLArticle {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlArticle) Styles(s map[string]string) HTMLArticle {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlArticle) TabIndex(v int) HTMLArticle {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlArticle) Title(v string) HTMLArticle {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlArticle) On(event string, h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlArticle) OnBlur(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlArticle) OnChange(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlArticle) OnClick(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlArticle) OnContextMenu(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlArticle) OnCopy(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlArticle) OnCut(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDblClick(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDrag(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDragEnd(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDragEnter(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDragLeave(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDragOver(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDragStart(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlArticle) OnDrop(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlArticle) OnFocus(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlArticle) OnInput(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlArticle) OnInvalid(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlArticle) OnKeyDown(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlArticle) OnKeyPress(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlArticle) OnKeyUp(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlArticle) OnMouseDown(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlArticle) OnMouseMove(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlArticle) OnMouseOut(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlArticle) OnMouseOver(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlArticle) OnMouseUp(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlArticle) OnPaste(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlArticle) OnReset(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlArticle) OnScroll(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlArticle) OnSearch(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlArticle) OnSelect(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlArticle) OnSubmit(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlArticle) OnWheel(h EventHandler, scope ...any) HTMLArticle {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLAside is the interface that describes a "aside" HTML element.
- type HTMLAside interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLAside
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLAside
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLAside
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLAside
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLAside
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLAside
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLAside
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLAside
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLAside
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLAside
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLAside
- // ID specifies a unique id for an element.
- ID(v string) HTMLAside
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLAside
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLAside
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLAside
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLAside
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLAside
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLAside
- // Title specifies extra information about an element.
- Title(v string) HTMLAside
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLAside
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLAside
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLAside
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLAside
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLAside
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLAside
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLAside
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLAside
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLAside
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLAside
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLAside
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLAside
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLAside
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLAside
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLAside
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLAside
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLAside
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLAside
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLAside
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLAside
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLAside
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLAside
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLAside
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLAside
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLAside
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLAside
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLAside
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLAside
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLAside
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLAside
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLAside
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLAside
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLAside
- }
- // Aside returns an HTML element that defines content aside from the page content.
- func Aside() HTMLAside {
- e := &htmlAside{
- htmlElement: htmlElement{
- tag: "aside",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlAside struct {
- htmlElement
- }
- func (e *htmlAside) Body(v ...UI) HTMLAside {
- e.setChildren(v...)
- return e
- }
- func (e *htmlAside) Text(v any) HTMLAside {
- return e.Body(Text(v))
- }
- func (e *htmlAside) AccessKey(v string) HTMLAside {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlAside) Aria(k string, v any) HTMLAside {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAside) Attr(n string, v any) HTMLAside {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlAside) Class(v ...string) HTMLAside {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlAside) ContentEditable(v bool) HTMLAside {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlAside) DataSet(k string, v any) HTMLAside {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAside) Dir(v string) HTMLAside {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlAside) Draggable(v bool) HTMLAside {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlAside) Hidden(v bool) HTMLAside {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlAside) ID(v string) HTMLAside {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlAside) Lang(v string) HTMLAside {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlAside) Role(v string) HTMLAside {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlAside) Spellcheck(v bool) HTMLAside {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlAside) Style(k, v string) HTMLAside {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlAside) Styles(s map[string]string) HTMLAside {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlAside) TabIndex(v int) HTMLAside {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlAside) Title(v string) HTMLAside {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlAside) On(event string, h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlAside) OnBlur(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlAside) OnChange(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlAside) OnClick(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlAside) OnContextMenu(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlAside) OnCopy(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlAside) OnCut(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlAside) OnDblClick(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlAside) OnDrag(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlAside) OnDragEnd(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlAside) OnDragEnter(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlAside) OnDragLeave(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlAside) OnDragOver(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlAside) OnDragStart(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlAside) OnDrop(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlAside) OnFocus(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlAside) OnInput(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlAside) OnInvalid(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlAside) OnKeyDown(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlAside) OnKeyPress(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlAside) OnKeyUp(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlAside) OnMouseDown(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlAside) OnMouseMove(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlAside) OnMouseOut(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlAside) OnMouseOver(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlAside) OnMouseUp(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlAside) OnPaste(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlAside) OnReset(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlAside) OnScroll(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlAside) OnSearch(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlAside) OnSelect(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlAside) OnSubmit(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlAside) OnWheel(h EventHandler, scope ...any) HTMLAside {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLAudio is the interface that describes a "audio" HTML element.
- type HTMLAudio interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLAudio
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLAudio
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLAudio
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLAudio
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLAudio
- // AutoPlay specifies that the audio/video will start playing as soon as it is ready.
- AutoPlay(v bool) HTMLAudio
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLAudio
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLAudio
- // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc).
- Controls(v bool) HTMLAudio
- // CrossOrigin sets the mode of the request to an HTTP CORS Request.
- CrossOrigin(v string) HTMLAudio
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLAudio
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLAudio
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLAudio
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLAudio
- // ID specifies a unique id for an element.
- ID(v string) HTMLAudio
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLAudio
- // Loop specifies that the audio/video will start over again, every time it is finished.
- Loop(v bool) HTMLAudio
- // Muted specifies that the audio output of the video should be muted.
- Muted(v bool) HTMLAudio
- // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads.
- Preload(v string) HTMLAudio
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLAudio
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLAudio
- // Src specifies the URL of the media file.
- Src(v string) HTMLAudio
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLAudio
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLAudio
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLAudio
- // Title specifies extra information about an element.
- Title(v string) HTMLAudio
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLAudio
- // OnAbort calls the given handler on abort.
- OnAbort(h EventHandler, scope ...any) HTMLAudio
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLAudio
- // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
- OnCanPlay(h EventHandler, scope ...any) HTMLAudio
- // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
- OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLAudio
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLAudio
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLAudio
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLAudio
- // OnCueChange calls the given handler when the cue changes in a track element.
- OnCueChange(h EventHandler, scope ...any) HTMLAudio
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLAudio
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLAudio
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLAudio
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLAudio
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLAudio
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLAudio
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLAudio
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLAudio
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLAudio
- // OnDurationChange calls the given handler when the length of the media changes.
- OnDurationChange(h EventHandler, scope ...any) HTMLAudio
- // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
- OnEmptied(h EventHandler, scope ...any) HTMLAudio
- // OnEnded calls the given handler when the media has reach the end.
- OnEnded(h EventHandler, scope ...any) HTMLAudio
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLAudio
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLAudio
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLAudio
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLAudio
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLAudio
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLAudio
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLAudio
- // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
- OnLoadStart(h EventHandler, scope ...any) HTMLAudio
- // OnLoadedData calls the given handler when media data is loaded.
- OnLoadedData(h EventHandler, scope ...any) HTMLAudio
- // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
- OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLAudio
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLAudio
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLAudio
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLAudio
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLAudio
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLAudio
- // OnPause calls the given handler when the media is paused either by the user or programmatically.
- OnPause(h EventHandler, scope ...any) HTMLAudio
- // OnPlay calls the given handler when the media is ready to start playing.
- OnPlay(h EventHandler, scope ...any) HTMLAudio
- // OnPlaying calls the given handler when the media actually has started playing.
- OnPlaying(h EventHandler, scope ...any) HTMLAudio
- // OnProgress calls the given handler when the browser is in the process of getting the media data.
- OnProgress(h EventHandler, scope ...any) HTMLAudio
- // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
- OnRateChange(h EventHandler, scope ...any) HTMLAudio
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLAudio
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLAudio
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLAudio
- // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
- OnSeeked(h EventHandler, scope ...any) HTMLAudio
- // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
- OnSeeking(h EventHandler, scope ...any) HTMLAudio
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLAudio
- // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
- OnStalled(h EventHandler, scope ...any) HTMLAudio
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLAudio
- // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
- OnSuspend(h EventHandler, scope ...any) HTMLAudio
- // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
- OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio
- // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
- OnVolumeChange(h EventHandler, scope ...any) HTMLAudio
- // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
- OnWaiting(h EventHandler, scope ...any) HTMLAudio
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLAudio
- }
- // Audio returns an HTML element that defines sound content.
- func Audio() HTMLAudio {
- e := &htmlAudio{
- htmlElement: htmlElement{
- tag: "audio",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlAudio struct {
- htmlElement
- }
- func (e *htmlAudio) Body(v ...UI) HTMLAudio {
- e.setChildren(v...)
- return e
- }
- func (e *htmlAudio) Text(v any) HTMLAudio {
- return e.Body(Text(v))
- }
- func (e *htmlAudio) AccessKey(v string) HTMLAudio {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlAudio) Aria(k string, v any) HTMLAudio {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAudio) Attr(n string, v any) HTMLAudio {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlAudio) AutoPlay(v bool) HTMLAudio {
- e.setAttr("autoplay", v)
- return e
- }
- func (e *htmlAudio) Class(v ...string) HTMLAudio {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlAudio) ContentEditable(v bool) HTMLAudio {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlAudio) Controls(v bool) HTMLAudio {
- e.setAttr("controls", v)
- return e
- }
- func (e *htmlAudio) CrossOrigin(v string) HTMLAudio {
- e.setAttr("crossorigin", v)
- return e
- }
- func (e *htmlAudio) DataSet(k string, v any) HTMLAudio {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlAudio) Dir(v string) HTMLAudio {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlAudio) Draggable(v bool) HTMLAudio {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlAudio) Hidden(v bool) HTMLAudio {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlAudio) ID(v string) HTMLAudio {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlAudio) Lang(v string) HTMLAudio {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlAudio) Loop(v bool) HTMLAudio {
- e.setAttr("loop", v)
- return e
- }
- func (e *htmlAudio) Muted(v bool) HTMLAudio {
- e.setAttr("muted", v)
- return e
- }
- func (e *htmlAudio) Preload(v string) HTMLAudio {
- e.setAttr("preload", v)
- return e
- }
- func (e *htmlAudio) Role(v string) HTMLAudio {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlAudio) Spellcheck(v bool) HTMLAudio {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlAudio) Src(v string) HTMLAudio {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlAudio) Style(k, v string) HTMLAudio {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlAudio) Styles(s map[string]string) HTMLAudio {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlAudio) TabIndex(v int) HTMLAudio {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlAudio) Title(v string) HTMLAudio {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlAudio) On(event string, h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlAudio) OnAbort(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("abort", h, scope...)
- return e
- }
- func (e *htmlAudio) OnBlur(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlAudio) OnCanPlay(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("canplay", h, scope...)
- return e
- }
- func (e *htmlAudio) OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("canplaythrough", h, scope...)
- return e
- }
- func (e *htmlAudio) OnChange(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlAudio) OnClick(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlAudio) OnContextMenu(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlAudio) OnCopy(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlAudio) OnCueChange(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("cuechange", h, scope...)
- return e
- }
- func (e *htmlAudio) OnCut(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDblClick(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDrag(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDragEnd(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDragEnter(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDragLeave(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDragOver(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDragStart(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDrop(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlAudio) OnDurationChange(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("durationchange", h, scope...)
- return e
- }
- func (e *htmlAudio) OnEmptied(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("emptied", h, scope...)
- return e
- }
- func (e *htmlAudio) OnEnded(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("ended", h, scope...)
- return e
- }
- func (e *htmlAudio) OnError(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlAudio) OnFocus(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlAudio) OnInput(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlAudio) OnInvalid(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlAudio) OnKeyDown(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlAudio) OnKeyPress(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlAudio) OnKeyUp(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlAudio) OnLoadStart(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("loadstart", h, scope...)
- return e
- }
- func (e *htmlAudio) OnLoadedData(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("loadeddata", h, scope...)
- return e
- }
- func (e *htmlAudio) OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("loadedmetadata", h, scope...)
- return e
- }
- func (e *htmlAudio) OnMouseDown(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlAudio) OnMouseMove(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlAudio) OnMouseOut(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlAudio) OnMouseOver(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlAudio) OnMouseUp(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlAudio) OnPaste(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlAudio) OnPause(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("pause", h, scope...)
- return e
- }
- func (e *htmlAudio) OnPlay(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("play", h, scope...)
- return e
- }
- func (e *htmlAudio) OnPlaying(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("playing", h, scope...)
- return e
- }
- func (e *htmlAudio) OnProgress(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("progress", h, scope...)
- return e
- }
- func (e *htmlAudio) OnRateChange(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("ratechange", h, scope...)
- return e
- }
- func (e *htmlAudio) OnReset(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlAudio) OnScroll(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSearch(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSeeked(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("seeked", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSeeking(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("seeking", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSelect(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlAudio) OnStalled(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("stalled", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSubmit(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlAudio) OnSuspend(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("suspend", h, scope...)
- return e
- }
- func (e *htmlAudio) OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("timeupdate", h, scope...)
- return e
- }
- func (e *htmlAudio) OnVolumeChange(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("volumechange", h, scope...)
- return e
- }
- func (e *htmlAudio) OnWaiting(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("waiting", h, scope...)
- return e
- }
- func (e *htmlAudio) OnWheel(h EventHandler, scope ...any) HTMLAudio {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLB is the interface that describes a "b" HTML element.
- type HTMLB interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLB
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLB
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLB
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLB
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLB
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLB
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLB
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLB
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLB
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLB
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLB
- // ID specifies a unique id for an element.
- ID(v string) HTMLB
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLB
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLB
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLB
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLB
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLB
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLB
- // Title specifies extra information about an element.
- Title(v string) HTMLB
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLB
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLB
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLB
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLB
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLB
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLB
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLB
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLB
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLB
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLB
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLB
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLB
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLB
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLB
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLB
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLB
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLB
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLB
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLB
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLB
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLB
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLB
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLB
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLB
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLB
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLB
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLB
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLB
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLB
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLB
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLB
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLB
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLB
- }
- // B returns an HTML element that defines bold text.
- func B() HTMLB {
- e := &htmlB{
- htmlElement: htmlElement{
- tag: "b",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlB struct {
- htmlElement
- }
- func (e *htmlB) Body(v ...UI) HTMLB {
- e.setChildren(v...)
- return e
- }
- func (e *htmlB) Text(v any) HTMLB {
- return e.Body(Text(v))
- }
- func (e *htmlB) AccessKey(v string) HTMLB {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlB) Aria(k string, v any) HTMLB {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlB) Attr(n string, v any) HTMLB {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlB) Class(v ...string) HTMLB {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlB) ContentEditable(v bool) HTMLB {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlB) DataSet(k string, v any) HTMLB {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlB) Dir(v string) HTMLB {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlB) Draggable(v bool) HTMLB {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlB) Hidden(v bool) HTMLB {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlB) ID(v string) HTMLB {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlB) Lang(v string) HTMLB {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlB) Role(v string) HTMLB {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlB) Spellcheck(v bool) HTMLB {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlB) Style(k, v string) HTMLB {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlB) Styles(s map[string]string) HTMLB {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlB) TabIndex(v int) HTMLB {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlB) Title(v string) HTMLB {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlB) On(event string, h EventHandler, scope ...any) HTMLB {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlB) OnBlur(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlB) OnChange(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlB) OnClick(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlB) OnContextMenu(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlB) OnCopy(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlB) OnCut(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlB) OnDblClick(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlB) OnDrag(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlB) OnDragEnd(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlB) OnDragEnter(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlB) OnDragLeave(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlB) OnDragOver(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlB) OnDragStart(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlB) OnDrop(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlB) OnFocus(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlB) OnInput(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlB) OnInvalid(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlB) OnKeyDown(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlB) OnKeyPress(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlB) OnKeyUp(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlB) OnMouseDown(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlB) OnMouseMove(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlB) OnMouseOut(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlB) OnMouseOver(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlB) OnMouseUp(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlB) OnPaste(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlB) OnReset(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlB) OnScroll(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlB) OnSearch(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlB) OnSelect(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlB) OnSubmit(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlB) OnWheel(h EventHandler, scope ...any) HTMLB {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBase is the interface that describes a "base" HTML element.
- type HTMLBase interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBase
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBase
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBase
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBase
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBase
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBase
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBase
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBase
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBase
- // Href specifies the URL of the page the link goes to.
- Href(v string) HTMLBase
- // ID specifies a unique id for an element.
- ID(v string) HTMLBase
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBase
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBase
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBase
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBase
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBase
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBase
- // Target specifies the target for where to open the linked document or where to submit the form.
- Target(v string) HTMLBase
- // Title specifies extra information about an element.
- Title(v string) HTMLBase
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBase
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBase
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBase
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBase
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBase
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBase
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBase
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBase
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBase
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBase
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBase
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBase
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBase
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBase
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBase
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBase
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBase
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBase
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBase
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBase
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBase
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBase
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBase
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBase
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBase
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBase
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBase
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBase
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBase
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBase
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBase
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBase
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBase
- }
- // Base returns an HTML element that specifies the base URL/target for all relative URLs in a document.
- func Base() HTMLBase {
- e := &htmlBase{
- htmlElement: htmlElement{
- tag: "base",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlBase struct {
- htmlElement
- }
- func (e *htmlBase) AccessKey(v string) HTMLBase {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBase) Aria(k string, v any) HTMLBase {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBase) Attr(n string, v any) HTMLBase {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBase) Class(v ...string) HTMLBase {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBase) ContentEditable(v bool) HTMLBase {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBase) DataSet(k string, v any) HTMLBase {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBase) Dir(v string) HTMLBase {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBase) Draggable(v bool) HTMLBase {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBase) Hidden(v bool) HTMLBase {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBase) Href(v string) HTMLBase {
- e.setAttr("href", v)
- return e
- }
- func (e *htmlBase) ID(v string) HTMLBase {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBase) Lang(v string) HTMLBase {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBase) Role(v string) HTMLBase {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBase) Spellcheck(v bool) HTMLBase {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBase) Style(k, v string) HTMLBase {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBase) Styles(s map[string]string) HTMLBase {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBase) TabIndex(v int) HTMLBase {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBase) Target(v string) HTMLBase {
- e.setAttr("target", v)
- return e
- }
- func (e *htmlBase) Title(v string) HTMLBase {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBase) On(event string, h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBase) OnBlur(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBase) OnChange(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBase) OnClick(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBase) OnContextMenu(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBase) OnCopy(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBase) OnCut(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBase) OnDblClick(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBase) OnDrag(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBase) OnDragEnd(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBase) OnDragEnter(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBase) OnDragLeave(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBase) OnDragOver(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBase) OnDragStart(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBase) OnDrop(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBase) OnFocus(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBase) OnInput(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBase) OnInvalid(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBase) OnKeyDown(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBase) OnKeyPress(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBase) OnKeyUp(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBase) OnMouseDown(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBase) OnMouseMove(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBase) OnMouseOut(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBase) OnMouseOver(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBase) OnMouseUp(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBase) OnPaste(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBase) OnReset(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBase) OnScroll(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBase) OnSearch(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBase) OnSelect(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBase) OnSubmit(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBase) OnWheel(h EventHandler, scope ...any) HTMLBase {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBdi is the interface that describes a "bdi" HTML element.
- type HTMLBdi interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLBdi
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLBdi
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBdi
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBdi
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBdi
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBdi
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBdi
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBdi
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBdi
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBdi
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBdi
- // ID specifies a unique id for an element.
- ID(v string) HTMLBdi
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBdi
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBdi
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBdi
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBdi
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBdi
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBdi
- // Title specifies extra information about an element.
- Title(v string) HTMLBdi
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBdi
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBdi
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBdi
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBdi
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBdi
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBdi
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBdi
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBdi
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBdi
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBdi
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBdi
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBdi
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBdi
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBdi
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBdi
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBdi
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBdi
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBdi
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBdi
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBdi
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBdi
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBdi
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBdi
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBdi
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBdi
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBdi
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBdi
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBdi
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBdi
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBdi
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBdi
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBdi
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBdi
- }
- // Bdi returns an HTML element that isolates a part of text that might be formatted in a different direction from other text outside it.
- func Bdi() HTMLBdi {
- e := &htmlBdi{
- htmlElement: htmlElement{
- tag: "bdi",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlBdi struct {
- htmlElement
- }
- func (e *htmlBdi) Body(v ...UI) HTMLBdi {
- e.setChildren(v...)
- return e
- }
- func (e *htmlBdi) Text(v any) HTMLBdi {
- return e.Body(Text(v))
- }
- func (e *htmlBdi) AccessKey(v string) HTMLBdi {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBdi) Aria(k string, v any) HTMLBdi {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBdi) Attr(n string, v any) HTMLBdi {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBdi) Class(v ...string) HTMLBdi {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBdi) ContentEditable(v bool) HTMLBdi {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBdi) DataSet(k string, v any) HTMLBdi {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBdi) Dir(v string) HTMLBdi {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBdi) Draggable(v bool) HTMLBdi {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBdi) Hidden(v bool) HTMLBdi {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBdi) ID(v string) HTMLBdi {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBdi) Lang(v string) HTMLBdi {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBdi) Role(v string) HTMLBdi {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBdi) Spellcheck(v bool) HTMLBdi {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBdi) Style(k, v string) HTMLBdi {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBdi) Styles(s map[string]string) HTMLBdi {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBdi) TabIndex(v int) HTMLBdi {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBdi) Title(v string) HTMLBdi {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBdi) On(event string, h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBdi) OnBlur(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBdi) OnChange(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBdi) OnClick(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBdi) OnContextMenu(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBdi) OnCopy(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBdi) OnCut(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDblClick(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDrag(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDragEnd(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDragEnter(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDragLeave(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDragOver(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDragStart(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBdi) OnDrop(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBdi) OnFocus(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBdi) OnInput(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBdi) OnInvalid(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBdi) OnKeyDown(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBdi) OnKeyPress(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBdi) OnKeyUp(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBdi) OnMouseDown(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBdi) OnMouseMove(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBdi) OnMouseOut(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBdi) OnMouseOver(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBdi) OnMouseUp(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBdi) OnPaste(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBdi) OnReset(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBdi) OnScroll(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBdi) OnSearch(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBdi) OnSelect(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBdi) OnSubmit(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBdi) OnWheel(h EventHandler, scope ...any) HTMLBdi {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBdo is the interface that describes a "bdo" HTML element.
- type HTMLBdo interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLBdo
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLBdo
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBdo
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBdo
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBdo
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBdo
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBdo
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBdo
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBdo
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBdo
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBdo
- // ID specifies a unique id for an element.
- ID(v string) HTMLBdo
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBdo
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBdo
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBdo
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBdo
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBdo
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBdo
- // Title specifies extra information about an element.
- Title(v string) HTMLBdo
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBdo
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBdo
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBdo
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBdo
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBdo
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBdo
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBdo
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBdo
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBdo
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBdo
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBdo
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBdo
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBdo
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBdo
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBdo
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBdo
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBdo
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBdo
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBdo
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBdo
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBdo
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBdo
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBdo
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBdo
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBdo
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBdo
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBdo
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBdo
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBdo
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBdo
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBdo
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBdo
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBdo
- }
- // Bdo returns an HTML element that overrides the current text direction.
- func Bdo() HTMLBdo {
- e := &htmlBdo{
- htmlElement: htmlElement{
- tag: "bdo",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlBdo struct {
- htmlElement
- }
- func (e *htmlBdo) Body(v ...UI) HTMLBdo {
- e.setChildren(v...)
- return e
- }
- func (e *htmlBdo) Text(v any) HTMLBdo {
- return e.Body(Text(v))
- }
- func (e *htmlBdo) AccessKey(v string) HTMLBdo {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBdo) Aria(k string, v any) HTMLBdo {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBdo) Attr(n string, v any) HTMLBdo {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBdo) Class(v ...string) HTMLBdo {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBdo) ContentEditable(v bool) HTMLBdo {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBdo) DataSet(k string, v any) HTMLBdo {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBdo) Dir(v string) HTMLBdo {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBdo) Draggable(v bool) HTMLBdo {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBdo) Hidden(v bool) HTMLBdo {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBdo) ID(v string) HTMLBdo {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBdo) Lang(v string) HTMLBdo {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBdo) Role(v string) HTMLBdo {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBdo) Spellcheck(v bool) HTMLBdo {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBdo) Style(k, v string) HTMLBdo {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBdo) Styles(s map[string]string) HTMLBdo {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBdo) TabIndex(v int) HTMLBdo {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBdo) Title(v string) HTMLBdo {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBdo) On(event string, h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBdo) OnBlur(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBdo) OnChange(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBdo) OnClick(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBdo) OnContextMenu(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBdo) OnCopy(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBdo) OnCut(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDblClick(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDrag(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDragEnd(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDragEnter(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDragLeave(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDragOver(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDragStart(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBdo) OnDrop(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBdo) OnFocus(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBdo) OnInput(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBdo) OnInvalid(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBdo) OnKeyDown(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBdo) OnKeyPress(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBdo) OnKeyUp(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBdo) OnMouseDown(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBdo) OnMouseMove(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBdo) OnMouseOut(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBdo) OnMouseOver(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBdo) OnMouseUp(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBdo) OnPaste(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBdo) OnReset(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBdo) OnScroll(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBdo) OnSearch(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBdo) OnSelect(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBdo) OnSubmit(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBdo) OnWheel(h EventHandler, scope ...any) HTMLBdo {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBlockquote is the interface that describes a "blockquote" HTML element.
- type HTMLBlockquote interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLBlockquote
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLBlockquote
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBlockquote
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBlockquote
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBlockquote
- // Cite specifies a URL which explains the quote/deleted/inserted text.
- Cite(v string) HTMLBlockquote
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBlockquote
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBlockquote
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBlockquote
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBlockquote
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBlockquote
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBlockquote
- // ID specifies a unique id for an element.
- ID(v string) HTMLBlockquote
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBlockquote
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBlockquote
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBlockquote
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBlockquote
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBlockquote
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBlockquote
- // Title specifies extra information about an element.
- Title(v string) HTMLBlockquote
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBlockquote
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBlockquote
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBlockquote
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBlockquote
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBlockquote
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBlockquote
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBlockquote
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBlockquote
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBlockquote
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBlockquote
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBlockquote
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBlockquote
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBlockquote
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBlockquote
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBlockquote
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBlockquote
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBlockquote
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBlockquote
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBlockquote
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBlockquote
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBlockquote
- }
- // Blockquote returns an HTML element that defines a section that is quoted from another source.
- func Blockquote() HTMLBlockquote {
- e := &htmlBlockquote{
- htmlElement: htmlElement{
- tag: "blockquote",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlBlockquote struct {
- htmlElement
- }
- func (e *htmlBlockquote) Body(v ...UI) HTMLBlockquote {
- e.setChildren(v...)
- return e
- }
- func (e *htmlBlockquote) Text(v any) HTMLBlockquote {
- return e.Body(Text(v))
- }
- func (e *htmlBlockquote) AccessKey(v string) HTMLBlockquote {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBlockquote) Aria(k string, v any) HTMLBlockquote {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBlockquote) Attr(n string, v any) HTMLBlockquote {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBlockquote) Cite(v string) HTMLBlockquote {
- e.setAttr("cite", v)
- return e
- }
- func (e *htmlBlockquote) Class(v ...string) HTMLBlockquote {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBlockquote) ContentEditable(v bool) HTMLBlockquote {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBlockquote) DataSet(k string, v any) HTMLBlockquote {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBlockquote) Dir(v string) HTMLBlockquote {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBlockquote) Draggable(v bool) HTMLBlockquote {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBlockquote) Hidden(v bool) HTMLBlockquote {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBlockquote) ID(v string) HTMLBlockquote {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBlockquote) Lang(v string) HTMLBlockquote {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBlockquote) Role(v string) HTMLBlockquote {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBlockquote) Spellcheck(v bool) HTMLBlockquote {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBlockquote) Style(k, v string) HTMLBlockquote {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBlockquote) Styles(s map[string]string) HTMLBlockquote {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBlockquote) TabIndex(v int) HTMLBlockquote {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBlockquote) Title(v string) HTMLBlockquote {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBlockquote) On(event string, h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnBlur(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnChange(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnClick(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnCopy(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnCut(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDblClick(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDrag(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDragOver(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDragStart(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnDrop(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnFocus(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnInput(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnInvalid(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnPaste(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnReset(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnScroll(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnSearch(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnSelect(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnSubmit(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBlockquote) OnWheel(h EventHandler, scope ...any) HTMLBlockquote {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBody is the interface that describes a "body" HTML element.
- type HTMLBody interface {
- UI
- privateBody(elems ...UI) HTMLBody
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBody
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBody
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBody
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBody
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBody
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBody
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBody
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBody
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBody
- // ID specifies a unique id for an element.
- ID(v string) HTMLBody
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBody
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBody
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBody
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBody
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBody
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBody
- // Title specifies extra information about an element.
- Title(v string) HTMLBody
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBody
- // OnAfterPrint runs the given handler after the document is printed.
- OnAfterPrint(h EventHandler, scope ...any) HTMLBody
- // OnBeforePrint calls the given handler before the document is printed.
- OnBeforePrint(h EventHandler, scope ...any) HTMLBody
- // OnBeforeUnload calls the given handler when the document is about to be unloaded.
- OnBeforeUnload(h EventHandler, scope ...any) HTMLBody
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBody
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBody
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBody
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBody
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBody
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBody
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBody
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBody
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBody
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBody
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBody
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBody
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBody
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBody
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLBody
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBody
- // OnHashChange calls the given handler when there has been changes to the anchor part of the a URL.
- OnHashChange(h EventHandler, scope ...any) HTMLBody
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBody
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBody
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBody
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBody
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBody
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLBody
- // OnMessage calls then given handler when a message is triggered.
- OnMessage(h EventHandler, scope ...any) HTMLBody
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBody
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBody
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBody
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBody
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBody
- // OnOffline calls the given handler when the browser starts to work offline.
- OnOffline(h EventHandler, scope ...any) HTMLBody
- // OnOnline calls the given handler when the browser starts to work online.
- OnOnline(h EventHandler, scope ...any) HTMLBody
- // OnPageHide calls the given handler when a user navigates away from a page.
- OnPageHide(h EventHandler, scope ...any) HTMLBody
- // OnPageShow calls the given handler when a user navigates to a page.
- OnPageShow(h EventHandler, scope ...any) HTMLBody
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBody
- // OnPopState calls the given handler when the window's history changes.
- OnPopState(h EventHandler, scope ...any) HTMLBody
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBody
- // OnResize calls the given handler when the browser window is resized.
- OnResize(h EventHandler, scope ...any) HTMLBody
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBody
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBody
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBody
- // OnStorage calls the given handler when a Web Storage area is updated.
- OnStorage(h EventHandler, scope ...any) HTMLBody
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBody
- // OnUnload calls the given handler once a page has unloaded (or the browser window has been closed).
- OnUnload(h EventHandler, scope ...any) HTMLBody
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBody
- }
- // Body returns an HTML element that defines the document's body.
- func Body() HTMLBody {
- e := &htmlBody{
- htmlElement: htmlElement{
- tag: "body",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlBody struct {
- htmlElement
- }
- func (e *htmlBody) privateBody(v ...UI) HTMLBody {
- e.setChildren(v...)
- return e
- }
- func (e *htmlBody) AccessKey(v string) HTMLBody {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBody) Aria(k string, v any) HTMLBody {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBody) Attr(n string, v any) HTMLBody {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBody) Class(v ...string) HTMLBody {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBody) ContentEditable(v bool) HTMLBody {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBody) DataSet(k string, v any) HTMLBody {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBody) Dir(v string) HTMLBody {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBody) Draggable(v bool) HTMLBody {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBody) Hidden(v bool) HTMLBody {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBody) ID(v string) HTMLBody {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBody) Lang(v string) HTMLBody {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBody) Role(v string) HTMLBody {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBody) Spellcheck(v bool) HTMLBody {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBody) Style(k, v string) HTMLBody {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBody) Styles(s map[string]string) HTMLBody {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBody) TabIndex(v int) HTMLBody {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBody) Title(v string) HTMLBody {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBody) On(event string, h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBody) OnAfterPrint(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("afterprint", h, scope...)
- return e
- }
- func (e *htmlBody) OnBeforePrint(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("beforeprint", h, scope...)
- return e
- }
- func (e *htmlBody) OnBeforeUnload(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("beforeunload", h, scope...)
- return e
- }
- func (e *htmlBody) OnBlur(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBody) OnChange(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBody) OnClick(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBody) OnContextMenu(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBody) OnCopy(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBody) OnCut(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBody) OnDblClick(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBody) OnDrag(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBody) OnDragEnd(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBody) OnDragEnter(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBody) OnDragLeave(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBody) OnDragOver(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBody) OnDragStart(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBody) OnDrop(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBody) OnError(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlBody) OnFocus(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBody) OnHashChange(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("hashchange", h, scope...)
- return e
- }
- func (e *htmlBody) OnInput(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBody) OnInvalid(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBody) OnKeyDown(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBody) OnKeyPress(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBody) OnKeyUp(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBody) OnLoad(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlBody) OnMessage(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("message", h, scope...)
- return e
- }
- func (e *htmlBody) OnMouseDown(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBody) OnMouseMove(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBody) OnMouseOut(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBody) OnMouseOver(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBody) OnMouseUp(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBody) OnOffline(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("offline", h, scope...)
- return e
- }
- func (e *htmlBody) OnOnline(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("online", h, scope...)
- return e
- }
- func (e *htmlBody) OnPageHide(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("pagehide", h, scope...)
- return e
- }
- func (e *htmlBody) OnPageShow(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("pageshow", h, scope...)
- return e
- }
- func (e *htmlBody) OnPaste(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBody) OnPopState(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("popstate", h, scope...)
- return e
- }
- func (e *htmlBody) OnReset(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBody) OnResize(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("resize", h, scope...)
- return e
- }
- func (e *htmlBody) OnScroll(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBody) OnSearch(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBody) OnSelect(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBody) OnStorage(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("storage", h, scope...)
- return e
- }
- func (e *htmlBody) OnSubmit(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBody) OnUnload(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("unload", h, scope...)
- return e
- }
- func (e *htmlBody) OnWheel(h EventHandler, scope ...any) HTMLBody {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLBr is the interface that describes a "br" HTML element.
- type HTMLBr interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLBr
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLBr
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLBr
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLBr
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLBr
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLBr
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLBr
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLBr
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLBr
- // ID specifies a unique id for an element.
- ID(v string) HTMLBr
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLBr
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLBr
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLBr
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLBr
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLBr
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLBr
- // Title specifies extra information about an element.
- Title(v string) HTMLBr
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLBr
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLBr
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLBr
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLBr
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLBr
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLBr
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLBr
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLBr
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLBr
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLBr
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLBr
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLBr
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLBr
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLBr
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLBr
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLBr
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLBr
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLBr
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLBr
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLBr
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLBr
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLBr
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLBr
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLBr
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLBr
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLBr
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLBr
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLBr
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLBr
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLBr
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLBr
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLBr
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLBr
- }
- // Br returns an HTML element that defines a single line break.
- func Br() HTMLBr {
- e := &htmlBr{
- htmlElement: htmlElement{
- tag: "br",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlBr struct {
- htmlElement
- }
- func (e *htmlBr) AccessKey(v string) HTMLBr {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlBr) Aria(k string, v any) HTMLBr {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBr) Attr(n string, v any) HTMLBr {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlBr) Class(v ...string) HTMLBr {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlBr) ContentEditable(v bool) HTMLBr {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlBr) DataSet(k string, v any) HTMLBr {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlBr) Dir(v string) HTMLBr {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlBr) Draggable(v bool) HTMLBr {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlBr) Hidden(v bool) HTMLBr {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlBr) ID(v string) HTMLBr {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlBr) Lang(v string) HTMLBr {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlBr) Role(v string) HTMLBr {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlBr) Spellcheck(v bool) HTMLBr {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlBr) Style(k, v string) HTMLBr {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlBr) Styles(s map[string]string) HTMLBr {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlBr) TabIndex(v int) HTMLBr {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlBr) Title(v string) HTMLBr {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlBr) On(event string, h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlBr) OnBlur(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlBr) OnChange(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlBr) OnClick(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlBr) OnContextMenu(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlBr) OnCopy(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlBr) OnCut(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlBr) OnDblClick(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlBr) OnDrag(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlBr) OnDragEnd(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlBr) OnDragEnter(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlBr) OnDragLeave(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlBr) OnDragOver(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlBr) OnDragStart(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlBr) OnDrop(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlBr) OnFocus(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlBr) OnInput(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlBr) OnInvalid(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlBr) OnKeyDown(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlBr) OnKeyPress(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlBr) OnKeyUp(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlBr) OnMouseDown(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlBr) OnMouseMove(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlBr) OnMouseOut(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlBr) OnMouseOver(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlBr) OnMouseUp(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlBr) OnPaste(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlBr) OnReset(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlBr) OnScroll(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlBr) OnSearch(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlBr) OnSelect(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlBr) OnSubmit(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlBr) OnWheel(h EventHandler, scope ...any) HTMLBr {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLButton is the interface that describes a "button" HTML element.
- type HTMLButton interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLButton
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLButton
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLButton
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLButton
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLButton
- // AutoFocus specifies that the element should automatically get focus when the page loads.
- AutoFocus(v bool) HTMLButton
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLButton
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLButton
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLButton
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLButton
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLButton
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLButton
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLButton
- // FormAction specifies where to send the form-data when a form is submitted. Only for submit type.
- FormAction(v string) HTMLButton
- // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type.
- FormEncType(v string) HTMLButton
- // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type.
- FormMethod(v string) HTMLButton
- // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type.
- FormNoValidate(v bool) HTMLButton
- // FormTarget specifies where to display the response after submitting the form. Only for submit type.
- FormTarget(v string) HTMLButton
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLButton
- // ID specifies a unique id for an element.
- ID(v string) HTMLButton
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLButton
- // Name specifies the name of the element.
- Name(v string) HTMLButton
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLButton
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLButton
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLButton
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLButton
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLButton
- // Title specifies extra information about an element.
- Title(v string) HTMLButton
- // Type specifies the type of element.
- Type(v string) HTMLButton
- // Value specifies the value of the element.
- Value(v any) HTMLButton
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLButton
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLButton
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLButton
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLButton
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLButton
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLButton
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLButton
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLButton
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLButton
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLButton
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLButton
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLButton
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLButton
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLButton
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLButton
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLButton
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLButton
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLButton
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLButton
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLButton
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLButton
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLButton
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLButton
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLButton
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLButton
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLButton
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLButton
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLButton
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLButton
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLButton
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLButton
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLButton
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLButton
- }
- // Button returns an HTML element that defines a clickable button.
- func Button() HTMLButton {
- e := &htmlButton{
- htmlElement: htmlElement{
- tag: "button",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlButton struct {
- htmlElement
- }
- func (e *htmlButton) Body(v ...UI) HTMLButton {
- e.setChildren(v...)
- return e
- }
- func (e *htmlButton) Text(v any) HTMLButton {
- return e.Body(Text(v))
- }
- func (e *htmlButton) AccessKey(v string) HTMLButton {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlButton) Aria(k string, v any) HTMLButton {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlButton) Attr(n string, v any) HTMLButton {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlButton) AutoFocus(v bool) HTMLButton {
- e.setAttr("autofocus", v)
- return e
- }
- func (e *htmlButton) Class(v ...string) HTMLButton {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlButton) ContentEditable(v bool) HTMLButton {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlButton) DataSet(k string, v any) HTMLButton {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlButton) Dir(v string) HTMLButton {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlButton) Disabled(v bool) HTMLButton {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlButton) Draggable(v bool) HTMLButton {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlButton) Form(v string) HTMLButton {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlButton) FormAction(v string) HTMLButton {
- e.setAttr("formaction", v)
- return e
- }
- func (e *htmlButton) FormEncType(v string) HTMLButton {
- e.setAttr("formenctype", v)
- return e
- }
- func (e *htmlButton) FormMethod(v string) HTMLButton {
- e.setAttr("formmethod", v)
- return e
- }
- func (e *htmlButton) FormNoValidate(v bool) HTMLButton {
- e.setAttr("formnovalidate", v)
- return e
- }
- func (e *htmlButton) FormTarget(v string) HTMLButton {
- e.setAttr("formtarget", v)
- return e
- }
- func (e *htmlButton) Hidden(v bool) HTMLButton {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlButton) ID(v string) HTMLButton {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlButton) Lang(v string) HTMLButton {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlButton) Name(v string) HTMLButton {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlButton) Role(v string) HTMLButton {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlButton) Spellcheck(v bool) HTMLButton {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlButton) Style(k, v string) HTMLButton {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlButton) Styles(s map[string]string) HTMLButton {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlButton) TabIndex(v int) HTMLButton {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlButton) Title(v string) HTMLButton {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlButton) Type(v string) HTMLButton {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlButton) Value(v any) HTMLButton {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlButton) On(event string, h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlButton) OnBlur(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlButton) OnChange(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlButton) OnClick(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlButton) OnContextMenu(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlButton) OnCopy(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlButton) OnCut(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlButton) OnDblClick(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlButton) OnDrag(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlButton) OnDragEnd(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlButton) OnDragEnter(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlButton) OnDragLeave(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlButton) OnDragOver(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlButton) OnDragStart(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlButton) OnDrop(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlButton) OnFocus(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlButton) OnInput(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlButton) OnInvalid(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlButton) OnKeyDown(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlButton) OnKeyPress(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlButton) OnKeyUp(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlButton) OnMouseDown(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlButton) OnMouseMove(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlButton) OnMouseOut(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlButton) OnMouseOver(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlButton) OnMouseUp(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlButton) OnPaste(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlButton) OnReset(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlButton) OnScroll(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlButton) OnSearch(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlButton) OnSelect(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlButton) OnSubmit(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlButton) OnWheel(h EventHandler, scope ...any) HTMLButton {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLCanvas is the interface that describes a "canvas" HTML element.
- type HTMLCanvas interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLCanvas
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLCanvas
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLCanvas
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLCanvas
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLCanvas
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLCanvas
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLCanvas
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLCanvas
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLCanvas
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLCanvas
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLCanvas
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLCanvas
- // ID specifies a unique id for an element.
- ID(v string) HTMLCanvas
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLCanvas
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLCanvas
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLCanvas
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLCanvas
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLCanvas
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLCanvas
- // Title specifies extra information about an element.
- Title(v string) HTMLCanvas
- // Width specifies the width of the element.
- Width(v int) HTMLCanvas
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLCanvas
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLCanvas
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLCanvas
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLCanvas
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLCanvas
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLCanvas
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLCanvas
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLCanvas
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLCanvas
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLCanvas
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLCanvas
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLCanvas
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLCanvas
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLCanvas
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLCanvas
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLCanvas
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLCanvas
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLCanvas
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLCanvas
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLCanvas
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLCanvas
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLCanvas
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLCanvas
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLCanvas
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLCanvas
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLCanvas
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLCanvas
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLCanvas
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLCanvas
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLCanvas
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLCanvas
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLCanvas
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLCanvas
- }
- // Canvas returns an HTML element that is used to draw graphics on the fly.
- func Canvas() HTMLCanvas {
- e := &htmlCanvas{
- htmlElement: htmlElement{
- tag: "canvas",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlCanvas struct {
- htmlElement
- }
- func (e *htmlCanvas) Body(v ...UI) HTMLCanvas {
- e.setChildren(v...)
- return e
- }
- func (e *htmlCanvas) Text(v any) HTMLCanvas {
- return e.Body(Text(v))
- }
- func (e *htmlCanvas) AccessKey(v string) HTMLCanvas {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlCanvas) Aria(k string, v any) HTMLCanvas {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCanvas) Attr(n string, v any) HTMLCanvas {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlCanvas) Class(v ...string) HTMLCanvas {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlCanvas) ContentEditable(v bool) HTMLCanvas {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlCanvas) DataSet(k string, v any) HTMLCanvas {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCanvas) Dir(v string) HTMLCanvas {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlCanvas) Draggable(v bool) HTMLCanvas {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlCanvas) Height(v int) HTMLCanvas {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlCanvas) Hidden(v bool) HTMLCanvas {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlCanvas) ID(v string) HTMLCanvas {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlCanvas) Lang(v string) HTMLCanvas {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlCanvas) Role(v string) HTMLCanvas {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlCanvas) Spellcheck(v bool) HTMLCanvas {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlCanvas) Style(k, v string) HTMLCanvas {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlCanvas) Styles(s map[string]string) HTMLCanvas {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlCanvas) TabIndex(v int) HTMLCanvas {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlCanvas) Title(v string) HTMLCanvas {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlCanvas) Width(v int) HTMLCanvas {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlCanvas) On(event string, h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlCanvas) OnBlur(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnChange(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnClick(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnContextMenu(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnCopy(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnCut(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDblClick(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDrag(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDragEnd(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDragEnter(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDragLeave(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDragOver(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDragStart(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnDrop(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnFocus(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnInput(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnInvalid(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnKeyDown(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnKeyPress(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnKeyUp(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnMouseDown(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnMouseMove(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnMouseOut(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnMouseOver(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnMouseUp(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnPaste(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnReset(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnScroll(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnSearch(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnSelect(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnSubmit(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlCanvas) OnWheel(h EventHandler, scope ...any) HTMLCanvas {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLCaption is the interface that describes a "caption" HTML element.
- type HTMLCaption interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLCaption
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLCaption
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLCaption
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLCaption
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLCaption
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLCaption
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLCaption
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLCaption
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLCaption
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLCaption
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLCaption
- // ID specifies a unique id for an element.
- ID(v string) HTMLCaption
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLCaption
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLCaption
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLCaption
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLCaption
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLCaption
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLCaption
- // Title specifies extra information about an element.
- Title(v string) HTMLCaption
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLCaption
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLCaption
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLCaption
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLCaption
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLCaption
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLCaption
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLCaption
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLCaption
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLCaption
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLCaption
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLCaption
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLCaption
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLCaption
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLCaption
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLCaption
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLCaption
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLCaption
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLCaption
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLCaption
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLCaption
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLCaption
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLCaption
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLCaption
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLCaption
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLCaption
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLCaption
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLCaption
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLCaption
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLCaption
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLCaption
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLCaption
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLCaption
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLCaption
- }
- // Caption returns an HTML element that defines a table caption.
- func Caption() HTMLCaption {
- e := &htmlCaption{
- htmlElement: htmlElement{
- tag: "caption",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlCaption struct {
- htmlElement
- }
- func (e *htmlCaption) Body(v ...UI) HTMLCaption {
- e.setChildren(v...)
- return e
- }
- func (e *htmlCaption) Text(v any) HTMLCaption {
- return e.Body(Text(v))
- }
- func (e *htmlCaption) AccessKey(v string) HTMLCaption {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlCaption) Aria(k string, v any) HTMLCaption {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCaption) Attr(n string, v any) HTMLCaption {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlCaption) Class(v ...string) HTMLCaption {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlCaption) ContentEditable(v bool) HTMLCaption {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlCaption) DataSet(k string, v any) HTMLCaption {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCaption) Dir(v string) HTMLCaption {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlCaption) Draggable(v bool) HTMLCaption {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlCaption) Hidden(v bool) HTMLCaption {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlCaption) ID(v string) HTMLCaption {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlCaption) Lang(v string) HTMLCaption {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlCaption) Role(v string) HTMLCaption {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlCaption) Spellcheck(v bool) HTMLCaption {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlCaption) Style(k, v string) HTMLCaption {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlCaption) Styles(s map[string]string) HTMLCaption {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlCaption) TabIndex(v int) HTMLCaption {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlCaption) Title(v string) HTMLCaption {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlCaption) On(event string, h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlCaption) OnBlur(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlCaption) OnChange(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlCaption) OnClick(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlCaption) OnContextMenu(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlCaption) OnCopy(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlCaption) OnCut(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDblClick(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDrag(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDragEnd(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDragEnter(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDragLeave(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDragOver(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDragStart(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlCaption) OnDrop(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlCaption) OnFocus(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlCaption) OnInput(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlCaption) OnInvalid(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlCaption) OnKeyDown(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlCaption) OnKeyPress(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlCaption) OnKeyUp(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlCaption) OnMouseDown(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlCaption) OnMouseMove(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlCaption) OnMouseOut(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlCaption) OnMouseOver(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlCaption) OnMouseUp(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlCaption) OnPaste(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlCaption) OnReset(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlCaption) OnScroll(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlCaption) OnSearch(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlCaption) OnSelect(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlCaption) OnSubmit(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlCaption) OnWheel(h EventHandler, scope ...any) HTMLCaption {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLCite is the interface that describes a "cite" HTML element.
- type HTMLCite interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLCite
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLCite
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLCite
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLCite
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLCite
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLCite
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLCite
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLCite
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLCite
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLCite
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLCite
- // ID specifies a unique id for an element.
- ID(v string) HTMLCite
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLCite
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLCite
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLCite
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLCite
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLCite
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLCite
- // Title specifies extra information about an element.
- Title(v string) HTMLCite
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLCite
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLCite
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLCite
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLCite
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLCite
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLCite
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLCite
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLCite
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLCite
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLCite
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLCite
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLCite
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLCite
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLCite
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLCite
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLCite
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLCite
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLCite
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLCite
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLCite
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLCite
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLCite
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLCite
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLCite
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLCite
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLCite
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLCite
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLCite
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLCite
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLCite
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLCite
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLCite
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLCite
- }
- // Cite returns an HTML element that defines the title of a work.
- func Cite() HTMLCite {
- e := &htmlCite{
- htmlElement: htmlElement{
- tag: "cite",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlCite struct {
- htmlElement
- }
- func (e *htmlCite) Body(v ...UI) HTMLCite {
- e.setChildren(v...)
- return e
- }
- func (e *htmlCite) Text(v any) HTMLCite {
- return e.Body(Text(v))
- }
- func (e *htmlCite) AccessKey(v string) HTMLCite {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlCite) Aria(k string, v any) HTMLCite {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCite) Attr(n string, v any) HTMLCite {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlCite) Class(v ...string) HTMLCite {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlCite) ContentEditable(v bool) HTMLCite {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlCite) DataSet(k string, v any) HTMLCite {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCite) Dir(v string) HTMLCite {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlCite) Draggable(v bool) HTMLCite {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlCite) Hidden(v bool) HTMLCite {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlCite) ID(v string) HTMLCite {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlCite) Lang(v string) HTMLCite {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlCite) Role(v string) HTMLCite {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlCite) Spellcheck(v bool) HTMLCite {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlCite) Style(k, v string) HTMLCite {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlCite) Styles(s map[string]string) HTMLCite {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlCite) TabIndex(v int) HTMLCite {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlCite) Title(v string) HTMLCite {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlCite) On(event string, h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlCite) OnBlur(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlCite) OnChange(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlCite) OnClick(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlCite) OnContextMenu(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlCite) OnCopy(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlCite) OnCut(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlCite) OnDblClick(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlCite) OnDrag(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlCite) OnDragEnd(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlCite) OnDragEnter(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlCite) OnDragLeave(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlCite) OnDragOver(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlCite) OnDragStart(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlCite) OnDrop(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlCite) OnFocus(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlCite) OnInput(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlCite) OnInvalid(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlCite) OnKeyDown(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlCite) OnKeyPress(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlCite) OnKeyUp(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlCite) OnMouseDown(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlCite) OnMouseMove(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlCite) OnMouseOut(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlCite) OnMouseOver(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlCite) OnMouseUp(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlCite) OnPaste(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlCite) OnReset(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlCite) OnScroll(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlCite) OnSearch(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlCite) OnSelect(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlCite) OnSubmit(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlCite) OnWheel(h EventHandler, scope ...any) HTMLCite {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLCode is the interface that describes a "code" HTML element.
- type HTMLCode interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLCode
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLCode
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLCode
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLCode
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLCode
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLCode
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLCode
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLCode
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLCode
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLCode
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLCode
- // ID specifies a unique id for an element.
- ID(v string) HTMLCode
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLCode
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLCode
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLCode
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLCode
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLCode
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLCode
- // Title specifies extra information about an element.
- Title(v string) HTMLCode
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLCode
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLCode
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLCode
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLCode
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLCode
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLCode
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLCode
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLCode
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLCode
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLCode
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLCode
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLCode
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLCode
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLCode
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLCode
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLCode
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLCode
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLCode
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLCode
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLCode
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLCode
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLCode
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLCode
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLCode
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLCode
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLCode
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLCode
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLCode
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLCode
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLCode
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLCode
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLCode
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLCode
- }
- // Code returns an HTML element that defines a piece of computer code.
- func Code() HTMLCode {
- e := &htmlCode{
- htmlElement: htmlElement{
- tag: "code",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlCode struct {
- htmlElement
- }
- func (e *htmlCode) Body(v ...UI) HTMLCode {
- e.setChildren(v...)
- return e
- }
- func (e *htmlCode) Text(v any) HTMLCode {
- return e.Body(Text(v))
- }
- func (e *htmlCode) AccessKey(v string) HTMLCode {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlCode) Aria(k string, v any) HTMLCode {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCode) Attr(n string, v any) HTMLCode {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlCode) Class(v ...string) HTMLCode {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlCode) ContentEditable(v bool) HTMLCode {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlCode) DataSet(k string, v any) HTMLCode {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCode) Dir(v string) HTMLCode {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlCode) Draggable(v bool) HTMLCode {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlCode) Hidden(v bool) HTMLCode {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlCode) ID(v string) HTMLCode {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlCode) Lang(v string) HTMLCode {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlCode) Role(v string) HTMLCode {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlCode) Spellcheck(v bool) HTMLCode {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlCode) Style(k, v string) HTMLCode {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlCode) Styles(s map[string]string) HTMLCode {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlCode) TabIndex(v int) HTMLCode {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlCode) Title(v string) HTMLCode {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlCode) On(event string, h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlCode) OnBlur(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlCode) OnChange(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlCode) OnClick(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlCode) OnContextMenu(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlCode) OnCopy(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlCode) OnCut(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlCode) OnDblClick(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlCode) OnDrag(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlCode) OnDragEnd(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlCode) OnDragEnter(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlCode) OnDragLeave(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlCode) OnDragOver(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlCode) OnDragStart(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlCode) OnDrop(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlCode) OnFocus(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlCode) OnInput(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlCode) OnInvalid(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlCode) OnKeyDown(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlCode) OnKeyPress(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlCode) OnKeyUp(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlCode) OnMouseDown(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlCode) OnMouseMove(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlCode) OnMouseOut(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlCode) OnMouseOver(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlCode) OnMouseUp(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlCode) OnPaste(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlCode) OnReset(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlCode) OnScroll(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlCode) OnSearch(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlCode) OnSelect(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlCode) OnSubmit(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlCode) OnWheel(h EventHandler, scope ...any) HTMLCode {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLCol is the interface that describes a "col" HTML element.
- type HTMLCol interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLCol
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLCol
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLCol
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLCol
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLCol
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLCol
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLCol
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLCol
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLCol
- // ID specifies a unique id for an element.
- ID(v string) HTMLCol
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLCol
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLCol
- // Span specifies the number of columns to span.
- Span(v int) HTMLCol
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLCol
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLCol
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLCol
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLCol
- // Title specifies extra information about an element.
- Title(v string) HTMLCol
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLCol
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLCol
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLCol
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLCol
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLCol
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLCol
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLCol
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLCol
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLCol
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLCol
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLCol
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLCol
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLCol
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLCol
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLCol
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLCol
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLCol
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLCol
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLCol
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLCol
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLCol
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLCol
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLCol
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLCol
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLCol
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLCol
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLCol
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLCol
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLCol
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLCol
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLCol
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLCol
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLCol
- }
- // Col returns an HTML element that specifies column properties for each column within a colgroup element.
- func Col() HTMLCol {
- e := &htmlCol{
- htmlElement: htmlElement{
- tag: "col",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlCol struct {
- htmlElement
- }
- func (e *htmlCol) AccessKey(v string) HTMLCol {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlCol) Aria(k string, v any) HTMLCol {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCol) Attr(n string, v any) HTMLCol {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlCol) Class(v ...string) HTMLCol {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlCol) ContentEditable(v bool) HTMLCol {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlCol) DataSet(k string, v any) HTMLCol {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlCol) Dir(v string) HTMLCol {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlCol) Draggable(v bool) HTMLCol {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlCol) Hidden(v bool) HTMLCol {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlCol) ID(v string) HTMLCol {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlCol) Lang(v string) HTMLCol {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlCol) Role(v string) HTMLCol {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlCol) Span(v int) HTMLCol {
- e.setAttr("span", v)
- return e
- }
- func (e *htmlCol) Spellcheck(v bool) HTMLCol {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlCol) Style(k, v string) HTMLCol {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlCol) Styles(s map[string]string) HTMLCol {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlCol) TabIndex(v int) HTMLCol {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlCol) Title(v string) HTMLCol {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlCol) On(event string, h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlCol) OnBlur(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlCol) OnChange(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlCol) OnClick(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlCol) OnContextMenu(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlCol) OnCopy(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlCol) OnCut(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlCol) OnDblClick(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlCol) OnDrag(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlCol) OnDragEnd(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlCol) OnDragEnter(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlCol) OnDragLeave(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlCol) OnDragOver(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlCol) OnDragStart(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlCol) OnDrop(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlCol) OnFocus(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlCol) OnInput(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlCol) OnInvalid(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlCol) OnKeyDown(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlCol) OnKeyPress(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlCol) OnKeyUp(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlCol) OnMouseDown(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlCol) OnMouseMove(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlCol) OnMouseOut(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlCol) OnMouseOver(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlCol) OnMouseUp(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlCol) OnPaste(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlCol) OnReset(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlCol) OnScroll(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlCol) OnSearch(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlCol) OnSelect(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlCol) OnSubmit(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlCol) OnWheel(h EventHandler, scope ...any) HTMLCol {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLColGroup is the interface that describes a "colgroup" HTML element.
- type HTMLColGroup interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLColGroup
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLColGroup
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLColGroup
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLColGroup
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLColGroup
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLColGroup
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLColGroup
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLColGroup
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLColGroup
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLColGroup
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLColGroup
- // ID specifies a unique id for an element.
- ID(v string) HTMLColGroup
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLColGroup
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLColGroup
- // Span specifies the number of columns to span.
- Span(v int) HTMLColGroup
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLColGroup
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLColGroup
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLColGroup
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLColGroup
- // Title specifies extra information about an element.
- Title(v string) HTMLColGroup
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLColGroup
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLColGroup
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLColGroup
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLColGroup
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLColGroup
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLColGroup
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLColGroup
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLColGroup
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLColGroup
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLColGroup
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLColGroup
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLColGroup
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLColGroup
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLColGroup
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLColGroup
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLColGroup
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLColGroup
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLColGroup
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLColGroup
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLColGroup
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLColGroup
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLColGroup
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLColGroup
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLColGroup
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLColGroup
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLColGroup
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLColGroup
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLColGroup
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLColGroup
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLColGroup
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLColGroup
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLColGroup
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLColGroup
- }
- // ColGroup returns an HTML element that specifies a group of one or more columns in a table for formatting.
- func ColGroup() HTMLColGroup {
- e := &htmlColGroup{
- htmlElement: htmlElement{
- tag: "colgroup",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlColGroup struct {
- htmlElement
- }
- func (e *htmlColGroup) Body(v ...UI) HTMLColGroup {
- e.setChildren(v...)
- return e
- }
- func (e *htmlColGroup) Text(v any) HTMLColGroup {
- return e.Body(Text(v))
- }
- func (e *htmlColGroup) AccessKey(v string) HTMLColGroup {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlColGroup) Aria(k string, v any) HTMLColGroup {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlColGroup) Attr(n string, v any) HTMLColGroup {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlColGroup) Class(v ...string) HTMLColGroup {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlColGroup) ContentEditable(v bool) HTMLColGroup {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlColGroup) DataSet(k string, v any) HTMLColGroup {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlColGroup) Dir(v string) HTMLColGroup {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlColGroup) Draggable(v bool) HTMLColGroup {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlColGroup) Hidden(v bool) HTMLColGroup {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlColGroup) ID(v string) HTMLColGroup {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlColGroup) Lang(v string) HTMLColGroup {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlColGroup) Role(v string) HTMLColGroup {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlColGroup) Span(v int) HTMLColGroup {
- e.setAttr("span", v)
- return e
- }
- func (e *htmlColGroup) Spellcheck(v bool) HTMLColGroup {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlColGroup) Style(k, v string) HTMLColGroup {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlColGroup) Styles(s map[string]string) HTMLColGroup {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlColGroup) TabIndex(v int) HTMLColGroup {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlColGroup) Title(v string) HTMLColGroup {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlColGroup) On(event string, h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlColGroup) OnBlur(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnChange(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnClick(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnContextMenu(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnCopy(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnCut(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDblClick(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDrag(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDragEnd(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDragEnter(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDragLeave(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDragOver(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDragStart(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnDrop(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnFocus(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnInput(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnInvalid(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnKeyDown(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnKeyPress(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnKeyUp(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnMouseDown(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnMouseMove(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnMouseOut(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnMouseOver(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnMouseUp(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnPaste(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnReset(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnScroll(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnSearch(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnSelect(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnSubmit(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlColGroup) OnWheel(h EventHandler, scope ...any) HTMLColGroup {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLData is the interface that describes a "data" HTML element.
- type HTMLData interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLData
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLData
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLData
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLData
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLData
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLData
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLData
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLData
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLData
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLData
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLData
- // ID specifies a unique id for an element.
- ID(v string) HTMLData
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLData
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLData
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLData
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLData
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLData
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLData
- // Title specifies extra information about an element.
- Title(v string) HTMLData
- // Value specifies the value of the element.
- Value(v any) HTMLData
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLData
- }
- // Data returns an HTML element that links the given content with a machine-readable translation.
- func Data() HTMLData {
- e := &htmlData{
- htmlElement: htmlElement{
- tag: "data",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlData struct {
- htmlElement
- }
- func (e *htmlData) Body(v ...UI) HTMLData {
- e.setChildren(v...)
- return e
- }
- func (e *htmlData) Text(v any) HTMLData {
- return e.Body(Text(v))
- }
- func (e *htmlData) AccessKey(v string) HTMLData {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlData) Aria(k string, v any) HTMLData {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlData) Attr(n string, v any) HTMLData {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlData) Class(v ...string) HTMLData {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlData) ContentEditable(v bool) HTMLData {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlData) DataSet(k string, v any) HTMLData {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlData) Dir(v string) HTMLData {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlData) Draggable(v bool) HTMLData {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlData) Hidden(v bool) HTMLData {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlData) ID(v string) HTMLData {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlData) Lang(v string) HTMLData {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlData) Role(v string) HTMLData {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlData) Spellcheck(v bool) HTMLData {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlData) Style(k, v string) HTMLData {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlData) Styles(s map[string]string) HTMLData {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlData) TabIndex(v int) HTMLData {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlData) Title(v string) HTMLData {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlData) Value(v any) HTMLData {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlData) On(event string, h EventHandler, scope ...any) HTMLData {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLDataList is the interface that describes a "datalist" HTML element.
- type HTMLDataList interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDataList
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDataList
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDataList
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDataList
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDataList
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDataList
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDataList
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDataList
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDataList
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDataList
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDataList
- // ID specifies a unique id for an element.
- ID(v string) HTMLDataList
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDataList
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDataList
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDataList
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDataList
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDataList
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDataList
- // Title specifies extra information about an element.
- Title(v string) HTMLDataList
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDataList
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDataList
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDataList
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDataList
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDataList
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDataList
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDataList
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDataList
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDataList
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDataList
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDataList
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDataList
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDataList
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDataList
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDataList
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDataList
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDataList
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDataList
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDataList
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDataList
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDataList
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDataList
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDataList
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDataList
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDataList
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDataList
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDataList
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDataList
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDataList
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDataList
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDataList
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDataList
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDataList
- }
- // DataList returns an HTML element that specifies a list of pre-defined options for input controls.
- func DataList() HTMLDataList {
- e := &htmlDataList{
- htmlElement: htmlElement{
- tag: "datalist",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDataList struct {
- htmlElement
- }
- func (e *htmlDataList) Body(v ...UI) HTMLDataList {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDataList) Text(v any) HTMLDataList {
- return e.Body(Text(v))
- }
- func (e *htmlDataList) AccessKey(v string) HTMLDataList {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDataList) Aria(k string, v any) HTMLDataList {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDataList) Attr(n string, v any) HTMLDataList {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDataList) Class(v ...string) HTMLDataList {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDataList) ContentEditable(v bool) HTMLDataList {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDataList) DataSet(k string, v any) HTMLDataList {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDataList) Dir(v string) HTMLDataList {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDataList) Draggable(v bool) HTMLDataList {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDataList) Hidden(v bool) HTMLDataList {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDataList) ID(v string) HTMLDataList {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDataList) Lang(v string) HTMLDataList {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDataList) Role(v string) HTMLDataList {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDataList) Spellcheck(v bool) HTMLDataList {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDataList) Style(k, v string) HTMLDataList {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDataList) Styles(s map[string]string) HTMLDataList {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDataList) TabIndex(v int) HTMLDataList {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDataList) Title(v string) HTMLDataList {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDataList) On(event string, h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDataList) OnBlur(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDataList) OnChange(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDataList) OnClick(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDataList) OnContextMenu(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDataList) OnCopy(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDataList) OnCut(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDblClick(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDrag(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDragEnd(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDragEnter(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDragLeave(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDragOver(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDragStart(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDataList) OnDrop(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDataList) OnFocus(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDataList) OnInput(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDataList) OnInvalid(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDataList) OnKeyDown(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDataList) OnKeyPress(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDataList) OnKeyUp(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDataList) OnMouseDown(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDataList) OnMouseMove(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDataList) OnMouseOut(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDataList) OnMouseOver(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDataList) OnMouseUp(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDataList) OnPaste(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDataList) OnReset(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDataList) OnScroll(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDataList) OnSearch(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDataList) OnSelect(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDataList) OnSubmit(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDataList) OnWheel(h EventHandler, scope ...any) HTMLDataList {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDd is the interface that describes a "dd" HTML element.
- type HTMLDd interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDd
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDd
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDd
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDd
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDd
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDd
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDd
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDd
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDd
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDd
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDd
- // ID specifies a unique id for an element.
- ID(v string) HTMLDd
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDd
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDd
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDd
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDd
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDd
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDd
- // Title specifies extra information about an element.
- Title(v string) HTMLDd
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDd
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDd
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDd
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDd
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDd
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDd
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDd
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDd
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDd
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDd
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDd
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDd
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDd
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDd
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDd
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDd
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDd
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDd
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDd
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDd
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDd
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDd
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDd
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDd
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDd
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDd
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDd
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDd
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDd
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDd
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDd
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDd
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDd
- }
- // Dd returns an HTML element that defines a description/value of a term in a description list.
- func Dd() HTMLDd {
- e := &htmlDd{
- htmlElement: htmlElement{
- tag: "dd",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDd struct {
- htmlElement
- }
- func (e *htmlDd) Body(v ...UI) HTMLDd {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDd) Text(v any) HTMLDd {
- return e.Body(Text(v))
- }
- func (e *htmlDd) AccessKey(v string) HTMLDd {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDd) Aria(k string, v any) HTMLDd {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDd) Attr(n string, v any) HTMLDd {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDd) Class(v ...string) HTMLDd {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDd) ContentEditable(v bool) HTMLDd {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDd) DataSet(k string, v any) HTMLDd {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDd) Dir(v string) HTMLDd {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDd) Draggable(v bool) HTMLDd {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDd) Hidden(v bool) HTMLDd {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDd) ID(v string) HTMLDd {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDd) Lang(v string) HTMLDd {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDd) Role(v string) HTMLDd {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDd) Spellcheck(v bool) HTMLDd {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDd) Style(k, v string) HTMLDd {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDd) Styles(s map[string]string) HTMLDd {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDd) TabIndex(v int) HTMLDd {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDd) Title(v string) HTMLDd {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDd) On(event string, h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDd) OnBlur(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDd) OnChange(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDd) OnClick(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDd) OnContextMenu(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDd) OnCopy(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDd) OnCut(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDd) OnDblClick(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDd) OnDrag(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDd) OnDragEnd(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDd) OnDragEnter(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDd) OnDragLeave(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDd) OnDragOver(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDd) OnDragStart(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDd) OnDrop(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDd) OnFocus(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDd) OnInput(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDd) OnInvalid(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDd) OnKeyDown(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDd) OnKeyPress(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDd) OnKeyUp(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDd) OnMouseDown(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDd) OnMouseMove(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDd) OnMouseOut(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDd) OnMouseOver(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDd) OnMouseUp(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDd) OnPaste(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDd) OnReset(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDd) OnScroll(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDd) OnSearch(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDd) OnSelect(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDd) OnSubmit(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDd) OnWheel(h EventHandler, scope ...any) HTMLDd {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDel is the interface that describes a "del" HTML element.
- type HTMLDel interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDel
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDel
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDel
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDel
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDel
- // Cite specifies a URL which explains the quote/deleted/inserted text.
- Cite(v string) HTMLDel
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDel
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDel
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDel
- // DateTime specifies the date and time.
- DateTime(v string) HTMLDel
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDel
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDel
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDel
- // ID specifies a unique id for an element.
- ID(v string) HTMLDel
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDel
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDel
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDel
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDel
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDel
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDel
- // Title specifies extra information about an element.
- Title(v string) HTMLDel
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDel
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDel
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDel
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDel
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDel
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDel
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDel
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDel
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDel
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDel
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDel
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDel
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDel
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDel
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDel
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDel
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDel
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDel
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDel
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDel
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDel
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDel
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDel
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDel
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDel
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDel
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDel
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDel
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDel
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDel
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDel
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDel
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDel
- }
- // Del returns an HTML element that defines text that has been deleted from a document.
- func Del() HTMLDel {
- e := &htmlDel{
- htmlElement: htmlElement{
- tag: "del",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDel struct {
- htmlElement
- }
- func (e *htmlDel) Body(v ...UI) HTMLDel {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDel) Text(v any) HTMLDel {
- return e.Body(Text(v))
- }
- func (e *htmlDel) AccessKey(v string) HTMLDel {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDel) Aria(k string, v any) HTMLDel {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDel) Attr(n string, v any) HTMLDel {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDel) Cite(v string) HTMLDel {
- e.setAttr("cite", v)
- return e
- }
- func (e *htmlDel) Class(v ...string) HTMLDel {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDel) ContentEditable(v bool) HTMLDel {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDel) DataSet(k string, v any) HTMLDel {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDel) DateTime(v string) HTMLDel {
- e.setAttr("datetime", v)
- return e
- }
- func (e *htmlDel) Dir(v string) HTMLDel {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDel) Draggable(v bool) HTMLDel {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDel) Hidden(v bool) HTMLDel {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDel) ID(v string) HTMLDel {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDel) Lang(v string) HTMLDel {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDel) Role(v string) HTMLDel {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDel) Spellcheck(v bool) HTMLDel {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDel) Style(k, v string) HTMLDel {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDel) Styles(s map[string]string) HTMLDel {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDel) TabIndex(v int) HTMLDel {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDel) Title(v string) HTMLDel {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDel) On(event string, h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDel) OnBlur(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDel) OnChange(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDel) OnClick(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDel) OnContextMenu(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDel) OnCopy(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDel) OnCut(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDel) OnDblClick(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDel) OnDrag(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDel) OnDragEnd(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDel) OnDragEnter(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDel) OnDragLeave(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDel) OnDragOver(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDel) OnDragStart(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDel) OnDrop(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDel) OnFocus(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDel) OnInput(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDel) OnInvalid(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDel) OnKeyDown(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDel) OnKeyPress(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDel) OnKeyUp(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDel) OnMouseDown(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDel) OnMouseMove(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDel) OnMouseOut(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDel) OnMouseOver(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDel) OnMouseUp(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDel) OnPaste(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDel) OnReset(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDel) OnScroll(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDel) OnSearch(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDel) OnSelect(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDel) OnSubmit(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDel) OnWheel(h EventHandler, scope ...any) HTMLDel {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDetails is the interface that describes a "details" HTML element.
- type HTMLDetails interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDetails
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDetails
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDetails
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDetails
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDetails
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDetails
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDetails
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDetails
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDetails
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDetails
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDetails
- // ID specifies a unique id for an element.
- ID(v string) HTMLDetails
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDetails
- // Open specifies that the details should be visible (open) to the user.
- Open(v bool) HTMLDetails
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDetails
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDetails
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDetails
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDetails
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDetails
- // Title specifies extra information about an element.
- Title(v string) HTMLDetails
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDetails
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDetails
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDetails
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDetails
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDetails
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDetails
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDetails
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDetails
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDetails
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDetails
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDetails
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDetails
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDetails
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDetails
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDetails
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDetails
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDetails
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDetails
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDetails
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDetails
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDetails
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDetails
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDetails
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDetails
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDetails
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDetails
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDetails
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDetails
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDetails
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDetails
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDetails
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDetails
- // OnToggle calls the given handler when the user opens or closes the details element.
- OnToggle(h EventHandler, scope ...any) HTMLDetails
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDetails
- }
- // Details returns an HTML element that defines additional details that the user can view or hide.
- func Details() HTMLDetails {
- e := &htmlDetails{
- htmlElement: htmlElement{
- tag: "details",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDetails struct {
- htmlElement
- }
- func (e *htmlDetails) Body(v ...UI) HTMLDetails {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDetails) Text(v any) HTMLDetails {
- return e.Body(Text(v))
- }
- func (e *htmlDetails) AccessKey(v string) HTMLDetails {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDetails) Aria(k string, v any) HTMLDetails {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDetails) Attr(n string, v any) HTMLDetails {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDetails) Class(v ...string) HTMLDetails {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDetails) ContentEditable(v bool) HTMLDetails {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDetails) DataSet(k string, v any) HTMLDetails {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDetails) Dir(v string) HTMLDetails {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDetails) Draggable(v bool) HTMLDetails {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDetails) Hidden(v bool) HTMLDetails {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDetails) ID(v string) HTMLDetails {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDetails) Lang(v string) HTMLDetails {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDetails) Open(v bool) HTMLDetails {
- e.setAttr("open", v)
- return e
- }
- func (e *htmlDetails) Role(v string) HTMLDetails {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDetails) Spellcheck(v bool) HTMLDetails {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDetails) Style(k, v string) HTMLDetails {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDetails) Styles(s map[string]string) HTMLDetails {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDetails) TabIndex(v int) HTMLDetails {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDetails) Title(v string) HTMLDetails {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDetails) On(event string, h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDetails) OnBlur(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDetails) OnChange(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDetails) OnClick(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDetails) OnContextMenu(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDetails) OnCopy(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDetails) OnCut(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDblClick(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDrag(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDragEnd(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDragEnter(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDragLeave(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDragOver(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDragStart(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDetails) OnDrop(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDetails) OnFocus(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDetails) OnInput(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDetails) OnInvalid(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDetails) OnKeyDown(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDetails) OnKeyPress(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDetails) OnKeyUp(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDetails) OnMouseDown(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDetails) OnMouseMove(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDetails) OnMouseOut(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDetails) OnMouseOver(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDetails) OnMouseUp(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDetails) OnPaste(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDetails) OnReset(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDetails) OnScroll(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDetails) OnSearch(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDetails) OnSelect(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDetails) OnSubmit(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDetails) OnToggle(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("toggle", h, scope...)
- return e
- }
- func (e *htmlDetails) OnWheel(h EventHandler, scope ...any) HTMLDetails {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDfn is the interface that describes a "dfn" HTML element.
- type HTMLDfn interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDfn
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDfn
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDfn
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDfn
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDfn
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDfn
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDfn
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDfn
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDfn
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDfn
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDfn
- // ID specifies a unique id for an element.
- ID(v string) HTMLDfn
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDfn
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDfn
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDfn
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDfn
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDfn
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDfn
- // Title specifies extra information about an element.
- Title(v string) HTMLDfn
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDfn
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDfn
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDfn
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDfn
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDfn
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDfn
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDfn
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDfn
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDfn
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDfn
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDfn
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDfn
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDfn
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDfn
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDfn
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDfn
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDfn
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDfn
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDfn
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDfn
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDfn
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDfn
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDfn
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDfn
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDfn
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDfn
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDfn
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDfn
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDfn
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDfn
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDfn
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDfn
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDfn
- }
- // Dfn returns an HTML element that represents the defining instance of a term.
- func Dfn() HTMLDfn {
- e := &htmlDfn{
- htmlElement: htmlElement{
- tag: "dfn",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDfn struct {
- htmlElement
- }
- func (e *htmlDfn) Body(v ...UI) HTMLDfn {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDfn) Text(v any) HTMLDfn {
- return e.Body(Text(v))
- }
- func (e *htmlDfn) AccessKey(v string) HTMLDfn {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDfn) Aria(k string, v any) HTMLDfn {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDfn) Attr(n string, v any) HTMLDfn {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDfn) Class(v ...string) HTMLDfn {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDfn) ContentEditable(v bool) HTMLDfn {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDfn) DataSet(k string, v any) HTMLDfn {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDfn) Dir(v string) HTMLDfn {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDfn) Draggable(v bool) HTMLDfn {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDfn) Hidden(v bool) HTMLDfn {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDfn) ID(v string) HTMLDfn {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDfn) Lang(v string) HTMLDfn {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDfn) Role(v string) HTMLDfn {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDfn) Spellcheck(v bool) HTMLDfn {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDfn) Style(k, v string) HTMLDfn {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDfn) Styles(s map[string]string) HTMLDfn {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDfn) TabIndex(v int) HTMLDfn {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDfn) Title(v string) HTMLDfn {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDfn) On(event string, h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDfn) OnBlur(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDfn) OnChange(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDfn) OnClick(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDfn) OnContextMenu(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDfn) OnCopy(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDfn) OnCut(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDblClick(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDrag(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDragEnd(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDragEnter(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDragLeave(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDragOver(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDragStart(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDfn) OnDrop(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDfn) OnFocus(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDfn) OnInput(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDfn) OnInvalid(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDfn) OnKeyDown(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDfn) OnKeyPress(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDfn) OnKeyUp(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDfn) OnMouseDown(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDfn) OnMouseMove(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDfn) OnMouseOut(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDfn) OnMouseOver(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDfn) OnMouseUp(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDfn) OnPaste(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDfn) OnReset(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDfn) OnScroll(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDfn) OnSearch(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDfn) OnSelect(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDfn) OnSubmit(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDfn) OnWheel(h EventHandler, scope ...any) HTMLDfn {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDialog is the interface that describes a "dialog" HTML element.
- type HTMLDialog interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDialog
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDialog
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDialog
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDialog
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDialog
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDialog
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDialog
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDialog
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDialog
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDialog
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDialog
- // ID specifies a unique id for an element.
- ID(v string) HTMLDialog
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDialog
- // Open specifies that the details should be visible (open) to the user.
- Open(v bool) HTMLDialog
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDialog
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDialog
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDialog
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDialog
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDialog
- // Title specifies extra information about an element.
- Title(v string) HTMLDialog
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDialog
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDialog
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDialog
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDialog
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDialog
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDialog
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDialog
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDialog
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDialog
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDialog
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDialog
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDialog
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDialog
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDialog
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDialog
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDialog
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDialog
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDialog
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDialog
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDialog
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDialog
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDialog
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDialog
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDialog
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDialog
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDialog
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDialog
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDialog
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDialog
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDialog
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDialog
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDialog
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDialog
- }
- // Dialog returns an HTML element that defines a dialog box or window.
- func Dialog() HTMLDialog {
- e := &htmlDialog{
- htmlElement: htmlElement{
- tag: "dialog",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDialog struct {
- htmlElement
- }
- func (e *htmlDialog) Body(v ...UI) HTMLDialog {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDialog) Text(v any) HTMLDialog {
- return e.Body(Text(v))
- }
- func (e *htmlDialog) AccessKey(v string) HTMLDialog {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDialog) Aria(k string, v any) HTMLDialog {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDialog) Attr(n string, v any) HTMLDialog {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDialog) Class(v ...string) HTMLDialog {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDialog) ContentEditable(v bool) HTMLDialog {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDialog) DataSet(k string, v any) HTMLDialog {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDialog) Dir(v string) HTMLDialog {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDialog) Draggable(v bool) HTMLDialog {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDialog) Hidden(v bool) HTMLDialog {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDialog) ID(v string) HTMLDialog {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDialog) Lang(v string) HTMLDialog {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDialog) Open(v bool) HTMLDialog {
- e.setAttr("open", v)
- return e
- }
- func (e *htmlDialog) Role(v string) HTMLDialog {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDialog) Spellcheck(v bool) HTMLDialog {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDialog) Style(k, v string) HTMLDialog {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDialog) Styles(s map[string]string) HTMLDialog {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDialog) TabIndex(v int) HTMLDialog {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDialog) Title(v string) HTMLDialog {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDialog) On(event string, h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDialog) OnBlur(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDialog) OnChange(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDialog) OnClick(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDialog) OnContextMenu(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDialog) OnCopy(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDialog) OnCut(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDblClick(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDrag(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDragEnd(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDragEnter(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDragLeave(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDragOver(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDragStart(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDialog) OnDrop(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDialog) OnFocus(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDialog) OnInput(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDialog) OnInvalid(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDialog) OnKeyDown(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDialog) OnKeyPress(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDialog) OnKeyUp(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDialog) OnMouseDown(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDialog) OnMouseMove(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDialog) OnMouseOut(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDialog) OnMouseOver(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDialog) OnMouseUp(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDialog) OnPaste(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDialog) OnReset(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDialog) OnScroll(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDialog) OnSearch(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDialog) OnSelect(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDialog) OnSubmit(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDialog) OnWheel(h EventHandler, scope ...any) HTMLDialog {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDiv is the interface that describes a "div" HTML element.
- type HTMLDiv interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDiv
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDiv
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDiv
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDiv
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDiv
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDiv
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDiv
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDiv
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDiv
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDiv
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDiv
- // ID specifies a unique id for an element.
- ID(v string) HTMLDiv
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDiv
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDiv
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDiv
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDiv
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDiv
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDiv
- // Title specifies extra information about an element.
- Title(v string) HTMLDiv
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDiv
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDiv
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDiv
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDiv
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDiv
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDiv
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDiv
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDiv
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDiv
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDiv
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDiv
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDiv
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDiv
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDiv
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDiv
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDiv
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDiv
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDiv
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDiv
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDiv
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDiv
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDiv
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDiv
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDiv
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDiv
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDiv
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDiv
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDiv
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDiv
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDiv
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDiv
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDiv
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDiv
- }
- // Div returns an HTML element that defines a section in a document.
- func Div() HTMLDiv {
- e := &htmlDiv{
- htmlElement: htmlElement{
- tag: "div",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDiv struct {
- htmlElement
- }
- func (e *htmlDiv) Body(v ...UI) HTMLDiv {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDiv) Text(v any) HTMLDiv {
- return e.Body(Text(v))
- }
- func (e *htmlDiv) AccessKey(v string) HTMLDiv {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDiv) Aria(k string, v any) HTMLDiv {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDiv) Attr(n string, v any) HTMLDiv {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDiv) Class(v ...string) HTMLDiv {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDiv) ContentEditable(v bool) HTMLDiv {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDiv) DataSet(k string, v any) HTMLDiv {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDiv) Dir(v string) HTMLDiv {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDiv) Draggable(v bool) HTMLDiv {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDiv) Hidden(v bool) HTMLDiv {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDiv) ID(v string) HTMLDiv {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDiv) Lang(v string) HTMLDiv {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDiv) Role(v string) HTMLDiv {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDiv) Spellcheck(v bool) HTMLDiv {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDiv) Style(k, v string) HTMLDiv {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDiv) Styles(s map[string]string) HTMLDiv {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDiv) TabIndex(v int) HTMLDiv {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDiv) Title(v string) HTMLDiv {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDiv) On(event string, h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDiv) OnBlur(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDiv) OnChange(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDiv) OnClick(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDiv) OnContextMenu(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDiv) OnCopy(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDiv) OnCut(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDblClick(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDrag(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDragEnd(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDragEnter(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDragLeave(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDragOver(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDragStart(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDiv) OnDrop(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDiv) OnFocus(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDiv) OnInput(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDiv) OnInvalid(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDiv) OnKeyDown(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDiv) OnKeyPress(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDiv) OnKeyUp(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDiv) OnMouseDown(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDiv) OnMouseMove(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDiv) OnMouseOut(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDiv) OnMouseOver(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDiv) OnMouseUp(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDiv) OnPaste(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDiv) OnReset(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDiv) OnScroll(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDiv) OnSearch(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDiv) OnSelect(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDiv) OnSubmit(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDiv) OnWheel(h EventHandler, scope ...any) HTMLDiv {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDl is the interface that describes a "dl" HTML element.
- type HTMLDl interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDl
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDl
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDl
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDl
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDl
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDl
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDl
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDl
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDl
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDl
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDl
- // ID specifies a unique id for an element.
- ID(v string) HTMLDl
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDl
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDl
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDl
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDl
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDl
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDl
- // Title specifies extra information about an element.
- Title(v string) HTMLDl
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDl
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDl
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDl
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDl
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDl
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDl
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDl
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDl
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDl
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDl
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDl
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDl
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDl
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDl
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDl
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDl
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDl
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDl
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDl
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDl
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDl
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDl
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDl
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDl
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDl
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDl
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDl
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDl
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDl
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDl
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDl
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDl
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDl
- }
- // Dl returns an HTML element that defines a description list.
- func Dl() HTMLDl {
- e := &htmlDl{
- htmlElement: htmlElement{
- tag: "dl",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDl struct {
- htmlElement
- }
- func (e *htmlDl) Body(v ...UI) HTMLDl {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDl) Text(v any) HTMLDl {
- return e.Body(Text(v))
- }
- func (e *htmlDl) AccessKey(v string) HTMLDl {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDl) Aria(k string, v any) HTMLDl {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDl) Attr(n string, v any) HTMLDl {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDl) Class(v ...string) HTMLDl {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDl) ContentEditable(v bool) HTMLDl {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDl) DataSet(k string, v any) HTMLDl {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDl) Dir(v string) HTMLDl {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDl) Draggable(v bool) HTMLDl {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDl) Hidden(v bool) HTMLDl {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDl) ID(v string) HTMLDl {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDl) Lang(v string) HTMLDl {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDl) Role(v string) HTMLDl {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDl) Spellcheck(v bool) HTMLDl {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDl) Style(k, v string) HTMLDl {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDl) Styles(s map[string]string) HTMLDl {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDl) TabIndex(v int) HTMLDl {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDl) Title(v string) HTMLDl {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDl) On(event string, h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDl) OnBlur(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDl) OnChange(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDl) OnClick(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDl) OnContextMenu(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDl) OnCopy(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDl) OnCut(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDl) OnDblClick(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDl) OnDrag(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDl) OnDragEnd(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDl) OnDragEnter(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDl) OnDragLeave(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDl) OnDragOver(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDl) OnDragStart(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDl) OnDrop(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDl) OnFocus(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDl) OnInput(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDl) OnInvalid(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDl) OnKeyDown(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDl) OnKeyPress(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDl) OnKeyUp(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDl) OnMouseDown(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDl) OnMouseMove(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDl) OnMouseOut(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDl) OnMouseOver(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDl) OnMouseUp(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDl) OnPaste(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDl) OnReset(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDl) OnScroll(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDl) OnSearch(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDl) OnSelect(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDl) OnSubmit(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDl) OnWheel(h EventHandler, scope ...any) HTMLDl {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLDt is the interface that describes a "dt" HTML element.
- type HTMLDt interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLDt
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLDt
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLDt
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLDt
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLDt
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLDt
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLDt
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLDt
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLDt
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLDt
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLDt
- // ID specifies a unique id for an element.
- ID(v string) HTMLDt
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLDt
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLDt
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLDt
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLDt
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLDt
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLDt
- // Title specifies extra information about an element.
- Title(v string) HTMLDt
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLDt
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLDt
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLDt
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLDt
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLDt
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLDt
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLDt
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLDt
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLDt
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLDt
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLDt
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLDt
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLDt
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLDt
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLDt
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLDt
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLDt
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLDt
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLDt
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLDt
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLDt
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLDt
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLDt
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLDt
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLDt
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLDt
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLDt
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLDt
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLDt
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLDt
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLDt
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLDt
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLDt
- }
- // Dt returns an HTML element that defines a term/name in a description list.
- func Dt() HTMLDt {
- e := &htmlDt{
- htmlElement: htmlElement{
- tag: "dt",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlDt struct {
- htmlElement
- }
- func (e *htmlDt) Body(v ...UI) HTMLDt {
- e.setChildren(v...)
- return e
- }
- func (e *htmlDt) Text(v any) HTMLDt {
- return e.Body(Text(v))
- }
- func (e *htmlDt) AccessKey(v string) HTMLDt {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlDt) Aria(k string, v any) HTMLDt {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDt) Attr(n string, v any) HTMLDt {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlDt) Class(v ...string) HTMLDt {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlDt) ContentEditable(v bool) HTMLDt {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlDt) DataSet(k string, v any) HTMLDt {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlDt) Dir(v string) HTMLDt {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlDt) Draggable(v bool) HTMLDt {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlDt) Hidden(v bool) HTMLDt {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlDt) ID(v string) HTMLDt {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlDt) Lang(v string) HTMLDt {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlDt) Role(v string) HTMLDt {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlDt) Spellcheck(v bool) HTMLDt {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlDt) Style(k, v string) HTMLDt {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlDt) Styles(s map[string]string) HTMLDt {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlDt) TabIndex(v int) HTMLDt {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlDt) Title(v string) HTMLDt {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlDt) On(event string, h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlDt) OnBlur(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlDt) OnChange(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlDt) OnClick(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlDt) OnContextMenu(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlDt) OnCopy(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlDt) OnCut(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlDt) OnDblClick(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlDt) OnDrag(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlDt) OnDragEnd(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlDt) OnDragEnter(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlDt) OnDragLeave(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlDt) OnDragOver(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlDt) OnDragStart(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlDt) OnDrop(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlDt) OnFocus(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlDt) OnInput(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlDt) OnInvalid(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlDt) OnKeyDown(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlDt) OnKeyPress(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlDt) OnKeyUp(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlDt) OnMouseDown(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlDt) OnMouseMove(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlDt) OnMouseOut(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlDt) OnMouseOver(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlDt) OnMouseUp(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlDt) OnPaste(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlDt) OnReset(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlDt) OnScroll(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlDt) OnSearch(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlDt) OnSelect(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlDt) OnSubmit(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlDt) OnWheel(h EventHandler, scope ...any) HTMLDt {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLElem is the interface that describes a "elem" HTML element.
- type HTMLElem interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLElem
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLElem
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLElem
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLElem
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLElem
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLElem
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLElem
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLElem
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLElem
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLElem
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLElem
- // ID specifies a unique id for an element.
- ID(v string) HTMLElem
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLElem
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLElem
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLElem
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLElem
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLElem
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLElem
- // Title specifies extra information about an element.
- Title(v string) HTMLElem
- // XMLNS specifies the xml namespace of the element.
- XMLNS(v string) HTMLElem
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLElem
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLElem
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLElem
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLElem
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLElem
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLElem
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLElem
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLElem
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLElem
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLElem
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLElem
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLElem
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLElem
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLElem
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLElem
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLElem
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLElem
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLElem
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLElem
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLElem
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLElem
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLElem
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLElem
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLElem
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLElem
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLElem
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLElem
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLElem
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLElem
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLElem
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLElem
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLElem
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLElem
- }
- // Elem returns an HTML element that represents an customizable HTML element.
- func Elem(tag string) HTMLElem {
- e := &htmlElem{
- htmlElement: htmlElement{
- tag: tag,
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlElem struct {
- htmlElement
- }
- func (e *htmlElem) Body(v ...UI) HTMLElem {
- e.setChildren(v...)
- return e
- }
- func (e *htmlElem) Text(v any) HTMLElem {
- return e.Body(Text(v))
- }
- func (e *htmlElem) AccessKey(v string) HTMLElem {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlElem) Aria(k string, v any) HTMLElem {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlElem) Attr(n string, v any) HTMLElem {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlElem) Class(v ...string) HTMLElem {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlElem) ContentEditable(v bool) HTMLElem {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlElem) DataSet(k string, v any) HTMLElem {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlElem) Dir(v string) HTMLElem {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlElem) Draggable(v bool) HTMLElem {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlElem) Hidden(v bool) HTMLElem {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlElem) ID(v string) HTMLElem {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlElem) Lang(v string) HTMLElem {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlElem) Role(v string) HTMLElem {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlElem) Spellcheck(v bool) HTMLElem {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlElem) Style(k, v string) HTMLElem {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlElem) Styles(s map[string]string) HTMLElem {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlElem) TabIndex(v int) HTMLElem {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlElem) Title(v string) HTMLElem {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlElem) XMLNS(v string) HTMLElem {
- e.xmlns = v
- return e
- }
- func (e *htmlElem) On(event string, h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlElem) OnBlur(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlElem) OnChange(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlElem) OnClick(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlElem) OnContextMenu(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlElem) OnCopy(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlElem) OnCut(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlElem) OnDblClick(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlElem) OnDrag(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlElem) OnDragEnd(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlElem) OnDragEnter(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlElem) OnDragLeave(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlElem) OnDragOver(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlElem) OnDragStart(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlElem) OnDrop(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlElem) OnFocus(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlElem) OnInput(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlElem) OnInvalid(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlElem) OnKeyDown(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlElem) OnKeyPress(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlElem) OnKeyUp(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlElem) OnMouseDown(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlElem) OnMouseMove(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlElem) OnMouseOut(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlElem) OnMouseOver(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlElem) OnMouseUp(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlElem) OnPaste(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlElem) OnReset(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlElem) OnScroll(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlElem) OnSearch(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlElem) OnSelect(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlElem) OnSubmit(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlElem) OnWheel(h EventHandler, scope ...any) HTMLElem {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLElemSelfClosing is the interface that describes a "elemselfclosing" HTML element.
- type HTMLElemSelfClosing interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLElemSelfClosing
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLElemSelfClosing
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLElemSelfClosing
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLElemSelfClosing
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLElemSelfClosing
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLElemSelfClosing
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLElemSelfClosing
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLElemSelfClosing
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLElemSelfClosing
- // ID specifies a unique id for an element.
- ID(v string) HTMLElemSelfClosing
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLElemSelfClosing
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLElemSelfClosing
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLElemSelfClosing
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLElemSelfClosing
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLElemSelfClosing
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLElemSelfClosing
- // Title specifies extra information about an element.
- Title(v string) HTMLElemSelfClosing
- // XMLNS specifies the xml namespace of the element.
- XMLNS(v string) HTMLElemSelfClosing
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing
- }
- // ElemSelfClosing returns an HTML element that represents a self closing custom HTML element.
- func ElemSelfClosing(tag string) HTMLElemSelfClosing {
- e := &htmlElemSelfClosing{
- htmlElement: htmlElement{
- tag: tag,
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlElemSelfClosing struct {
- htmlElement
- }
- func (e *htmlElemSelfClosing) AccessKey(v string) HTMLElemSelfClosing {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlElemSelfClosing) Aria(k string, v any) HTMLElemSelfClosing {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlElemSelfClosing) Attr(n string, v any) HTMLElemSelfClosing {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlElemSelfClosing) Class(v ...string) HTMLElemSelfClosing {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlElemSelfClosing) ContentEditable(v bool) HTMLElemSelfClosing {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlElemSelfClosing) DataSet(k string, v any) HTMLElemSelfClosing {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlElemSelfClosing) Dir(v string) HTMLElemSelfClosing {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlElemSelfClosing) Draggable(v bool) HTMLElemSelfClosing {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlElemSelfClosing) Hidden(v bool) HTMLElemSelfClosing {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlElemSelfClosing) ID(v string) HTMLElemSelfClosing {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlElemSelfClosing) Lang(v string) HTMLElemSelfClosing {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlElemSelfClosing) Role(v string) HTMLElemSelfClosing {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlElemSelfClosing) Spellcheck(v bool) HTMLElemSelfClosing {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlElemSelfClosing) Style(k, v string) HTMLElemSelfClosing {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlElemSelfClosing) Styles(s map[string]string) HTMLElemSelfClosing {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlElemSelfClosing) TabIndex(v int) HTMLElemSelfClosing {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlElemSelfClosing) Title(v string) HTMLElemSelfClosing {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlElemSelfClosing) XMLNS(v string) HTMLElemSelfClosing {
- e.xmlns = v
- return e
- }
- func (e *htmlElemSelfClosing) On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlElemSelfClosing) OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLEm is the interface that describes a "em" HTML element.
- type HTMLEm interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLEm
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLEm
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLEm
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLEm
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLEm
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLEm
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLEm
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLEm
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLEm
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLEm
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLEm
- // ID specifies a unique id for an element.
- ID(v string) HTMLEm
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLEm
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLEm
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLEm
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLEm
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLEm
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLEm
- // Title specifies extra information about an element.
- Title(v string) HTMLEm
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLEm
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLEm
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLEm
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLEm
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLEm
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLEm
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLEm
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLEm
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLEm
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLEm
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLEm
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLEm
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLEm
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLEm
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLEm
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLEm
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLEm
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLEm
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLEm
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLEm
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLEm
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLEm
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLEm
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLEm
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLEm
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLEm
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLEm
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLEm
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLEm
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLEm
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLEm
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLEm
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLEm
- }
- // Em returns an HTML element that defines emphasized text.
- func Em() HTMLEm {
- e := &htmlEm{
- htmlElement: htmlElement{
- tag: "em",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlEm struct {
- htmlElement
- }
- func (e *htmlEm) Body(v ...UI) HTMLEm {
- e.setChildren(v...)
- return e
- }
- func (e *htmlEm) Text(v any) HTMLEm {
- return e.Body(Text(v))
- }
- func (e *htmlEm) AccessKey(v string) HTMLEm {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlEm) Aria(k string, v any) HTMLEm {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlEm) Attr(n string, v any) HTMLEm {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlEm) Class(v ...string) HTMLEm {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlEm) ContentEditable(v bool) HTMLEm {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlEm) DataSet(k string, v any) HTMLEm {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlEm) Dir(v string) HTMLEm {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlEm) Draggable(v bool) HTMLEm {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlEm) Hidden(v bool) HTMLEm {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlEm) ID(v string) HTMLEm {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlEm) Lang(v string) HTMLEm {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlEm) Role(v string) HTMLEm {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlEm) Spellcheck(v bool) HTMLEm {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlEm) Style(k, v string) HTMLEm {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlEm) Styles(s map[string]string) HTMLEm {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlEm) TabIndex(v int) HTMLEm {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlEm) Title(v string) HTMLEm {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlEm) On(event string, h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlEm) OnBlur(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlEm) OnChange(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlEm) OnClick(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlEm) OnContextMenu(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlEm) OnCopy(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlEm) OnCut(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlEm) OnDblClick(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlEm) OnDrag(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlEm) OnDragEnd(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlEm) OnDragEnter(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlEm) OnDragLeave(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlEm) OnDragOver(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlEm) OnDragStart(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlEm) OnDrop(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlEm) OnFocus(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlEm) OnInput(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlEm) OnInvalid(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlEm) OnKeyDown(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlEm) OnKeyPress(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlEm) OnKeyUp(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlEm) OnMouseDown(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlEm) OnMouseMove(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlEm) OnMouseOut(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlEm) OnMouseOver(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlEm) OnMouseUp(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlEm) OnPaste(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlEm) OnReset(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlEm) OnScroll(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlEm) OnSearch(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlEm) OnSelect(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlEm) OnSubmit(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlEm) OnWheel(h EventHandler, scope ...any) HTMLEm {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLEmbed is the interface that describes a "embed" HTML element.
- type HTMLEmbed interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLEmbed
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLEmbed
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLEmbed
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLEmbed
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLEmbed
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLEmbed
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLEmbed
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLEmbed
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLEmbed
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLEmbed
- // ID specifies a unique id for an element.
- ID(v string) HTMLEmbed
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLEmbed
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLEmbed
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLEmbed
- // Src specifies the URL of the media file.
- Src(v string) HTMLEmbed
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLEmbed
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLEmbed
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLEmbed
- // Title specifies extra information about an element.
- Title(v string) HTMLEmbed
- // Type specifies the type of element.
- Type(v string) HTMLEmbed
- // Width specifies the width of the element.
- Width(v int) HTMLEmbed
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLEmbed
- // OnAbort calls the given handler on abort.
- OnAbort(h EventHandler, scope ...any) HTMLEmbed
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLEmbed
- // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
- OnCanPlay(h EventHandler, scope ...any) HTMLEmbed
- // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
- OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLEmbed
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLEmbed
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLEmbed
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLEmbed
- // OnCueChange calls the given handler when the cue changes in a track element.
- OnCueChange(h EventHandler, scope ...any) HTMLEmbed
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLEmbed
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLEmbed
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLEmbed
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLEmbed
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLEmbed
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLEmbed
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLEmbed
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLEmbed
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLEmbed
- // OnDurationChange calls the given handler when the length of the media changes.
- OnDurationChange(h EventHandler, scope ...any) HTMLEmbed
- // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
- OnEmptied(h EventHandler, scope ...any) HTMLEmbed
- // OnEnded calls the given handler when the media has reach the end.
- OnEnded(h EventHandler, scope ...any) HTMLEmbed
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLEmbed
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLEmbed
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLEmbed
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLEmbed
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLEmbed
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLEmbed
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLEmbed
- // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
- OnLoadStart(h EventHandler, scope ...any) HTMLEmbed
- // OnLoadedData calls the given handler when media data is loaded.
- OnLoadedData(h EventHandler, scope ...any) HTMLEmbed
- // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
- OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLEmbed
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLEmbed
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLEmbed
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLEmbed
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLEmbed
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLEmbed
- // OnPause calls the given handler when the media is paused either by the user or programmatically.
- OnPause(h EventHandler, scope ...any) HTMLEmbed
- // OnPlay calls the given handler when the media is ready to start playing.
- OnPlay(h EventHandler, scope ...any) HTMLEmbed
- // OnPlaying calls the given handler when the media actually has started playing.
- OnPlaying(h EventHandler, scope ...any) HTMLEmbed
- // OnProgress calls the given handler when the browser is in the process of getting the media data.
- OnProgress(h EventHandler, scope ...any) HTMLEmbed
- // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
- OnRateChange(h EventHandler, scope ...any) HTMLEmbed
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLEmbed
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLEmbed
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLEmbed
- // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
- OnSeeked(h EventHandler, scope ...any) HTMLEmbed
- // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
- OnSeeking(h EventHandler, scope ...any) HTMLEmbed
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLEmbed
- // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
- OnStalled(h EventHandler, scope ...any) HTMLEmbed
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLEmbed
- // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
- OnSuspend(h EventHandler, scope ...any) HTMLEmbed
- // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
- OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed
- // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
- OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed
- // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
- OnWaiting(h EventHandler, scope ...any) HTMLEmbed
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLEmbed
- }
- // Embed returns an HTML element that defines a container for an external (non-HTML) application.
- func Embed() HTMLEmbed {
- e := &htmlEmbed{
- htmlElement: htmlElement{
- tag: "embed",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlEmbed struct {
- htmlElement
- }
- func (e *htmlEmbed) AccessKey(v string) HTMLEmbed {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlEmbed) Aria(k string, v any) HTMLEmbed {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlEmbed) Attr(n string, v any) HTMLEmbed {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlEmbed) Class(v ...string) HTMLEmbed {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlEmbed) ContentEditable(v bool) HTMLEmbed {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlEmbed) DataSet(k string, v any) HTMLEmbed {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlEmbed) Dir(v string) HTMLEmbed {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlEmbed) Draggable(v bool) HTMLEmbed {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlEmbed) Height(v int) HTMLEmbed {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlEmbed) Hidden(v bool) HTMLEmbed {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlEmbed) ID(v string) HTMLEmbed {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlEmbed) Lang(v string) HTMLEmbed {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlEmbed) Role(v string) HTMLEmbed {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlEmbed) Spellcheck(v bool) HTMLEmbed {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlEmbed) Src(v string) HTMLEmbed {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlEmbed) Style(k, v string) HTMLEmbed {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlEmbed) Styles(s map[string]string) HTMLEmbed {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlEmbed) TabIndex(v int) HTMLEmbed {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlEmbed) Title(v string) HTMLEmbed {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlEmbed) Type(v string) HTMLEmbed {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlEmbed) Width(v int) HTMLEmbed {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlEmbed) On(event string, h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlEmbed) OnAbort(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("abort", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnBlur(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnCanPlay(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("canplay", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("canplaythrough", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnChange(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnClick(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnContextMenu(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnCopy(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnCueChange(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("cuechange", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnCut(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDblClick(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDrag(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDragEnd(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDragEnter(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDragLeave(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDragOver(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDragStart(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDrop(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnDurationChange(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("durationchange", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnEmptied(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("emptied", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnEnded(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("ended", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnError(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnFocus(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnInput(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnInvalid(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnKeyDown(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnKeyPress(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnKeyUp(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnLoadStart(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("loadstart", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnLoadedData(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("loadeddata", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("loadedmetadata", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnMouseDown(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnMouseMove(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnMouseOut(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnMouseOver(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnMouseUp(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnPaste(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnPause(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("pause", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnPlay(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("play", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnPlaying(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("playing", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnProgress(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("progress", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnRateChange(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("ratechange", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnReset(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnScroll(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSearch(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSeeked(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("seeked", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSeeking(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("seeking", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSelect(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnStalled(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("stalled", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSubmit(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnSuspend(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("suspend", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("timeupdate", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("volumechange", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnWaiting(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("waiting", h, scope...)
- return e
- }
- func (e *htmlEmbed) OnWheel(h EventHandler, scope ...any) HTMLEmbed {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLFieldSet is the interface that describes a "fieldset" HTML element.
- type HTMLFieldSet interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLFieldSet
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLFieldSet
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLFieldSet
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLFieldSet
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLFieldSet
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLFieldSet
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLFieldSet
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLFieldSet
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLFieldSet
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLFieldSet
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLFieldSet
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLFieldSet
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLFieldSet
- // ID specifies a unique id for an element.
- ID(v string) HTMLFieldSet
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLFieldSet
- // Name specifies the name of the element.
- Name(v string) HTMLFieldSet
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLFieldSet
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLFieldSet
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLFieldSet
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLFieldSet
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLFieldSet
- // Title specifies extra information about an element.
- Title(v string) HTMLFieldSet
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLFieldSet
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLFieldSet
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLFieldSet
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLFieldSet
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLFieldSet
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLFieldSet
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLFieldSet
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLFieldSet
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLFieldSet
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLFieldSet
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLFieldSet
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLFieldSet
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLFieldSet
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLFieldSet
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLFieldSet
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLFieldSet
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLFieldSet
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLFieldSet
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLFieldSet
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLFieldSet
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLFieldSet
- }
- // FieldSet returns an HTML element that groups related elements in a form.
- func FieldSet() HTMLFieldSet {
- e := &htmlFieldSet{
- htmlElement: htmlElement{
- tag: "fieldset",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlFieldSet struct {
- htmlElement
- }
- func (e *htmlFieldSet) Body(v ...UI) HTMLFieldSet {
- e.setChildren(v...)
- return e
- }
- func (e *htmlFieldSet) Text(v any) HTMLFieldSet {
- return e.Body(Text(v))
- }
- func (e *htmlFieldSet) AccessKey(v string) HTMLFieldSet {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlFieldSet) Aria(k string, v any) HTMLFieldSet {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFieldSet) Attr(n string, v any) HTMLFieldSet {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlFieldSet) Class(v ...string) HTMLFieldSet {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlFieldSet) ContentEditable(v bool) HTMLFieldSet {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlFieldSet) DataSet(k string, v any) HTMLFieldSet {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFieldSet) Dir(v string) HTMLFieldSet {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlFieldSet) Disabled(v bool) HTMLFieldSet {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlFieldSet) Draggable(v bool) HTMLFieldSet {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlFieldSet) Form(v string) HTMLFieldSet {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlFieldSet) Hidden(v bool) HTMLFieldSet {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlFieldSet) ID(v string) HTMLFieldSet {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlFieldSet) Lang(v string) HTMLFieldSet {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlFieldSet) Name(v string) HTMLFieldSet {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlFieldSet) Role(v string) HTMLFieldSet {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlFieldSet) Spellcheck(v bool) HTMLFieldSet {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlFieldSet) Style(k, v string) HTMLFieldSet {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlFieldSet) Styles(s map[string]string) HTMLFieldSet {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlFieldSet) TabIndex(v int) HTMLFieldSet {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlFieldSet) Title(v string) HTMLFieldSet {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlFieldSet) On(event string, h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnBlur(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnChange(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnClick(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnCopy(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnCut(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDblClick(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDrag(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDragOver(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDragStart(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnDrop(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnFocus(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnInput(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnInvalid(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnPaste(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnReset(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnScroll(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnSearch(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnSelect(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnSubmit(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlFieldSet) OnWheel(h EventHandler, scope ...any) HTMLFieldSet {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLFigCaption is the interface that describes a "figcaption" HTML element.
- type HTMLFigCaption interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLFigCaption
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLFigCaption
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLFigCaption
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLFigCaption
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLFigCaption
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLFigCaption
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLFigCaption
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLFigCaption
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLFigCaption
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLFigCaption
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLFigCaption
- // ID specifies a unique id for an element.
- ID(v string) HTMLFigCaption
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLFigCaption
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLFigCaption
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLFigCaption
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLFigCaption
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLFigCaption
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLFigCaption
- // Title specifies extra information about an element.
- Title(v string) HTMLFigCaption
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLFigCaption
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLFigCaption
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLFigCaption
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLFigCaption
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLFigCaption
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLFigCaption
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLFigCaption
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLFigCaption
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLFigCaption
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLFigCaption
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLFigCaption
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLFigCaption
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLFigCaption
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLFigCaption
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLFigCaption
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLFigCaption
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLFigCaption
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLFigCaption
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLFigCaption
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLFigCaption
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLFigCaption
- }
- // FigCaption returns an HTML element that defines a caption for a figure element.
- func FigCaption() HTMLFigCaption {
- e := &htmlFigCaption{
- htmlElement: htmlElement{
- tag: "figcaption",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlFigCaption struct {
- htmlElement
- }
- func (e *htmlFigCaption) Body(v ...UI) HTMLFigCaption {
- e.setChildren(v...)
- return e
- }
- func (e *htmlFigCaption) Text(v any) HTMLFigCaption {
- return e.Body(Text(v))
- }
- func (e *htmlFigCaption) AccessKey(v string) HTMLFigCaption {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlFigCaption) Aria(k string, v any) HTMLFigCaption {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFigCaption) Attr(n string, v any) HTMLFigCaption {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlFigCaption) Class(v ...string) HTMLFigCaption {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlFigCaption) ContentEditable(v bool) HTMLFigCaption {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlFigCaption) DataSet(k string, v any) HTMLFigCaption {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFigCaption) Dir(v string) HTMLFigCaption {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlFigCaption) Draggable(v bool) HTMLFigCaption {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlFigCaption) Hidden(v bool) HTMLFigCaption {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlFigCaption) ID(v string) HTMLFigCaption {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlFigCaption) Lang(v string) HTMLFigCaption {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlFigCaption) Role(v string) HTMLFigCaption {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlFigCaption) Spellcheck(v bool) HTMLFigCaption {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlFigCaption) Style(k, v string) HTMLFigCaption {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlFigCaption) Styles(s map[string]string) HTMLFigCaption {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlFigCaption) TabIndex(v int) HTMLFigCaption {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlFigCaption) Title(v string) HTMLFigCaption {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlFigCaption) On(event string, h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnBlur(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnChange(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnClick(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnCopy(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnCut(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDblClick(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDrag(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDragOver(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDragStart(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnDrop(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnFocus(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnInput(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnInvalid(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnPaste(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnReset(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnScroll(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnSearch(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnSelect(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnSubmit(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlFigCaption) OnWheel(h EventHandler, scope ...any) HTMLFigCaption {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLFigure is the interface that describes a "figure" HTML element.
- type HTMLFigure interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLFigure
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLFigure
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLFigure
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLFigure
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLFigure
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLFigure
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLFigure
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLFigure
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLFigure
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLFigure
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLFigure
- // ID specifies a unique id for an element.
- ID(v string) HTMLFigure
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLFigure
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLFigure
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLFigure
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLFigure
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLFigure
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLFigure
- // Title specifies extra information about an element.
- Title(v string) HTMLFigure
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLFigure
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLFigure
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLFigure
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLFigure
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLFigure
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLFigure
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLFigure
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLFigure
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLFigure
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLFigure
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLFigure
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLFigure
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLFigure
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLFigure
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLFigure
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLFigure
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLFigure
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLFigure
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLFigure
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLFigure
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLFigure
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLFigure
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLFigure
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLFigure
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLFigure
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLFigure
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLFigure
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLFigure
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLFigure
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLFigure
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLFigure
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLFigure
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLFigure
- }
- // Figure returns an HTML element that specifies self-contained content.
- func Figure() HTMLFigure {
- e := &htmlFigure{
- htmlElement: htmlElement{
- tag: "figure",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlFigure struct {
- htmlElement
- }
- func (e *htmlFigure) Body(v ...UI) HTMLFigure {
- e.setChildren(v...)
- return e
- }
- func (e *htmlFigure) Text(v any) HTMLFigure {
- return e.Body(Text(v))
- }
- func (e *htmlFigure) AccessKey(v string) HTMLFigure {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlFigure) Aria(k string, v any) HTMLFigure {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFigure) Attr(n string, v any) HTMLFigure {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlFigure) Class(v ...string) HTMLFigure {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlFigure) ContentEditable(v bool) HTMLFigure {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlFigure) DataSet(k string, v any) HTMLFigure {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFigure) Dir(v string) HTMLFigure {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlFigure) Draggable(v bool) HTMLFigure {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlFigure) Hidden(v bool) HTMLFigure {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlFigure) ID(v string) HTMLFigure {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlFigure) Lang(v string) HTMLFigure {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlFigure) Role(v string) HTMLFigure {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlFigure) Spellcheck(v bool) HTMLFigure {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlFigure) Style(k, v string) HTMLFigure {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlFigure) Styles(s map[string]string) HTMLFigure {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlFigure) TabIndex(v int) HTMLFigure {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlFigure) Title(v string) HTMLFigure {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlFigure) On(event string, h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlFigure) OnBlur(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlFigure) OnChange(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlFigure) OnClick(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlFigure) OnContextMenu(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlFigure) OnCopy(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlFigure) OnCut(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDblClick(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDrag(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDragEnd(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDragEnter(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDragLeave(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDragOver(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDragStart(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlFigure) OnDrop(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlFigure) OnFocus(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlFigure) OnInput(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlFigure) OnInvalid(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlFigure) OnKeyDown(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlFigure) OnKeyPress(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlFigure) OnKeyUp(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlFigure) OnMouseDown(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlFigure) OnMouseMove(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlFigure) OnMouseOut(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlFigure) OnMouseOver(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlFigure) OnMouseUp(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlFigure) OnPaste(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlFigure) OnReset(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlFigure) OnScroll(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlFigure) OnSearch(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlFigure) OnSelect(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlFigure) OnSubmit(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlFigure) OnWheel(h EventHandler, scope ...any) HTMLFigure {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLFooter is the interface that describes a "footer" HTML element.
- type HTMLFooter interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLFooter
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLFooter
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLFooter
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLFooter
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLFooter
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLFooter
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLFooter
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLFooter
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLFooter
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLFooter
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLFooter
- // ID specifies a unique id for an element.
- ID(v string) HTMLFooter
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLFooter
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLFooter
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLFooter
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLFooter
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLFooter
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLFooter
- // Title specifies extra information about an element.
- Title(v string) HTMLFooter
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLFooter
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLFooter
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLFooter
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLFooter
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLFooter
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLFooter
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLFooter
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLFooter
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLFooter
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLFooter
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLFooter
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLFooter
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLFooter
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLFooter
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLFooter
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLFooter
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLFooter
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLFooter
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLFooter
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLFooter
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLFooter
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLFooter
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLFooter
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLFooter
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLFooter
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLFooter
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLFooter
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLFooter
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLFooter
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLFooter
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLFooter
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLFooter
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLFooter
- }
- // Footer returns an HTML element that defines a footer for a document or section.
- func Footer() HTMLFooter {
- e := &htmlFooter{
- htmlElement: htmlElement{
- tag: "footer",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlFooter struct {
- htmlElement
- }
- func (e *htmlFooter) Body(v ...UI) HTMLFooter {
- e.setChildren(v...)
- return e
- }
- func (e *htmlFooter) Text(v any) HTMLFooter {
- return e.Body(Text(v))
- }
- func (e *htmlFooter) AccessKey(v string) HTMLFooter {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlFooter) Aria(k string, v any) HTMLFooter {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFooter) Attr(n string, v any) HTMLFooter {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlFooter) Class(v ...string) HTMLFooter {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlFooter) ContentEditable(v bool) HTMLFooter {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlFooter) DataSet(k string, v any) HTMLFooter {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlFooter) Dir(v string) HTMLFooter {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlFooter) Draggable(v bool) HTMLFooter {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlFooter) Hidden(v bool) HTMLFooter {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlFooter) ID(v string) HTMLFooter {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlFooter) Lang(v string) HTMLFooter {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlFooter) Role(v string) HTMLFooter {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlFooter) Spellcheck(v bool) HTMLFooter {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlFooter) Style(k, v string) HTMLFooter {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlFooter) Styles(s map[string]string) HTMLFooter {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlFooter) TabIndex(v int) HTMLFooter {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlFooter) Title(v string) HTMLFooter {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlFooter) On(event string, h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlFooter) OnBlur(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlFooter) OnChange(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlFooter) OnClick(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlFooter) OnContextMenu(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlFooter) OnCopy(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlFooter) OnCut(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDblClick(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDrag(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDragEnd(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDragEnter(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDragLeave(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDragOver(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDragStart(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlFooter) OnDrop(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlFooter) OnFocus(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlFooter) OnInput(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlFooter) OnInvalid(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlFooter) OnKeyDown(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlFooter) OnKeyPress(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlFooter) OnKeyUp(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlFooter) OnMouseDown(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlFooter) OnMouseMove(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlFooter) OnMouseOut(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlFooter) OnMouseOver(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlFooter) OnMouseUp(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlFooter) OnPaste(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlFooter) OnReset(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlFooter) OnScroll(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlFooter) OnSearch(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlFooter) OnSelect(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlFooter) OnSubmit(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlFooter) OnWheel(h EventHandler, scope ...any) HTMLFooter {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLForm is the interface that describes a "form" HTML element.
- type HTMLForm interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLForm
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLForm
- // AcceptCharset specifies the character encodings that are to be used for the form submission.
- AcceptCharset(v string) HTMLForm
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLForm
- // Action specifies where to send the form-data when a form is submitted.
- Action(v string) HTMLForm
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLForm
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLForm
- // AutoComplete specifies whether the element should have autocomplete enabled.
- AutoComplete(v bool) HTMLForm
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLForm
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLForm
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLForm
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLForm
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLForm
- // EncType specifies how the form-data should be encoded when submitting it to the server (only for post method).
- EncType(v string) HTMLForm
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLForm
- // ID specifies a unique id for an element.
- ID(v string) HTMLForm
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLForm
- // Method specifies the HTTP method to use when sending form-data.
- Method(v string) HTMLForm
- // Name specifies the name of the element.
- Name(v string) HTMLForm
- // NoValidate specifies that the form should not be validated when submitted.
- NoValidate(v bool) HTMLForm
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLForm
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLForm
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLForm
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLForm
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLForm
- // Target specifies the target for where to open the linked document or where to submit the form.
- Target(v string) HTMLForm
- // Title specifies extra information about an element.
- Title(v string) HTMLForm
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLForm
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLForm
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLForm
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLForm
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLForm
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLForm
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLForm
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLForm
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLForm
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLForm
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLForm
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLForm
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLForm
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLForm
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLForm
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLForm
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLForm
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLForm
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLForm
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLForm
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLForm
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLForm
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLForm
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLForm
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLForm
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLForm
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLForm
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLForm
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLForm
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLForm
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLForm
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLForm
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLForm
- }
- // Form returns an HTML element that defines an HTML form for user input.
- func Form() HTMLForm {
- e := &htmlForm{
- htmlElement: htmlElement{
- tag: "form",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlForm struct {
- htmlElement
- }
- func (e *htmlForm) Body(v ...UI) HTMLForm {
- e.setChildren(v...)
- return e
- }
- func (e *htmlForm) Text(v any) HTMLForm {
- return e.Body(Text(v))
- }
- func (e *htmlForm) AcceptCharset(v string) HTMLForm {
- e.setAttr("accept-charset", v)
- return e
- }
- func (e *htmlForm) AccessKey(v string) HTMLForm {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlForm) Action(v string) HTMLForm {
- e.setAttr("action", v)
- return e
- }
- func (e *htmlForm) Aria(k string, v any) HTMLForm {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlForm) Attr(n string, v any) HTMLForm {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlForm) AutoComplete(v bool) HTMLForm {
- s := "off"
- if v {
- s = "on"
- }
- e.setAttr("autocomplete", s)
- return e
- }
- func (e *htmlForm) Class(v ...string) HTMLForm {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlForm) ContentEditable(v bool) HTMLForm {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlForm) DataSet(k string, v any) HTMLForm {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlForm) Dir(v string) HTMLForm {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlForm) Draggable(v bool) HTMLForm {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlForm) EncType(v string) HTMLForm {
- e.setAttr("enctype", v)
- return e
- }
- func (e *htmlForm) Hidden(v bool) HTMLForm {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlForm) ID(v string) HTMLForm {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlForm) Lang(v string) HTMLForm {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlForm) Method(v string) HTMLForm {
- e.setAttr("method", v)
- return e
- }
- func (e *htmlForm) Name(v string) HTMLForm {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlForm) NoValidate(v bool) HTMLForm {
- e.setAttr("novalidate", v)
- return e
- }
- func (e *htmlForm) Role(v string) HTMLForm {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlForm) Spellcheck(v bool) HTMLForm {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlForm) Style(k, v string) HTMLForm {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlForm) Styles(s map[string]string) HTMLForm {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlForm) TabIndex(v int) HTMLForm {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlForm) Target(v string) HTMLForm {
- e.setAttr("target", v)
- return e
- }
- func (e *htmlForm) Title(v string) HTMLForm {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlForm) On(event string, h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlForm) OnBlur(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlForm) OnChange(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlForm) OnClick(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlForm) OnContextMenu(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlForm) OnCopy(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlForm) OnCut(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlForm) OnDblClick(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlForm) OnDrag(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlForm) OnDragEnd(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlForm) OnDragEnter(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlForm) OnDragLeave(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlForm) OnDragOver(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlForm) OnDragStart(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlForm) OnDrop(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlForm) OnFocus(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlForm) OnInput(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlForm) OnInvalid(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlForm) OnKeyDown(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlForm) OnKeyPress(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlForm) OnKeyUp(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlForm) OnMouseDown(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlForm) OnMouseMove(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlForm) OnMouseOut(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlForm) OnMouseOver(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlForm) OnMouseUp(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlForm) OnPaste(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlForm) OnReset(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlForm) OnScroll(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlForm) OnSearch(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlForm) OnSelect(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlForm) OnSubmit(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlForm) OnWheel(h EventHandler, scope ...any) HTMLForm {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH1 is the interface that describes a "h1" HTML element.
- type HTMLH1 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH1
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH1
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH1
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH1
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH1
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH1
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH1
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH1
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH1
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH1
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH1
- // ID specifies a unique id for an element.
- ID(v string) HTMLH1
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH1
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH1
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH1
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH1
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH1
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH1
- // Title specifies extra information about an element.
- Title(v string) HTMLH1
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH1
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH1
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH1
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH1
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH1
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH1
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH1
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH1
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH1
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH1
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH1
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH1
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH1
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH1
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH1
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH1
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH1
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH1
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH1
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH1
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH1
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH1
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH1
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH1
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH1
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH1
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH1
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH1
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH1
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH1
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH1
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH1
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH1
- }
- // H1 returns an HTML element that defines HTML heading.
- func H1() HTMLH1 {
- e := &htmlH1{
- htmlElement: htmlElement{
- tag: "h1",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH1 struct {
- htmlElement
- }
- func (e *htmlH1) Body(v ...UI) HTMLH1 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH1) Text(v any) HTMLH1 {
- return e.Body(Text(v))
- }
- func (e *htmlH1) AccessKey(v string) HTMLH1 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH1) Aria(k string, v any) HTMLH1 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH1) Attr(n string, v any) HTMLH1 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH1) Class(v ...string) HTMLH1 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH1) ContentEditable(v bool) HTMLH1 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH1) DataSet(k string, v any) HTMLH1 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH1) Dir(v string) HTMLH1 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH1) Draggable(v bool) HTMLH1 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH1) Hidden(v bool) HTMLH1 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH1) ID(v string) HTMLH1 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH1) Lang(v string) HTMLH1 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH1) Role(v string) HTMLH1 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH1) Spellcheck(v bool) HTMLH1 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH1) Style(k, v string) HTMLH1 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH1) Styles(s map[string]string) HTMLH1 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH1) TabIndex(v int) HTMLH1 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH1) Title(v string) HTMLH1 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH1) On(event string, h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH1) OnBlur(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH1) OnChange(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH1) OnClick(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH1) OnContextMenu(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH1) OnCopy(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH1) OnCut(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH1) OnDblClick(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH1) OnDrag(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH1) OnDragEnd(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH1) OnDragEnter(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH1) OnDragLeave(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH1) OnDragOver(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH1) OnDragStart(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH1) OnDrop(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH1) OnFocus(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH1) OnInput(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH1) OnInvalid(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH1) OnKeyDown(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH1) OnKeyPress(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH1) OnKeyUp(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH1) OnMouseDown(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH1) OnMouseMove(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH1) OnMouseOut(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH1) OnMouseOver(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH1) OnMouseUp(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH1) OnPaste(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH1) OnReset(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH1) OnScroll(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH1) OnSearch(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH1) OnSelect(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH1) OnSubmit(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH1) OnWheel(h EventHandler, scope ...any) HTMLH1 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH2 is the interface that describes a "h2" HTML element.
- type HTMLH2 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH2
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH2
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH2
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH2
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH2
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH2
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH2
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH2
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH2
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH2
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH2
- // ID specifies a unique id for an element.
- ID(v string) HTMLH2
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH2
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH2
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH2
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH2
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH2
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH2
- // Title specifies extra information about an element.
- Title(v string) HTMLH2
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH2
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH2
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH2
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH2
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH2
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH2
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH2
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH2
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH2
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH2
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH2
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH2
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH2
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH2
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH2
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH2
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH2
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH2
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH2
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH2
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH2
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH2
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH2
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH2
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH2
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH2
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH2
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH2
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH2
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH2
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH2
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH2
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH2
- }
- // H2 returns an HTML element that defines HTML heading.
- func H2() HTMLH2 {
- e := &htmlH2{
- htmlElement: htmlElement{
- tag: "h2",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH2 struct {
- htmlElement
- }
- func (e *htmlH2) Body(v ...UI) HTMLH2 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH2) Text(v any) HTMLH2 {
- return e.Body(Text(v))
- }
- func (e *htmlH2) AccessKey(v string) HTMLH2 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH2) Aria(k string, v any) HTMLH2 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH2) Attr(n string, v any) HTMLH2 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH2) Class(v ...string) HTMLH2 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH2) ContentEditable(v bool) HTMLH2 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH2) DataSet(k string, v any) HTMLH2 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH2) Dir(v string) HTMLH2 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH2) Draggable(v bool) HTMLH2 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH2) Hidden(v bool) HTMLH2 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH2) ID(v string) HTMLH2 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH2) Lang(v string) HTMLH2 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH2) Role(v string) HTMLH2 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH2) Spellcheck(v bool) HTMLH2 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH2) Style(k, v string) HTMLH2 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH2) Styles(s map[string]string) HTMLH2 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH2) TabIndex(v int) HTMLH2 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH2) Title(v string) HTMLH2 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH2) On(event string, h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH2) OnBlur(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH2) OnChange(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH2) OnClick(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH2) OnContextMenu(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH2) OnCopy(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH2) OnCut(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH2) OnDblClick(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH2) OnDrag(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH2) OnDragEnd(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH2) OnDragEnter(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH2) OnDragLeave(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH2) OnDragOver(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH2) OnDragStart(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH2) OnDrop(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH2) OnFocus(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH2) OnInput(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH2) OnInvalid(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH2) OnKeyDown(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH2) OnKeyPress(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH2) OnKeyUp(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH2) OnMouseDown(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH2) OnMouseMove(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH2) OnMouseOut(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH2) OnMouseOver(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH2) OnMouseUp(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH2) OnPaste(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH2) OnReset(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH2) OnScroll(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH2) OnSearch(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH2) OnSelect(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH2) OnSubmit(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH2) OnWheel(h EventHandler, scope ...any) HTMLH2 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH3 is the interface that describes a "h3" HTML element.
- type HTMLH3 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH3
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH3
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH3
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH3
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH3
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH3
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH3
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH3
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH3
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH3
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH3
- // ID specifies a unique id for an element.
- ID(v string) HTMLH3
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH3
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH3
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH3
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH3
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH3
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH3
- // Title specifies extra information about an element.
- Title(v string) HTMLH3
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH3
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH3
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH3
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH3
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH3
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH3
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH3
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH3
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH3
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH3
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH3
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH3
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH3
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH3
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH3
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH3
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH3
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH3
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH3
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH3
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH3
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH3
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH3
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH3
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH3
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH3
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH3
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH3
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH3
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH3
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH3
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH3
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH3
- }
- // H3 returns an HTML element that defines HTML heading.
- func H3() HTMLH3 {
- e := &htmlH3{
- htmlElement: htmlElement{
- tag: "h3",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH3 struct {
- htmlElement
- }
- func (e *htmlH3) Body(v ...UI) HTMLH3 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH3) Text(v any) HTMLH3 {
- return e.Body(Text(v))
- }
- func (e *htmlH3) AccessKey(v string) HTMLH3 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH3) Aria(k string, v any) HTMLH3 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH3) Attr(n string, v any) HTMLH3 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH3) Class(v ...string) HTMLH3 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH3) ContentEditable(v bool) HTMLH3 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH3) DataSet(k string, v any) HTMLH3 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH3) Dir(v string) HTMLH3 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH3) Draggable(v bool) HTMLH3 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH3) Hidden(v bool) HTMLH3 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH3) ID(v string) HTMLH3 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH3) Lang(v string) HTMLH3 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH3) Role(v string) HTMLH3 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH3) Spellcheck(v bool) HTMLH3 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH3) Style(k, v string) HTMLH3 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH3) Styles(s map[string]string) HTMLH3 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH3) TabIndex(v int) HTMLH3 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH3) Title(v string) HTMLH3 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH3) On(event string, h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH3) OnBlur(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH3) OnChange(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH3) OnClick(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH3) OnContextMenu(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH3) OnCopy(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH3) OnCut(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH3) OnDblClick(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH3) OnDrag(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH3) OnDragEnd(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH3) OnDragEnter(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH3) OnDragLeave(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH3) OnDragOver(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH3) OnDragStart(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH3) OnDrop(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH3) OnFocus(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH3) OnInput(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH3) OnInvalid(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH3) OnKeyDown(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH3) OnKeyPress(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH3) OnKeyUp(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH3) OnMouseDown(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH3) OnMouseMove(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH3) OnMouseOut(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH3) OnMouseOver(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH3) OnMouseUp(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH3) OnPaste(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH3) OnReset(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH3) OnScroll(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH3) OnSearch(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH3) OnSelect(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH3) OnSubmit(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH3) OnWheel(h EventHandler, scope ...any) HTMLH3 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH4 is the interface that describes a "h4" HTML element.
- type HTMLH4 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH4
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH4
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH4
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH4
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH4
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH4
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH4
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH4
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH4
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH4
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH4
- // ID specifies a unique id for an element.
- ID(v string) HTMLH4
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH4
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH4
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH4
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH4
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH4
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH4
- // Title specifies extra information about an element.
- Title(v string) HTMLH4
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH4
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH4
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH4
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH4
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH4
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH4
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH4
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH4
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH4
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH4
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH4
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH4
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH4
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH4
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH4
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH4
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH4
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH4
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH4
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH4
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH4
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH4
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH4
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH4
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH4
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH4
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH4
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH4
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH4
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH4
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH4
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH4
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH4
- }
- // H4 returns an HTML element that defines HTML heading.
- func H4() HTMLH4 {
- e := &htmlH4{
- htmlElement: htmlElement{
- tag: "h4",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH4 struct {
- htmlElement
- }
- func (e *htmlH4) Body(v ...UI) HTMLH4 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH4) Text(v any) HTMLH4 {
- return e.Body(Text(v))
- }
- func (e *htmlH4) AccessKey(v string) HTMLH4 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH4) Aria(k string, v any) HTMLH4 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH4) Attr(n string, v any) HTMLH4 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH4) Class(v ...string) HTMLH4 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH4) ContentEditable(v bool) HTMLH4 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH4) DataSet(k string, v any) HTMLH4 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH4) Dir(v string) HTMLH4 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH4) Draggable(v bool) HTMLH4 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH4) Hidden(v bool) HTMLH4 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH4) ID(v string) HTMLH4 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH4) Lang(v string) HTMLH4 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH4) Role(v string) HTMLH4 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH4) Spellcheck(v bool) HTMLH4 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH4) Style(k, v string) HTMLH4 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH4) Styles(s map[string]string) HTMLH4 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH4) TabIndex(v int) HTMLH4 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH4) Title(v string) HTMLH4 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH4) On(event string, h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH4) OnBlur(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH4) OnChange(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH4) OnClick(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH4) OnContextMenu(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH4) OnCopy(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH4) OnCut(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH4) OnDblClick(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH4) OnDrag(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH4) OnDragEnd(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH4) OnDragEnter(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH4) OnDragLeave(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH4) OnDragOver(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH4) OnDragStart(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH4) OnDrop(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH4) OnFocus(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH4) OnInput(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH4) OnInvalid(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH4) OnKeyDown(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH4) OnKeyPress(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH4) OnKeyUp(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH4) OnMouseDown(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH4) OnMouseMove(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH4) OnMouseOut(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH4) OnMouseOver(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH4) OnMouseUp(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH4) OnPaste(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH4) OnReset(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH4) OnScroll(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH4) OnSearch(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH4) OnSelect(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH4) OnSubmit(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH4) OnWheel(h EventHandler, scope ...any) HTMLH4 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH5 is the interface that describes a "h5" HTML element.
- type HTMLH5 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH5
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH5
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH5
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH5
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH5
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH5
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH5
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH5
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH5
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH5
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH5
- // ID specifies a unique id for an element.
- ID(v string) HTMLH5
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH5
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH5
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH5
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH5
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH5
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH5
- // Title specifies extra information about an element.
- Title(v string) HTMLH5
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH5
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH5
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH5
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH5
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH5
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH5
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH5
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH5
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH5
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH5
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH5
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH5
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH5
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH5
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH5
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH5
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH5
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH5
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH5
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH5
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH5
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH5
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH5
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH5
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH5
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH5
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH5
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH5
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH5
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH5
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH5
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH5
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH5
- }
- // H5 returns an HTML element that defines HTML heading.
- func H5() HTMLH5 {
- e := &htmlH5{
- htmlElement: htmlElement{
- tag: "h5",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH5 struct {
- htmlElement
- }
- func (e *htmlH5) Body(v ...UI) HTMLH5 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH5) Text(v any) HTMLH5 {
- return e.Body(Text(v))
- }
- func (e *htmlH5) AccessKey(v string) HTMLH5 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH5) Aria(k string, v any) HTMLH5 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH5) Attr(n string, v any) HTMLH5 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH5) Class(v ...string) HTMLH5 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH5) ContentEditable(v bool) HTMLH5 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH5) DataSet(k string, v any) HTMLH5 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH5) Dir(v string) HTMLH5 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH5) Draggable(v bool) HTMLH5 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH5) Hidden(v bool) HTMLH5 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH5) ID(v string) HTMLH5 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH5) Lang(v string) HTMLH5 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH5) Role(v string) HTMLH5 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH5) Spellcheck(v bool) HTMLH5 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH5) Style(k, v string) HTMLH5 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH5) Styles(s map[string]string) HTMLH5 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH5) TabIndex(v int) HTMLH5 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH5) Title(v string) HTMLH5 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH5) On(event string, h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH5) OnBlur(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH5) OnChange(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH5) OnClick(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH5) OnContextMenu(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH5) OnCopy(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH5) OnCut(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH5) OnDblClick(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH5) OnDrag(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH5) OnDragEnd(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH5) OnDragEnter(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH5) OnDragLeave(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH5) OnDragOver(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH5) OnDragStart(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH5) OnDrop(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH5) OnFocus(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH5) OnInput(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH5) OnInvalid(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH5) OnKeyDown(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH5) OnKeyPress(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH5) OnKeyUp(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH5) OnMouseDown(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH5) OnMouseMove(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH5) OnMouseOut(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH5) OnMouseOver(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH5) OnMouseUp(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH5) OnPaste(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH5) OnReset(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH5) OnScroll(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH5) OnSearch(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH5) OnSelect(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH5) OnSubmit(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH5) OnWheel(h EventHandler, scope ...any) HTMLH5 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLH6 is the interface that describes a "h6" HTML element.
- type HTMLH6 interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLH6
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLH6
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLH6
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLH6
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLH6
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLH6
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLH6
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLH6
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLH6
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLH6
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLH6
- // ID specifies a unique id for an element.
- ID(v string) HTMLH6
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLH6
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLH6
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLH6
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLH6
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLH6
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLH6
- // Title specifies extra information about an element.
- Title(v string) HTMLH6
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLH6
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLH6
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLH6
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLH6
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLH6
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLH6
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLH6
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLH6
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLH6
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLH6
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLH6
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLH6
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLH6
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLH6
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLH6
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLH6
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLH6
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLH6
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLH6
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLH6
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLH6
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLH6
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLH6
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLH6
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLH6
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLH6
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLH6
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLH6
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLH6
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLH6
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLH6
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLH6
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLH6
- }
- // H6 returns an HTML element that defines HTML heading.
- func H6() HTMLH6 {
- e := &htmlH6{
- htmlElement: htmlElement{
- tag: "h6",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlH6 struct {
- htmlElement
- }
- func (e *htmlH6) Body(v ...UI) HTMLH6 {
- e.setChildren(v...)
- return e
- }
- func (e *htmlH6) Text(v any) HTMLH6 {
- return e.Body(Text(v))
- }
- func (e *htmlH6) AccessKey(v string) HTMLH6 {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlH6) Aria(k string, v any) HTMLH6 {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH6) Attr(n string, v any) HTMLH6 {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlH6) Class(v ...string) HTMLH6 {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlH6) ContentEditable(v bool) HTMLH6 {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlH6) DataSet(k string, v any) HTMLH6 {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlH6) Dir(v string) HTMLH6 {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlH6) Draggable(v bool) HTMLH6 {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlH6) Hidden(v bool) HTMLH6 {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlH6) ID(v string) HTMLH6 {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlH6) Lang(v string) HTMLH6 {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlH6) Role(v string) HTMLH6 {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlH6) Spellcheck(v bool) HTMLH6 {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlH6) Style(k, v string) HTMLH6 {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlH6) Styles(s map[string]string) HTMLH6 {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlH6) TabIndex(v int) HTMLH6 {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlH6) Title(v string) HTMLH6 {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlH6) On(event string, h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlH6) OnBlur(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlH6) OnChange(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlH6) OnClick(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlH6) OnContextMenu(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlH6) OnCopy(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlH6) OnCut(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlH6) OnDblClick(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlH6) OnDrag(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlH6) OnDragEnd(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlH6) OnDragEnter(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlH6) OnDragLeave(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlH6) OnDragOver(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlH6) OnDragStart(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlH6) OnDrop(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlH6) OnFocus(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlH6) OnInput(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlH6) OnInvalid(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlH6) OnKeyDown(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlH6) OnKeyPress(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlH6) OnKeyUp(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlH6) OnMouseDown(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlH6) OnMouseMove(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlH6) OnMouseOut(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlH6) OnMouseOver(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlH6) OnMouseUp(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlH6) OnPaste(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlH6) OnReset(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlH6) OnScroll(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlH6) OnSearch(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlH6) OnSelect(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlH6) OnSubmit(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlH6) OnWheel(h EventHandler, scope ...any) HTMLH6 {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLHead is the interface that describes a "head" HTML element.
- type HTMLHead interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLHead
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLHead
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLHead
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLHead
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLHead
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLHead
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLHead
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLHead
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLHead
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLHead
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLHead
- // ID specifies a unique id for an element.
- ID(v string) HTMLHead
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLHead
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLHead
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLHead
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLHead
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLHead
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLHead
- // Title specifies extra information about an element.
- Title(v string) HTMLHead
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLHead
- }
- // Head returns an HTML element that defines information about the document.
- func Head() HTMLHead {
- e := &htmlHead{
- htmlElement: htmlElement{
- tag: "head",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlHead struct {
- htmlElement
- }
- func (e *htmlHead) Body(v ...UI) HTMLHead {
- e.setChildren(v...)
- return e
- }
- func (e *htmlHead) Text(v any) HTMLHead {
- return e.Body(Text(v))
- }
- func (e *htmlHead) AccessKey(v string) HTMLHead {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlHead) Aria(k string, v any) HTMLHead {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHead) Attr(n string, v any) HTMLHead {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlHead) Class(v ...string) HTMLHead {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlHead) ContentEditable(v bool) HTMLHead {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlHead) DataSet(k string, v any) HTMLHead {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHead) Dir(v string) HTMLHead {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlHead) Draggable(v bool) HTMLHead {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlHead) Hidden(v bool) HTMLHead {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlHead) ID(v string) HTMLHead {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlHead) Lang(v string) HTMLHead {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlHead) Role(v string) HTMLHead {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlHead) Spellcheck(v bool) HTMLHead {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlHead) Style(k, v string) HTMLHead {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlHead) Styles(s map[string]string) HTMLHead {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlHead) TabIndex(v int) HTMLHead {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlHead) Title(v string) HTMLHead {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlHead) On(event string, h EventHandler, scope ...any) HTMLHead {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLHeader is the interface that describes a "header" HTML element.
- type HTMLHeader interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLHeader
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLHeader
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLHeader
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLHeader
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLHeader
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLHeader
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLHeader
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLHeader
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLHeader
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLHeader
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLHeader
- // ID specifies a unique id for an element.
- ID(v string) HTMLHeader
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLHeader
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLHeader
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLHeader
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLHeader
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLHeader
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLHeader
- // Title specifies extra information about an element.
- Title(v string) HTMLHeader
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLHeader
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLHeader
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLHeader
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLHeader
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLHeader
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLHeader
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLHeader
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLHeader
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLHeader
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLHeader
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLHeader
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLHeader
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLHeader
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLHeader
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLHeader
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLHeader
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLHeader
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLHeader
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLHeader
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLHeader
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLHeader
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLHeader
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLHeader
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLHeader
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLHeader
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLHeader
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLHeader
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLHeader
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLHeader
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLHeader
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLHeader
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLHeader
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLHeader
- }
- // Header returns an HTML element that defines a header for a document or section.
- func Header() HTMLHeader {
- e := &htmlHeader{
- htmlElement: htmlElement{
- tag: "header",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlHeader struct {
- htmlElement
- }
- func (e *htmlHeader) Body(v ...UI) HTMLHeader {
- e.setChildren(v...)
- return e
- }
- func (e *htmlHeader) Text(v any) HTMLHeader {
- return e.Body(Text(v))
- }
- func (e *htmlHeader) AccessKey(v string) HTMLHeader {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlHeader) Aria(k string, v any) HTMLHeader {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHeader) Attr(n string, v any) HTMLHeader {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlHeader) Class(v ...string) HTMLHeader {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlHeader) ContentEditable(v bool) HTMLHeader {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlHeader) DataSet(k string, v any) HTMLHeader {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHeader) Dir(v string) HTMLHeader {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlHeader) Draggable(v bool) HTMLHeader {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlHeader) Hidden(v bool) HTMLHeader {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlHeader) ID(v string) HTMLHeader {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlHeader) Lang(v string) HTMLHeader {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlHeader) Role(v string) HTMLHeader {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlHeader) Spellcheck(v bool) HTMLHeader {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlHeader) Style(k, v string) HTMLHeader {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlHeader) Styles(s map[string]string) HTMLHeader {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlHeader) TabIndex(v int) HTMLHeader {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlHeader) Title(v string) HTMLHeader {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlHeader) On(event string, h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlHeader) OnBlur(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlHeader) OnChange(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlHeader) OnClick(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlHeader) OnContextMenu(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlHeader) OnCopy(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlHeader) OnCut(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDblClick(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDrag(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDragEnd(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDragEnter(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDragLeave(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDragOver(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDragStart(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlHeader) OnDrop(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlHeader) OnFocus(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlHeader) OnInput(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlHeader) OnInvalid(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlHeader) OnKeyDown(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlHeader) OnKeyPress(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlHeader) OnKeyUp(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlHeader) OnMouseDown(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlHeader) OnMouseMove(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlHeader) OnMouseOut(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlHeader) OnMouseOver(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlHeader) OnMouseUp(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlHeader) OnPaste(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlHeader) OnReset(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlHeader) OnScroll(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlHeader) OnSearch(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlHeader) OnSelect(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlHeader) OnSubmit(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlHeader) OnWheel(h EventHandler, scope ...any) HTMLHeader {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLHr is the interface that describes a "hr" HTML element.
- type HTMLHr interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLHr
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLHr
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLHr
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLHr
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLHr
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLHr
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLHr
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLHr
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLHr
- // ID specifies a unique id for an element.
- ID(v string) HTMLHr
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLHr
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLHr
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLHr
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLHr
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLHr
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLHr
- // Title specifies extra information about an element.
- Title(v string) HTMLHr
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLHr
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLHr
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLHr
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLHr
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLHr
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLHr
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLHr
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLHr
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLHr
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLHr
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLHr
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLHr
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLHr
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLHr
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLHr
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLHr
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLHr
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLHr
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLHr
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLHr
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLHr
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLHr
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLHr
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLHr
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLHr
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLHr
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLHr
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLHr
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLHr
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLHr
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLHr
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLHr
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLHr
- }
- // Hr returns an HTML element that defines a thematic change in the content.
- func Hr() HTMLHr {
- e := &htmlHr{
- htmlElement: htmlElement{
- tag: "hr",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlHr struct {
- htmlElement
- }
- func (e *htmlHr) AccessKey(v string) HTMLHr {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlHr) Aria(k string, v any) HTMLHr {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHr) Attr(n string, v any) HTMLHr {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlHr) Class(v ...string) HTMLHr {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlHr) ContentEditable(v bool) HTMLHr {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlHr) DataSet(k string, v any) HTMLHr {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHr) Dir(v string) HTMLHr {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlHr) Draggable(v bool) HTMLHr {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlHr) Hidden(v bool) HTMLHr {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlHr) ID(v string) HTMLHr {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlHr) Lang(v string) HTMLHr {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlHr) Role(v string) HTMLHr {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlHr) Spellcheck(v bool) HTMLHr {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlHr) Style(k, v string) HTMLHr {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlHr) Styles(s map[string]string) HTMLHr {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlHr) TabIndex(v int) HTMLHr {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlHr) Title(v string) HTMLHr {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlHr) On(event string, h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlHr) OnBlur(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlHr) OnChange(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlHr) OnClick(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlHr) OnContextMenu(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlHr) OnCopy(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlHr) OnCut(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlHr) OnDblClick(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlHr) OnDrag(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlHr) OnDragEnd(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlHr) OnDragEnter(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlHr) OnDragLeave(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlHr) OnDragOver(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlHr) OnDragStart(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlHr) OnDrop(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlHr) OnFocus(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlHr) OnInput(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlHr) OnInvalid(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlHr) OnKeyDown(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlHr) OnKeyPress(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlHr) OnKeyUp(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlHr) OnMouseDown(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlHr) OnMouseMove(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlHr) OnMouseOut(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlHr) OnMouseOver(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlHr) OnMouseUp(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlHr) OnPaste(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlHr) OnReset(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlHr) OnScroll(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlHr) OnSearch(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlHr) OnSelect(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlHr) OnSubmit(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlHr) OnWheel(h EventHandler, scope ...any) HTMLHr {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLHtml is the interface that describes a "html" HTML element.
- type HTMLHtml interface {
- UI
- privateBody(elems ...UI) HTMLHtml
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLHtml
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLHtml
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLHtml
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLHtml
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLHtml
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLHtml
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLHtml
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLHtml
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLHtml
- // ID specifies a unique id for an element.
- ID(v string) HTMLHtml
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLHtml
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLHtml
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLHtml
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLHtml
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLHtml
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLHtml
- // Title specifies extra information about an element.
- Title(v string) HTMLHtml
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLHtml
- }
- // Html returns an HTML element that defines the root of an HTML document.
- func Html() HTMLHtml {
- e := &htmlHtml{
- htmlElement: htmlElement{
- tag: "html",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlHtml struct {
- htmlElement
- }
- func (e *htmlHtml) privateBody(v ...UI) HTMLHtml {
- e.setChildren(v...)
- return e
- }
- func (e *htmlHtml) AccessKey(v string) HTMLHtml {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlHtml) Aria(k string, v any) HTMLHtml {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHtml) Attr(n string, v any) HTMLHtml {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlHtml) Class(v ...string) HTMLHtml {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlHtml) ContentEditable(v bool) HTMLHtml {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlHtml) DataSet(k string, v any) HTMLHtml {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlHtml) Dir(v string) HTMLHtml {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlHtml) Draggable(v bool) HTMLHtml {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlHtml) Hidden(v bool) HTMLHtml {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlHtml) ID(v string) HTMLHtml {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlHtml) Lang(v string) HTMLHtml {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlHtml) Role(v string) HTMLHtml {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlHtml) Spellcheck(v bool) HTMLHtml {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlHtml) Style(k, v string) HTMLHtml {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlHtml) Styles(s map[string]string) HTMLHtml {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlHtml) TabIndex(v int) HTMLHtml {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlHtml) Title(v string) HTMLHtml {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlHtml) On(event string, h EventHandler, scope ...any) HTMLHtml {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLI is the interface that describes a "i" HTML element.
- type HTMLI interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLI
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLI
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLI
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLI
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLI
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLI
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLI
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLI
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLI
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLI
- // ID specifies a unique id for an element.
- ID(v string) HTMLI
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLI
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLI
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLI
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLI
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLI
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLI
- // Title specifies extra information about an element.
- Title(v string) HTMLI
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLI
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLI
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLI
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLI
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLI
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLI
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLI
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLI
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLI
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLI
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLI
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLI
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLI
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLI
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLI
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLI
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLI
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLI
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLI
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLI
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLI
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLI
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLI
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLI
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLI
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLI
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLI
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLI
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLI
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLI
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLI
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLI
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLI
- }
- // I returns an HTML element that defines a part of text in an alternate voice or mood.
- func I() HTMLI {
- e := &htmlI{
- htmlElement: htmlElement{
- tag: "i",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlI struct {
- htmlElement
- }
- func (e *htmlI) Body(v ...UI) HTMLI {
- e.setChildren(v...)
- return e
- }
- func (e *htmlI) Text(v any) HTMLI {
- return e.Body(Text(v))
- }
- func (e *htmlI) AccessKey(v string) HTMLI {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlI) Aria(k string, v any) HTMLI {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlI) Attr(n string, v any) HTMLI {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlI) Class(v ...string) HTMLI {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlI) ContentEditable(v bool) HTMLI {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlI) DataSet(k string, v any) HTMLI {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlI) Dir(v string) HTMLI {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlI) Draggable(v bool) HTMLI {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlI) Hidden(v bool) HTMLI {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlI) ID(v string) HTMLI {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlI) Lang(v string) HTMLI {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlI) Role(v string) HTMLI {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlI) Spellcheck(v bool) HTMLI {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlI) Style(k, v string) HTMLI {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlI) Styles(s map[string]string) HTMLI {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlI) TabIndex(v int) HTMLI {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlI) Title(v string) HTMLI {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlI) On(event string, h EventHandler, scope ...any) HTMLI {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlI) OnBlur(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlI) OnChange(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlI) OnClick(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlI) OnContextMenu(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlI) OnCopy(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlI) OnCut(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlI) OnDblClick(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlI) OnDrag(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlI) OnDragEnd(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlI) OnDragEnter(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlI) OnDragLeave(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlI) OnDragOver(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlI) OnDragStart(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlI) OnDrop(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlI) OnFocus(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlI) OnInput(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlI) OnInvalid(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlI) OnKeyDown(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlI) OnKeyPress(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlI) OnKeyUp(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlI) OnMouseDown(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlI) OnMouseMove(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlI) OnMouseOut(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlI) OnMouseOver(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlI) OnMouseUp(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlI) OnPaste(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlI) OnReset(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlI) OnScroll(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlI) OnSearch(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlI) OnSelect(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlI) OnSubmit(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlI) OnWheel(h EventHandler, scope ...any) HTMLI {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLIFrame is the interface that describes a "iframe" HTML element.
- type HTMLIFrame interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLIFrame
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLIFrame
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLIFrame
- // Allow specifies a feature policy. Can be called multiple times to set multiple policies.
- Allow(v string) HTMLIFrame
- // AllowFullscreen reports whether an iframe can activate fullscreen mode.
- AllowFullscreen(v bool) HTMLIFrame
- // AllowPaymentRequest reports whether an iframe should be allowed to invoke the Payment Request API
- AllowPaymentRequest(v bool) HTMLIFrame
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLIFrame
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLIFrame
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLIFrame
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLIFrame
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLIFrame
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLIFrame
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLIFrame
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLIFrame
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLIFrame
- // ID specifies a unique id for an element.
- ID(v string) HTMLIFrame
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLIFrame
- // Loading indicates how the browser should load the iframe (eager|lazy).
- Loading(v string) HTMLIFrame
- // Name specifies the name of the element.
- Name(v string) HTMLIFrame
- // ReferrerPolicy specifies how much/which referrer information that will be sent when processing the iframe attributes
- ReferrerPolicy(v string) HTMLIFrame
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLIFrame
- // Sandbox enables an extra set of restrictions for the content in an iframe.
- Sandbox(v any) HTMLIFrame
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLIFrame
- // Src specifies the URL of the media file.
- Src(v string) HTMLIFrame
- // SrcDoc specifies the HTML content of the page to show in the iframe.
- SrcDoc(v string) HTMLIFrame
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLIFrame
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLIFrame
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLIFrame
- // Title specifies extra information about an element.
- Title(v string) HTMLIFrame
- // Width specifies the width of the element.
- Width(v int) HTMLIFrame
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLIFrame
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLIFrame
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLIFrame
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLIFrame
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLIFrame
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLIFrame
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLIFrame
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLIFrame
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLIFrame
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLIFrame
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLIFrame
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLIFrame
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLIFrame
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLIFrame
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLIFrame
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLIFrame
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLIFrame
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLIFrame
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLIFrame
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLIFrame
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLIFrame
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLIFrame
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLIFrame
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLIFrame
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLIFrame
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLIFrame
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLIFrame
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLIFrame
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLIFrame
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLIFrame
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLIFrame
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLIFrame
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLIFrame
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLIFrame
- }
- // IFrame returns an HTML element that defines an inline frame.
- func IFrame() HTMLIFrame {
- e := &htmlIFrame{
- htmlElement: htmlElement{
- tag: "iframe",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlIFrame struct {
- htmlElement
- }
- func (e *htmlIFrame) Body(v ...UI) HTMLIFrame {
- e.setChildren(v...)
- return e
- }
- func (e *htmlIFrame) Text(v any) HTMLIFrame {
- return e.Body(Text(v))
- }
- func (e *htmlIFrame) AccessKey(v string) HTMLIFrame {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlIFrame) Allow(v string) HTMLIFrame {
- e.setAttr("allow", v)
- return e
- }
- func (e *htmlIFrame) AllowFullscreen(v bool) HTMLIFrame {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("allowfullscreen", s)
- return e
- }
- func (e *htmlIFrame) AllowPaymentRequest(v bool) HTMLIFrame {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("allowpaymentrequest", s)
- return e
- }
- func (e *htmlIFrame) Aria(k string, v any) HTMLIFrame {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlIFrame) Attr(n string, v any) HTMLIFrame {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlIFrame) Class(v ...string) HTMLIFrame {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlIFrame) ContentEditable(v bool) HTMLIFrame {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlIFrame) DataSet(k string, v any) HTMLIFrame {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlIFrame) Dir(v string) HTMLIFrame {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlIFrame) Draggable(v bool) HTMLIFrame {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlIFrame) Height(v int) HTMLIFrame {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlIFrame) Hidden(v bool) HTMLIFrame {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlIFrame) ID(v string) HTMLIFrame {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlIFrame) Lang(v string) HTMLIFrame {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlIFrame) Loading(v string) HTMLIFrame {
- e.setAttr("loading", v)
- return e
- }
- func (e *htmlIFrame) Name(v string) HTMLIFrame {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlIFrame) ReferrerPolicy(v string) HTMLIFrame {
- e.setAttr("referrerpolicy", v)
- return e
- }
- func (e *htmlIFrame) Role(v string) HTMLIFrame {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlIFrame) Sandbox(v any) HTMLIFrame {
- e.setAttr("sandbox", v)
- return e
- }
- func (e *htmlIFrame) Spellcheck(v bool) HTMLIFrame {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlIFrame) Src(v string) HTMLIFrame {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlIFrame) SrcDoc(v string) HTMLIFrame {
- e.setAttr("srcdoc", v)
- return e
- }
- func (e *htmlIFrame) Style(k, v string) HTMLIFrame {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlIFrame) Styles(s map[string]string) HTMLIFrame {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlIFrame) TabIndex(v int) HTMLIFrame {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlIFrame) Title(v string) HTMLIFrame {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlIFrame) Width(v int) HTMLIFrame {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlIFrame) On(event string, h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlIFrame) OnBlur(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnChange(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnClick(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnContextMenu(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnCopy(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnCut(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDblClick(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDrag(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDragEnd(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDragEnter(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDragLeave(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDragOver(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDragStart(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnDrop(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnFocus(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnInput(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnInvalid(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnKeyDown(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnKeyPress(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnKeyUp(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnLoad(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnMouseDown(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnMouseMove(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnMouseOut(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnMouseOver(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnMouseUp(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnPaste(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnReset(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnScroll(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnSearch(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnSelect(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnSubmit(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlIFrame) OnWheel(h EventHandler, scope ...any) HTMLIFrame {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLImg is the interface that describes a "img" HTML element.
- type HTMLImg interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLImg
- // Alt specifies an alternate text when the original element fails to display.
- Alt(v string) HTMLImg
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLImg
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLImg
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLImg
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLImg
- // CrossOrigin sets the mode of the request to an HTTP CORS Request.
- CrossOrigin(v string) HTMLImg
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLImg
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLImg
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLImg
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLImg
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLImg
- // ID specifies a unique id for an element.
- ID(v string) HTMLImg
- // IsMap specifies an image as a server-side image-map.
- IsMap(v bool) HTMLImg
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLImg
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLImg
- // Sizes specifies the size of the linked resource.
- Sizes(v string) HTMLImg
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLImg
- // Src specifies the URL of the media file.
- Src(v string) HTMLImg
- // SrcSet specifies the URL of the image to use in different situations.
- SrcSet(v string) HTMLImg
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLImg
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLImg
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLImg
- // Title specifies extra information about an element.
- Title(v string) HTMLImg
- // UseMap specifies an image as a client-side image-map.
- UseMap(v string) HTMLImg
- // Width specifies the width of the element.
- Width(v int) HTMLImg
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLImg
- // OnAbort calls the given handler on abort.
- OnAbort(h EventHandler, scope ...any) HTMLImg
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLImg
- // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
- OnCanPlay(h EventHandler, scope ...any) HTMLImg
- // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
- OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLImg
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLImg
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLImg
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLImg
- // OnCueChange calls the given handler when the cue changes in a track element.
- OnCueChange(h EventHandler, scope ...any) HTMLImg
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLImg
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLImg
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLImg
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLImg
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLImg
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLImg
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLImg
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLImg
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLImg
- // OnDurationChange calls the given handler when the length of the media changes.
- OnDurationChange(h EventHandler, scope ...any) HTMLImg
- // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
- OnEmptied(h EventHandler, scope ...any) HTMLImg
- // OnEnded calls the given handler when the media has reach the end.
- OnEnded(h EventHandler, scope ...any) HTMLImg
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLImg
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLImg
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLImg
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLImg
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLImg
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLImg
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLImg
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLImg
- // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
- OnLoadStart(h EventHandler, scope ...any) HTMLImg
- // OnLoadedData calls the given handler when media data is loaded.
- OnLoadedData(h EventHandler, scope ...any) HTMLImg
- // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
- OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLImg
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLImg
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLImg
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLImg
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLImg
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLImg
- // OnPause calls the given handler when the media is paused either by the user or programmatically.
- OnPause(h EventHandler, scope ...any) HTMLImg
- // OnPlay calls the given handler when the media is ready to start playing.
- OnPlay(h EventHandler, scope ...any) HTMLImg
- // OnPlaying calls the given handler when the media actually has started playing.
- OnPlaying(h EventHandler, scope ...any) HTMLImg
- // OnProgress calls the given handler when the browser is in the process of getting the media data.
- OnProgress(h EventHandler, scope ...any) HTMLImg
- // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
- OnRateChange(h EventHandler, scope ...any) HTMLImg
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLImg
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLImg
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLImg
- // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
- OnSeeked(h EventHandler, scope ...any) HTMLImg
- // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
- OnSeeking(h EventHandler, scope ...any) HTMLImg
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLImg
- // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
- OnStalled(h EventHandler, scope ...any) HTMLImg
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLImg
- // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
- OnSuspend(h EventHandler, scope ...any) HTMLImg
- // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
- OnTimeUpdate(h EventHandler, scope ...any) HTMLImg
- // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
- OnVolumeChange(h EventHandler, scope ...any) HTMLImg
- // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
- OnWaiting(h EventHandler, scope ...any) HTMLImg
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLImg
- }
- // Img returns an HTML element that defines an image.
- func Img() HTMLImg {
- e := &htmlImg{
- htmlElement: htmlElement{
- tag: "img",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlImg struct {
- htmlElement
- }
- func (e *htmlImg) AccessKey(v string) HTMLImg {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlImg) Alt(v string) HTMLImg {
- e.setAttr("alt", v)
- return e
- }
- func (e *htmlImg) Aria(k string, v any) HTMLImg {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlImg) Attr(n string, v any) HTMLImg {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlImg) Class(v ...string) HTMLImg {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlImg) ContentEditable(v bool) HTMLImg {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlImg) CrossOrigin(v string) HTMLImg {
- e.setAttr("crossorigin", v)
- return e
- }
- func (e *htmlImg) DataSet(k string, v any) HTMLImg {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlImg) Dir(v string) HTMLImg {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlImg) Draggable(v bool) HTMLImg {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlImg) Height(v int) HTMLImg {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlImg) Hidden(v bool) HTMLImg {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlImg) ID(v string) HTMLImg {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlImg) IsMap(v bool) HTMLImg {
- e.setAttr("ismap", v)
- return e
- }
- func (e *htmlImg) Lang(v string) HTMLImg {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlImg) Role(v string) HTMLImg {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlImg) Sizes(v string) HTMLImg {
- e.setAttr("sizes", v)
- return e
- }
- func (e *htmlImg) Spellcheck(v bool) HTMLImg {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlImg) Src(v string) HTMLImg {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlImg) SrcSet(v string) HTMLImg {
- e.setAttr("srcset", v)
- return e
- }
- func (e *htmlImg) Style(k, v string) HTMLImg {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlImg) Styles(s map[string]string) HTMLImg {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlImg) TabIndex(v int) HTMLImg {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlImg) Title(v string) HTMLImg {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlImg) UseMap(v string) HTMLImg {
- e.setAttr("usemap", v)
- return e
- }
- func (e *htmlImg) Width(v int) HTMLImg {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlImg) On(event string, h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlImg) OnAbort(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("abort", h, scope...)
- return e
- }
- func (e *htmlImg) OnBlur(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlImg) OnCanPlay(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("canplay", h, scope...)
- return e
- }
- func (e *htmlImg) OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("canplaythrough", h, scope...)
- return e
- }
- func (e *htmlImg) OnChange(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlImg) OnClick(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlImg) OnContextMenu(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlImg) OnCopy(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlImg) OnCueChange(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("cuechange", h, scope...)
- return e
- }
- func (e *htmlImg) OnCut(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlImg) OnDblClick(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlImg) OnDrag(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlImg) OnDragEnd(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlImg) OnDragEnter(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlImg) OnDragLeave(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlImg) OnDragOver(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlImg) OnDragStart(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlImg) OnDrop(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlImg) OnDurationChange(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("durationchange", h, scope...)
- return e
- }
- func (e *htmlImg) OnEmptied(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("emptied", h, scope...)
- return e
- }
- func (e *htmlImg) OnEnded(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("ended", h, scope...)
- return e
- }
- func (e *htmlImg) OnError(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlImg) OnFocus(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlImg) OnInput(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlImg) OnInvalid(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlImg) OnKeyDown(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlImg) OnKeyPress(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlImg) OnKeyUp(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlImg) OnLoad(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlImg) OnLoadStart(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("loadstart", h, scope...)
- return e
- }
- func (e *htmlImg) OnLoadedData(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("loadeddata", h, scope...)
- return e
- }
- func (e *htmlImg) OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("loadedmetadata", h, scope...)
- return e
- }
- func (e *htmlImg) OnMouseDown(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlImg) OnMouseMove(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlImg) OnMouseOut(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlImg) OnMouseOver(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlImg) OnMouseUp(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlImg) OnPaste(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlImg) OnPause(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("pause", h, scope...)
- return e
- }
- func (e *htmlImg) OnPlay(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("play", h, scope...)
- return e
- }
- func (e *htmlImg) OnPlaying(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("playing", h, scope...)
- return e
- }
- func (e *htmlImg) OnProgress(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("progress", h, scope...)
- return e
- }
- func (e *htmlImg) OnRateChange(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("ratechange", h, scope...)
- return e
- }
- func (e *htmlImg) OnReset(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlImg) OnScroll(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlImg) OnSearch(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlImg) OnSeeked(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("seeked", h, scope...)
- return e
- }
- func (e *htmlImg) OnSeeking(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("seeking", h, scope...)
- return e
- }
- func (e *htmlImg) OnSelect(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlImg) OnStalled(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("stalled", h, scope...)
- return e
- }
- func (e *htmlImg) OnSubmit(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlImg) OnSuspend(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("suspend", h, scope...)
- return e
- }
- func (e *htmlImg) OnTimeUpdate(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("timeupdate", h, scope...)
- return e
- }
- func (e *htmlImg) OnVolumeChange(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("volumechange", h, scope...)
- return e
- }
- func (e *htmlImg) OnWaiting(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("waiting", h, scope...)
- return e
- }
- func (e *htmlImg) OnWheel(h EventHandler, scope ...any) HTMLImg {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLInput is the interface that describes a "input" HTML element.
- type HTMLInput interface {
- UI
- // Accept specifies the types of files that the server accepts (only for file type).
- Accept(v string) HTMLInput
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLInput
- // Alt specifies an alternate text when the original element fails to display.
- Alt(v string) HTMLInput
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLInput
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLInput
- // AutoComplete specifies whether the element should have autocomplete enabled.
- AutoComplete(v bool) HTMLInput
- // AutoFocus specifies that the element should automatically get focus when the page loads.
- AutoFocus(v bool) HTMLInput
- // Capture specifies the capture input method in file upload controls
- Capture(v string) HTMLInput
- // Checked specifies that an input element should be pre-selected when the page loads (for checkbox or radio types).
- Checked(v bool) HTMLInput
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLInput
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLInput
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLInput
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLInput
- // DirName specifies that the text direction will be submitted.
- DirName(v string) HTMLInput
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLInput
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLInput
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLInput
- // FormAction specifies where to send the form-data when a form is submitted. Only for submit type.
- FormAction(v string) HTMLInput
- // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type.
- FormEncType(v string) HTMLInput
- // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type.
- FormMethod(v string) HTMLInput
- // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type.
- FormNoValidate(v bool) HTMLInput
- // FormTarget specifies where to display the response after submitting the form. Only for submit type.
- FormTarget(v string) HTMLInput
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLInput
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLInput
- // ID specifies a unique id for an element.
- ID(v string) HTMLInput
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLInput
- // List refers to a datalist element that contains pre-defined options for an input element.
- List(v string) HTMLInput
- // Max Specifies the maximum value.
- Max(v any) HTMLInput
- // MaxLength specifies the maximum number of characters allowed in an element.
- MaxLength(v int) HTMLInput
- // Min specifies a minimum value.
- Min(v any) HTMLInput
- // Multiple specifies that a user can enter more than one value.
- Multiple(v bool) HTMLInput
- // Name specifies the name of the element.
- Name(v string) HTMLInput
- // Pattern specifies a regular expression that an input element's value is checked against.
- Pattern(v string) HTMLInput
- // Placeholder specifies a short hint that describes the expected value of the element.
- Placeholder(v string) HTMLInput
- // ReadOnly specifies that the element is read-only.
- ReadOnly(v bool) HTMLInput
- // Required specifies that the element must be filled out before submitting the form.
- Required(v bool) HTMLInput
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLInput
- // Size specifies the width.
- Size(v int) HTMLInput
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLInput
- // Src specifies the URL of the media file.
- Src(v string) HTMLInput
- // Step specifies the legal number intervals for an input field.
- Step(v float64) HTMLInput
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLInput
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLInput
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLInput
- // Title specifies extra information about an element.
- Title(v string) HTMLInput
- // Type specifies the type of element.
- Type(v string) HTMLInput
- // Value specifies the value of the element.
- Value(v any) HTMLInput
- // Width specifies the width of the element.
- Width(v int) HTMLInput
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLInput
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLInput
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLInput
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLInput
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLInput
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLInput
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLInput
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLInput
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLInput
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLInput
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLInput
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLInput
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLInput
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLInput
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLInput
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLInput
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLInput
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLInput
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLInput
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLInput
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLInput
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLInput
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLInput
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLInput
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLInput
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLInput
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLInput
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLInput
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLInput
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLInput
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLInput
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLInput
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLInput
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLInput
- }
- // Input returns an HTML element that defines an input control.
- func Input() HTMLInput {
- e := &htmlInput{
- htmlElement: htmlElement{
- tag: "input",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlInput struct {
- htmlElement
- }
- func (e *htmlInput) Accept(v string) HTMLInput {
- e.setAttr("accept", v)
- return e
- }
- func (e *htmlInput) AccessKey(v string) HTMLInput {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlInput) Alt(v string) HTMLInput {
- e.setAttr("alt", v)
- return e
- }
- func (e *htmlInput) Aria(k string, v any) HTMLInput {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlInput) Attr(n string, v any) HTMLInput {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlInput) AutoComplete(v bool) HTMLInput {
- s := "off"
- if v {
- s = "on"
- }
- e.setAttr("autocomplete", s)
- return e
- }
- func (e *htmlInput) AutoFocus(v bool) HTMLInput {
- e.setAttr("autofocus", v)
- return e
- }
- func (e *htmlInput) Capture(v string) HTMLInput {
- e.setAttr("capture", v)
- return e
- }
- func (e *htmlInput) Checked(v bool) HTMLInput {
- e.setAttr("checked", v)
- return e
- }
- func (e *htmlInput) Class(v ...string) HTMLInput {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlInput) ContentEditable(v bool) HTMLInput {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlInput) DataSet(k string, v any) HTMLInput {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlInput) Dir(v string) HTMLInput {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlInput) DirName(v string) HTMLInput {
- e.setAttr("dirname", v)
- return e
- }
- func (e *htmlInput) Disabled(v bool) HTMLInput {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlInput) Draggable(v bool) HTMLInput {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlInput) Form(v string) HTMLInput {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlInput) FormAction(v string) HTMLInput {
- e.setAttr("formaction", v)
- return e
- }
- func (e *htmlInput) FormEncType(v string) HTMLInput {
- e.setAttr("formenctype", v)
- return e
- }
- func (e *htmlInput) FormMethod(v string) HTMLInput {
- e.setAttr("formmethod", v)
- return e
- }
- func (e *htmlInput) FormNoValidate(v bool) HTMLInput {
- e.setAttr("formnovalidate", v)
- return e
- }
- func (e *htmlInput) FormTarget(v string) HTMLInput {
- e.setAttr("formtarget", v)
- return e
- }
- func (e *htmlInput) Height(v int) HTMLInput {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlInput) Hidden(v bool) HTMLInput {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlInput) ID(v string) HTMLInput {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlInput) Lang(v string) HTMLInput {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlInput) List(v string) HTMLInput {
- e.setAttr("list", v)
- return e
- }
- func (e *htmlInput) Max(v any) HTMLInput {
- e.setAttr("max", v)
- return e
- }
- func (e *htmlInput) MaxLength(v int) HTMLInput {
- e.setAttr("maxlength", v)
- return e
- }
- func (e *htmlInput) Min(v any) HTMLInput {
- e.setAttr("min", v)
- return e
- }
- func (e *htmlInput) Multiple(v bool) HTMLInput {
- e.setAttr("multiple", v)
- return e
- }
- func (e *htmlInput) Name(v string) HTMLInput {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlInput) Pattern(v string) HTMLInput {
- e.setAttr("pattern", v)
- return e
- }
- func (e *htmlInput) Placeholder(v string) HTMLInput {
- e.setAttr("placeholder", v)
- return e
- }
- func (e *htmlInput) ReadOnly(v bool) HTMLInput {
- e.setAttr("readonly", v)
- return e
- }
- func (e *htmlInput) Required(v bool) HTMLInput {
- e.setAttr("required", v)
- return e
- }
- func (e *htmlInput) Role(v string) HTMLInput {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlInput) Size(v int) HTMLInput {
- e.setAttr("size", v)
- return e
- }
- func (e *htmlInput) Spellcheck(v bool) HTMLInput {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlInput) Src(v string) HTMLInput {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlInput) Step(v float64) HTMLInput {
- e.setAttr("step", v)
- return e
- }
- func (e *htmlInput) Style(k, v string) HTMLInput {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlInput) Styles(s map[string]string) HTMLInput {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlInput) TabIndex(v int) HTMLInput {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlInput) Title(v string) HTMLInput {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlInput) Type(v string) HTMLInput {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlInput) Value(v any) HTMLInput {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlInput) Width(v int) HTMLInput {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlInput) On(event string, h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlInput) OnBlur(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlInput) OnChange(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlInput) OnClick(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlInput) OnContextMenu(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlInput) OnCopy(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlInput) OnCut(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlInput) OnDblClick(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlInput) OnDrag(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlInput) OnDragEnd(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlInput) OnDragEnter(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlInput) OnDragLeave(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlInput) OnDragOver(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlInput) OnDragStart(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlInput) OnDrop(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlInput) OnFocus(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlInput) OnInput(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlInput) OnInvalid(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlInput) OnKeyDown(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlInput) OnKeyPress(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlInput) OnKeyUp(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlInput) OnLoad(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlInput) OnMouseDown(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlInput) OnMouseMove(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlInput) OnMouseOut(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlInput) OnMouseOver(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlInput) OnMouseUp(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlInput) OnPaste(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlInput) OnReset(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlInput) OnScroll(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlInput) OnSearch(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlInput) OnSelect(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlInput) OnSubmit(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlInput) OnWheel(h EventHandler, scope ...any) HTMLInput {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLIns is the interface that describes a "ins" HTML element.
- type HTMLIns interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLIns
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLIns
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLIns
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLIns
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLIns
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLIns
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLIns
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLIns
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLIns
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLIns
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLIns
- // ID specifies a unique id for an element.
- ID(v string) HTMLIns
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLIns
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLIns
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLIns
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLIns
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLIns
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLIns
- // Title specifies extra information about an element.
- Title(v string) HTMLIns
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLIns
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLIns
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLIns
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLIns
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLIns
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLIns
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLIns
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLIns
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLIns
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLIns
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLIns
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLIns
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLIns
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLIns
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLIns
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLIns
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLIns
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLIns
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLIns
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLIns
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLIns
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLIns
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLIns
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLIns
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLIns
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLIns
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLIns
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLIns
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLIns
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLIns
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLIns
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLIns
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLIns
- }
- // Ins returns an HTML element that defines a text that has been inserted into a document.
- func Ins() HTMLIns {
- e := &htmlIns{
- htmlElement: htmlElement{
- tag: "ins",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlIns struct {
- htmlElement
- }
- func (e *htmlIns) Body(v ...UI) HTMLIns {
- e.setChildren(v...)
- return e
- }
- func (e *htmlIns) Text(v any) HTMLIns {
- return e.Body(Text(v))
- }
- func (e *htmlIns) AccessKey(v string) HTMLIns {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlIns) Aria(k string, v any) HTMLIns {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlIns) Attr(n string, v any) HTMLIns {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlIns) Class(v ...string) HTMLIns {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlIns) ContentEditable(v bool) HTMLIns {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlIns) DataSet(k string, v any) HTMLIns {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlIns) Dir(v string) HTMLIns {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlIns) Draggable(v bool) HTMLIns {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlIns) Hidden(v bool) HTMLIns {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlIns) ID(v string) HTMLIns {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlIns) Lang(v string) HTMLIns {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlIns) Role(v string) HTMLIns {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlIns) Spellcheck(v bool) HTMLIns {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlIns) Style(k, v string) HTMLIns {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlIns) Styles(s map[string]string) HTMLIns {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlIns) TabIndex(v int) HTMLIns {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlIns) Title(v string) HTMLIns {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlIns) On(event string, h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlIns) OnBlur(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlIns) OnChange(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlIns) OnClick(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlIns) OnContextMenu(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlIns) OnCopy(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlIns) OnCut(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlIns) OnDblClick(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlIns) OnDrag(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlIns) OnDragEnd(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlIns) OnDragEnter(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlIns) OnDragLeave(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlIns) OnDragOver(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlIns) OnDragStart(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlIns) OnDrop(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlIns) OnFocus(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlIns) OnInput(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlIns) OnInvalid(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlIns) OnKeyDown(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlIns) OnKeyPress(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlIns) OnKeyUp(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlIns) OnMouseDown(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlIns) OnMouseMove(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlIns) OnMouseOut(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlIns) OnMouseOver(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlIns) OnMouseUp(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlIns) OnPaste(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlIns) OnReset(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlIns) OnScroll(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlIns) OnSearch(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlIns) OnSelect(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlIns) OnSubmit(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlIns) OnWheel(h EventHandler, scope ...any) HTMLIns {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLKbd is the interface that describes a "kbd" HTML element.
- type HTMLKbd interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLKbd
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLKbd
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLKbd
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLKbd
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLKbd
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLKbd
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLKbd
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLKbd
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLKbd
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLKbd
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLKbd
- // ID specifies a unique id for an element.
- ID(v string) HTMLKbd
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLKbd
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLKbd
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLKbd
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLKbd
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLKbd
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLKbd
- // Title specifies extra information about an element.
- Title(v string) HTMLKbd
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLKbd
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLKbd
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLKbd
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLKbd
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLKbd
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLKbd
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLKbd
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLKbd
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLKbd
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLKbd
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLKbd
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLKbd
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLKbd
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLKbd
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLKbd
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLKbd
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLKbd
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLKbd
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLKbd
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLKbd
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLKbd
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLKbd
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLKbd
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLKbd
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLKbd
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLKbd
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLKbd
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLKbd
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLKbd
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLKbd
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLKbd
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLKbd
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLKbd
- }
- // Kbd returns an HTML element that defines keyboard input.
- func Kbd() HTMLKbd {
- e := &htmlKbd{
- htmlElement: htmlElement{
- tag: "kbd",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlKbd struct {
- htmlElement
- }
- func (e *htmlKbd) Body(v ...UI) HTMLKbd {
- e.setChildren(v...)
- return e
- }
- func (e *htmlKbd) Text(v any) HTMLKbd {
- return e.Body(Text(v))
- }
- func (e *htmlKbd) AccessKey(v string) HTMLKbd {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlKbd) Aria(k string, v any) HTMLKbd {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlKbd) Attr(n string, v any) HTMLKbd {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlKbd) Class(v ...string) HTMLKbd {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlKbd) ContentEditable(v bool) HTMLKbd {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlKbd) DataSet(k string, v any) HTMLKbd {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlKbd) Dir(v string) HTMLKbd {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlKbd) Draggable(v bool) HTMLKbd {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlKbd) Hidden(v bool) HTMLKbd {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlKbd) ID(v string) HTMLKbd {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlKbd) Lang(v string) HTMLKbd {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlKbd) Role(v string) HTMLKbd {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlKbd) Spellcheck(v bool) HTMLKbd {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlKbd) Style(k, v string) HTMLKbd {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlKbd) Styles(s map[string]string) HTMLKbd {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlKbd) TabIndex(v int) HTMLKbd {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlKbd) Title(v string) HTMLKbd {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlKbd) On(event string, h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlKbd) OnBlur(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlKbd) OnChange(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlKbd) OnClick(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlKbd) OnContextMenu(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlKbd) OnCopy(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlKbd) OnCut(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDblClick(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDrag(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDragEnd(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDragEnter(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDragLeave(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDragOver(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDragStart(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlKbd) OnDrop(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlKbd) OnFocus(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlKbd) OnInput(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlKbd) OnInvalid(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlKbd) OnKeyDown(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlKbd) OnKeyPress(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlKbd) OnKeyUp(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlKbd) OnMouseDown(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlKbd) OnMouseMove(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlKbd) OnMouseOut(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlKbd) OnMouseOver(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlKbd) OnMouseUp(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlKbd) OnPaste(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlKbd) OnReset(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlKbd) OnScroll(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlKbd) OnSearch(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlKbd) OnSelect(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlKbd) OnSubmit(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlKbd) OnWheel(h EventHandler, scope ...any) HTMLKbd {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLLabel is the interface that describes a "label" HTML element.
- type HTMLLabel interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLLabel
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLLabel
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLLabel
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLLabel
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLLabel
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLLabel
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLLabel
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLLabel
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLLabel
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLLabel
- // For specifies which form element(s) a label/calculation is bound to.
- For(v string) HTMLLabel
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLLabel
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLLabel
- // ID specifies a unique id for an element.
- ID(v string) HTMLLabel
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLLabel
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLLabel
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLLabel
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLLabel
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLLabel
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLLabel
- // Title specifies extra information about an element.
- Title(v string) HTMLLabel
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLLabel
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLLabel
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLLabel
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLLabel
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLLabel
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLLabel
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLLabel
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLLabel
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLLabel
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLLabel
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLLabel
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLLabel
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLLabel
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLLabel
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLLabel
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLLabel
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLLabel
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLLabel
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLLabel
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLLabel
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLLabel
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLLabel
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLLabel
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLLabel
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLLabel
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLLabel
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLLabel
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLLabel
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLLabel
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLLabel
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLLabel
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLLabel
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLLabel
- }
- // Label returns an HTML element that defines a label for an input element.
- func Label() HTMLLabel {
- e := &htmlLabel{
- htmlElement: htmlElement{
- tag: "label",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlLabel struct {
- htmlElement
- }
- func (e *htmlLabel) Body(v ...UI) HTMLLabel {
- e.setChildren(v...)
- return e
- }
- func (e *htmlLabel) Text(v any) HTMLLabel {
- return e.Body(Text(v))
- }
- func (e *htmlLabel) AccessKey(v string) HTMLLabel {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlLabel) Aria(k string, v any) HTMLLabel {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLabel) Attr(n string, v any) HTMLLabel {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlLabel) Class(v ...string) HTMLLabel {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlLabel) ContentEditable(v bool) HTMLLabel {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlLabel) DataSet(k string, v any) HTMLLabel {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLabel) Dir(v string) HTMLLabel {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlLabel) Draggable(v bool) HTMLLabel {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlLabel) For(v string) HTMLLabel {
- e.setAttr("for", v)
- return e
- }
- func (e *htmlLabel) Form(v string) HTMLLabel {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlLabel) Hidden(v bool) HTMLLabel {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlLabel) ID(v string) HTMLLabel {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlLabel) Lang(v string) HTMLLabel {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlLabel) Role(v string) HTMLLabel {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlLabel) Spellcheck(v bool) HTMLLabel {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlLabel) Style(k, v string) HTMLLabel {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlLabel) Styles(s map[string]string) HTMLLabel {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlLabel) TabIndex(v int) HTMLLabel {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlLabel) Title(v string) HTMLLabel {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlLabel) On(event string, h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlLabel) OnBlur(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlLabel) OnChange(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlLabel) OnClick(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlLabel) OnContextMenu(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlLabel) OnCopy(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlLabel) OnCut(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDblClick(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDrag(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDragEnd(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDragEnter(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDragLeave(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDragOver(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDragStart(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlLabel) OnDrop(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlLabel) OnFocus(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlLabel) OnInput(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlLabel) OnInvalid(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlLabel) OnKeyDown(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlLabel) OnKeyPress(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlLabel) OnKeyUp(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlLabel) OnMouseDown(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlLabel) OnMouseMove(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlLabel) OnMouseOut(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlLabel) OnMouseOver(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlLabel) OnMouseUp(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlLabel) OnPaste(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlLabel) OnReset(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlLabel) OnScroll(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlLabel) OnSearch(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlLabel) OnSelect(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlLabel) OnSubmit(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlLabel) OnWheel(h EventHandler, scope ...any) HTMLLabel {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLLegend is the interface that describes a "legend" HTML element.
- type HTMLLegend interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLLegend
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLLegend
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLLegend
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLLegend
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLLegend
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLLegend
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLLegend
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLLegend
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLLegend
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLLegend
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLLegend
- // ID specifies a unique id for an element.
- ID(v string) HTMLLegend
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLLegend
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLLegend
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLLegend
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLLegend
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLLegend
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLLegend
- // Title specifies extra information about an element.
- Title(v string) HTMLLegend
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLLegend
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLLegend
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLLegend
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLLegend
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLLegend
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLLegend
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLLegend
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLLegend
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLLegend
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLLegend
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLLegend
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLLegend
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLLegend
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLLegend
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLLegend
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLLegend
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLLegend
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLLegend
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLLegend
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLLegend
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLLegend
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLLegend
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLLegend
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLLegend
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLLegend
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLLegend
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLLegend
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLLegend
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLLegend
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLLegend
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLLegend
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLLegend
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLLegend
- }
- // Legend returns an HTML element that defines a caption for a fieldset element.
- func Legend() HTMLLegend {
- e := &htmlLegend{
- htmlElement: htmlElement{
- tag: "legend",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlLegend struct {
- htmlElement
- }
- func (e *htmlLegend) Body(v ...UI) HTMLLegend {
- e.setChildren(v...)
- return e
- }
- func (e *htmlLegend) Text(v any) HTMLLegend {
- return e.Body(Text(v))
- }
- func (e *htmlLegend) AccessKey(v string) HTMLLegend {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlLegend) Aria(k string, v any) HTMLLegend {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLegend) Attr(n string, v any) HTMLLegend {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlLegend) Class(v ...string) HTMLLegend {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlLegend) ContentEditable(v bool) HTMLLegend {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlLegend) DataSet(k string, v any) HTMLLegend {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLegend) Dir(v string) HTMLLegend {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlLegend) Draggable(v bool) HTMLLegend {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlLegend) Hidden(v bool) HTMLLegend {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlLegend) ID(v string) HTMLLegend {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlLegend) Lang(v string) HTMLLegend {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlLegend) Role(v string) HTMLLegend {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlLegend) Spellcheck(v bool) HTMLLegend {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlLegend) Style(k, v string) HTMLLegend {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlLegend) Styles(s map[string]string) HTMLLegend {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlLegend) TabIndex(v int) HTMLLegend {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlLegend) Title(v string) HTMLLegend {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlLegend) On(event string, h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlLegend) OnBlur(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlLegend) OnChange(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlLegend) OnClick(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlLegend) OnContextMenu(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlLegend) OnCopy(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlLegend) OnCut(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDblClick(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDrag(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDragEnd(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDragEnter(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDragLeave(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDragOver(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDragStart(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlLegend) OnDrop(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlLegend) OnFocus(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlLegend) OnInput(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlLegend) OnInvalid(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlLegend) OnKeyDown(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlLegend) OnKeyPress(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlLegend) OnKeyUp(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlLegend) OnMouseDown(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlLegend) OnMouseMove(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlLegend) OnMouseOut(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlLegend) OnMouseOver(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlLegend) OnMouseUp(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlLegend) OnPaste(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlLegend) OnReset(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlLegend) OnScroll(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlLegend) OnSearch(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlLegend) OnSelect(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlLegend) OnSubmit(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlLegend) OnWheel(h EventHandler, scope ...any) HTMLLegend {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLLi is the interface that describes a "li" HTML element.
- type HTMLLi interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLLi
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLLi
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLLi
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLLi
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLLi
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLLi
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLLi
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLLi
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLLi
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLLi
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLLi
- // ID specifies a unique id for an element.
- ID(v string) HTMLLi
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLLi
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLLi
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLLi
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLLi
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLLi
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLLi
- // Title specifies extra information about an element.
- Title(v string) HTMLLi
- // Value specifies the value of the element.
- Value(v any) HTMLLi
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLLi
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLLi
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLLi
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLLi
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLLi
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLLi
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLLi
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLLi
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLLi
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLLi
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLLi
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLLi
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLLi
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLLi
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLLi
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLLi
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLLi
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLLi
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLLi
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLLi
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLLi
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLLi
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLLi
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLLi
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLLi
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLLi
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLLi
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLLi
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLLi
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLLi
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLLi
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLLi
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLLi
- }
- // Li returns an HTML element that defines a list item.
- func Li() HTMLLi {
- e := &htmlLi{
- htmlElement: htmlElement{
- tag: "li",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlLi struct {
- htmlElement
- }
- func (e *htmlLi) Body(v ...UI) HTMLLi {
- e.setChildren(v...)
- return e
- }
- func (e *htmlLi) Text(v any) HTMLLi {
- return e.Body(Text(v))
- }
- func (e *htmlLi) AccessKey(v string) HTMLLi {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlLi) Aria(k string, v any) HTMLLi {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLi) Attr(n string, v any) HTMLLi {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlLi) Class(v ...string) HTMLLi {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlLi) ContentEditable(v bool) HTMLLi {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlLi) DataSet(k string, v any) HTMLLi {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLi) Dir(v string) HTMLLi {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlLi) Draggable(v bool) HTMLLi {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlLi) Hidden(v bool) HTMLLi {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlLi) ID(v string) HTMLLi {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlLi) Lang(v string) HTMLLi {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlLi) Role(v string) HTMLLi {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlLi) Spellcheck(v bool) HTMLLi {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlLi) Style(k, v string) HTMLLi {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlLi) Styles(s map[string]string) HTMLLi {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlLi) TabIndex(v int) HTMLLi {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlLi) Title(v string) HTMLLi {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlLi) Value(v any) HTMLLi {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlLi) On(event string, h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlLi) OnBlur(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlLi) OnChange(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlLi) OnClick(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlLi) OnContextMenu(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlLi) OnCopy(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlLi) OnCut(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlLi) OnDblClick(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlLi) OnDrag(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlLi) OnDragEnd(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlLi) OnDragEnter(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlLi) OnDragLeave(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlLi) OnDragOver(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlLi) OnDragStart(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlLi) OnDrop(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlLi) OnFocus(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlLi) OnInput(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlLi) OnInvalid(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlLi) OnKeyDown(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlLi) OnKeyPress(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlLi) OnKeyUp(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlLi) OnMouseDown(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlLi) OnMouseMove(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlLi) OnMouseOut(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlLi) OnMouseOver(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlLi) OnMouseUp(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlLi) OnPaste(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlLi) OnReset(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlLi) OnScroll(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlLi) OnSearch(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlLi) OnSelect(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlLi) OnSubmit(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlLi) OnWheel(h EventHandler, scope ...any) HTMLLi {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLLink is the interface that describes a "link" HTML element.
- type HTMLLink interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLLink
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLLink
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLLink
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLLink
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLLink
- // CrossOrigin sets the mode of the request to an HTTP CORS Request.
- CrossOrigin(v string) HTMLLink
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLLink
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLLink
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLLink
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLLink
- // Href specifies the URL of the page the link goes to.
- Href(v string) HTMLLink
- // HrefLang specifies the language of the linked document.
- HrefLang(v string) HTMLLink
- // ID specifies a unique id for an element.
- ID(v string) HTMLLink
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLLink
- // Media specifies what media/device the linked document is optimized for.
- Media(v string) HTMLLink
- // Rel specifies the relationship between the current document and the linked document.
- Rel(v string) HTMLLink
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLLink
- // Sizes specifies the size of the linked resource.
- Sizes(v string) HTMLLink
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLLink
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLLink
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLLink
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLLink
- // Title specifies extra information about an element.
- Title(v string) HTMLLink
- // Type specifies the type of element.
- Type(v string) HTMLLink
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLLink
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLLink
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLLink
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLLink
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLLink
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLLink
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLLink
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLLink
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLLink
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLLink
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLLink
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLLink
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLLink
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLLink
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLLink
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLLink
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLLink
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLLink
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLLink
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLLink
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLLink
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLLink
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLLink
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLLink
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLLink
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLLink
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLLink
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLLink
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLLink
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLLink
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLLink
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLLink
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLLink
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLLink
- }
- // Link returns an HTML element that defines the relationship between a document and an external resource (most used to link to style sheets).
- func Link() HTMLLink {
- e := &htmlLink{
- htmlElement: htmlElement{
- tag: "link",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlLink struct {
- htmlElement
- }
- func (e *htmlLink) AccessKey(v string) HTMLLink {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlLink) Aria(k string, v any) HTMLLink {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLink) Attr(n string, v any) HTMLLink {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlLink) Class(v ...string) HTMLLink {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlLink) ContentEditable(v bool) HTMLLink {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlLink) CrossOrigin(v string) HTMLLink {
- e.setAttr("crossorigin", v)
- return e
- }
- func (e *htmlLink) DataSet(k string, v any) HTMLLink {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlLink) Dir(v string) HTMLLink {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlLink) Draggable(v bool) HTMLLink {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlLink) Hidden(v bool) HTMLLink {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlLink) Href(v string) HTMLLink {
- e.setAttr("href", v)
- return e
- }
- func (e *htmlLink) HrefLang(v string) HTMLLink {
- e.setAttr("hreflang", v)
- return e
- }
- func (e *htmlLink) ID(v string) HTMLLink {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlLink) Lang(v string) HTMLLink {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlLink) Media(v string) HTMLLink {
- e.setAttr("media", v)
- return e
- }
- func (e *htmlLink) Rel(v string) HTMLLink {
- e.setAttr("rel", v)
- return e
- }
- func (e *htmlLink) Role(v string) HTMLLink {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlLink) Sizes(v string) HTMLLink {
- e.setAttr("sizes", v)
- return e
- }
- func (e *htmlLink) Spellcheck(v bool) HTMLLink {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlLink) Style(k, v string) HTMLLink {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlLink) Styles(s map[string]string) HTMLLink {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlLink) TabIndex(v int) HTMLLink {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlLink) Title(v string) HTMLLink {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlLink) Type(v string) HTMLLink {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlLink) On(event string, h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlLink) OnBlur(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlLink) OnChange(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlLink) OnClick(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlLink) OnContextMenu(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlLink) OnCopy(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlLink) OnCut(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlLink) OnDblClick(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlLink) OnDrag(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlLink) OnDragEnd(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlLink) OnDragEnter(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlLink) OnDragLeave(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlLink) OnDragOver(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlLink) OnDragStart(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlLink) OnDrop(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlLink) OnFocus(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlLink) OnInput(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlLink) OnInvalid(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlLink) OnKeyDown(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlLink) OnKeyPress(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlLink) OnKeyUp(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlLink) OnLoad(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlLink) OnMouseDown(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlLink) OnMouseMove(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlLink) OnMouseOut(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlLink) OnMouseOver(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlLink) OnMouseUp(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlLink) OnPaste(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlLink) OnReset(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlLink) OnScroll(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlLink) OnSearch(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlLink) OnSelect(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlLink) OnSubmit(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlLink) OnWheel(h EventHandler, scope ...any) HTMLLink {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLMain is the interface that describes a "main" HTML element.
- type HTMLMain interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLMain
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLMain
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLMain
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLMain
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLMain
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLMain
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLMain
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLMain
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLMain
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLMain
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLMain
- // ID specifies a unique id for an element.
- ID(v string) HTMLMain
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLMain
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLMain
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLMain
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLMain
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLMain
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLMain
- // Title specifies extra information about an element.
- Title(v string) HTMLMain
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLMain
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLMain
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLMain
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLMain
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLMain
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLMain
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLMain
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLMain
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLMain
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLMain
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLMain
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLMain
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLMain
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLMain
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLMain
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLMain
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLMain
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLMain
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLMain
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLMain
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLMain
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLMain
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLMain
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLMain
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLMain
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLMain
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLMain
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLMain
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLMain
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLMain
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLMain
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLMain
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLMain
- }
- // Main returns an HTML element that specifies the main content of a document.
- func Main() HTMLMain {
- e := &htmlMain{
- htmlElement: htmlElement{
- tag: "main",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlMain struct {
- htmlElement
- }
- func (e *htmlMain) Body(v ...UI) HTMLMain {
- e.setChildren(v...)
- return e
- }
- func (e *htmlMain) Text(v any) HTMLMain {
- return e.Body(Text(v))
- }
- func (e *htmlMain) AccessKey(v string) HTMLMain {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlMain) Aria(k string, v any) HTMLMain {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMain) Attr(n string, v any) HTMLMain {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlMain) Class(v ...string) HTMLMain {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlMain) ContentEditable(v bool) HTMLMain {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlMain) DataSet(k string, v any) HTMLMain {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMain) Dir(v string) HTMLMain {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlMain) Draggable(v bool) HTMLMain {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlMain) Hidden(v bool) HTMLMain {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlMain) ID(v string) HTMLMain {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlMain) Lang(v string) HTMLMain {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlMain) Role(v string) HTMLMain {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlMain) Spellcheck(v bool) HTMLMain {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlMain) Style(k, v string) HTMLMain {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlMain) Styles(s map[string]string) HTMLMain {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlMain) TabIndex(v int) HTMLMain {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlMain) Title(v string) HTMLMain {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlMain) On(event string, h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlMain) OnBlur(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlMain) OnChange(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlMain) OnClick(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlMain) OnContextMenu(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlMain) OnCopy(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlMain) OnCut(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlMain) OnDblClick(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlMain) OnDrag(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlMain) OnDragEnd(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlMain) OnDragEnter(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlMain) OnDragLeave(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlMain) OnDragOver(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlMain) OnDragStart(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlMain) OnDrop(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlMain) OnFocus(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlMain) OnInput(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlMain) OnInvalid(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlMain) OnKeyDown(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlMain) OnKeyPress(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlMain) OnKeyUp(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlMain) OnMouseDown(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlMain) OnMouseMove(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlMain) OnMouseOut(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlMain) OnMouseOver(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlMain) OnMouseUp(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlMain) OnPaste(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlMain) OnReset(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlMain) OnScroll(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlMain) OnSearch(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlMain) OnSelect(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlMain) OnSubmit(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlMain) OnWheel(h EventHandler, scope ...any) HTMLMain {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLMap is the interface that describes a "map" HTML element.
- type HTMLMap interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLMap
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLMap
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLMap
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLMap
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLMap
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLMap
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLMap
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLMap
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLMap
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLMap
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLMap
- // ID specifies a unique id for an element.
- ID(v string) HTMLMap
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLMap
- // Name specifies the name of the element.
- Name(v string) HTMLMap
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLMap
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLMap
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLMap
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLMap
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLMap
- // Title specifies extra information about an element.
- Title(v string) HTMLMap
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLMap
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLMap
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLMap
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLMap
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLMap
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLMap
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLMap
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLMap
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLMap
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLMap
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLMap
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLMap
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLMap
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLMap
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLMap
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLMap
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLMap
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLMap
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLMap
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLMap
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLMap
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLMap
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLMap
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLMap
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLMap
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLMap
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLMap
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLMap
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLMap
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLMap
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLMap
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLMap
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLMap
- }
- // Map returns an HTML element that defines a client-side image-map.
- func Map() HTMLMap {
- e := &htmlMap{
- htmlElement: htmlElement{
- tag: "map",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlMap struct {
- htmlElement
- }
- func (e *htmlMap) Body(v ...UI) HTMLMap {
- e.setChildren(v...)
- return e
- }
- func (e *htmlMap) Text(v any) HTMLMap {
- return e.Body(Text(v))
- }
- func (e *htmlMap) AccessKey(v string) HTMLMap {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlMap) Aria(k string, v any) HTMLMap {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMap) Attr(n string, v any) HTMLMap {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlMap) Class(v ...string) HTMLMap {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlMap) ContentEditable(v bool) HTMLMap {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlMap) DataSet(k string, v any) HTMLMap {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMap) Dir(v string) HTMLMap {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlMap) Draggable(v bool) HTMLMap {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlMap) Hidden(v bool) HTMLMap {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlMap) ID(v string) HTMLMap {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlMap) Lang(v string) HTMLMap {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlMap) Name(v string) HTMLMap {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlMap) Role(v string) HTMLMap {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlMap) Spellcheck(v bool) HTMLMap {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlMap) Style(k, v string) HTMLMap {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlMap) Styles(s map[string]string) HTMLMap {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlMap) TabIndex(v int) HTMLMap {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlMap) Title(v string) HTMLMap {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlMap) On(event string, h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlMap) OnBlur(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlMap) OnChange(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlMap) OnClick(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlMap) OnContextMenu(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlMap) OnCopy(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlMap) OnCut(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlMap) OnDblClick(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlMap) OnDrag(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlMap) OnDragEnd(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlMap) OnDragEnter(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlMap) OnDragLeave(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlMap) OnDragOver(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlMap) OnDragStart(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlMap) OnDrop(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlMap) OnFocus(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlMap) OnInput(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlMap) OnInvalid(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlMap) OnKeyDown(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlMap) OnKeyPress(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlMap) OnKeyUp(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlMap) OnMouseDown(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlMap) OnMouseMove(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlMap) OnMouseOut(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlMap) OnMouseOver(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlMap) OnMouseUp(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlMap) OnPaste(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlMap) OnReset(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlMap) OnScroll(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlMap) OnSearch(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlMap) OnSelect(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlMap) OnSubmit(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlMap) OnWheel(h EventHandler, scope ...any) HTMLMap {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLMark is the interface that describes a "mark" HTML element.
- type HTMLMark interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLMark
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLMark
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLMark
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLMark
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLMark
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLMark
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLMark
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLMark
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLMark
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLMark
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLMark
- // ID specifies a unique id for an element.
- ID(v string) HTMLMark
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLMark
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLMark
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLMark
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLMark
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLMark
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLMark
- // Title specifies extra information about an element.
- Title(v string) HTMLMark
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLMark
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLMark
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLMark
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLMark
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLMark
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLMark
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLMark
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLMark
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLMark
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLMark
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLMark
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLMark
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLMark
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLMark
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLMark
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLMark
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLMark
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLMark
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLMark
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLMark
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLMark
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLMark
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLMark
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLMark
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLMark
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLMark
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLMark
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLMark
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLMark
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLMark
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLMark
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLMark
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLMark
- }
- // Mark returns an HTML element that defines marked/highlighted text.
- func Mark() HTMLMark {
- e := &htmlMark{
- htmlElement: htmlElement{
- tag: "mark",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlMark struct {
- htmlElement
- }
- func (e *htmlMark) Body(v ...UI) HTMLMark {
- e.setChildren(v...)
- return e
- }
- func (e *htmlMark) Text(v any) HTMLMark {
- return e.Body(Text(v))
- }
- func (e *htmlMark) AccessKey(v string) HTMLMark {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlMark) Aria(k string, v any) HTMLMark {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMark) Attr(n string, v any) HTMLMark {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlMark) Class(v ...string) HTMLMark {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlMark) ContentEditable(v bool) HTMLMark {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlMark) DataSet(k string, v any) HTMLMark {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMark) Dir(v string) HTMLMark {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlMark) Draggable(v bool) HTMLMark {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlMark) Hidden(v bool) HTMLMark {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlMark) ID(v string) HTMLMark {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlMark) Lang(v string) HTMLMark {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlMark) Role(v string) HTMLMark {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlMark) Spellcheck(v bool) HTMLMark {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlMark) Style(k, v string) HTMLMark {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlMark) Styles(s map[string]string) HTMLMark {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlMark) TabIndex(v int) HTMLMark {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlMark) Title(v string) HTMLMark {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlMark) On(event string, h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlMark) OnBlur(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlMark) OnChange(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlMark) OnClick(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlMark) OnContextMenu(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlMark) OnCopy(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlMark) OnCut(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlMark) OnDblClick(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlMark) OnDrag(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlMark) OnDragEnd(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlMark) OnDragEnter(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlMark) OnDragLeave(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlMark) OnDragOver(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlMark) OnDragStart(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlMark) OnDrop(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlMark) OnFocus(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlMark) OnInput(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlMark) OnInvalid(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlMark) OnKeyDown(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlMark) OnKeyPress(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlMark) OnKeyUp(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlMark) OnMouseDown(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlMark) OnMouseMove(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlMark) OnMouseOut(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlMark) OnMouseOver(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlMark) OnMouseUp(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlMark) OnPaste(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlMark) OnReset(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlMark) OnScroll(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlMark) OnSearch(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlMark) OnSelect(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlMark) OnSubmit(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlMark) OnWheel(h EventHandler, scope ...any) HTMLMark {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLMeta is the interface that describes a "meta" HTML element.
- type HTMLMeta interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLMeta
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLMeta
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLMeta
- // Charset specifies the character encoding.
- Charset(v string) HTMLMeta
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLMeta
- // Content gives the value associated with the http-equiv or name attribute.
- Content(v string) HTMLMeta
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLMeta
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLMeta
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLMeta
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLMeta
- // HTTPEquiv provides an HTTP header for the information/value of the content attribute.
- HTTPEquiv(v string) HTMLMeta
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLMeta
- // ID specifies a unique id for an element.
- ID(v string) HTMLMeta
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLMeta
- // Name specifies the name of the element.
- Name(v string) HTMLMeta
- // Property specifies the property name.
- Property(v string) HTMLMeta
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLMeta
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLMeta
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLMeta
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLMeta
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLMeta
- // Title specifies extra information about an element.
- Title(v string) HTMLMeta
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLMeta
- }
- // Meta returns an HTML element that .
- func Meta() HTMLMeta {
- e := &htmlMeta{
- htmlElement: htmlElement{
- tag: "meta",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlMeta struct {
- htmlElement
- }
- func (e *htmlMeta) AccessKey(v string) HTMLMeta {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlMeta) Aria(k string, v any) HTMLMeta {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMeta) Attr(n string, v any) HTMLMeta {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlMeta) Charset(v string) HTMLMeta {
- e.setAttr("charset", v)
- return e
- }
- func (e *htmlMeta) Class(v ...string) HTMLMeta {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlMeta) Content(v string) HTMLMeta {
- e.setAttr("content", v)
- return e
- }
- func (e *htmlMeta) ContentEditable(v bool) HTMLMeta {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlMeta) DataSet(k string, v any) HTMLMeta {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMeta) Dir(v string) HTMLMeta {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlMeta) Draggable(v bool) HTMLMeta {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlMeta) HTTPEquiv(v string) HTMLMeta {
- e.setAttr("http-equiv", v)
- return e
- }
- func (e *htmlMeta) Hidden(v bool) HTMLMeta {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlMeta) ID(v string) HTMLMeta {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlMeta) Lang(v string) HTMLMeta {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlMeta) Name(v string) HTMLMeta {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlMeta) Property(v string) HTMLMeta {
- e.setAttr("property", v)
- return e
- }
- func (e *htmlMeta) Role(v string) HTMLMeta {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlMeta) Spellcheck(v bool) HTMLMeta {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlMeta) Style(k, v string) HTMLMeta {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlMeta) Styles(s map[string]string) HTMLMeta {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlMeta) TabIndex(v int) HTMLMeta {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlMeta) Title(v string) HTMLMeta {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlMeta) On(event string, h EventHandler, scope ...any) HTMLMeta {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLMeter is the interface that describes a "meter" HTML element.
- type HTMLMeter interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLMeter
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLMeter
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLMeter
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLMeter
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLMeter
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLMeter
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLMeter
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLMeter
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLMeter
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLMeter
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLMeter
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLMeter
- // High specifies the range that is considered to be a high value.
- High(v float64) HTMLMeter
- // ID specifies a unique id for an element.
- ID(v string) HTMLMeter
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLMeter
- // Low specifies the range that is considered to be a low value.
- Low(v float64) HTMLMeter
- // Max Specifies the maximum value.
- Max(v any) HTMLMeter
- // Min specifies a minimum value.
- Min(v any) HTMLMeter
- // Optimum specifies what value is the optimal value for the gauge.
- Optimum(v float64) HTMLMeter
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLMeter
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLMeter
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLMeter
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLMeter
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLMeter
- // Title specifies extra information about an element.
- Title(v string) HTMLMeter
- // Value specifies the value of the element.
- Value(v any) HTMLMeter
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLMeter
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLMeter
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLMeter
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLMeter
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLMeter
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLMeter
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLMeter
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLMeter
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLMeter
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLMeter
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLMeter
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLMeter
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLMeter
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLMeter
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLMeter
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLMeter
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLMeter
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLMeter
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLMeter
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLMeter
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLMeter
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLMeter
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLMeter
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLMeter
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLMeter
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLMeter
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLMeter
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLMeter
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLMeter
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLMeter
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLMeter
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLMeter
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLMeter
- }
- // Meter returns an HTML element that defines a scalar measurement within a known range (a gauge).
- func Meter() HTMLMeter {
- e := &htmlMeter{
- htmlElement: htmlElement{
- tag: "meter",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlMeter struct {
- htmlElement
- }
- func (e *htmlMeter) Body(v ...UI) HTMLMeter {
- e.setChildren(v...)
- return e
- }
- func (e *htmlMeter) Text(v any) HTMLMeter {
- return e.Body(Text(v))
- }
- func (e *htmlMeter) AccessKey(v string) HTMLMeter {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlMeter) Aria(k string, v any) HTMLMeter {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMeter) Attr(n string, v any) HTMLMeter {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlMeter) Class(v ...string) HTMLMeter {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlMeter) ContentEditable(v bool) HTMLMeter {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlMeter) DataSet(k string, v any) HTMLMeter {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlMeter) Dir(v string) HTMLMeter {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlMeter) Draggable(v bool) HTMLMeter {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlMeter) Form(v string) HTMLMeter {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlMeter) Hidden(v bool) HTMLMeter {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlMeter) High(v float64) HTMLMeter {
- e.setAttr("high", v)
- return e
- }
- func (e *htmlMeter) ID(v string) HTMLMeter {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlMeter) Lang(v string) HTMLMeter {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlMeter) Low(v float64) HTMLMeter {
- e.setAttr("low", v)
- return e
- }
- func (e *htmlMeter) Max(v any) HTMLMeter {
- e.setAttr("max", v)
- return e
- }
- func (e *htmlMeter) Min(v any) HTMLMeter {
- e.setAttr("min", v)
- return e
- }
- func (e *htmlMeter) Optimum(v float64) HTMLMeter {
- e.setAttr("optimum", v)
- return e
- }
- func (e *htmlMeter) Role(v string) HTMLMeter {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlMeter) Spellcheck(v bool) HTMLMeter {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlMeter) Style(k, v string) HTMLMeter {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlMeter) Styles(s map[string]string) HTMLMeter {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlMeter) TabIndex(v int) HTMLMeter {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlMeter) Title(v string) HTMLMeter {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlMeter) Value(v any) HTMLMeter {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlMeter) On(event string, h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlMeter) OnBlur(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlMeter) OnChange(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlMeter) OnClick(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlMeter) OnContextMenu(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlMeter) OnCopy(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlMeter) OnCut(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDblClick(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDrag(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDragEnd(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDragEnter(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDragLeave(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDragOver(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDragStart(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlMeter) OnDrop(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlMeter) OnFocus(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlMeter) OnInput(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlMeter) OnInvalid(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlMeter) OnKeyDown(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlMeter) OnKeyPress(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlMeter) OnKeyUp(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlMeter) OnMouseDown(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlMeter) OnMouseMove(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlMeter) OnMouseOut(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlMeter) OnMouseOver(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlMeter) OnMouseUp(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlMeter) OnPaste(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlMeter) OnReset(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlMeter) OnScroll(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlMeter) OnSearch(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlMeter) OnSelect(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlMeter) OnSubmit(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlMeter) OnWheel(h EventHandler, scope ...any) HTMLMeter {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLNav is the interface that describes a "nav" HTML element.
- type HTMLNav interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLNav
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLNav
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLNav
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLNav
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLNav
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLNav
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLNav
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLNav
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLNav
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLNav
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLNav
- // ID specifies a unique id for an element.
- ID(v string) HTMLNav
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLNav
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLNav
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLNav
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLNav
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLNav
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLNav
- // Title specifies extra information about an element.
- Title(v string) HTMLNav
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLNav
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLNav
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLNav
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLNav
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLNav
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLNav
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLNav
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLNav
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLNav
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLNav
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLNav
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLNav
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLNav
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLNav
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLNav
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLNav
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLNav
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLNav
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLNav
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLNav
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLNav
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLNav
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLNav
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLNav
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLNav
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLNav
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLNav
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLNav
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLNav
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLNav
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLNav
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLNav
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLNav
- }
- // Nav returns an HTML element that defines navigation links.
- func Nav() HTMLNav {
- e := &htmlNav{
- htmlElement: htmlElement{
- tag: "nav",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlNav struct {
- htmlElement
- }
- func (e *htmlNav) Body(v ...UI) HTMLNav {
- e.setChildren(v...)
- return e
- }
- func (e *htmlNav) Text(v any) HTMLNav {
- return e.Body(Text(v))
- }
- func (e *htmlNav) AccessKey(v string) HTMLNav {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlNav) Aria(k string, v any) HTMLNav {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlNav) Attr(n string, v any) HTMLNav {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlNav) Class(v ...string) HTMLNav {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlNav) ContentEditable(v bool) HTMLNav {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlNav) DataSet(k string, v any) HTMLNav {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlNav) Dir(v string) HTMLNav {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlNav) Draggable(v bool) HTMLNav {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlNav) Hidden(v bool) HTMLNav {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlNav) ID(v string) HTMLNav {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlNav) Lang(v string) HTMLNav {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlNav) Role(v string) HTMLNav {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlNav) Spellcheck(v bool) HTMLNav {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlNav) Style(k, v string) HTMLNav {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlNav) Styles(s map[string]string) HTMLNav {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlNav) TabIndex(v int) HTMLNav {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlNav) Title(v string) HTMLNav {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlNav) On(event string, h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlNav) OnBlur(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlNav) OnChange(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlNav) OnClick(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlNav) OnContextMenu(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlNav) OnCopy(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlNav) OnCut(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlNav) OnDblClick(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlNav) OnDrag(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlNav) OnDragEnd(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlNav) OnDragEnter(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlNav) OnDragLeave(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlNav) OnDragOver(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlNav) OnDragStart(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlNav) OnDrop(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlNav) OnFocus(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlNav) OnInput(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlNav) OnInvalid(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlNav) OnKeyDown(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlNav) OnKeyPress(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlNav) OnKeyUp(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlNav) OnMouseDown(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlNav) OnMouseMove(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlNav) OnMouseOut(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlNav) OnMouseOver(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlNav) OnMouseUp(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlNav) OnPaste(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlNav) OnReset(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlNav) OnScroll(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlNav) OnSearch(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlNav) OnSelect(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlNav) OnSubmit(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlNav) OnWheel(h EventHandler, scope ...any) HTMLNav {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLNoScript is the interface that describes a "noscript" HTML element.
- type HTMLNoScript interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLNoScript
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLNoScript
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLNoScript
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLNoScript
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLNoScript
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLNoScript
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLNoScript
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLNoScript
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLNoScript
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLNoScript
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLNoScript
- // ID specifies a unique id for an element.
- ID(v string) HTMLNoScript
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLNoScript
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLNoScript
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLNoScript
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLNoScript
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLNoScript
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLNoScript
- // Title specifies extra information about an element.
- Title(v string) HTMLNoScript
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLNoScript
- }
- // NoScript returns an HTML element that defines an alternate content for users that do not support client-side scripts.
- func NoScript() HTMLNoScript {
- e := &htmlNoScript{
- htmlElement: htmlElement{
- tag: "noscript",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlNoScript struct {
- htmlElement
- }
- func (e *htmlNoScript) Body(v ...UI) HTMLNoScript {
- e.setChildren(v...)
- return e
- }
- func (e *htmlNoScript) Text(v any) HTMLNoScript {
- return e.Body(Text(v))
- }
- func (e *htmlNoScript) AccessKey(v string) HTMLNoScript {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlNoScript) Aria(k string, v any) HTMLNoScript {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlNoScript) Attr(n string, v any) HTMLNoScript {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlNoScript) Class(v ...string) HTMLNoScript {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlNoScript) ContentEditable(v bool) HTMLNoScript {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlNoScript) DataSet(k string, v any) HTMLNoScript {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlNoScript) Dir(v string) HTMLNoScript {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlNoScript) Draggable(v bool) HTMLNoScript {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlNoScript) Hidden(v bool) HTMLNoScript {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlNoScript) ID(v string) HTMLNoScript {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlNoScript) Lang(v string) HTMLNoScript {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlNoScript) Role(v string) HTMLNoScript {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlNoScript) Spellcheck(v bool) HTMLNoScript {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlNoScript) Style(k, v string) HTMLNoScript {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlNoScript) Styles(s map[string]string) HTMLNoScript {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlNoScript) TabIndex(v int) HTMLNoScript {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlNoScript) Title(v string) HTMLNoScript {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlNoScript) On(event string, h EventHandler, scope ...any) HTMLNoScript {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLObject is the interface that describes a "object" HTML element.
- type HTMLObject interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLObject
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLObject
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLObject
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLObject
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLObject
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLObject
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLObject
- // Data specifies the URL of the resource to be used by the object.
- Data(v string) HTMLObject
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLObject
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLObject
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLObject
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLObject
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLObject
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLObject
- // ID specifies a unique id for an element.
- ID(v string) HTMLObject
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLObject
- // Name specifies the name of the element.
- Name(v string) HTMLObject
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLObject
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLObject
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLObject
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLObject
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLObject
- // Title specifies extra information about an element.
- Title(v string) HTMLObject
- // Type specifies the type of element.
- Type(v string) HTMLObject
- // UseMap specifies an image as a client-side image-map.
- UseMap(v string) HTMLObject
- // Width specifies the width of the element.
- Width(v int) HTMLObject
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLObject
- // OnAbort calls the given handler on abort.
- OnAbort(h EventHandler, scope ...any) HTMLObject
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLObject
- // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
- OnCanPlay(h EventHandler, scope ...any) HTMLObject
- // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
- OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLObject
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLObject
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLObject
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLObject
- // OnCueChange calls the given handler when the cue changes in a track element.
- OnCueChange(h EventHandler, scope ...any) HTMLObject
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLObject
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLObject
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLObject
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLObject
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLObject
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLObject
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLObject
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLObject
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLObject
- // OnDurationChange calls the given handler when the length of the media changes.
- OnDurationChange(h EventHandler, scope ...any) HTMLObject
- // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
- OnEmptied(h EventHandler, scope ...any) HTMLObject
- // OnEnded calls the given handler when the media has reach the end.
- OnEnded(h EventHandler, scope ...any) HTMLObject
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLObject
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLObject
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLObject
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLObject
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLObject
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLObject
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLObject
- // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
- OnLoadStart(h EventHandler, scope ...any) HTMLObject
- // OnLoadedData calls the given handler when media data is loaded.
- OnLoadedData(h EventHandler, scope ...any) HTMLObject
- // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
- OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLObject
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLObject
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLObject
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLObject
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLObject
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLObject
- // OnPause calls the given handler when the media is paused either by the user or programmatically.
- OnPause(h EventHandler, scope ...any) HTMLObject
- // OnPlay calls the given handler when the media is ready to start playing.
- OnPlay(h EventHandler, scope ...any) HTMLObject
- // OnPlaying calls the given handler when the media actually has started playing.
- OnPlaying(h EventHandler, scope ...any) HTMLObject
- // OnProgress calls the given handler when the browser is in the process of getting the media data.
- OnProgress(h EventHandler, scope ...any) HTMLObject
- // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
- OnRateChange(h EventHandler, scope ...any) HTMLObject
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLObject
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLObject
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLObject
- // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
- OnSeeked(h EventHandler, scope ...any) HTMLObject
- // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
- OnSeeking(h EventHandler, scope ...any) HTMLObject
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLObject
- // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
- OnStalled(h EventHandler, scope ...any) HTMLObject
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLObject
- // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
- OnSuspend(h EventHandler, scope ...any) HTMLObject
- // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
- OnTimeUpdate(h EventHandler, scope ...any) HTMLObject
- // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
- OnVolumeChange(h EventHandler, scope ...any) HTMLObject
- // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
- OnWaiting(h EventHandler, scope ...any) HTMLObject
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLObject
- }
- // Object returns an HTML element that defines an embedded object.
- func Object() HTMLObject {
- e := &htmlObject{
- htmlElement: htmlElement{
- tag: "object",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlObject struct {
- htmlElement
- }
- func (e *htmlObject) Body(v ...UI) HTMLObject {
- e.setChildren(v...)
- return e
- }
- func (e *htmlObject) Text(v any) HTMLObject {
- return e.Body(Text(v))
- }
- func (e *htmlObject) AccessKey(v string) HTMLObject {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlObject) Aria(k string, v any) HTMLObject {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlObject) Attr(n string, v any) HTMLObject {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlObject) Class(v ...string) HTMLObject {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlObject) ContentEditable(v bool) HTMLObject {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlObject) Data(v string) HTMLObject {
- e.setAttr("data", v)
- return e
- }
- func (e *htmlObject) DataSet(k string, v any) HTMLObject {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlObject) Dir(v string) HTMLObject {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlObject) Draggable(v bool) HTMLObject {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlObject) Form(v string) HTMLObject {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlObject) Height(v int) HTMLObject {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlObject) Hidden(v bool) HTMLObject {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlObject) ID(v string) HTMLObject {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlObject) Lang(v string) HTMLObject {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlObject) Name(v string) HTMLObject {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlObject) Role(v string) HTMLObject {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlObject) Spellcheck(v bool) HTMLObject {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlObject) Style(k, v string) HTMLObject {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlObject) Styles(s map[string]string) HTMLObject {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlObject) TabIndex(v int) HTMLObject {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlObject) Title(v string) HTMLObject {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlObject) Type(v string) HTMLObject {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlObject) UseMap(v string) HTMLObject {
- e.setAttr("usemap", v)
- return e
- }
- func (e *htmlObject) Width(v int) HTMLObject {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlObject) On(event string, h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlObject) OnAbort(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("abort", h, scope...)
- return e
- }
- func (e *htmlObject) OnBlur(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlObject) OnCanPlay(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("canplay", h, scope...)
- return e
- }
- func (e *htmlObject) OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("canplaythrough", h, scope...)
- return e
- }
- func (e *htmlObject) OnChange(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlObject) OnClick(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlObject) OnContextMenu(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlObject) OnCopy(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlObject) OnCueChange(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("cuechange", h, scope...)
- return e
- }
- func (e *htmlObject) OnCut(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlObject) OnDblClick(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlObject) OnDrag(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlObject) OnDragEnd(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlObject) OnDragEnter(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlObject) OnDragLeave(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlObject) OnDragOver(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlObject) OnDragStart(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlObject) OnDrop(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlObject) OnDurationChange(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("durationchange", h, scope...)
- return e
- }
- func (e *htmlObject) OnEmptied(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("emptied", h, scope...)
- return e
- }
- func (e *htmlObject) OnEnded(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("ended", h, scope...)
- return e
- }
- func (e *htmlObject) OnError(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlObject) OnFocus(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlObject) OnInput(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlObject) OnInvalid(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlObject) OnKeyDown(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlObject) OnKeyPress(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlObject) OnKeyUp(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlObject) OnLoadStart(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("loadstart", h, scope...)
- return e
- }
- func (e *htmlObject) OnLoadedData(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("loadeddata", h, scope...)
- return e
- }
- func (e *htmlObject) OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("loadedmetadata", h, scope...)
- return e
- }
- func (e *htmlObject) OnMouseDown(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlObject) OnMouseMove(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlObject) OnMouseOut(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlObject) OnMouseOver(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlObject) OnMouseUp(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlObject) OnPaste(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlObject) OnPause(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("pause", h, scope...)
- return e
- }
- func (e *htmlObject) OnPlay(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("play", h, scope...)
- return e
- }
- func (e *htmlObject) OnPlaying(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("playing", h, scope...)
- return e
- }
- func (e *htmlObject) OnProgress(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("progress", h, scope...)
- return e
- }
- func (e *htmlObject) OnRateChange(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("ratechange", h, scope...)
- return e
- }
- func (e *htmlObject) OnReset(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlObject) OnScroll(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlObject) OnSearch(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlObject) OnSeeked(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("seeked", h, scope...)
- return e
- }
- func (e *htmlObject) OnSeeking(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("seeking", h, scope...)
- return e
- }
- func (e *htmlObject) OnSelect(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlObject) OnStalled(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("stalled", h, scope...)
- return e
- }
- func (e *htmlObject) OnSubmit(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlObject) OnSuspend(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("suspend", h, scope...)
- return e
- }
- func (e *htmlObject) OnTimeUpdate(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("timeupdate", h, scope...)
- return e
- }
- func (e *htmlObject) OnVolumeChange(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("volumechange", h, scope...)
- return e
- }
- func (e *htmlObject) OnWaiting(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("waiting", h, scope...)
- return e
- }
- func (e *htmlObject) OnWheel(h EventHandler, scope ...any) HTMLObject {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLOl is the interface that describes a "ol" HTML element.
- type HTMLOl interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLOl
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLOl
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLOl
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLOl
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLOl
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLOl
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLOl
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLOl
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLOl
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLOl
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLOl
- // ID specifies a unique id for an element.
- ID(v string) HTMLOl
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLOl
- // Reversed specifies that the list order should be descending (9,8,7...).
- Reversed(v bool) HTMLOl
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLOl
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLOl
- // Start specifies the start value of the ordered list.
- Start(v int) HTMLOl
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLOl
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLOl
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLOl
- // Title specifies extra information about an element.
- Title(v string) HTMLOl
- // Type specifies the type of element.
- Type(v string) HTMLOl
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLOl
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLOl
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLOl
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLOl
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLOl
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLOl
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLOl
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLOl
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLOl
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLOl
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLOl
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLOl
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLOl
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLOl
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLOl
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLOl
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLOl
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLOl
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLOl
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLOl
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLOl
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLOl
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLOl
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLOl
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLOl
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLOl
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLOl
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLOl
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLOl
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLOl
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLOl
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLOl
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLOl
- }
- // Ol returns an HTML element that defines an ordered list.
- func Ol() HTMLOl {
- e := &htmlOl{
- htmlElement: htmlElement{
- tag: "ol",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlOl struct {
- htmlElement
- }
- func (e *htmlOl) Body(v ...UI) HTMLOl {
- e.setChildren(v...)
- return e
- }
- func (e *htmlOl) Text(v any) HTMLOl {
- return e.Body(Text(v))
- }
- func (e *htmlOl) AccessKey(v string) HTMLOl {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlOl) Aria(k string, v any) HTMLOl {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOl) Attr(n string, v any) HTMLOl {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlOl) Class(v ...string) HTMLOl {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlOl) ContentEditable(v bool) HTMLOl {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlOl) DataSet(k string, v any) HTMLOl {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOl) Dir(v string) HTMLOl {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlOl) Draggable(v bool) HTMLOl {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlOl) Hidden(v bool) HTMLOl {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlOl) ID(v string) HTMLOl {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlOl) Lang(v string) HTMLOl {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlOl) Reversed(v bool) HTMLOl {
- e.setAttr("reversed", v)
- return e
- }
- func (e *htmlOl) Role(v string) HTMLOl {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlOl) Spellcheck(v bool) HTMLOl {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlOl) Start(v int) HTMLOl {
- e.setAttr("start", v)
- return e
- }
- func (e *htmlOl) Style(k, v string) HTMLOl {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlOl) Styles(s map[string]string) HTMLOl {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlOl) TabIndex(v int) HTMLOl {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlOl) Title(v string) HTMLOl {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlOl) Type(v string) HTMLOl {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlOl) On(event string, h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlOl) OnBlur(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlOl) OnChange(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlOl) OnClick(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlOl) OnContextMenu(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlOl) OnCopy(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlOl) OnCut(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlOl) OnDblClick(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlOl) OnDrag(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlOl) OnDragEnd(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlOl) OnDragEnter(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlOl) OnDragLeave(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlOl) OnDragOver(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlOl) OnDragStart(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlOl) OnDrop(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlOl) OnFocus(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlOl) OnInput(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlOl) OnInvalid(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlOl) OnKeyDown(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlOl) OnKeyPress(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlOl) OnKeyUp(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlOl) OnMouseDown(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlOl) OnMouseMove(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlOl) OnMouseOut(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlOl) OnMouseOver(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlOl) OnMouseUp(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlOl) OnPaste(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlOl) OnReset(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlOl) OnScroll(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlOl) OnSearch(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlOl) OnSelect(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlOl) OnSubmit(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlOl) OnWheel(h EventHandler, scope ...any) HTMLOl {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLOptGroup is the interface that describes a "optgroup" HTML element.
- type HTMLOptGroup interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLOptGroup
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLOptGroup
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLOptGroup
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLOptGroup
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLOptGroup
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLOptGroup
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLOptGroup
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLOptGroup
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLOptGroup
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLOptGroup
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLOptGroup
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLOptGroup
- // ID specifies a unique id for an element.
- ID(v string) HTMLOptGroup
- // Label specifies a shorter label for the option.
- Label(v string) HTMLOptGroup
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLOptGroup
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLOptGroup
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLOptGroup
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLOptGroup
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLOptGroup
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLOptGroup
- // Title specifies extra information about an element.
- Title(v string) HTMLOptGroup
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLOptGroup
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLOptGroup
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLOptGroup
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLOptGroup
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLOptGroup
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLOptGroup
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLOptGroup
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLOptGroup
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLOptGroup
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLOptGroup
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLOptGroup
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLOptGroup
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLOptGroup
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLOptGroup
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLOptGroup
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLOptGroup
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLOptGroup
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLOptGroup
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLOptGroup
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLOptGroup
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLOptGroup
- }
- // OptGroup returns an HTML element that defines a group of related options in a drop-down list.
- func OptGroup() HTMLOptGroup {
- e := &htmlOptGroup{
- htmlElement: htmlElement{
- tag: "optgroup",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlOptGroup struct {
- htmlElement
- }
- func (e *htmlOptGroup) Body(v ...UI) HTMLOptGroup {
- e.setChildren(v...)
- return e
- }
- func (e *htmlOptGroup) Text(v any) HTMLOptGroup {
- return e.Body(Text(v))
- }
- func (e *htmlOptGroup) AccessKey(v string) HTMLOptGroup {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlOptGroup) Aria(k string, v any) HTMLOptGroup {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOptGroup) Attr(n string, v any) HTMLOptGroup {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlOptGroup) Class(v ...string) HTMLOptGroup {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlOptGroup) ContentEditable(v bool) HTMLOptGroup {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlOptGroup) DataSet(k string, v any) HTMLOptGroup {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOptGroup) Dir(v string) HTMLOptGroup {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlOptGroup) Disabled(v bool) HTMLOptGroup {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlOptGroup) Draggable(v bool) HTMLOptGroup {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlOptGroup) Hidden(v bool) HTMLOptGroup {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlOptGroup) ID(v string) HTMLOptGroup {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlOptGroup) Label(v string) HTMLOptGroup {
- e.setAttr("label", v)
- return e
- }
- func (e *htmlOptGroup) Lang(v string) HTMLOptGroup {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlOptGroup) Role(v string) HTMLOptGroup {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlOptGroup) Spellcheck(v bool) HTMLOptGroup {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlOptGroup) Style(k, v string) HTMLOptGroup {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlOptGroup) Styles(s map[string]string) HTMLOptGroup {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlOptGroup) TabIndex(v int) HTMLOptGroup {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlOptGroup) Title(v string) HTMLOptGroup {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlOptGroup) On(event string, h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnBlur(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnChange(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnClick(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnCopy(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnCut(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDblClick(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDrag(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDragOver(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDragStart(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnDrop(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnFocus(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnInput(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnInvalid(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnPaste(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnReset(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnScroll(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnSearch(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnSelect(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnSubmit(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlOptGroup) OnWheel(h EventHandler, scope ...any) HTMLOptGroup {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLOption is the interface that describes a "option" HTML element.
- type HTMLOption interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLOption
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLOption
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLOption
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLOption
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLOption
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLOption
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLOption
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLOption
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLOption
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLOption
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLOption
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLOption
- // ID specifies a unique id for an element.
- ID(v string) HTMLOption
- // Label specifies a shorter label for the option.
- Label(v string) HTMLOption
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLOption
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLOption
- // Selected specifies that an option should be pre-selected when the page loads.
- Selected(v bool) HTMLOption
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLOption
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLOption
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLOption
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLOption
- // Title specifies extra information about an element.
- Title(v string) HTMLOption
- // Value specifies the value of the element.
- Value(v any) HTMLOption
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLOption
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLOption
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLOption
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLOption
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLOption
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLOption
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLOption
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLOption
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLOption
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLOption
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLOption
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLOption
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLOption
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLOption
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLOption
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLOption
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLOption
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLOption
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLOption
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLOption
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLOption
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLOption
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLOption
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLOption
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLOption
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLOption
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLOption
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLOption
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLOption
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLOption
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLOption
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLOption
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLOption
- }
- // Option returns an HTML element that defines an option in a drop-down list.
- func Option() HTMLOption {
- e := &htmlOption{
- htmlElement: htmlElement{
- tag: "option",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlOption struct {
- htmlElement
- }
- func (e *htmlOption) Body(v ...UI) HTMLOption {
- e.setChildren(v...)
- return e
- }
- func (e *htmlOption) Text(v any) HTMLOption {
- return e.Body(Text(v))
- }
- func (e *htmlOption) AccessKey(v string) HTMLOption {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlOption) Aria(k string, v any) HTMLOption {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOption) Attr(n string, v any) HTMLOption {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlOption) Class(v ...string) HTMLOption {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlOption) ContentEditable(v bool) HTMLOption {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlOption) DataSet(k string, v any) HTMLOption {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOption) Dir(v string) HTMLOption {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlOption) Disabled(v bool) HTMLOption {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlOption) Draggable(v bool) HTMLOption {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlOption) Hidden(v bool) HTMLOption {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlOption) ID(v string) HTMLOption {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlOption) Label(v string) HTMLOption {
- e.setAttr("label", v)
- return e
- }
- func (e *htmlOption) Lang(v string) HTMLOption {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlOption) Role(v string) HTMLOption {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlOption) Selected(v bool) HTMLOption {
- e.setAttr("selected", v)
- return e
- }
- func (e *htmlOption) Spellcheck(v bool) HTMLOption {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlOption) Style(k, v string) HTMLOption {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlOption) Styles(s map[string]string) HTMLOption {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlOption) TabIndex(v int) HTMLOption {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlOption) Title(v string) HTMLOption {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlOption) Value(v any) HTMLOption {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlOption) On(event string, h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlOption) OnBlur(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlOption) OnChange(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlOption) OnClick(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlOption) OnContextMenu(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlOption) OnCopy(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlOption) OnCut(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlOption) OnDblClick(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlOption) OnDrag(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlOption) OnDragEnd(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlOption) OnDragEnter(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlOption) OnDragLeave(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlOption) OnDragOver(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlOption) OnDragStart(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlOption) OnDrop(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlOption) OnFocus(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlOption) OnInput(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlOption) OnInvalid(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlOption) OnKeyDown(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlOption) OnKeyPress(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlOption) OnKeyUp(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlOption) OnMouseDown(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlOption) OnMouseMove(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlOption) OnMouseOut(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlOption) OnMouseOver(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlOption) OnMouseUp(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlOption) OnPaste(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlOption) OnReset(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlOption) OnScroll(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlOption) OnSearch(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlOption) OnSelect(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlOption) OnSubmit(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlOption) OnWheel(h EventHandler, scope ...any) HTMLOption {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLOutput is the interface that describes a "output" HTML element.
- type HTMLOutput interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLOutput
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLOutput
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLOutput
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLOutput
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLOutput
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLOutput
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLOutput
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLOutput
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLOutput
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLOutput
- // For specifies which form element(s) a label/calculation is bound to.
- For(v string) HTMLOutput
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLOutput
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLOutput
- // ID specifies a unique id for an element.
- ID(v string) HTMLOutput
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLOutput
- // Name specifies the name of the element.
- Name(v string) HTMLOutput
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLOutput
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLOutput
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLOutput
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLOutput
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLOutput
- // Title specifies extra information about an element.
- Title(v string) HTMLOutput
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLOutput
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLOutput
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLOutput
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLOutput
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLOutput
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLOutput
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLOutput
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLOutput
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLOutput
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLOutput
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLOutput
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLOutput
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLOutput
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLOutput
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLOutput
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLOutput
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLOutput
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLOutput
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLOutput
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLOutput
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLOutput
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLOutput
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLOutput
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLOutput
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLOutput
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLOutput
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLOutput
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLOutput
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLOutput
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLOutput
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLOutput
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLOutput
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLOutput
- }
- // Output returns an HTML element that .
- func Output() HTMLOutput {
- e := &htmlOutput{
- htmlElement: htmlElement{
- tag: "output",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlOutput struct {
- htmlElement
- }
- func (e *htmlOutput) Body(v ...UI) HTMLOutput {
- e.setChildren(v...)
- return e
- }
- func (e *htmlOutput) Text(v any) HTMLOutput {
- return e.Body(Text(v))
- }
- func (e *htmlOutput) AccessKey(v string) HTMLOutput {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlOutput) Aria(k string, v any) HTMLOutput {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOutput) Attr(n string, v any) HTMLOutput {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlOutput) Class(v ...string) HTMLOutput {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlOutput) ContentEditable(v bool) HTMLOutput {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlOutput) DataSet(k string, v any) HTMLOutput {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlOutput) Dir(v string) HTMLOutput {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlOutput) Draggable(v bool) HTMLOutput {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlOutput) For(v string) HTMLOutput {
- e.setAttr("for", v)
- return e
- }
- func (e *htmlOutput) Form(v string) HTMLOutput {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlOutput) Hidden(v bool) HTMLOutput {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlOutput) ID(v string) HTMLOutput {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlOutput) Lang(v string) HTMLOutput {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlOutput) Name(v string) HTMLOutput {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlOutput) Role(v string) HTMLOutput {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlOutput) Spellcheck(v bool) HTMLOutput {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlOutput) Style(k, v string) HTMLOutput {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlOutput) Styles(s map[string]string) HTMLOutput {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlOutput) TabIndex(v int) HTMLOutput {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlOutput) Title(v string) HTMLOutput {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlOutput) On(event string, h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlOutput) OnBlur(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlOutput) OnChange(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlOutput) OnClick(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlOutput) OnContextMenu(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlOutput) OnCopy(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlOutput) OnCut(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDblClick(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDrag(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDragEnd(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDragEnter(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDragLeave(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDragOver(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDragStart(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlOutput) OnDrop(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlOutput) OnFocus(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlOutput) OnInput(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlOutput) OnInvalid(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlOutput) OnKeyDown(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlOutput) OnKeyPress(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlOutput) OnKeyUp(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlOutput) OnMouseDown(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlOutput) OnMouseMove(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlOutput) OnMouseOut(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlOutput) OnMouseOver(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlOutput) OnMouseUp(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlOutput) OnPaste(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlOutput) OnReset(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlOutput) OnScroll(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlOutput) OnSearch(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlOutput) OnSelect(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlOutput) OnSubmit(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlOutput) OnWheel(h EventHandler, scope ...any) HTMLOutput {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLP is the interface that describes a "p" HTML element.
- type HTMLP interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLP
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLP
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLP
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLP
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLP
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLP
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLP
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLP
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLP
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLP
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLP
- // ID specifies a unique id for an element.
- ID(v string) HTMLP
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLP
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLP
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLP
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLP
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLP
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLP
- // Title specifies extra information about an element.
- Title(v string) HTMLP
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLP
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLP
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLP
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLP
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLP
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLP
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLP
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLP
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLP
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLP
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLP
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLP
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLP
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLP
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLP
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLP
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLP
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLP
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLP
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLP
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLP
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLP
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLP
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLP
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLP
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLP
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLP
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLP
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLP
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLP
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLP
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLP
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLP
- }
- // P returns an HTML element that defines a paragraph.
- func P() HTMLP {
- e := &htmlP{
- htmlElement: htmlElement{
- tag: "p",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlP struct {
- htmlElement
- }
- func (e *htmlP) Body(v ...UI) HTMLP {
- e.setChildren(v...)
- return e
- }
- func (e *htmlP) Text(v any) HTMLP {
- return e.Body(Text(v))
- }
- func (e *htmlP) AccessKey(v string) HTMLP {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlP) Aria(k string, v any) HTMLP {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlP) Attr(n string, v any) HTMLP {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlP) Class(v ...string) HTMLP {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlP) ContentEditable(v bool) HTMLP {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlP) DataSet(k string, v any) HTMLP {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlP) Dir(v string) HTMLP {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlP) Draggable(v bool) HTMLP {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlP) Hidden(v bool) HTMLP {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlP) ID(v string) HTMLP {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlP) Lang(v string) HTMLP {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlP) Role(v string) HTMLP {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlP) Spellcheck(v bool) HTMLP {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlP) Style(k, v string) HTMLP {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlP) Styles(s map[string]string) HTMLP {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlP) TabIndex(v int) HTMLP {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlP) Title(v string) HTMLP {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlP) On(event string, h EventHandler, scope ...any) HTMLP {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlP) OnBlur(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlP) OnChange(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlP) OnClick(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlP) OnContextMenu(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlP) OnCopy(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlP) OnCut(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlP) OnDblClick(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlP) OnDrag(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlP) OnDragEnd(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlP) OnDragEnter(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlP) OnDragLeave(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlP) OnDragOver(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlP) OnDragStart(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlP) OnDrop(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlP) OnFocus(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlP) OnInput(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlP) OnInvalid(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlP) OnKeyDown(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlP) OnKeyPress(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlP) OnKeyUp(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlP) OnMouseDown(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlP) OnMouseMove(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlP) OnMouseOut(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlP) OnMouseOver(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlP) OnMouseUp(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlP) OnPaste(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlP) OnReset(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlP) OnScroll(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlP) OnSearch(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlP) OnSelect(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlP) OnSubmit(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlP) OnWheel(h EventHandler, scope ...any) HTMLP {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLParam is the interface that describes a "param" HTML element.
- type HTMLParam interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLParam
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLParam
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLParam
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLParam
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLParam
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLParam
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLParam
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLParam
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLParam
- // ID specifies a unique id for an element.
- ID(v string) HTMLParam
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLParam
- // Name specifies the name of the element.
- Name(v string) HTMLParam
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLParam
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLParam
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLParam
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLParam
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLParam
- // Title specifies extra information about an element.
- Title(v string) HTMLParam
- // Value specifies the value of the element.
- Value(v any) HTMLParam
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLParam
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLParam
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLParam
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLParam
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLParam
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLParam
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLParam
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLParam
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLParam
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLParam
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLParam
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLParam
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLParam
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLParam
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLParam
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLParam
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLParam
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLParam
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLParam
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLParam
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLParam
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLParam
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLParam
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLParam
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLParam
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLParam
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLParam
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLParam
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLParam
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLParam
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLParam
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLParam
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLParam
- }
- // Param returns an HTML element that defines a parameter for an object.
- func Param() HTMLParam {
- e := &htmlParam{
- htmlElement: htmlElement{
- tag: "param",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlParam struct {
- htmlElement
- }
- func (e *htmlParam) AccessKey(v string) HTMLParam {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlParam) Aria(k string, v any) HTMLParam {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlParam) Attr(n string, v any) HTMLParam {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlParam) Class(v ...string) HTMLParam {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlParam) ContentEditable(v bool) HTMLParam {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlParam) DataSet(k string, v any) HTMLParam {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlParam) Dir(v string) HTMLParam {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlParam) Draggable(v bool) HTMLParam {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlParam) Hidden(v bool) HTMLParam {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlParam) ID(v string) HTMLParam {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlParam) Lang(v string) HTMLParam {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlParam) Name(v string) HTMLParam {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlParam) Role(v string) HTMLParam {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlParam) Spellcheck(v bool) HTMLParam {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlParam) Style(k, v string) HTMLParam {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlParam) Styles(s map[string]string) HTMLParam {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlParam) TabIndex(v int) HTMLParam {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlParam) Title(v string) HTMLParam {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlParam) Value(v any) HTMLParam {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlParam) On(event string, h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlParam) OnBlur(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlParam) OnChange(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlParam) OnClick(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlParam) OnContextMenu(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlParam) OnCopy(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlParam) OnCut(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlParam) OnDblClick(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlParam) OnDrag(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlParam) OnDragEnd(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlParam) OnDragEnter(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlParam) OnDragLeave(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlParam) OnDragOver(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlParam) OnDragStart(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlParam) OnDrop(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlParam) OnFocus(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlParam) OnInput(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlParam) OnInvalid(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlParam) OnKeyDown(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlParam) OnKeyPress(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlParam) OnKeyUp(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlParam) OnMouseDown(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlParam) OnMouseMove(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlParam) OnMouseOut(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlParam) OnMouseOver(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlParam) OnMouseUp(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlParam) OnPaste(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlParam) OnReset(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlParam) OnScroll(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlParam) OnSearch(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlParam) OnSelect(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlParam) OnSubmit(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlParam) OnWheel(h EventHandler, scope ...any) HTMLParam {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLPicture is the interface that describes a "picture" HTML element.
- type HTMLPicture interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLPicture
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLPicture
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLPicture
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLPicture
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLPicture
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLPicture
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLPicture
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLPicture
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLPicture
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLPicture
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLPicture
- // ID specifies a unique id for an element.
- ID(v string) HTMLPicture
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLPicture
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLPicture
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLPicture
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLPicture
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLPicture
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLPicture
- // Title specifies extra information about an element.
- Title(v string) HTMLPicture
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLPicture
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLPicture
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLPicture
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLPicture
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLPicture
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLPicture
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLPicture
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLPicture
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLPicture
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLPicture
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLPicture
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLPicture
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLPicture
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLPicture
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLPicture
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLPicture
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLPicture
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLPicture
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLPicture
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLPicture
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLPicture
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLPicture
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLPicture
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLPicture
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLPicture
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLPicture
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLPicture
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLPicture
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLPicture
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLPicture
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLPicture
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLPicture
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLPicture
- }
- // Picture returns an HTML element that defines a container for multiple image resources.
- func Picture() HTMLPicture {
- e := &htmlPicture{
- htmlElement: htmlElement{
- tag: "picture",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlPicture struct {
- htmlElement
- }
- func (e *htmlPicture) Body(v ...UI) HTMLPicture {
- e.setChildren(v...)
- return e
- }
- func (e *htmlPicture) Text(v any) HTMLPicture {
- return e.Body(Text(v))
- }
- func (e *htmlPicture) AccessKey(v string) HTMLPicture {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlPicture) Aria(k string, v any) HTMLPicture {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlPicture) Attr(n string, v any) HTMLPicture {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlPicture) Class(v ...string) HTMLPicture {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlPicture) ContentEditable(v bool) HTMLPicture {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlPicture) DataSet(k string, v any) HTMLPicture {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlPicture) Dir(v string) HTMLPicture {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlPicture) Draggable(v bool) HTMLPicture {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlPicture) Hidden(v bool) HTMLPicture {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlPicture) ID(v string) HTMLPicture {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlPicture) Lang(v string) HTMLPicture {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlPicture) Role(v string) HTMLPicture {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlPicture) Spellcheck(v bool) HTMLPicture {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlPicture) Style(k, v string) HTMLPicture {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlPicture) Styles(s map[string]string) HTMLPicture {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlPicture) TabIndex(v int) HTMLPicture {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlPicture) Title(v string) HTMLPicture {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlPicture) On(event string, h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlPicture) OnBlur(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlPicture) OnChange(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlPicture) OnClick(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlPicture) OnContextMenu(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlPicture) OnCopy(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlPicture) OnCut(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDblClick(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDrag(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDragEnd(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDragEnter(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDragLeave(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDragOver(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDragStart(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlPicture) OnDrop(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlPicture) OnFocus(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlPicture) OnInput(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlPicture) OnInvalid(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlPicture) OnKeyDown(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlPicture) OnKeyPress(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlPicture) OnKeyUp(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlPicture) OnMouseDown(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlPicture) OnMouseMove(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlPicture) OnMouseOut(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlPicture) OnMouseOver(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlPicture) OnMouseUp(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlPicture) OnPaste(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlPicture) OnReset(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlPicture) OnScroll(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlPicture) OnSearch(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlPicture) OnSelect(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlPicture) OnSubmit(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlPicture) OnWheel(h EventHandler, scope ...any) HTMLPicture {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLPre is the interface that describes a "pre" HTML element.
- type HTMLPre interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLPre
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLPre
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLPre
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLPre
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLPre
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLPre
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLPre
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLPre
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLPre
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLPre
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLPre
- // ID specifies a unique id for an element.
- ID(v string) HTMLPre
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLPre
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLPre
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLPre
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLPre
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLPre
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLPre
- // Title specifies extra information about an element.
- Title(v string) HTMLPre
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLPre
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLPre
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLPre
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLPre
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLPre
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLPre
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLPre
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLPre
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLPre
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLPre
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLPre
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLPre
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLPre
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLPre
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLPre
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLPre
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLPre
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLPre
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLPre
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLPre
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLPre
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLPre
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLPre
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLPre
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLPre
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLPre
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLPre
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLPre
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLPre
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLPre
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLPre
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLPre
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLPre
- }
- // Pre returns an HTML element that defines preformatted text.
- func Pre() HTMLPre {
- e := &htmlPre{
- htmlElement: htmlElement{
- tag: "pre",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlPre struct {
- htmlElement
- }
- func (e *htmlPre) Body(v ...UI) HTMLPre {
- e.setChildren(v...)
- return e
- }
- func (e *htmlPre) Text(v any) HTMLPre {
- return e.Body(Text(v))
- }
- func (e *htmlPre) AccessKey(v string) HTMLPre {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlPre) Aria(k string, v any) HTMLPre {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlPre) Attr(n string, v any) HTMLPre {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlPre) Class(v ...string) HTMLPre {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlPre) ContentEditable(v bool) HTMLPre {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlPre) DataSet(k string, v any) HTMLPre {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlPre) Dir(v string) HTMLPre {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlPre) Draggable(v bool) HTMLPre {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlPre) Hidden(v bool) HTMLPre {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlPre) ID(v string) HTMLPre {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlPre) Lang(v string) HTMLPre {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlPre) Role(v string) HTMLPre {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlPre) Spellcheck(v bool) HTMLPre {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlPre) Style(k, v string) HTMLPre {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlPre) Styles(s map[string]string) HTMLPre {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlPre) TabIndex(v int) HTMLPre {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlPre) Title(v string) HTMLPre {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlPre) On(event string, h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlPre) OnBlur(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlPre) OnChange(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlPre) OnClick(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlPre) OnContextMenu(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlPre) OnCopy(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlPre) OnCut(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlPre) OnDblClick(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlPre) OnDrag(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlPre) OnDragEnd(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlPre) OnDragEnter(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlPre) OnDragLeave(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlPre) OnDragOver(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlPre) OnDragStart(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlPre) OnDrop(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlPre) OnFocus(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlPre) OnInput(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlPre) OnInvalid(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlPre) OnKeyDown(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlPre) OnKeyPress(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlPre) OnKeyUp(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlPre) OnMouseDown(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlPre) OnMouseMove(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlPre) OnMouseOut(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlPre) OnMouseOver(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlPre) OnMouseUp(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlPre) OnPaste(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlPre) OnReset(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlPre) OnScroll(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlPre) OnSearch(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlPre) OnSelect(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlPre) OnSubmit(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlPre) OnWheel(h EventHandler, scope ...any) HTMLPre {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLProgress is the interface that describes a "progress" HTML element.
- type HTMLProgress interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLProgress
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLProgress
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLProgress
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLProgress
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLProgress
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLProgress
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLProgress
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLProgress
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLProgress
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLProgress
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLProgress
- // ID specifies a unique id for an element.
- ID(v string) HTMLProgress
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLProgress
- // Max Specifies the maximum value.
- Max(v any) HTMLProgress
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLProgress
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLProgress
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLProgress
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLProgress
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLProgress
- // Title specifies extra information about an element.
- Title(v string) HTMLProgress
- // Value specifies the value of the element.
- Value(v any) HTMLProgress
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLProgress
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLProgress
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLProgress
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLProgress
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLProgress
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLProgress
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLProgress
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLProgress
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLProgress
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLProgress
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLProgress
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLProgress
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLProgress
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLProgress
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLProgress
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLProgress
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLProgress
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLProgress
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLProgress
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLProgress
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLProgress
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLProgress
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLProgress
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLProgress
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLProgress
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLProgress
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLProgress
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLProgress
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLProgress
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLProgress
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLProgress
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLProgress
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLProgress
- }
- // Progress returns an HTML element that represents the progress of a task.
- func Progress() HTMLProgress {
- e := &htmlProgress{
- htmlElement: htmlElement{
- tag: "progress",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlProgress struct {
- htmlElement
- }
- func (e *htmlProgress) Body(v ...UI) HTMLProgress {
- e.setChildren(v...)
- return e
- }
- func (e *htmlProgress) Text(v any) HTMLProgress {
- return e.Body(Text(v))
- }
- func (e *htmlProgress) AccessKey(v string) HTMLProgress {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlProgress) Aria(k string, v any) HTMLProgress {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlProgress) Attr(n string, v any) HTMLProgress {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlProgress) Class(v ...string) HTMLProgress {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlProgress) ContentEditable(v bool) HTMLProgress {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlProgress) DataSet(k string, v any) HTMLProgress {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlProgress) Dir(v string) HTMLProgress {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlProgress) Draggable(v bool) HTMLProgress {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlProgress) Hidden(v bool) HTMLProgress {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlProgress) ID(v string) HTMLProgress {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlProgress) Lang(v string) HTMLProgress {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlProgress) Max(v any) HTMLProgress {
- e.setAttr("max", v)
- return e
- }
- func (e *htmlProgress) Role(v string) HTMLProgress {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlProgress) Spellcheck(v bool) HTMLProgress {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlProgress) Style(k, v string) HTMLProgress {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlProgress) Styles(s map[string]string) HTMLProgress {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlProgress) TabIndex(v int) HTMLProgress {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlProgress) Title(v string) HTMLProgress {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlProgress) Value(v any) HTMLProgress {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlProgress) On(event string, h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlProgress) OnBlur(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlProgress) OnChange(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlProgress) OnClick(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlProgress) OnContextMenu(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlProgress) OnCopy(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlProgress) OnCut(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDblClick(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDrag(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDragEnd(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDragEnter(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDragLeave(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDragOver(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDragStart(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlProgress) OnDrop(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlProgress) OnFocus(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlProgress) OnInput(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlProgress) OnInvalid(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlProgress) OnKeyDown(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlProgress) OnKeyPress(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlProgress) OnKeyUp(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlProgress) OnMouseDown(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlProgress) OnMouseMove(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlProgress) OnMouseOut(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlProgress) OnMouseOver(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlProgress) OnMouseUp(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlProgress) OnPaste(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlProgress) OnReset(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlProgress) OnScroll(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlProgress) OnSearch(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlProgress) OnSelect(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlProgress) OnSubmit(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlProgress) OnWheel(h EventHandler, scope ...any) HTMLProgress {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLQ is the interface that describes a "q" HTML element.
- type HTMLQ interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLQ
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLQ
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLQ
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLQ
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLQ
- // Cite specifies a URL which explains the quote/deleted/inserted text.
- Cite(v string) HTMLQ
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLQ
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLQ
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLQ
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLQ
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLQ
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLQ
- // ID specifies a unique id for an element.
- ID(v string) HTMLQ
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLQ
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLQ
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLQ
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLQ
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLQ
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLQ
- // Title specifies extra information about an element.
- Title(v string) HTMLQ
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLQ
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLQ
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLQ
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLQ
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLQ
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLQ
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLQ
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLQ
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLQ
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLQ
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLQ
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLQ
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLQ
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLQ
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLQ
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLQ
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLQ
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLQ
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLQ
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLQ
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLQ
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLQ
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLQ
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLQ
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLQ
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLQ
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLQ
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLQ
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLQ
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLQ
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLQ
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLQ
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLQ
- }
- // Q returns an HTML element that defines a short quotation.
- func Q() HTMLQ {
- e := &htmlQ{
- htmlElement: htmlElement{
- tag: "q",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlQ struct {
- htmlElement
- }
- func (e *htmlQ) Body(v ...UI) HTMLQ {
- e.setChildren(v...)
- return e
- }
- func (e *htmlQ) Text(v any) HTMLQ {
- return e.Body(Text(v))
- }
- func (e *htmlQ) AccessKey(v string) HTMLQ {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlQ) Aria(k string, v any) HTMLQ {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlQ) Attr(n string, v any) HTMLQ {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlQ) Cite(v string) HTMLQ {
- e.setAttr("cite", v)
- return e
- }
- func (e *htmlQ) Class(v ...string) HTMLQ {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlQ) ContentEditable(v bool) HTMLQ {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlQ) DataSet(k string, v any) HTMLQ {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlQ) Dir(v string) HTMLQ {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlQ) Draggable(v bool) HTMLQ {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlQ) Hidden(v bool) HTMLQ {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlQ) ID(v string) HTMLQ {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlQ) Lang(v string) HTMLQ {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlQ) Role(v string) HTMLQ {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlQ) Spellcheck(v bool) HTMLQ {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlQ) Style(k, v string) HTMLQ {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlQ) Styles(s map[string]string) HTMLQ {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlQ) TabIndex(v int) HTMLQ {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlQ) Title(v string) HTMLQ {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlQ) On(event string, h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlQ) OnBlur(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlQ) OnChange(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlQ) OnClick(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlQ) OnContextMenu(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlQ) OnCopy(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlQ) OnCut(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlQ) OnDblClick(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlQ) OnDrag(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlQ) OnDragEnd(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlQ) OnDragEnter(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlQ) OnDragLeave(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlQ) OnDragOver(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlQ) OnDragStart(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlQ) OnDrop(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlQ) OnFocus(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlQ) OnInput(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlQ) OnInvalid(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlQ) OnKeyDown(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlQ) OnKeyPress(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlQ) OnKeyUp(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlQ) OnMouseDown(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlQ) OnMouseMove(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlQ) OnMouseOut(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlQ) OnMouseOver(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlQ) OnMouseUp(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlQ) OnPaste(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlQ) OnReset(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlQ) OnScroll(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlQ) OnSearch(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlQ) OnSelect(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlQ) OnSubmit(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlQ) OnWheel(h EventHandler, scope ...any) HTMLQ {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLRp is the interface that describes a "rp" HTML element.
- type HTMLRp interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLRp
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLRp
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLRp
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLRp
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLRp
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLRp
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLRp
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLRp
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLRp
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLRp
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLRp
- // ID specifies a unique id for an element.
- ID(v string) HTMLRp
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLRp
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLRp
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLRp
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLRp
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLRp
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLRp
- // Title specifies extra information about an element.
- Title(v string) HTMLRp
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLRp
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLRp
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLRp
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLRp
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLRp
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLRp
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLRp
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLRp
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLRp
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLRp
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLRp
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLRp
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLRp
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLRp
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLRp
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLRp
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLRp
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLRp
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLRp
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLRp
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLRp
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLRp
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLRp
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLRp
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLRp
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLRp
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLRp
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLRp
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLRp
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLRp
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLRp
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLRp
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLRp
- }
- // Rp returns an HTML element that defines what to show in browsers that do not support ruby annotations.
- func Rp() HTMLRp {
- e := &htmlRp{
- htmlElement: htmlElement{
- tag: "rp",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlRp struct {
- htmlElement
- }
- func (e *htmlRp) Body(v ...UI) HTMLRp {
- e.setChildren(v...)
- return e
- }
- func (e *htmlRp) Text(v any) HTMLRp {
- return e.Body(Text(v))
- }
- func (e *htmlRp) AccessKey(v string) HTMLRp {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlRp) Aria(k string, v any) HTMLRp {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRp) Attr(n string, v any) HTMLRp {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlRp) Class(v ...string) HTMLRp {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlRp) ContentEditable(v bool) HTMLRp {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlRp) DataSet(k string, v any) HTMLRp {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRp) Dir(v string) HTMLRp {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlRp) Draggable(v bool) HTMLRp {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlRp) Hidden(v bool) HTMLRp {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlRp) ID(v string) HTMLRp {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlRp) Lang(v string) HTMLRp {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlRp) Role(v string) HTMLRp {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlRp) Spellcheck(v bool) HTMLRp {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlRp) Style(k, v string) HTMLRp {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlRp) Styles(s map[string]string) HTMLRp {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlRp) TabIndex(v int) HTMLRp {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlRp) Title(v string) HTMLRp {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlRp) On(event string, h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlRp) OnBlur(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlRp) OnChange(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlRp) OnClick(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlRp) OnContextMenu(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlRp) OnCopy(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlRp) OnCut(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlRp) OnDblClick(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlRp) OnDrag(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlRp) OnDragEnd(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlRp) OnDragEnter(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlRp) OnDragLeave(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlRp) OnDragOver(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlRp) OnDragStart(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlRp) OnDrop(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlRp) OnFocus(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlRp) OnInput(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlRp) OnInvalid(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlRp) OnKeyDown(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlRp) OnKeyPress(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlRp) OnKeyUp(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlRp) OnMouseDown(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlRp) OnMouseMove(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlRp) OnMouseOut(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlRp) OnMouseOver(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlRp) OnMouseUp(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlRp) OnPaste(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlRp) OnReset(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlRp) OnScroll(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlRp) OnSearch(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlRp) OnSelect(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlRp) OnSubmit(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlRp) OnWheel(h EventHandler, scope ...any) HTMLRp {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLRt is the interface that describes a "rt" HTML element.
- type HTMLRt interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLRt
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLRt
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLRt
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLRt
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLRt
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLRt
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLRt
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLRt
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLRt
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLRt
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLRt
- // ID specifies a unique id for an element.
- ID(v string) HTMLRt
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLRt
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLRt
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLRt
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLRt
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLRt
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLRt
- // Title specifies extra information about an element.
- Title(v string) HTMLRt
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLRt
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLRt
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLRt
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLRt
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLRt
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLRt
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLRt
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLRt
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLRt
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLRt
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLRt
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLRt
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLRt
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLRt
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLRt
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLRt
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLRt
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLRt
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLRt
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLRt
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLRt
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLRt
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLRt
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLRt
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLRt
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLRt
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLRt
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLRt
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLRt
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLRt
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLRt
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLRt
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLRt
- }
- // Rt returns an HTML element that defines an explanation/pronunciation of characters (for East Asian typography).
- func Rt() HTMLRt {
- e := &htmlRt{
- htmlElement: htmlElement{
- tag: "rt",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlRt struct {
- htmlElement
- }
- func (e *htmlRt) Body(v ...UI) HTMLRt {
- e.setChildren(v...)
- return e
- }
- func (e *htmlRt) Text(v any) HTMLRt {
- return e.Body(Text(v))
- }
- func (e *htmlRt) AccessKey(v string) HTMLRt {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlRt) Aria(k string, v any) HTMLRt {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRt) Attr(n string, v any) HTMLRt {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlRt) Class(v ...string) HTMLRt {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlRt) ContentEditable(v bool) HTMLRt {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlRt) DataSet(k string, v any) HTMLRt {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRt) Dir(v string) HTMLRt {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlRt) Draggable(v bool) HTMLRt {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlRt) Hidden(v bool) HTMLRt {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlRt) ID(v string) HTMLRt {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlRt) Lang(v string) HTMLRt {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlRt) Role(v string) HTMLRt {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlRt) Spellcheck(v bool) HTMLRt {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlRt) Style(k, v string) HTMLRt {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlRt) Styles(s map[string]string) HTMLRt {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlRt) TabIndex(v int) HTMLRt {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlRt) Title(v string) HTMLRt {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlRt) On(event string, h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlRt) OnBlur(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlRt) OnChange(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlRt) OnClick(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlRt) OnContextMenu(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlRt) OnCopy(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlRt) OnCut(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlRt) OnDblClick(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlRt) OnDrag(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlRt) OnDragEnd(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlRt) OnDragEnter(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlRt) OnDragLeave(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlRt) OnDragOver(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlRt) OnDragStart(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlRt) OnDrop(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlRt) OnFocus(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlRt) OnInput(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlRt) OnInvalid(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlRt) OnKeyDown(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlRt) OnKeyPress(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlRt) OnKeyUp(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlRt) OnMouseDown(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlRt) OnMouseMove(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlRt) OnMouseOut(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlRt) OnMouseOver(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlRt) OnMouseUp(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlRt) OnPaste(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlRt) OnReset(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlRt) OnScroll(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlRt) OnSearch(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlRt) OnSelect(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlRt) OnSubmit(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlRt) OnWheel(h EventHandler, scope ...any) HTMLRt {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLRuby is the interface that describes a "ruby" HTML element.
- type HTMLRuby interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLRuby
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLRuby
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLRuby
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLRuby
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLRuby
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLRuby
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLRuby
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLRuby
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLRuby
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLRuby
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLRuby
- // ID specifies a unique id for an element.
- ID(v string) HTMLRuby
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLRuby
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLRuby
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLRuby
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLRuby
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLRuby
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLRuby
- // Title specifies extra information about an element.
- Title(v string) HTMLRuby
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLRuby
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLRuby
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLRuby
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLRuby
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLRuby
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLRuby
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLRuby
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLRuby
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLRuby
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLRuby
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLRuby
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLRuby
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLRuby
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLRuby
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLRuby
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLRuby
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLRuby
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLRuby
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLRuby
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLRuby
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLRuby
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLRuby
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLRuby
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLRuby
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLRuby
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLRuby
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLRuby
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLRuby
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLRuby
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLRuby
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLRuby
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLRuby
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLRuby
- }
- // Ruby returns an HTML element that defines a ruby annotation (for East Asian typography).
- func Ruby() HTMLRuby {
- e := &htmlRuby{
- htmlElement: htmlElement{
- tag: "ruby",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlRuby struct {
- htmlElement
- }
- func (e *htmlRuby) Body(v ...UI) HTMLRuby {
- e.setChildren(v...)
- return e
- }
- func (e *htmlRuby) Text(v any) HTMLRuby {
- return e.Body(Text(v))
- }
- func (e *htmlRuby) AccessKey(v string) HTMLRuby {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlRuby) Aria(k string, v any) HTMLRuby {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRuby) Attr(n string, v any) HTMLRuby {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlRuby) Class(v ...string) HTMLRuby {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlRuby) ContentEditable(v bool) HTMLRuby {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlRuby) DataSet(k string, v any) HTMLRuby {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlRuby) Dir(v string) HTMLRuby {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlRuby) Draggable(v bool) HTMLRuby {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlRuby) Hidden(v bool) HTMLRuby {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlRuby) ID(v string) HTMLRuby {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlRuby) Lang(v string) HTMLRuby {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlRuby) Role(v string) HTMLRuby {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlRuby) Spellcheck(v bool) HTMLRuby {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlRuby) Style(k, v string) HTMLRuby {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlRuby) Styles(s map[string]string) HTMLRuby {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlRuby) TabIndex(v int) HTMLRuby {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlRuby) Title(v string) HTMLRuby {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlRuby) On(event string, h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlRuby) OnBlur(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlRuby) OnChange(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlRuby) OnClick(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlRuby) OnContextMenu(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlRuby) OnCopy(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlRuby) OnCut(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDblClick(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDrag(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDragEnd(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDragEnter(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDragLeave(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDragOver(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDragStart(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlRuby) OnDrop(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlRuby) OnFocus(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlRuby) OnInput(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlRuby) OnInvalid(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlRuby) OnKeyDown(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlRuby) OnKeyPress(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlRuby) OnKeyUp(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlRuby) OnMouseDown(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlRuby) OnMouseMove(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlRuby) OnMouseOut(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlRuby) OnMouseOver(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlRuby) OnMouseUp(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlRuby) OnPaste(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlRuby) OnReset(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlRuby) OnScroll(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlRuby) OnSearch(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlRuby) OnSelect(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlRuby) OnSubmit(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlRuby) OnWheel(h EventHandler, scope ...any) HTMLRuby {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLS is the interface that describes a "s" HTML element.
- type HTMLS interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLS
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLS
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLS
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLS
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLS
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLS
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLS
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLS
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLS
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLS
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLS
- // ID specifies a unique id for an element.
- ID(v string) HTMLS
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLS
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLS
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLS
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLS
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLS
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLS
- // Title specifies extra information about an element.
- Title(v string) HTMLS
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLS
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLS
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLS
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLS
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLS
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLS
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLS
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLS
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLS
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLS
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLS
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLS
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLS
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLS
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLS
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLS
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLS
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLS
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLS
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLS
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLS
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLS
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLS
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLS
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLS
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLS
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLS
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLS
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLS
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLS
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLS
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLS
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLS
- }
- // S returns an HTML element that Defines text that is no longer correct.
- func S() HTMLS {
- e := &htmlS{
- htmlElement: htmlElement{
- tag: "s",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlS struct {
- htmlElement
- }
- func (e *htmlS) Body(v ...UI) HTMLS {
- e.setChildren(v...)
- return e
- }
- func (e *htmlS) Text(v any) HTMLS {
- return e.Body(Text(v))
- }
- func (e *htmlS) AccessKey(v string) HTMLS {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlS) Aria(k string, v any) HTMLS {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlS) Attr(n string, v any) HTMLS {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlS) Class(v ...string) HTMLS {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlS) ContentEditable(v bool) HTMLS {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlS) DataSet(k string, v any) HTMLS {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlS) Dir(v string) HTMLS {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlS) Draggable(v bool) HTMLS {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlS) Hidden(v bool) HTMLS {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlS) ID(v string) HTMLS {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlS) Lang(v string) HTMLS {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlS) Role(v string) HTMLS {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlS) Spellcheck(v bool) HTMLS {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlS) Style(k, v string) HTMLS {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlS) Styles(s map[string]string) HTMLS {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlS) TabIndex(v int) HTMLS {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlS) Title(v string) HTMLS {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlS) On(event string, h EventHandler, scope ...any) HTMLS {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlS) OnBlur(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlS) OnChange(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlS) OnClick(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlS) OnContextMenu(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlS) OnCopy(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlS) OnCut(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlS) OnDblClick(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlS) OnDrag(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlS) OnDragEnd(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlS) OnDragEnter(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlS) OnDragLeave(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlS) OnDragOver(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlS) OnDragStart(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlS) OnDrop(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlS) OnFocus(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlS) OnInput(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlS) OnInvalid(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlS) OnKeyDown(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlS) OnKeyPress(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlS) OnKeyUp(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlS) OnMouseDown(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlS) OnMouseMove(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlS) OnMouseOut(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlS) OnMouseOver(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlS) OnMouseUp(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlS) OnPaste(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlS) OnReset(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlS) OnScroll(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlS) OnSearch(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlS) OnSelect(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlS) OnSubmit(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlS) OnWheel(h EventHandler, scope ...any) HTMLS {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSamp is the interface that describes a "samp" HTML element.
- type HTMLSamp interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSamp
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSamp
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSamp
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSamp
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSamp
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSamp
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSamp
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSamp
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSamp
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSamp
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSamp
- // ID specifies a unique id for an element.
- ID(v string) HTMLSamp
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSamp
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSamp
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSamp
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSamp
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSamp
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSamp
- // Title specifies extra information about an element.
- Title(v string) HTMLSamp
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSamp
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSamp
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSamp
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSamp
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSamp
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSamp
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSamp
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSamp
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSamp
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSamp
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSamp
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSamp
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSamp
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSamp
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSamp
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSamp
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSamp
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSamp
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSamp
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSamp
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSamp
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSamp
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSamp
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSamp
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSamp
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSamp
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSamp
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSamp
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSamp
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSamp
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSamp
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSamp
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSamp
- }
- // Samp returns an HTML element that defines sample output from a computer program.
- func Samp() HTMLSamp {
- e := &htmlSamp{
- htmlElement: htmlElement{
- tag: "samp",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSamp struct {
- htmlElement
- }
- func (e *htmlSamp) Body(v ...UI) HTMLSamp {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSamp) Text(v any) HTMLSamp {
- return e.Body(Text(v))
- }
- func (e *htmlSamp) AccessKey(v string) HTMLSamp {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSamp) Aria(k string, v any) HTMLSamp {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSamp) Attr(n string, v any) HTMLSamp {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSamp) Class(v ...string) HTMLSamp {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSamp) ContentEditable(v bool) HTMLSamp {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSamp) DataSet(k string, v any) HTMLSamp {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSamp) Dir(v string) HTMLSamp {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSamp) Draggable(v bool) HTMLSamp {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSamp) Hidden(v bool) HTMLSamp {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSamp) ID(v string) HTMLSamp {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSamp) Lang(v string) HTMLSamp {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSamp) Role(v string) HTMLSamp {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSamp) Spellcheck(v bool) HTMLSamp {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSamp) Style(k, v string) HTMLSamp {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSamp) Styles(s map[string]string) HTMLSamp {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSamp) TabIndex(v int) HTMLSamp {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSamp) Title(v string) HTMLSamp {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSamp) On(event string, h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSamp) OnBlur(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSamp) OnChange(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSamp) OnClick(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSamp) OnContextMenu(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSamp) OnCopy(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSamp) OnCut(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDblClick(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDrag(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDragEnd(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDragEnter(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDragLeave(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDragOver(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDragStart(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSamp) OnDrop(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSamp) OnFocus(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSamp) OnInput(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSamp) OnInvalid(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSamp) OnKeyDown(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSamp) OnKeyPress(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSamp) OnKeyUp(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSamp) OnMouseDown(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSamp) OnMouseMove(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSamp) OnMouseOut(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSamp) OnMouseOver(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSamp) OnMouseUp(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSamp) OnPaste(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSamp) OnReset(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSamp) OnScroll(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSamp) OnSearch(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSamp) OnSelect(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSamp) OnSubmit(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSamp) OnWheel(h EventHandler, scope ...any) HTMLSamp {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLScript is the interface that describes a "script" HTML element.
- type HTMLScript interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLScript
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLScript
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLScript
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLScript
- // Async specifies that the script is executed asynchronously (only for external scripts).
- Async(v bool) HTMLScript
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLScript
- // Charset specifies the character encoding.
- Charset(v string) HTMLScript
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLScript
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLScript
- // CrossOrigin sets the mode of the request to an HTTP CORS Request.
- CrossOrigin(v string) HTMLScript
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLScript
- // Defer specifies that the script is executed when the page has finished parsing (only for external scripts).
- Defer(v bool) HTMLScript
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLScript
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLScript
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLScript
- // ID specifies a unique id for an element.
- ID(v string) HTMLScript
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLScript
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLScript
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLScript
- // Src specifies the URL of the media file.
- Src(v string) HTMLScript
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLScript
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLScript
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLScript
- // Title specifies extra information about an element.
- Title(v string) HTMLScript
- // Type specifies the type of element.
- Type(v string) HTMLScript
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLScript
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLScript
- }
- // Script returns an HTML element that defines a client-side script.
- func Script() HTMLScript {
- e := &htmlScript{
- htmlElement: htmlElement{
- tag: "script",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlScript struct {
- htmlElement
- }
- func (e *htmlScript) Body(v ...UI) HTMLScript {
- e.setChildren(v...)
- return e
- }
- func (e *htmlScript) Text(v any) HTMLScript {
- return e.Body(Text(v))
- }
- func (e *htmlScript) AccessKey(v string) HTMLScript {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlScript) Aria(k string, v any) HTMLScript {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlScript) Async(v bool) HTMLScript {
- e.setAttr("async", v)
- return e
- }
- func (e *htmlScript) Attr(n string, v any) HTMLScript {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlScript) Charset(v string) HTMLScript {
- e.setAttr("charset", v)
- return e
- }
- func (e *htmlScript) Class(v ...string) HTMLScript {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlScript) ContentEditable(v bool) HTMLScript {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlScript) CrossOrigin(v string) HTMLScript {
- e.setAttr("crossorigin", v)
- return e
- }
- func (e *htmlScript) DataSet(k string, v any) HTMLScript {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlScript) Defer(v bool) HTMLScript {
- e.setAttr("defer", v)
- return e
- }
- func (e *htmlScript) Dir(v string) HTMLScript {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlScript) Draggable(v bool) HTMLScript {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlScript) Hidden(v bool) HTMLScript {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlScript) ID(v string) HTMLScript {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlScript) Lang(v string) HTMLScript {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlScript) Role(v string) HTMLScript {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlScript) Spellcheck(v bool) HTMLScript {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlScript) Src(v string) HTMLScript {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlScript) Style(k, v string) HTMLScript {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlScript) Styles(s map[string]string) HTMLScript {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlScript) TabIndex(v int) HTMLScript {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlScript) Title(v string) HTMLScript {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlScript) Type(v string) HTMLScript {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlScript) On(event string, h EventHandler, scope ...any) HTMLScript {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlScript) OnLoad(h EventHandler, scope ...any) HTMLScript {
- e.setEventHandler("load", h, scope...)
- return e
- }
- // HTMLSection is the interface that describes a "section" HTML element.
- type HTMLSection interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSection
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSection
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSection
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSection
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSection
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSection
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSection
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSection
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSection
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSection
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSection
- // ID specifies a unique id for an element.
- ID(v string) HTMLSection
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSection
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSection
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSection
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSection
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSection
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSection
- // Title specifies extra information about an element.
- Title(v string) HTMLSection
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSection
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSection
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSection
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSection
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSection
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSection
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSection
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSection
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSection
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSection
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSection
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSection
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSection
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSection
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSection
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSection
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSection
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSection
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSection
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSection
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSection
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSection
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSection
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSection
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSection
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSection
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSection
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSection
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSection
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSection
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSection
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSection
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSection
- }
- // Section returns an HTML element that defines a section in a document.
- func Section() HTMLSection {
- e := &htmlSection{
- htmlElement: htmlElement{
- tag: "section",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSection struct {
- htmlElement
- }
- func (e *htmlSection) Body(v ...UI) HTMLSection {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSection) Text(v any) HTMLSection {
- return e.Body(Text(v))
- }
- func (e *htmlSection) AccessKey(v string) HTMLSection {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSection) Aria(k string, v any) HTMLSection {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSection) Attr(n string, v any) HTMLSection {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSection) Class(v ...string) HTMLSection {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSection) ContentEditable(v bool) HTMLSection {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSection) DataSet(k string, v any) HTMLSection {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSection) Dir(v string) HTMLSection {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSection) Draggable(v bool) HTMLSection {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSection) Hidden(v bool) HTMLSection {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSection) ID(v string) HTMLSection {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSection) Lang(v string) HTMLSection {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSection) Role(v string) HTMLSection {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSection) Spellcheck(v bool) HTMLSection {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSection) Style(k, v string) HTMLSection {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSection) Styles(s map[string]string) HTMLSection {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSection) TabIndex(v int) HTMLSection {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSection) Title(v string) HTMLSection {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSection) On(event string, h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSection) OnBlur(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSection) OnChange(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSection) OnClick(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSection) OnContextMenu(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSection) OnCopy(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSection) OnCut(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSection) OnDblClick(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSection) OnDrag(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSection) OnDragEnd(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSection) OnDragEnter(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSection) OnDragLeave(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSection) OnDragOver(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSection) OnDragStart(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSection) OnDrop(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSection) OnFocus(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSection) OnInput(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSection) OnInvalid(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSection) OnKeyDown(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSection) OnKeyPress(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSection) OnKeyUp(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSection) OnMouseDown(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSection) OnMouseMove(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSection) OnMouseOut(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSection) OnMouseOver(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSection) OnMouseUp(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSection) OnPaste(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSection) OnReset(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSection) OnScroll(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSection) OnSearch(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSection) OnSelect(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSection) OnSubmit(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSection) OnWheel(h EventHandler, scope ...any) HTMLSection {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSelect is the interface that describes a "select" HTML element.
- type HTMLSelect interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSelect
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSelect
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSelect
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSelect
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSelect
- // AutoFocus specifies that the element should automatically get focus when the page loads.
- AutoFocus(v bool) HTMLSelect
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSelect
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSelect
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSelect
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSelect
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLSelect
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSelect
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLSelect
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSelect
- // ID specifies a unique id for an element.
- ID(v string) HTMLSelect
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSelect
- // Multiple specifies that a user can enter more than one value.
- Multiple(v bool) HTMLSelect
- // Name specifies the name of the element.
- Name(v string) HTMLSelect
- // Required specifies that the element must be filled out before submitting the form.
- Required(v bool) HTMLSelect
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSelect
- // Size specifies the width.
- Size(v int) HTMLSelect
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSelect
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSelect
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSelect
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSelect
- // Title specifies extra information about an element.
- Title(v string) HTMLSelect
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSelect
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSelect
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSelect
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSelect
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSelect
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSelect
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSelect
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSelect
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSelect
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSelect
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSelect
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSelect
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSelect
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSelect
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSelect
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSelect
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSelect
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSelect
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSelect
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSelect
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSelect
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSelect
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSelect
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSelect
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSelect
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSelect
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSelect
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSelect
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSelect
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSelect
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSelect
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSelect
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSelect
- }
- // Select returns an HTML element that defines a drop-down list.
- func Select() HTMLSelect {
- e := &htmlSelect{
- htmlElement: htmlElement{
- tag: "select",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSelect struct {
- htmlElement
- }
- func (e *htmlSelect) Body(v ...UI) HTMLSelect {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSelect) Text(v any) HTMLSelect {
- return e.Body(Text(v))
- }
- func (e *htmlSelect) AccessKey(v string) HTMLSelect {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSelect) Aria(k string, v any) HTMLSelect {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSelect) Attr(n string, v any) HTMLSelect {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSelect) AutoFocus(v bool) HTMLSelect {
- e.setAttr("autofocus", v)
- return e
- }
- func (e *htmlSelect) Class(v ...string) HTMLSelect {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSelect) ContentEditable(v bool) HTMLSelect {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSelect) DataSet(k string, v any) HTMLSelect {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSelect) Dir(v string) HTMLSelect {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSelect) Disabled(v bool) HTMLSelect {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlSelect) Draggable(v bool) HTMLSelect {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSelect) Form(v string) HTMLSelect {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlSelect) Hidden(v bool) HTMLSelect {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSelect) ID(v string) HTMLSelect {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSelect) Lang(v string) HTMLSelect {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSelect) Multiple(v bool) HTMLSelect {
- e.setAttr("multiple", v)
- return e
- }
- func (e *htmlSelect) Name(v string) HTMLSelect {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlSelect) Required(v bool) HTMLSelect {
- e.setAttr("required", v)
- return e
- }
- func (e *htmlSelect) Role(v string) HTMLSelect {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSelect) Size(v int) HTMLSelect {
- e.setAttr("size", v)
- return e
- }
- func (e *htmlSelect) Spellcheck(v bool) HTMLSelect {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSelect) Style(k, v string) HTMLSelect {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSelect) Styles(s map[string]string) HTMLSelect {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSelect) TabIndex(v int) HTMLSelect {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSelect) Title(v string) HTMLSelect {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSelect) On(event string, h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSelect) OnBlur(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSelect) OnChange(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSelect) OnClick(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSelect) OnContextMenu(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSelect) OnCopy(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSelect) OnCut(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDblClick(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDrag(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDragEnd(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDragEnter(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDragLeave(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDragOver(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDragStart(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSelect) OnDrop(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSelect) OnFocus(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSelect) OnInput(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSelect) OnInvalid(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSelect) OnKeyDown(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSelect) OnKeyPress(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSelect) OnKeyUp(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSelect) OnMouseDown(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSelect) OnMouseMove(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSelect) OnMouseOut(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSelect) OnMouseOver(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSelect) OnMouseUp(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSelect) OnPaste(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSelect) OnReset(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSelect) OnScroll(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSelect) OnSearch(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSelect) OnSelect(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSelect) OnSubmit(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSelect) OnWheel(h EventHandler, scope ...any) HTMLSelect {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSmall is the interface that describes a "small" HTML element.
- type HTMLSmall interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSmall
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSmall
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSmall
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSmall
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSmall
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSmall
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSmall
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSmall
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSmall
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSmall
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSmall
- // ID specifies a unique id for an element.
- ID(v string) HTMLSmall
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSmall
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSmall
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSmall
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSmall
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSmall
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSmall
- // Title specifies extra information about an element.
- Title(v string) HTMLSmall
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSmall
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSmall
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSmall
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSmall
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSmall
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSmall
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSmall
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSmall
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSmall
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSmall
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSmall
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSmall
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSmall
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSmall
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSmall
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSmall
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSmall
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSmall
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSmall
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSmall
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSmall
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSmall
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSmall
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSmall
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSmall
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSmall
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSmall
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSmall
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSmall
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSmall
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSmall
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSmall
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSmall
- }
- // Small returns an HTML element that defines smaller text.
- func Small() HTMLSmall {
- e := &htmlSmall{
- htmlElement: htmlElement{
- tag: "small",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSmall struct {
- htmlElement
- }
- func (e *htmlSmall) Body(v ...UI) HTMLSmall {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSmall) Text(v any) HTMLSmall {
- return e.Body(Text(v))
- }
- func (e *htmlSmall) AccessKey(v string) HTMLSmall {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSmall) Aria(k string, v any) HTMLSmall {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSmall) Attr(n string, v any) HTMLSmall {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSmall) Class(v ...string) HTMLSmall {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSmall) ContentEditable(v bool) HTMLSmall {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSmall) DataSet(k string, v any) HTMLSmall {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSmall) Dir(v string) HTMLSmall {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSmall) Draggable(v bool) HTMLSmall {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSmall) Hidden(v bool) HTMLSmall {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSmall) ID(v string) HTMLSmall {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSmall) Lang(v string) HTMLSmall {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSmall) Role(v string) HTMLSmall {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSmall) Spellcheck(v bool) HTMLSmall {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSmall) Style(k, v string) HTMLSmall {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSmall) Styles(s map[string]string) HTMLSmall {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSmall) TabIndex(v int) HTMLSmall {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSmall) Title(v string) HTMLSmall {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSmall) On(event string, h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSmall) OnBlur(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSmall) OnChange(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSmall) OnClick(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSmall) OnContextMenu(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSmall) OnCopy(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSmall) OnCut(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDblClick(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDrag(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDragEnd(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDragEnter(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDragLeave(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDragOver(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDragStart(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSmall) OnDrop(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSmall) OnFocus(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSmall) OnInput(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSmall) OnInvalid(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSmall) OnKeyDown(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSmall) OnKeyPress(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSmall) OnKeyUp(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSmall) OnMouseDown(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSmall) OnMouseMove(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSmall) OnMouseOut(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSmall) OnMouseOver(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSmall) OnMouseUp(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSmall) OnPaste(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSmall) OnReset(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSmall) OnScroll(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSmall) OnSearch(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSmall) OnSelect(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSmall) OnSubmit(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSmall) OnWheel(h EventHandler, scope ...any) HTMLSmall {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSource is the interface that describes a "source" HTML element.
- type HTMLSource interface {
- UI
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSource
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSource
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSource
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSource
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSource
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSource
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSource
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSource
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSource
- // ID specifies a unique id for an element.
- ID(v string) HTMLSource
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSource
- // Media specifies what media/device the linked document is optimized for.
- Media(v string) HTMLSource
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSource
- // Sizes specifies the size of the linked resource.
- Sizes(v string) HTMLSource
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSource
- // Src specifies the URL of the media file.
- Src(v string) HTMLSource
- // SrcSet specifies the URL of the image to use in different situations.
- SrcSet(v string) HTMLSource
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSource
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSource
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSource
- // Title specifies extra information about an element.
- Title(v string) HTMLSource
- // Type specifies the type of element.
- Type(v string) HTMLSource
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSource
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSource
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSource
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSource
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSource
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSource
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSource
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSource
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSource
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSource
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSource
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSource
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSource
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSource
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSource
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSource
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSource
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSource
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSource
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSource
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSource
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSource
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSource
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSource
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSource
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSource
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSource
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSource
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSource
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSource
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSource
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSource
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSource
- }
- // Source returns an HTML element that .
- func Source() HTMLSource {
- e := &htmlSource{
- htmlElement: htmlElement{
- tag: "source",
- isSelfClosing: true,
- },
- }
- return e
- }
- type htmlSource struct {
- htmlElement
- }
- func (e *htmlSource) AccessKey(v string) HTMLSource {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSource) Aria(k string, v any) HTMLSource {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSource) Attr(n string, v any) HTMLSource {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSource) Class(v ...string) HTMLSource {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSource) ContentEditable(v bool) HTMLSource {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSource) DataSet(k string, v any) HTMLSource {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSource) Dir(v string) HTMLSource {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSource) Draggable(v bool) HTMLSource {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSource) Hidden(v bool) HTMLSource {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSource) ID(v string) HTMLSource {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSource) Lang(v string) HTMLSource {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSource) Media(v string) HTMLSource {
- e.setAttr("media", v)
- return e
- }
- func (e *htmlSource) Role(v string) HTMLSource {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSource) Sizes(v string) HTMLSource {
- e.setAttr("sizes", v)
- return e
- }
- func (e *htmlSource) Spellcheck(v bool) HTMLSource {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSource) Src(v string) HTMLSource {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlSource) SrcSet(v string) HTMLSource {
- e.setAttr("srcset", v)
- return e
- }
- func (e *htmlSource) Style(k, v string) HTMLSource {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSource) Styles(s map[string]string) HTMLSource {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSource) TabIndex(v int) HTMLSource {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSource) Title(v string) HTMLSource {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSource) Type(v string) HTMLSource {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlSource) On(event string, h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSource) OnBlur(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSource) OnChange(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSource) OnClick(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSource) OnContextMenu(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSource) OnCopy(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSource) OnCut(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSource) OnDblClick(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSource) OnDrag(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSource) OnDragEnd(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSource) OnDragEnter(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSource) OnDragLeave(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSource) OnDragOver(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSource) OnDragStart(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSource) OnDrop(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSource) OnFocus(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSource) OnInput(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSource) OnInvalid(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSource) OnKeyDown(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSource) OnKeyPress(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSource) OnKeyUp(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSource) OnMouseDown(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSource) OnMouseMove(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSource) OnMouseOut(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSource) OnMouseOver(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSource) OnMouseUp(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSource) OnPaste(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSource) OnReset(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSource) OnScroll(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSource) OnSearch(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSource) OnSelect(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSource) OnSubmit(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSource) OnWheel(h EventHandler, scope ...any) HTMLSource {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSpan is the interface that describes a "span" HTML element.
- type HTMLSpan interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSpan
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSpan
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSpan
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSpan
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSpan
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSpan
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSpan
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSpan
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSpan
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSpan
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSpan
- // ID specifies a unique id for an element.
- ID(v string) HTMLSpan
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSpan
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSpan
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSpan
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSpan
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSpan
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSpan
- // Title specifies extra information about an element.
- Title(v string) HTMLSpan
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSpan
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSpan
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSpan
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSpan
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSpan
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSpan
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSpan
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSpan
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSpan
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSpan
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSpan
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSpan
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSpan
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSpan
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSpan
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSpan
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSpan
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSpan
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSpan
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSpan
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSpan
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSpan
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSpan
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSpan
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSpan
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSpan
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSpan
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSpan
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSpan
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSpan
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSpan
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSpan
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSpan
- }
- // Span returns an HTML element that defines a section in a document.
- func Span() HTMLSpan {
- e := &htmlSpan{
- htmlElement: htmlElement{
- tag: "span",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSpan struct {
- htmlElement
- }
- func (e *htmlSpan) Body(v ...UI) HTMLSpan {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSpan) Text(v any) HTMLSpan {
- return e.Body(Text(v))
- }
- func (e *htmlSpan) AccessKey(v string) HTMLSpan {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSpan) Aria(k string, v any) HTMLSpan {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSpan) Attr(n string, v any) HTMLSpan {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSpan) Class(v ...string) HTMLSpan {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSpan) ContentEditable(v bool) HTMLSpan {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSpan) DataSet(k string, v any) HTMLSpan {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSpan) Dir(v string) HTMLSpan {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSpan) Draggable(v bool) HTMLSpan {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSpan) Hidden(v bool) HTMLSpan {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSpan) ID(v string) HTMLSpan {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSpan) Lang(v string) HTMLSpan {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSpan) Role(v string) HTMLSpan {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSpan) Spellcheck(v bool) HTMLSpan {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSpan) Style(k, v string) HTMLSpan {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSpan) Styles(s map[string]string) HTMLSpan {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSpan) TabIndex(v int) HTMLSpan {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSpan) Title(v string) HTMLSpan {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSpan) On(event string, h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSpan) OnBlur(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSpan) OnChange(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSpan) OnClick(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSpan) OnContextMenu(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSpan) OnCopy(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSpan) OnCut(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDblClick(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDrag(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDragEnd(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDragEnter(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDragLeave(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDragOver(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDragStart(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSpan) OnDrop(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSpan) OnFocus(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSpan) OnInput(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSpan) OnInvalid(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSpan) OnKeyDown(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSpan) OnKeyPress(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSpan) OnKeyUp(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSpan) OnMouseDown(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSpan) OnMouseMove(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSpan) OnMouseOut(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSpan) OnMouseOver(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSpan) OnMouseUp(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSpan) OnPaste(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSpan) OnReset(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSpan) OnScroll(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSpan) OnSearch(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSpan) OnSelect(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSpan) OnSubmit(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSpan) OnWheel(h EventHandler, scope ...any) HTMLSpan {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLStrong is the interface that describes a "strong" HTML element.
- type HTMLStrong interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLStrong
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLStrong
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLStrong
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLStrong
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLStrong
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLStrong
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLStrong
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLStrong
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLStrong
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLStrong
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLStrong
- // ID specifies a unique id for an element.
- ID(v string) HTMLStrong
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLStrong
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLStrong
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLStrong
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLStrong
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLStrong
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLStrong
- // Title specifies extra information about an element.
- Title(v string) HTMLStrong
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLStrong
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLStrong
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLStrong
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLStrong
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLStrong
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLStrong
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLStrong
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLStrong
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLStrong
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLStrong
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLStrong
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLStrong
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLStrong
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLStrong
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLStrong
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLStrong
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLStrong
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLStrong
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLStrong
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLStrong
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLStrong
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLStrong
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLStrong
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLStrong
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLStrong
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLStrong
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLStrong
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLStrong
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLStrong
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLStrong
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLStrong
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLStrong
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLStrong
- }
- // Strong returns an HTML element that defines important text.
- func Strong() HTMLStrong {
- e := &htmlStrong{
- htmlElement: htmlElement{
- tag: "strong",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlStrong struct {
- htmlElement
- }
- func (e *htmlStrong) Body(v ...UI) HTMLStrong {
- e.setChildren(v...)
- return e
- }
- func (e *htmlStrong) Text(v any) HTMLStrong {
- return e.Body(Text(v))
- }
- func (e *htmlStrong) AccessKey(v string) HTMLStrong {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlStrong) Aria(k string, v any) HTMLStrong {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlStrong) Attr(n string, v any) HTMLStrong {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlStrong) Class(v ...string) HTMLStrong {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlStrong) ContentEditable(v bool) HTMLStrong {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlStrong) DataSet(k string, v any) HTMLStrong {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlStrong) Dir(v string) HTMLStrong {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlStrong) Draggable(v bool) HTMLStrong {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlStrong) Hidden(v bool) HTMLStrong {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlStrong) ID(v string) HTMLStrong {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlStrong) Lang(v string) HTMLStrong {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlStrong) Role(v string) HTMLStrong {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlStrong) Spellcheck(v bool) HTMLStrong {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlStrong) Style(k, v string) HTMLStrong {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlStrong) Styles(s map[string]string) HTMLStrong {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlStrong) TabIndex(v int) HTMLStrong {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlStrong) Title(v string) HTMLStrong {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlStrong) On(event string, h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlStrong) OnBlur(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlStrong) OnChange(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlStrong) OnClick(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlStrong) OnContextMenu(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlStrong) OnCopy(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlStrong) OnCut(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDblClick(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDrag(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDragEnd(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDragEnter(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDragLeave(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDragOver(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDragStart(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlStrong) OnDrop(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlStrong) OnFocus(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlStrong) OnInput(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlStrong) OnInvalid(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlStrong) OnKeyDown(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlStrong) OnKeyPress(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlStrong) OnKeyUp(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlStrong) OnMouseDown(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlStrong) OnMouseMove(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlStrong) OnMouseOut(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlStrong) OnMouseOver(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlStrong) OnMouseUp(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlStrong) OnPaste(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlStrong) OnReset(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlStrong) OnScroll(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlStrong) OnSearch(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlStrong) OnSelect(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlStrong) OnSubmit(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlStrong) OnWheel(h EventHandler, scope ...any) HTMLStrong {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLStyle is the interface that describes a "style" HTML element.
- type HTMLStyle interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLStyle
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLStyle
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLStyle
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLStyle
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLStyle
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLStyle
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLStyle
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLStyle
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLStyle
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLStyle
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLStyle
- // ID specifies a unique id for an element.
- ID(v string) HTMLStyle
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLStyle
- // Media specifies what media/device the linked document is optimized for.
- Media(v string) HTMLStyle
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLStyle
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLStyle
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLStyle
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLStyle
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLStyle
- // Title specifies extra information about an element.
- Title(v string) HTMLStyle
- // Type specifies the type of element.
- Type(v string) HTMLStyle
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLStyle
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLStyle
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLStyle
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLStyle
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLStyle
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLStyle
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLStyle
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLStyle
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLStyle
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLStyle
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLStyle
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLStyle
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLStyle
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLStyle
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLStyle
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLStyle
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLStyle
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLStyle
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLStyle
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLStyle
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLStyle
- // OnLoad calls the given handler after the element is finished loading.
- OnLoad(h EventHandler, scope ...any) HTMLStyle
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLStyle
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLStyle
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLStyle
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLStyle
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLStyle
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLStyle
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLStyle
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLStyle
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLStyle
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLStyle
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLStyle
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLStyle
- }
- // Style returns an HTML element that defines style information for a document.
- func Style() HTMLStyle {
- e := &htmlStyle{
- htmlElement: htmlElement{
- tag: "style",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlStyle struct {
- htmlElement
- }
- func (e *htmlStyle) Body(v ...UI) HTMLStyle {
- e.setChildren(v...)
- return e
- }
- func (e *htmlStyle) Text(v any) HTMLStyle {
- return e.Body(Text(v))
- }
- func (e *htmlStyle) AccessKey(v string) HTMLStyle {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlStyle) Aria(k string, v any) HTMLStyle {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlStyle) Attr(n string, v any) HTMLStyle {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlStyle) Class(v ...string) HTMLStyle {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlStyle) ContentEditable(v bool) HTMLStyle {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlStyle) DataSet(k string, v any) HTMLStyle {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlStyle) Dir(v string) HTMLStyle {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlStyle) Draggable(v bool) HTMLStyle {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlStyle) Hidden(v bool) HTMLStyle {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlStyle) ID(v string) HTMLStyle {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlStyle) Lang(v string) HTMLStyle {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlStyle) Media(v string) HTMLStyle {
- e.setAttr("media", v)
- return e
- }
- func (e *htmlStyle) Role(v string) HTMLStyle {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlStyle) Spellcheck(v bool) HTMLStyle {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlStyle) Style(k, v string) HTMLStyle {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlStyle) Styles(s map[string]string) HTMLStyle {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlStyle) TabIndex(v int) HTMLStyle {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlStyle) Title(v string) HTMLStyle {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlStyle) Type(v string) HTMLStyle {
- e.setAttr("type", v)
- return e
- }
- func (e *htmlStyle) On(event string, h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlStyle) OnBlur(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlStyle) OnChange(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlStyle) OnClick(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlStyle) OnContextMenu(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlStyle) OnCopy(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlStyle) OnCut(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDblClick(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDrag(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDragEnd(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDragEnter(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDragLeave(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDragOver(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDragStart(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlStyle) OnDrop(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlStyle) OnFocus(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlStyle) OnInput(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlStyle) OnInvalid(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlStyle) OnKeyDown(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlStyle) OnKeyPress(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlStyle) OnKeyUp(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlStyle) OnLoad(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("load", h, scope...)
- return e
- }
- func (e *htmlStyle) OnMouseDown(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlStyle) OnMouseMove(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlStyle) OnMouseOut(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlStyle) OnMouseOver(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlStyle) OnMouseUp(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlStyle) OnPaste(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlStyle) OnReset(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlStyle) OnScroll(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlStyle) OnSearch(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlStyle) OnSelect(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlStyle) OnSubmit(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlStyle) OnWheel(h EventHandler, scope ...any) HTMLStyle {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSub is the interface that describes a "sub" HTML element.
- type HTMLSub interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSub
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSub
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSub
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSub
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSub
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSub
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSub
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSub
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSub
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSub
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSub
- // ID specifies a unique id for an element.
- ID(v string) HTMLSub
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSub
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSub
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSub
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSub
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSub
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSub
- // Title specifies extra information about an element.
- Title(v string) HTMLSub
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSub
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSub
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSub
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSub
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSub
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSub
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSub
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSub
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSub
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSub
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSub
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSub
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSub
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSub
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSub
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSub
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSub
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSub
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSub
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSub
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSub
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSub
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSub
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSub
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSub
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSub
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSub
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSub
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSub
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSub
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSub
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSub
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSub
- }
- // Sub returns an HTML element that defines subscripted text.
- func Sub() HTMLSub {
- e := &htmlSub{
- htmlElement: htmlElement{
- tag: "sub",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSub struct {
- htmlElement
- }
- func (e *htmlSub) Body(v ...UI) HTMLSub {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSub) Text(v any) HTMLSub {
- return e.Body(Text(v))
- }
- func (e *htmlSub) AccessKey(v string) HTMLSub {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSub) Aria(k string, v any) HTMLSub {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSub) Attr(n string, v any) HTMLSub {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSub) Class(v ...string) HTMLSub {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSub) ContentEditable(v bool) HTMLSub {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSub) DataSet(k string, v any) HTMLSub {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSub) Dir(v string) HTMLSub {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSub) Draggable(v bool) HTMLSub {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSub) Hidden(v bool) HTMLSub {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSub) ID(v string) HTMLSub {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSub) Lang(v string) HTMLSub {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSub) Role(v string) HTMLSub {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSub) Spellcheck(v bool) HTMLSub {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSub) Style(k, v string) HTMLSub {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSub) Styles(s map[string]string) HTMLSub {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSub) TabIndex(v int) HTMLSub {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSub) Title(v string) HTMLSub {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSub) On(event string, h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSub) OnBlur(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSub) OnChange(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSub) OnClick(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSub) OnContextMenu(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSub) OnCopy(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSub) OnCut(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSub) OnDblClick(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSub) OnDrag(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSub) OnDragEnd(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSub) OnDragEnter(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSub) OnDragLeave(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSub) OnDragOver(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSub) OnDragStart(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSub) OnDrop(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSub) OnFocus(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSub) OnInput(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSub) OnInvalid(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSub) OnKeyDown(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSub) OnKeyPress(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSub) OnKeyUp(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSub) OnMouseDown(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSub) OnMouseMove(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSub) OnMouseOut(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSub) OnMouseOver(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSub) OnMouseUp(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSub) OnPaste(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSub) OnReset(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSub) OnScroll(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSub) OnSearch(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSub) OnSelect(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSub) OnSubmit(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSub) OnWheel(h EventHandler, scope ...any) HTMLSub {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSummary is the interface that describes a "summary" HTML element.
- type HTMLSummary interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSummary
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSummary
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSummary
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSummary
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSummary
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSummary
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSummary
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSummary
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSummary
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSummary
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSummary
- // ID specifies a unique id for an element.
- ID(v string) HTMLSummary
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSummary
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSummary
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSummary
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSummary
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSummary
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSummary
- // Title specifies extra information about an element.
- Title(v string) HTMLSummary
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSummary
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSummary
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSummary
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSummary
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSummary
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSummary
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSummary
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSummary
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSummary
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSummary
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSummary
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSummary
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSummary
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSummary
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSummary
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSummary
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSummary
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSummary
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSummary
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSummary
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSummary
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSummary
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSummary
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSummary
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSummary
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSummary
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSummary
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSummary
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSummary
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSummary
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSummary
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSummary
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSummary
- }
- // Summary returns an HTML element that defines a visible heading for a details element.
- func Summary() HTMLSummary {
- e := &htmlSummary{
- htmlElement: htmlElement{
- tag: "summary",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSummary struct {
- htmlElement
- }
- func (e *htmlSummary) Body(v ...UI) HTMLSummary {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSummary) Text(v any) HTMLSummary {
- return e.Body(Text(v))
- }
- func (e *htmlSummary) AccessKey(v string) HTMLSummary {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSummary) Aria(k string, v any) HTMLSummary {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSummary) Attr(n string, v any) HTMLSummary {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSummary) Class(v ...string) HTMLSummary {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSummary) ContentEditable(v bool) HTMLSummary {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSummary) DataSet(k string, v any) HTMLSummary {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSummary) Dir(v string) HTMLSummary {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSummary) Draggable(v bool) HTMLSummary {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSummary) Hidden(v bool) HTMLSummary {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSummary) ID(v string) HTMLSummary {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSummary) Lang(v string) HTMLSummary {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSummary) Role(v string) HTMLSummary {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSummary) Spellcheck(v bool) HTMLSummary {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSummary) Style(k, v string) HTMLSummary {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSummary) Styles(s map[string]string) HTMLSummary {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSummary) TabIndex(v int) HTMLSummary {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSummary) Title(v string) HTMLSummary {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSummary) On(event string, h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSummary) OnBlur(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSummary) OnChange(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSummary) OnClick(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSummary) OnContextMenu(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSummary) OnCopy(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSummary) OnCut(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDblClick(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDrag(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDragEnd(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDragEnter(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDragLeave(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDragOver(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDragStart(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSummary) OnDrop(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSummary) OnFocus(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSummary) OnInput(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSummary) OnInvalid(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSummary) OnKeyDown(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSummary) OnKeyPress(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSummary) OnKeyUp(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSummary) OnMouseDown(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSummary) OnMouseMove(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSummary) OnMouseOut(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSummary) OnMouseOver(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSummary) OnMouseUp(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSummary) OnPaste(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSummary) OnReset(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSummary) OnScroll(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSummary) OnSearch(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSummary) OnSelect(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSummary) OnSubmit(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSummary) OnWheel(h EventHandler, scope ...any) HTMLSummary {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLSup is the interface that describes a "sup" HTML element.
- type HTMLSup interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLSup
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLSup
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLSup
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLSup
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLSup
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLSup
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLSup
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLSup
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLSup
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLSup
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLSup
- // ID specifies a unique id for an element.
- ID(v string) HTMLSup
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLSup
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLSup
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLSup
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLSup
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLSup
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLSup
- // Title specifies extra information about an element.
- Title(v string) HTMLSup
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLSup
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLSup
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLSup
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLSup
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLSup
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLSup
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLSup
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLSup
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLSup
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLSup
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLSup
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLSup
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLSup
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLSup
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLSup
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLSup
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLSup
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLSup
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLSup
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLSup
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLSup
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLSup
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLSup
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLSup
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLSup
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLSup
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLSup
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLSup
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLSup
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLSup
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLSup
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLSup
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLSup
- }
- // Sup returns an HTML element that defines superscripted text.
- func Sup() HTMLSup {
- e := &htmlSup{
- htmlElement: htmlElement{
- tag: "sup",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlSup struct {
- htmlElement
- }
- func (e *htmlSup) Body(v ...UI) HTMLSup {
- e.setChildren(v...)
- return e
- }
- func (e *htmlSup) Text(v any) HTMLSup {
- return e.Body(Text(v))
- }
- func (e *htmlSup) AccessKey(v string) HTMLSup {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlSup) Aria(k string, v any) HTMLSup {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSup) Attr(n string, v any) HTMLSup {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlSup) Class(v ...string) HTMLSup {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlSup) ContentEditable(v bool) HTMLSup {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlSup) DataSet(k string, v any) HTMLSup {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlSup) Dir(v string) HTMLSup {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlSup) Draggable(v bool) HTMLSup {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlSup) Hidden(v bool) HTMLSup {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlSup) ID(v string) HTMLSup {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlSup) Lang(v string) HTMLSup {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlSup) Role(v string) HTMLSup {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlSup) Spellcheck(v bool) HTMLSup {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlSup) Style(k, v string) HTMLSup {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlSup) Styles(s map[string]string) HTMLSup {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlSup) TabIndex(v int) HTMLSup {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlSup) Title(v string) HTMLSup {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlSup) On(event string, h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlSup) OnBlur(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlSup) OnChange(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlSup) OnClick(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlSup) OnContextMenu(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlSup) OnCopy(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlSup) OnCut(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlSup) OnDblClick(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlSup) OnDrag(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlSup) OnDragEnd(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlSup) OnDragEnter(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlSup) OnDragLeave(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlSup) OnDragOver(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlSup) OnDragStart(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlSup) OnDrop(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlSup) OnFocus(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlSup) OnInput(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlSup) OnInvalid(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlSup) OnKeyDown(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlSup) OnKeyPress(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlSup) OnKeyUp(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlSup) OnMouseDown(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlSup) OnMouseMove(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlSup) OnMouseOut(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlSup) OnMouseOver(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlSup) OnMouseUp(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlSup) OnPaste(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlSup) OnReset(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlSup) OnScroll(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlSup) OnSearch(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlSup) OnSelect(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlSup) OnSubmit(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlSup) OnWheel(h EventHandler, scope ...any) HTMLSup {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTable is the interface that describes a "table" HTML element.
- type HTMLTable interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTable
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTable
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTable
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTable
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTable
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTable
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTable
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTable
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTable
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTable
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTable
- // ID specifies a unique id for an element.
- ID(v string) HTMLTable
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTable
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTable
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTable
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTable
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTable
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTable
- // Title specifies extra information about an element.
- Title(v string) HTMLTable
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTable
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTable
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTable
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTable
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTable
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTable
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTable
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTable
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTable
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTable
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTable
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTable
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTable
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTable
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTable
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTable
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTable
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTable
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTable
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTable
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTable
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTable
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTable
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTable
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTable
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTable
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTable
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTable
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTable
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTable
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTable
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTable
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTable
- }
- // Table returns an HTML element that defines a table.
- func Table() HTMLTable {
- e := &htmlTable{
- htmlElement: htmlElement{
- tag: "table",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTable struct {
- htmlElement
- }
- func (e *htmlTable) Body(v ...UI) HTMLTable {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTable) Text(v any) HTMLTable {
- return e.Body(Text(v))
- }
- func (e *htmlTable) AccessKey(v string) HTMLTable {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTable) Aria(k string, v any) HTMLTable {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTable) Attr(n string, v any) HTMLTable {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTable) Class(v ...string) HTMLTable {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTable) ContentEditable(v bool) HTMLTable {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTable) DataSet(k string, v any) HTMLTable {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTable) Dir(v string) HTMLTable {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTable) Draggable(v bool) HTMLTable {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTable) Hidden(v bool) HTMLTable {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTable) ID(v string) HTMLTable {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTable) Lang(v string) HTMLTable {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTable) Role(v string) HTMLTable {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTable) Spellcheck(v bool) HTMLTable {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTable) Style(k, v string) HTMLTable {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTable) Styles(s map[string]string) HTMLTable {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTable) TabIndex(v int) HTMLTable {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTable) Title(v string) HTMLTable {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTable) On(event string, h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTable) OnBlur(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTable) OnChange(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTable) OnClick(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTable) OnContextMenu(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTable) OnCopy(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTable) OnCut(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTable) OnDblClick(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTable) OnDrag(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTable) OnDragEnd(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTable) OnDragEnter(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTable) OnDragLeave(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTable) OnDragOver(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTable) OnDragStart(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTable) OnDrop(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTable) OnFocus(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTable) OnInput(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTable) OnInvalid(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTable) OnKeyDown(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTable) OnKeyPress(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTable) OnKeyUp(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTable) OnMouseDown(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTable) OnMouseMove(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTable) OnMouseOut(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTable) OnMouseOver(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTable) OnMouseUp(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTable) OnPaste(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTable) OnReset(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTable) OnScroll(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTable) OnSearch(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTable) OnSelect(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTable) OnSubmit(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTable) OnWheel(h EventHandler, scope ...any) HTMLTable {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTBody is the interface that describes a "tbody" HTML element.
- type HTMLTBody interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTBody
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTBody
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTBody
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTBody
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTBody
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTBody
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTBody
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTBody
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTBody
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTBody
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTBody
- // ID specifies a unique id for an element.
- ID(v string) HTMLTBody
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTBody
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTBody
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTBody
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTBody
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTBody
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTBody
- // Title specifies extra information about an element.
- Title(v string) HTMLTBody
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTBody
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTBody
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTBody
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTBody
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTBody
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTBody
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTBody
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTBody
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTBody
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTBody
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTBody
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTBody
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTBody
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTBody
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTBody
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTBody
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTBody
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTBody
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTBody
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTBody
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTBody
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTBody
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTBody
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTBody
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTBody
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTBody
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTBody
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTBody
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTBody
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTBody
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTBody
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTBody
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTBody
- }
- // TBody returns an HTML element that groups the body content in a table.
- func TBody() HTMLTBody {
- e := &htmlTBody{
- htmlElement: htmlElement{
- tag: "tbody",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTBody struct {
- htmlElement
- }
- func (e *htmlTBody) Body(v ...UI) HTMLTBody {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTBody) Text(v any) HTMLTBody {
- return e.Body(Text(v))
- }
- func (e *htmlTBody) AccessKey(v string) HTMLTBody {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTBody) Aria(k string, v any) HTMLTBody {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTBody) Attr(n string, v any) HTMLTBody {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTBody) Class(v ...string) HTMLTBody {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTBody) ContentEditable(v bool) HTMLTBody {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTBody) DataSet(k string, v any) HTMLTBody {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTBody) Dir(v string) HTMLTBody {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTBody) Draggable(v bool) HTMLTBody {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTBody) Hidden(v bool) HTMLTBody {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTBody) ID(v string) HTMLTBody {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTBody) Lang(v string) HTMLTBody {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTBody) Role(v string) HTMLTBody {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTBody) Spellcheck(v bool) HTMLTBody {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTBody) Style(k, v string) HTMLTBody {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTBody) Styles(s map[string]string) HTMLTBody {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTBody) TabIndex(v int) HTMLTBody {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTBody) Title(v string) HTMLTBody {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTBody) On(event string, h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTBody) OnBlur(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTBody) OnChange(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTBody) OnClick(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTBody) OnContextMenu(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTBody) OnCopy(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTBody) OnCut(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDblClick(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDrag(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDragEnd(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDragEnter(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDragLeave(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDragOver(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDragStart(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTBody) OnDrop(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTBody) OnFocus(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTBody) OnInput(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTBody) OnInvalid(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTBody) OnKeyDown(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTBody) OnKeyPress(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTBody) OnKeyUp(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTBody) OnMouseDown(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTBody) OnMouseMove(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTBody) OnMouseOut(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTBody) OnMouseOver(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTBody) OnMouseUp(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTBody) OnPaste(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTBody) OnReset(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTBody) OnScroll(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTBody) OnSearch(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTBody) OnSelect(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTBody) OnSubmit(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTBody) OnWheel(h EventHandler, scope ...any) HTMLTBody {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTd is the interface that describes a "td" HTML element.
- type HTMLTd interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTd
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTd
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTd
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTd
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTd
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTd
- // ColSpan specifies the number of columns a table cell should span.
- ColSpan(v int) HTMLTd
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTd
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTd
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTd
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTd
- // Headers specifies one or more headers cells a cell is related to.
- Headers(v string) HTMLTd
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTd
- // ID specifies a unique id for an element.
- ID(v string) HTMLTd
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTd
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTd
- // Rowspan specifies the number of rows a table cell should span.
- Rowspan(v int) HTMLTd
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTd
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTd
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTd
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTd
- // Title specifies extra information about an element.
- Title(v string) HTMLTd
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTd
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTd
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTd
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTd
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTd
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTd
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTd
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTd
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTd
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTd
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTd
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTd
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTd
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTd
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTd
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTd
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTd
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTd
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTd
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTd
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTd
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTd
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTd
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTd
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTd
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTd
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTd
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTd
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTd
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTd
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTd
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTd
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTd
- }
- // Td returns an HTML element that defines a cell in a table.
- func Td() HTMLTd {
- e := &htmlTd{
- htmlElement: htmlElement{
- tag: "td",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTd struct {
- htmlElement
- }
- func (e *htmlTd) Body(v ...UI) HTMLTd {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTd) Text(v any) HTMLTd {
- return e.Body(Text(v))
- }
- func (e *htmlTd) AccessKey(v string) HTMLTd {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTd) Aria(k string, v any) HTMLTd {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTd) Attr(n string, v any) HTMLTd {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTd) Class(v ...string) HTMLTd {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTd) ColSpan(v int) HTMLTd {
- e.setAttr("colspan", v)
- return e
- }
- func (e *htmlTd) ContentEditable(v bool) HTMLTd {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTd) DataSet(k string, v any) HTMLTd {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTd) Dir(v string) HTMLTd {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTd) Draggable(v bool) HTMLTd {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTd) Headers(v string) HTMLTd {
- e.setAttr("headers", v)
- return e
- }
- func (e *htmlTd) Hidden(v bool) HTMLTd {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTd) ID(v string) HTMLTd {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTd) Lang(v string) HTMLTd {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTd) Role(v string) HTMLTd {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTd) Rowspan(v int) HTMLTd {
- e.setAttr("rowspan", v)
- return e
- }
- func (e *htmlTd) Spellcheck(v bool) HTMLTd {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTd) Style(k, v string) HTMLTd {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTd) Styles(s map[string]string) HTMLTd {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTd) TabIndex(v int) HTMLTd {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTd) Title(v string) HTMLTd {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTd) On(event string, h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTd) OnBlur(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTd) OnChange(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTd) OnClick(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTd) OnContextMenu(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTd) OnCopy(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTd) OnCut(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTd) OnDblClick(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTd) OnDrag(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTd) OnDragEnd(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTd) OnDragEnter(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTd) OnDragLeave(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTd) OnDragOver(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTd) OnDragStart(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTd) OnDrop(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTd) OnFocus(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTd) OnInput(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTd) OnInvalid(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTd) OnKeyDown(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTd) OnKeyPress(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTd) OnKeyUp(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTd) OnMouseDown(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTd) OnMouseMove(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTd) OnMouseOut(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTd) OnMouseOver(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTd) OnMouseUp(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTd) OnPaste(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTd) OnReset(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTd) OnScroll(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTd) OnSearch(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTd) OnSelect(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTd) OnSubmit(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTd) OnWheel(h EventHandler, scope ...any) HTMLTd {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTemplate is the interface that describes a "template" HTML element.
- type HTMLTemplate interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTemplate
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTemplate
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTemplate
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTemplate
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTemplate
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTemplate
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTemplate
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTemplate
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTemplate
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTemplate
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTemplate
- // ID specifies a unique id for an element.
- ID(v string) HTMLTemplate
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTemplate
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTemplate
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTemplate
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTemplate
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTemplate
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTemplate
- // Title specifies extra information about an element.
- Title(v string) HTMLTemplate
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTemplate
- }
- // Template returns an HTML element that defines a template.
- func Template() HTMLTemplate {
- e := &htmlTemplate{
- htmlElement: htmlElement{
- tag: "template",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTemplate struct {
- htmlElement
- }
- func (e *htmlTemplate) Body(v ...UI) HTMLTemplate {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTemplate) Text(v any) HTMLTemplate {
- return e.Body(Text(v))
- }
- func (e *htmlTemplate) AccessKey(v string) HTMLTemplate {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTemplate) Aria(k string, v any) HTMLTemplate {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTemplate) Attr(n string, v any) HTMLTemplate {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTemplate) Class(v ...string) HTMLTemplate {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTemplate) ContentEditable(v bool) HTMLTemplate {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTemplate) DataSet(k string, v any) HTMLTemplate {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTemplate) Dir(v string) HTMLTemplate {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTemplate) Draggable(v bool) HTMLTemplate {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTemplate) Hidden(v bool) HTMLTemplate {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTemplate) ID(v string) HTMLTemplate {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTemplate) Lang(v string) HTMLTemplate {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTemplate) Role(v string) HTMLTemplate {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTemplate) Spellcheck(v bool) HTMLTemplate {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTemplate) Style(k, v string) HTMLTemplate {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTemplate) Styles(s map[string]string) HTMLTemplate {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTemplate) TabIndex(v int) HTMLTemplate {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTemplate) Title(v string) HTMLTemplate {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTemplate) On(event string, h EventHandler, scope ...any) HTMLTemplate {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLTextarea is the interface that describes a "textarea" HTML element.
- type HTMLTextarea interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTextarea
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTextarea
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTextarea
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTextarea
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTextarea
- // AutoFocus specifies that the element should automatically get focus when the page loads.
- AutoFocus(v bool) HTMLTextarea
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTextarea
- // Cols specifies the visible width of a text area.
- Cols(v int) HTMLTextarea
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTextarea
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTextarea
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTextarea
- // DirName specifies that the text direction will be submitted.
- DirName(v string) HTMLTextarea
- // Disabled specifies that the specified element/group of elements should be disabled.
- Disabled(v bool) HTMLTextarea
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTextarea
- // Form specifies the name of the form the element belongs to.
- Form(v string) HTMLTextarea
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTextarea
- // ID specifies a unique id for an element.
- ID(v string) HTMLTextarea
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTextarea
- // MaxLength specifies the maximum number of characters allowed in an element.
- MaxLength(v int) HTMLTextarea
- // Name specifies the name of the element.
- Name(v string) HTMLTextarea
- // Placeholder specifies a short hint that describes the expected value of the element.
- Placeholder(v string) HTMLTextarea
- // ReadOnly specifies that the element is read-only.
- ReadOnly(v bool) HTMLTextarea
- // Required specifies that the element must be filled out before submitting the form.
- Required(v bool) HTMLTextarea
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTextarea
- // Rows specifies the visible number of lines in a text area.
- Rows(v int) HTMLTextarea
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTextarea
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTextarea
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTextarea
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTextarea
- // Title specifies extra information about an element.
- Title(v string) HTMLTextarea
- // Wrap specifies how the text in a text area is to be wrapped when submitted in a form.
- Wrap(v string) HTMLTextarea
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTextarea
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTextarea
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTextarea
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTextarea
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTextarea
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTextarea
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTextarea
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTextarea
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTextarea
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTextarea
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTextarea
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTextarea
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTextarea
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTextarea
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTextarea
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTextarea
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTextarea
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTextarea
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTextarea
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTextarea
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTextarea
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTextarea
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTextarea
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTextarea
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTextarea
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTextarea
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTextarea
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTextarea
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTextarea
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTextarea
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTextarea
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTextarea
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTextarea
- }
- // Textarea returns an HTML element that defines a multiline input control (text area).
- func Textarea() HTMLTextarea {
- e := &htmlTextarea{
- htmlElement: htmlElement{
- tag: "textarea",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTextarea struct {
- htmlElement
- }
- func (e *htmlTextarea) Body(v ...UI) HTMLTextarea {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTextarea) Text(v any) HTMLTextarea {
- e.setAttr("value", v)
- return e
- }
- func (e *htmlTextarea) AccessKey(v string) HTMLTextarea {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTextarea) Aria(k string, v any) HTMLTextarea {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTextarea) Attr(n string, v any) HTMLTextarea {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTextarea) AutoFocus(v bool) HTMLTextarea {
- e.setAttr("autofocus", v)
- return e
- }
- func (e *htmlTextarea) Class(v ...string) HTMLTextarea {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTextarea) Cols(v int) HTMLTextarea {
- e.setAttr("cols", v)
- return e
- }
- func (e *htmlTextarea) ContentEditable(v bool) HTMLTextarea {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTextarea) DataSet(k string, v any) HTMLTextarea {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTextarea) Dir(v string) HTMLTextarea {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTextarea) DirName(v string) HTMLTextarea {
- e.setAttr("dirname", v)
- return e
- }
- func (e *htmlTextarea) Disabled(v bool) HTMLTextarea {
- e.setAttr("disabled", v)
- return e
- }
- func (e *htmlTextarea) Draggable(v bool) HTMLTextarea {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTextarea) Form(v string) HTMLTextarea {
- e.setAttr("form", v)
- return e
- }
- func (e *htmlTextarea) Hidden(v bool) HTMLTextarea {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTextarea) ID(v string) HTMLTextarea {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTextarea) Lang(v string) HTMLTextarea {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTextarea) MaxLength(v int) HTMLTextarea {
- e.setAttr("maxlength", v)
- return e
- }
- func (e *htmlTextarea) Name(v string) HTMLTextarea {
- e.setAttr("name", v)
- return e
- }
- func (e *htmlTextarea) Placeholder(v string) HTMLTextarea {
- e.setAttr("placeholder", v)
- return e
- }
- func (e *htmlTextarea) ReadOnly(v bool) HTMLTextarea {
- e.setAttr("readonly", v)
- return e
- }
- func (e *htmlTextarea) Required(v bool) HTMLTextarea {
- e.setAttr("required", v)
- return e
- }
- func (e *htmlTextarea) Role(v string) HTMLTextarea {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTextarea) Rows(v int) HTMLTextarea {
- e.setAttr("rows", v)
- return e
- }
- func (e *htmlTextarea) Spellcheck(v bool) HTMLTextarea {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTextarea) Style(k, v string) HTMLTextarea {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTextarea) Styles(s map[string]string) HTMLTextarea {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTextarea) TabIndex(v int) HTMLTextarea {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTextarea) Title(v string) HTMLTextarea {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTextarea) Wrap(v string) HTMLTextarea {
- e.setAttr("wrap", v)
- return e
- }
- func (e *htmlTextarea) On(event string, h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTextarea) OnBlur(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnChange(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnClick(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnContextMenu(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnCopy(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnCut(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDblClick(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDrag(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDragEnd(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDragEnter(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDragLeave(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDragOver(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDragStart(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnDrop(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnFocus(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnInput(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnInvalid(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnKeyDown(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnKeyPress(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnKeyUp(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnMouseDown(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnMouseMove(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnMouseOut(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnMouseOver(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnMouseUp(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnPaste(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnReset(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnScroll(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnSearch(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnSelect(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnSubmit(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTextarea) OnWheel(h EventHandler, scope ...any) HTMLTextarea {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTFoot is the interface that describes a "tfoot" HTML element.
- type HTMLTFoot interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTFoot
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTFoot
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTFoot
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTFoot
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTFoot
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTFoot
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTFoot
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTFoot
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTFoot
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTFoot
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTFoot
- // ID specifies a unique id for an element.
- ID(v string) HTMLTFoot
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTFoot
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTFoot
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTFoot
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTFoot
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTFoot
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTFoot
- // Title specifies extra information about an element.
- Title(v string) HTMLTFoot
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTFoot
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTFoot
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTFoot
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTFoot
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTFoot
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTFoot
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTFoot
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTFoot
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTFoot
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTFoot
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTFoot
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTFoot
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTFoot
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTFoot
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTFoot
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTFoot
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTFoot
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTFoot
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTFoot
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTFoot
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTFoot
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTFoot
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTFoot
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTFoot
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTFoot
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTFoot
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTFoot
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTFoot
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTFoot
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTFoot
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTFoot
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTFoot
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTFoot
- }
- // TFoot returns an HTML element that groups the footer content in a table.
- func TFoot() HTMLTFoot {
- e := &htmlTFoot{
- htmlElement: htmlElement{
- tag: "tfoot",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTFoot struct {
- htmlElement
- }
- func (e *htmlTFoot) Body(v ...UI) HTMLTFoot {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTFoot) Text(v any) HTMLTFoot {
- return e.Body(Text(v))
- }
- func (e *htmlTFoot) AccessKey(v string) HTMLTFoot {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTFoot) Aria(k string, v any) HTMLTFoot {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTFoot) Attr(n string, v any) HTMLTFoot {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTFoot) Class(v ...string) HTMLTFoot {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTFoot) ContentEditable(v bool) HTMLTFoot {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTFoot) DataSet(k string, v any) HTMLTFoot {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTFoot) Dir(v string) HTMLTFoot {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTFoot) Draggable(v bool) HTMLTFoot {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTFoot) Hidden(v bool) HTMLTFoot {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTFoot) ID(v string) HTMLTFoot {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTFoot) Lang(v string) HTMLTFoot {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTFoot) Role(v string) HTMLTFoot {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTFoot) Spellcheck(v bool) HTMLTFoot {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTFoot) Style(k, v string) HTMLTFoot {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTFoot) Styles(s map[string]string) HTMLTFoot {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTFoot) TabIndex(v int) HTMLTFoot {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTFoot) Title(v string) HTMLTFoot {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTFoot) On(event string, h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTFoot) OnBlur(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnChange(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnClick(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnContextMenu(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnCopy(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnCut(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDblClick(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDrag(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDragEnd(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDragEnter(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDragLeave(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDragOver(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDragStart(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnDrop(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnFocus(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnInput(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnInvalid(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnKeyDown(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnKeyPress(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnKeyUp(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnMouseDown(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnMouseMove(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnMouseOut(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnMouseOver(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnMouseUp(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnPaste(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnReset(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnScroll(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnSearch(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnSelect(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnSubmit(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTFoot) OnWheel(h EventHandler, scope ...any) HTMLTFoot {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTh is the interface that describes a "th" HTML element.
- type HTMLTh interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTh
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTh
- // Abbr specifies an abbreviated version of the content in a header cell.
- Abbr(v string) HTMLTh
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTh
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTh
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTh
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTh
- // ColSpan specifies the number of columns a table cell should span.
- ColSpan(v int) HTMLTh
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTh
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTh
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTh
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTh
- // Headers specifies one or more headers cells a cell is related to.
- Headers(v string) HTMLTh
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTh
- // ID specifies a unique id for an element.
- ID(v string) HTMLTh
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTh
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTh
- // Rowspan specifies the number of rows a table cell should span.
- Rowspan(v int) HTMLTh
- // Scope specifies whether a header cell is a header for a column, row, or group of columns or rows.
- Scope(v string) HTMLTh
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTh
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTh
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTh
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTh
- // Title specifies extra information about an element.
- Title(v string) HTMLTh
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTh
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTh
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTh
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTh
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTh
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTh
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTh
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTh
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTh
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTh
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTh
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTh
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTh
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTh
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTh
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTh
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTh
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTh
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTh
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTh
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTh
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTh
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTh
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTh
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTh
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTh
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTh
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTh
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTh
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTh
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTh
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTh
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTh
- }
- // Th returns an HTML element that defines a header cell in a table.
- func Th() HTMLTh {
- e := &htmlTh{
- htmlElement: htmlElement{
- tag: "th",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTh struct {
- htmlElement
- }
- func (e *htmlTh) Body(v ...UI) HTMLTh {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTh) Text(v any) HTMLTh {
- return e.Body(Text(v))
- }
- func (e *htmlTh) Abbr(v string) HTMLTh {
- e.setAttr("abbr", v)
- return e
- }
- func (e *htmlTh) AccessKey(v string) HTMLTh {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTh) Aria(k string, v any) HTMLTh {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTh) Attr(n string, v any) HTMLTh {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTh) Class(v ...string) HTMLTh {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTh) ColSpan(v int) HTMLTh {
- e.setAttr("colspan", v)
- return e
- }
- func (e *htmlTh) ContentEditable(v bool) HTMLTh {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTh) DataSet(k string, v any) HTMLTh {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTh) Dir(v string) HTMLTh {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTh) Draggable(v bool) HTMLTh {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTh) Headers(v string) HTMLTh {
- e.setAttr("headers", v)
- return e
- }
- func (e *htmlTh) Hidden(v bool) HTMLTh {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTh) ID(v string) HTMLTh {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTh) Lang(v string) HTMLTh {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTh) Role(v string) HTMLTh {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTh) Rowspan(v int) HTMLTh {
- e.setAttr("rowspan", v)
- return e
- }
- func (e *htmlTh) Scope(v string) HTMLTh {
- e.setAttr("scope", v)
- return e
- }
- func (e *htmlTh) Spellcheck(v bool) HTMLTh {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTh) Style(k, v string) HTMLTh {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTh) Styles(s map[string]string) HTMLTh {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTh) TabIndex(v int) HTMLTh {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTh) Title(v string) HTMLTh {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTh) On(event string, h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTh) OnBlur(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTh) OnChange(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTh) OnClick(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTh) OnContextMenu(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTh) OnCopy(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTh) OnCut(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTh) OnDblClick(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTh) OnDrag(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTh) OnDragEnd(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTh) OnDragEnter(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTh) OnDragLeave(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTh) OnDragOver(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTh) OnDragStart(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTh) OnDrop(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTh) OnFocus(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTh) OnInput(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTh) OnInvalid(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTh) OnKeyDown(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTh) OnKeyPress(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTh) OnKeyUp(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTh) OnMouseDown(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTh) OnMouseMove(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTh) OnMouseOut(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTh) OnMouseOver(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTh) OnMouseUp(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTh) OnPaste(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTh) OnReset(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTh) OnScroll(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTh) OnSearch(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTh) OnSelect(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTh) OnSubmit(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTh) OnWheel(h EventHandler, scope ...any) HTMLTh {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTHead is the interface that describes a "thead" HTML element.
- type HTMLTHead interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTHead
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTHead
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTHead
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTHead
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTHead
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTHead
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTHead
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTHead
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTHead
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTHead
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTHead
- // ID specifies a unique id for an element.
- ID(v string) HTMLTHead
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTHead
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTHead
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTHead
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTHead
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTHead
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTHead
- // Title specifies extra information about an element.
- Title(v string) HTMLTHead
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTHead
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTHead
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTHead
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTHead
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTHead
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTHead
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTHead
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTHead
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTHead
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTHead
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTHead
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTHead
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTHead
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTHead
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTHead
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTHead
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTHead
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTHead
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTHead
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTHead
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTHead
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTHead
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTHead
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTHead
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTHead
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTHead
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTHead
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTHead
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTHead
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTHead
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTHead
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTHead
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTHead
- }
- // THead returns an HTML element that groups the header content in a table
- func THead() HTMLTHead {
- e := &htmlTHead{
- htmlElement: htmlElement{
- tag: "thead",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTHead struct {
- htmlElement
- }
- func (e *htmlTHead) Body(v ...UI) HTMLTHead {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTHead) Text(v any) HTMLTHead {
- return e.Body(Text(v))
- }
- func (e *htmlTHead) AccessKey(v string) HTMLTHead {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTHead) Aria(k string, v any) HTMLTHead {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTHead) Attr(n string, v any) HTMLTHead {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTHead) Class(v ...string) HTMLTHead {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTHead) ContentEditable(v bool) HTMLTHead {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTHead) DataSet(k string, v any) HTMLTHead {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTHead) Dir(v string) HTMLTHead {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTHead) Draggable(v bool) HTMLTHead {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTHead) Hidden(v bool) HTMLTHead {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTHead) ID(v string) HTMLTHead {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTHead) Lang(v string) HTMLTHead {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTHead) Role(v string) HTMLTHead {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTHead) Spellcheck(v bool) HTMLTHead {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTHead) Style(k, v string) HTMLTHead {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTHead) Styles(s map[string]string) HTMLTHead {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTHead) TabIndex(v int) HTMLTHead {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTHead) Title(v string) HTMLTHead {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTHead) On(event string, h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTHead) OnBlur(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTHead) OnChange(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTHead) OnClick(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTHead) OnContextMenu(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTHead) OnCopy(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTHead) OnCut(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDblClick(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDrag(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDragEnd(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDragEnter(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDragLeave(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDragOver(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDragStart(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTHead) OnDrop(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTHead) OnFocus(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTHead) OnInput(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTHead) OnInvalid(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTHead) OnKeyDown(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTHead) OnKeyPress(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTHead) OnKeyUp(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTHead) OnMouseDown(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTHead) OnMouseMove(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTHead) OnMouseOut(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTHead) OnMouseOver(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTHead) OnMouseUp(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTHead) OnPaste(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTHead) OnReset(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTHead) OnScroll(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTHead) OnSearch(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTHead) OnSelect(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTHead) OnSubmit(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTHead) OnWheel(h EventHandler, scope ...any) HTMLTHead {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTime is the interface that describes a "time" HTML element.
- type HTMLTime interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTime
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTime
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTime
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTime
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTime
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTime
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTime
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTime
- // DateTime specifies the date and time.
- DateTime(v string) HTMLTime
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTime
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTime
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTime
- // ID specifies a unique id for an element.
- ID(v string) HTMLTime
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTime
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTime
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTime
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTime
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTime
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTime
- // Title specifies extra information about an element.
- Title(v string) HTMLTime
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTime
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTime
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTime
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTime
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTime
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTime
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTime
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTime
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTime
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTime
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTime
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTime
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTime
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTime
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTime
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTime
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTime
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTime
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTime
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTime
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTime
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTime
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTime
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTime
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTime
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTime
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTime
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTime
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTime
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTime
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTime
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTime
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTime
- }
- // Time returns an HTML element that defines a date/time.
- func Time() HTMLTime {
- e := &htmlTime{
- htmlElement: htmlElement{
- tag: "time",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTime struct {
- htmlElement
- }
- func (e *htmlTime) Body(v ...UI) HTMLTime {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTime) Text(v any) HTMLTime {
- return e.Body(Text(v))
- }
- func (e *htmlTime) AccessKey(v string) HTMLTime {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTime) Aria(k string, v any) HTMLTime {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTime) Attr(n string, v any) HTMLTime {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTime) Class(v ...string) HTMLTime {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTime) ContentEditable(v bool) HTMLTime {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTime) DataSet(k string, v any) HTMLTime {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTime) DateTime(v string) HTMLTime {
- e.setAttr("datetime", v)
- return e
- }
- func (e *htmlTime) Dir(v string) HTMLTime {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTime) Draggable(v bool) HTMLTime {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTime) Hidden(v bool) HTMLTime {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTime) ID(v string) HTMLTime {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTime) Lang(v string) HTMLTime {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTime) Role(v string) HTMLTime {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTime) Spellcheck(v bool) HTMLTime {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTime) Style(k, v string) HTMLTime {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTime) Styles(s map[string]string) HTMLTime {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTime) TabIndex(v int) HTMLTime {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTime) Title(v string) HTMLTime {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTime) On(event string, h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTime) OnBlur(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTime) OnChange(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTime) OnClick(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTime) OnContextMenu(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTime) OnCopy(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTime) OnCut(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTime) OnDblClick(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTime) OnDrag(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTime) OnDragEnd(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTime) OnDragEnter(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTime) OnDragLeave(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTime) OnDragOver(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTime) OnDragStart(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTime) OnDrop(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTime) OnFocus(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTime) OnInput(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTime) OnInvalid(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTime) OnKeyDown(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTime) OnKeyPress(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTime) OnKeyUp(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTime) OnMouseDown(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTime) OnMouseMove(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTime) OnMouseOut(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTime) OnMouseOver(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTime) OnMouseUp(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTime) OnPaste(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTime) OnReset(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTime) OnScroll(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTime) OnSearch(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTime) OnSelect(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTime) OnSubmit(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTime) OnWheel(h EventHandler, scope ...any) HTMLTime {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLTitle is the interface that describes a "title" HTML element.
- type HTMLTitle interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTitle
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTitle
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTitle
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTitle
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTitle
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTitle
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTitle
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTitle
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTitle
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTitle
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTitle
- // ID specifies a unique id for an element.
- ID(v string) HTMLTitle
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTitle
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTitle
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTitle
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTitle
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTitle
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTitle
- // Title specifies extra information about an element.
- Title(v string) HTMLTitle
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTitle
- }
- // Title returns an HTML element that defines a title for the document.
- func Title() HTMLTitle {
- e := &htmlTitle{
- htmlElement: htmlElement{
- tag: "title",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTitle struct {
- htmlElement
- }
- func (e *htmlTitle) Body(v ...UI) HTMLTitle {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTitle) Text(v any) HTMLTitle {
- return e.Body(Text(v))
- }
- func (e *htmlTitle) AccessKey(v string) HTMLTitle {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTitle) Aria(k string, v any) HTMLTitle {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTitle) Attr(n string, v any) HTMLTitle {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTitle) Class(v ...string) HTMLTitle {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTitle) ContentEditable(v bool) HTMLTitle {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTitle) DataSet(k string, v any) HTMLTitle {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTitle) Dir(v string) HTMLTitle {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTitle) Draggable(v bool) HTMLTitle {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTitle) Hidden(v bool) HTMLTitle {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTitle) ID(v string) HTMLTitle {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTitle) Lang(v string) HTMLTitle {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTitle) Role(v string) HTMLTitle {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTitle) Spellcheck(v bool) HTMLTitle {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTitle) Style(k, v string) HTMLTitle {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTitle) Styles(s map[string]string) HTMLTitle {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTitle) TabIndex(v int) HTMLTitle {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTitle) Title(v string) HTMLTitle {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTitle) On(event string, h EventHandler, scope ...any) HTMLTitle {
- e.setEventHandler(event, h, scope...)
- return e
- }
- // HTMLTr is the interface that describes a "tr" HTML element.
- type HTMLTr interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLTr
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLTr
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLTr
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLTr
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLTr
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLTr
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLTr
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLTr
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLTr
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLTr
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLTr
- // ID specifies a unique id for an element.
- ID(v string) HTMLTr
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLTr
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLTr
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLTr
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLTr
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLTr
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLTr
- // Title specifies extra information about an element.
- Title(v string) HTMLTr
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLTr
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLTr
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLTr
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLTr
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLTr
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLTr
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLTr
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLTr
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLTr
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLTr
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLTr
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLTr
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLTr
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLTr
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLTr
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLTr
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLTr
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLTr
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLTr
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLTr
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLTr
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLTr
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLTr
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLTr
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLTr
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLTr
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLTr
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLTr
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLTr
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLTr
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLTr
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLTr
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLTr
- }
- // Tr returns an HTML element that defines a row in a table.
- func Tr() HTMLTr {
- e := &htmlTr{
- htmlElement: htmlElement{
- tag: "tr",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlTr struct {
- htmlElement
- }
- func (e *htmlTr) Body(v ...UI) HTMLTr {
- e.setChildren(v...)
- return e
- }
- func (e *htmlTr) Text(v any) HTMLTr {
- return e.Body(Text(v))
- }
- func (e *htmlTr) AccessKey(v string) HTMLTr {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlTr) Aria(k string, v any) HTMLTr {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTr) Attr(n string, v any) HTMLTr {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlTr) Class(v ...string) HTMLTr {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlTr) ContentEditable(v bool) HTMLTr {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlTr) DataSet(k string, v any) HTMLTr {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlTr) Dir(v string) HTMLTr {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlTr) Draggable(v bool) HTMLTr {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlTr) Hidden(v bool) HTMLTr {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlTr) ID(v string) HTMLTr {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlTr) Lang(v string) HTMLTr {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlTr) Role(v string) HTMLTr {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlTr) Spellcheck(v bool) HTMLTr {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlTr) Style(k, v string) HTMLTr {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlTr) Styles(s map[string]string) HTMLTr {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlTr) TabIndex(v int) HTMLTr {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlTr) Title(v string) HTMLTr {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlTr) On(event string, h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlTr) OnBlur(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlTr) OnChange(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlTr) OnClick(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlTr) OnContextMenu(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlTr) OnCopy(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlTr) OnCut(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlTr) OnDblClick(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlTr) OnDrag(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlTr) OnDragEnd(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlTr) OnDragEnter(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlTr) OnDragLeave(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlTr) OnDragOver(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlTr) OnDragStart(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlTr) OnDrop(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlTr) OnFocus(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlTr) OnInput(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlTr) OnInvalid(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlTr) OnKeyDown(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlTr) OnKeyPress(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlTr) OnKeyUp(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlTr) OnMouseDown(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlTr) OnMouseMove(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlTr) OnMouseOut(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlTr) OnMouseOver(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlTr) OnMouseUp(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlTr) OnPaste(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlTr) OnReset(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlTr) OnScroll(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlTr) OnSearch(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlTr) OnSelect(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlTr) OnSubmit(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlTr) OnWheel(h EventHandler, scope ...any) HTMLTr {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLU is the interface that describes a "u" HTML element.
- type HTMLU interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLU
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLU
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLU
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLU
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLU
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLU
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLU
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLU
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLU
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLU
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLU
- // ID specifies a unique id for an element.
- ID(v string) HTMLU
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLU
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLU
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLU
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLU
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLU
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLU
- // Title specifies extra information about an element.
- Title(v string) HTMLU
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLU
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLU
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLU
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLU
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLU
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLU
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLU
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLU
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLU
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLU
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLU
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLU
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLU
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLU
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLU
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLU
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLU
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLU
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLU
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLU
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLU
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLU
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLU
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLU
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLU
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLU
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLU
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLU
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLU
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLU
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLU
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLU
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLU
- }
- // U returns an HTML element that defines text that should be stylistically different from normal text.
- func U() HTMLU {
- e := &htmlU{
- htmlElement: htmlElement{
- tag: "u",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlU struct {
- htmlElement
- }
- func (e *htmlU) Body(v ...UI) HTMLU {
- e.setChildren(v...)
- return e
- }
- func (e *htmlU) Text(v any) HTMLU {
- return e.Body(Text(v))
- }
- func (e *htmlU) AccessKey(v string) HTMLU {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlU) Aria(k string, v any) HTMLU {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlU) Attr(n string, v any) HTMLU {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlU) Class(v ...string) HTMLU {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlU) ContentEditable(v bool) HTMLU {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlU) DataSet(k string, v any) HTMLU {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlU) Dir(v string) HTMLU {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlU) Draggable(v bool) HTMLU {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlU) Hidden(v bool) HTMLU {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlU) ID(v string) HTMLU {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlU) Lang(v string) HTMLU {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlU) Role(v string) HTMLU {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlU) Spellcheck(v bool) HTMLU {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlU) Style(k, v string) HTMLU {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlU) Styles(s map[string]string) HTMLU {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlU) TabIndex(v int) HTMLU {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlU) Title(v string) HTMLU {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlU) On(event string, h EventHandler, scope ...any) HTMLU {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlU) OnBlur(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlU) OnChange(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlU) OnClick(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlU) OnContextMenu(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlU) OnCopy(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlU) OnCut(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlU) OnDblClick(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlU) OnDrag(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlU) OnDragEnd(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlU) OnDragEnter(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlU) OnDragLeave(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlU) OnDragOver(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlU) OnDragStart(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlU) OnDrop(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlU) OnFocus(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlU) OnInput(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlU) OnInvalid(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlU) OnKeyDown(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlU) OnKeyPress(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlU) OnKeyUp(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlU) OnMouseDown(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlU) OnMouseMove(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlU) OnMouseOut(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlU) OnMouseOver(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlU) OnMouseUp(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlU) OnPaste(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlU) OnReset(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlU) OnScroll(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlU) OnSearch(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlU) OnSelect(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlU) OnSubmit(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlU) OnWheel(h EventHandler, scope ...any) HTMLU {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLUl is the interface that describes a "ul" HTML element.
- type HTMLUl interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLUl
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLUl
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLUl
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLUl
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLUl
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLUl
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLUl
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLUl
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLUl
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLUl
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLUl
- // ID specifies a unique id for an element.
- ID(v string) HTMLUl
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLUl
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLUl
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLUl
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLUl
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLUl
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLUl
- // Title specifies extra information about an element.
- Title(v string) HTMLUl
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLUl
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLUl
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLUl
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLUl
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLUl
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLUl
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLUl
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLUl
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLUl
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLUl
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLUl
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLUl
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLUl
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLUl
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLUl
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLUl
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLUl
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLUl
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLUl
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLUl
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLUl
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLUl
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLUl
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLUl
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLUl
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLUl
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLUl
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLUl
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLUl
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLUl
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLUl
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLUl
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLUl
- }
- // Ul returns an HTML element that defines an unordered list.
- func Ul() HTMLUl {
- e := &htmlUl{
- htmlElement: htmlElement{
- tag: "ul",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlUl struct {
- htmlElement
- }
- func (e *htmlUl) Body(v ...UI) HTMLUl {
- e.setChildren(v...)
- return e
- }
- func (e *htmlUl) Text(v any) HTMLUl {
- return e.Body(Text(v))
- }
- func (e *htmlUl) AccessKey(v string) HTMLUl {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlUl) Aria(k string, v any) HTMLUl {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlUl) Attr(n string, v any) HTMLUl {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlUl) Class(v ...string) HTMLUl {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlUl) ContentEditable(v bool) HTMLUl {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlUl) DataSet(k string, v any) HTMLUl {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlUl) Dir(v string) HTMLUl {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlUl) Draggable(v bool) HTMLUl {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlUl) Hidden(v bool) HTMLUl {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlUl) ID(v string) HTMLUl {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlUl) Lang(v string) HTMLUl {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlUl) Role(v string) HTMLUl {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlUl) Spellcheck(v bool) HTMLUl {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlUl) Style(k, v string) HTMLUl {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlUl) Styles(s map[string]string) HTMLUl {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlUl) TabIndex(v int) HTMLUl {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlUl) Title(v string) HTMLUl {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlUl) On(event string, h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlUl) OnBlur(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlUl) OnChange(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlUl) OnClick(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlUl) OnContextMenu(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlUl) OnCopy(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlUl) OnCut(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlUl) OnDblClick(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlUl) OnDrag(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlUl) OnDragEnd(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlUl) OnDragEnter(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlUl) OnDragLeave(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlUl) OnDragOver(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlUl) OnDragStart(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlUl) OnDrop(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlUl) OnFocus(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlUl) OnInput(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlUl) OnInvalid(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlUl) OnKeyDown(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlUl) OnKeyPress(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlUl) OnKeyUp(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlUl) OnMouseDown(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlUl) OnMouseMove(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlUl) OnMouseOut(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlUl) OnMouseOver(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlUl) OnMouseUp(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlUl) OnPaste(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlUl) OnReset(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlUl) OnScroll(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlUl) OnSearch(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlUl) OnSelect(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlUl) OnSubmit(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlUl) OnWheel(h EventHandler, scope ...any) HTMLUl {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLVar is the interface that describes a "var" HTML element.
- type HTMLVar interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLVar
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLVar
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLVar
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLVar
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLVar
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLVar
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLVar
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLVar
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLVar
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLVar
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLVar
- // ID specifies a unique id for an element.
- ID(v string) HTMLVar
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLVar
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLVar
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLVar
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLVar
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLVar
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLVar
- // Title specifies extra information about an element.
- Title(v string) HTMLVar
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLVar
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLVar
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLVar
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLVar
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLVar
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLVar
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLVar
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLVar
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLVar
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLVar
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLVar
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLVar
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLVar
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLVar
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLVar
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLVar
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLVar
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLVar
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLVar
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLVar
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLVar
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLVar
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLVar
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLVar
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLVar
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLVar
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLVar
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLVar
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLVar
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLVar
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLVar
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLVar
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLVar
- }
- // Var returns an HTML element that defines a variable.
- func Var() HTMLVar {
- e := &htmlVar{
- htmlElement: htmlElement{
- tag: "var",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlVar struct {
- htmlElement
- }
- func (e *htmlVar) Body(v ...UI) HTMLVar {
- e.setChildren(v...)
- return e
- }
- func (e *htmlVar) Text(v any) HTMLVar {
- return e.Body(Text(v))
- }
- func (e *htmlVar) AccessKey(v string) HTMLVar {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlVar) Aria(k string, v any) HTMLVar {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlVar) Attr(n string, v any) HTMLVar {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlVar) Class(v ...string) HTMLVar {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlVar) ContentEditable(v bool) HTMLVar {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlVar) DataSet(k string, v any) HTMLVar {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlVar) Dir(v string) HTMLVar {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlVar) Draggable(v bool) HTMLVar {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlVar) Hidden(v bool) HTMLVar {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlVar) ID(v string) HTMLVar {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlVar) Lang(v string) HTMLVar {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlVar) Role(v string) HTMLVar {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlVar) Spellcheck(v bool) HTMLVar {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlVar) Style(k, v string) HTMLVar {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlVar) Styles(s map[string]string) HTMLVar {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlVar) TabIndex(v int) HTMLVar {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlVar) Title(v string) HTMLVar {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlVar) On(event string, h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlVar) OnBlur(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlVar) OnChange(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlVar) OnClick(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlVar) OnContextMenu(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlVar) OnCopy(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlVar) OnCut(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlVar) OnDblClick(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlVar) OnDrag(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlVar) OnDragEnd(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlVar) OnDragEnter(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlVar) OnDragLeave(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlVar) OnDragOver(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlVar) OnDragStart(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlVar) OnDrop(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlVar) OnFocus(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlVar) OnInput(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlVar) OnInvalid(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlVar) OnKeyDown(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlVar) OnKeyPress(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlVar) OnKeyUp(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlVar) OnMouseDown(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlVar) OnMouseMove(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlVar) OnMouseOut(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlVar) OnMouseOver(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlVar) OnMouseUp(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlVar) OnPaste(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlVar) OnReset(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlVar) OnScroll(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlVar) OnSearch(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlVar) OnSelect(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlVar) OnSubmit(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlVar) OnWheel(h EventHandler, scope ...any) HTMLVar {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLVideo is the interface that describes a "video" HTML element.
- type HTMLVideo interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLVideo
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLVideo
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLVideo
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLVideo
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLVideo
- // AutoPlay specifies that the audio/video will start playing as soon as it is ready.
- AutoPlay(v bool) HTMLVideo
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLVideo
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLVideo
- // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc).
- Controls(v bool) HTMLVideo
- // CrossOrigin sets the mode of the request to an HTTP CORS Request.
- CrossOrigin(v string) HTMLVideo
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLVideo
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLVideo
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLVideo
- // Height specifies the height of the element (in pixels).
- Height(v int) HTMLVideo
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLVideo
- // ID specifies a unique id for an element.
- ID(v string) HTMLVideo
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLVideo
- // Loop specifies that the audio/video will start over again, every time it is finished.
- Loop(v bool) HTMLVideo
- // Muted specifies that the audio output of the video should be muted.
- Muted(v bool) HTMLVideo
- // Poster specifies an image to be shown while the video is downloading, or until the user hits the play button.
- Poster(v string) HTMLVideo
- // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads.
- Preload(v string) HTMLVideo
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLVideo
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLVideo
- // Src specifies the URL of the media file.
- Src(v string) HTMLVideo
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLVideo
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLVideo
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLVideo
- // Title specifies extra information about an element.
- Title(v string) HTMLVideo
- // Width specifies the width of the element.
- Width(v int) HTMLVideo
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLVideo
- // OnAbort calls the given handler on abort.
- OnAbort(h EventHandler, scope ...any) HTMLVideo
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLVideo
- // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
- OnCanPlay(h EventHandler, scope ...any) HTMLVideo
- // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
- OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLVideo
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLVideo
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLVideo
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLVideo
- // OnCueChange calls the given handler when the cue changes in a track element.
- OnCueChange(h EventHandler, scope ...any) HTMLVideo
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLVideo
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLVideo
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLVideo
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLVideo
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLVideo
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLVideo
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLVideo
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLVideo
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLVideo
- // OnDurationChange calls the given handler when the length of the media changes.
- OnDurationChange(h EventHandler, scope ...any) HTMLVideo
- // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
- OnEmptied(h EventHandler, scope ...any) HTMLVideo
- // OnEnded calls the given handler when the media has reach the end.
- OnEnded(h EventHandler, scope ...any) HTMLVideo
- // OnError calls the given handler when an error occurs.
- OnError(h EventHandler, scope ...any) HTMLVideo
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLVideo
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLVideo
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLVideo
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLVideo
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLVideo
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLVideo
- // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
- OnLoadStart(h EventHandler, scope ...any) HTMLVideo
- // OnLoadedData calls the given handler when media data is loaded.
- OnLoadedData(h EventHandler, scope ...any) HTMLVideo
- // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
- OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLVideo
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLVideo
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLVideo
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLVideo
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLVideo
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLVideo
- // OnPause calls the given handler when the media is paused either by the user or programmatically.
- OnPause(h EventHandler, scope ...any) HTMLVideo
- // OnPlay calls the given handler when the media is ready to start playing.
- OnPlay(h EventHandler, scope ...any) HTMLVideo
- // OnPlaying calls the given handler when the media actually has started playing.
- OnPlaying(h EventHandler, scope ...any) HTMLVideo
- // OnProgress calls the given handler when the browser is in the process of getting the media data.
- OnProgress(h EventHandler, scope ...any) HTMLVideo
- // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
- OnRateChange(h EventHandler, scope ...any) HTMLVideo
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLVideo
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLVideo
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLVideo
- // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
- OnSeeked(h EventHandler, scope ...any) HTMLVideo
- // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
- OnSeeking(h EventHandler, scope ...any) HTMLVideo
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLVideo
- // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
- OnStalled(h EventHandler, scope ...any) HTMLVideo
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLVideo
- // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
- OnSuspend(h EventHandler, scope ...any) HTMLVideo
- // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
- OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo
- // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
- OnVolumeChange(h EventHandler, scope ...any) HTMLVideo
- // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
- OnWaiting(h EventHandler, scope ...any) HTMLVideo
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLVideo
- }
- // Video returns an HTML element that defines a video or movie.
- func Video() HTMLVideo {
- e := &htmlVideo{
- htmlElement: htmlElement{
- tag: "video",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlVideo struct {
- htmlElement
- }
- func (e *htmlVideo) Body(v ...UI) HTMLVideo {
- e.setChildren(v...)
- return e
- }
- func (e *htmlVideo) Text(v any) HTMLVideo {
- return e.Body(Text(v))
- }
- func (e *htmlVideo) AccessKey(v string) HTMLVideo {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlVideo) Aria(k string, v any) HTMLVideo {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlVideo) Attr(n string, v any) HTMLVideo {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlVideo) AutoPlay(v bool) HTMLVideo {
- e.setAttr("autoplay", v)
- return e
- }
- func (e *htmlVideo) Class(v ...string) HTMLVideo {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlVideo) ContentEditable(v bool) HTMLVideo {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlVideo) Controls(v bool) HTMLVideo {
- e.setAttr("controls", v)
- return e
- }
- func (e *htmlVideo) CrossOrigin(v string) HTMLVideo {
- e.setAttr("crossorigin", v)
- return e
- }
- func (e *htmlVideo) DataSet(k string, v any) HTMLVideo {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlVideo) Dir(v string) HTMLVideo {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlVideo) Draggable(v bool) HTMLVideo {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlVideo) Height(v int) HTMLVideo {
- e.setAttr("height", v)
- return e
- }
- func (e *htmlVideo) Hidden(v bool) HTMLVideo {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlVideo) ID(v string) HTMLVideo {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlVideo) Lang(v string) HTMLVideo {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlVideo) Loop(v bool) HTMLVideo {
- e.setAttr("loop", v)
- return e
- }
- func (e *htmlVideo) Muted(v bool) HTMLVideo {
- e.setAttr("muted", v)
- return e
- }
- func (e *htmlVideo) Poster(v string) HTMLVideo {
- e.setAttr("poster", v)
- return e
- }
- func (e *htmlVideo) Preload(v string) HTMLVideo {
- e.setAttr("preload", v)
- return e
- }
- func (e *htmlVideo) Role(v string) HTMLVideo {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlVideo) Spellcheck(v bool) HTMLVideo {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlVideo) Src(v string) HTMLVideo {
- e.setAttr("src", v)
- return e
- }
- func (e *htmlVideo) Style(k, v string) HTMLVideo {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlVideo) Styles(s map[string]string) HTMLVideo {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlVideo) TabIndex(v int) HTMLVideo {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlVideo) Title(v string) HTMLVideo {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlVideo) Width(v int) HTMLVideo {
- e.setAttr("width", v)
- return e
- }
- func (e *htmlVideo) On(event string, h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlVideo) OnAbort(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("abort", h, scope...)
- return e
- }
- func (e *htmlVideo) OnBlur(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlVideo) OnCanPlay(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("canplay", h, scope...)
- return e
- }
- func (e *htmlVideo) OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("canplaythrough", h, scope...)
- return e
- }
- func (e *htmlVideo) OnChange(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlVideo) OnClick(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlVideo) OnContextMenu(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlVideo) OnCopy(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlVideo) OnCueChange(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("cuechange", h, scope...)
- return e
- }
- func (e *htmlVideo) OnCut(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDblClick(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDrag(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDragEnd(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDragEnter(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDragLeave(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDragOver(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDragStart(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDrop(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlVideo) OnDurationChange(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("durationchange", h, scope...)
- return e
- }
- func (e *htmlVideo) OnEmptied(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("emptied", h, scope...)
- return e
- }
- func (e *htmlVideo) OnEnded(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("ended", h, scope...)
- return e
- }
- func (e *htmlVideo) OnError(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("error", h, scope...)
- return e
- }
- func (e *htmlVideo) OnFocus(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlVideo) OnInput(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlVideo) OnInvalid(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlVideo) OnKeyDown(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlVideo) OnKeyPress(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlVideo) OnKeyUp(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlVideo) OnLoadStart(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("loadstart", h, scope...)
- return e
- }
- func (e *htmlVideo) OnLoadedData(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("loadeddata", h, scope...)
- return e
- }
- func (e *htmlVideo) OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("loadedmetadata", h, scope...)
- return e
- }
- func (e *htmlVideo) OnMouseDown(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlVideo) OnMouseMove(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlVideo) OnMouseOut(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlVideo) OnMouseOver(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlVideo) OnMouseUp(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlVideo) OnPaste(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlVideo) OnPause(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("pause", h, scope...)
- return e
- }
- func (e *htmlVideo) OnPlay(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("play", h, scope...)
- return e
- }
- func (e *htmlVideo) OnPlaying(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("playing", h, scope...)
- return e
- }
- func (e *htmlVideo) OnProgress(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("progress", h, scope...)
- return e
- }
- func (e *htmlVideo) OnRateChange(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("ratechange", h, scope...)
- return e
- }
- func (e *htmlVideo) OnReset(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlVideo) OnScroll(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSearch(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSeeked(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("seeked", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSeeking(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("seeking", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSelect(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlVideo) OnStalled(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("stalled", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSubmit(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlVideo) OnSuspend(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("suspend", h, scope...)
- return e
- }
- func (e *htmlVideo) OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("timeupdate", h, scope...)
- return e
- }
- func (e *htmlVideo) OnVolumeChange(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("volumechange", h, scope...)
- return e
- }
- func (e *htmlVideo) OnWaiting(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("waiting", h, scope...)
- return e
- }
- func (e *htmlVideo) OnWheel(h EventHandler, scope ...any) HTMLVideo {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
- // HTMLWbr is the interface that describes a "wbr" HTML element.
- type HTMLWbr interface {
- UI
- // Body set the content of the element.
- Body(elems ...UI) HTMLWbr
- // Text sets the content of the element with a text node containing the stringified given value.
- Text(v any) HTMLWbr
- // AccessKey specifies a shortcut key to activate/focus an element.
- AccessKey(v string) HTMLWbr
- // Aria stores accessible rich internet applications (ARIA) data.
- Aria(k string, v any) HTMLWbr
- // Attr sets the named attribute with the given value.
- Attr(n string, v any) HTMLWbr
- // Class specifies one or more classnames for an element (refers to a class in a style sheet).
- Class(v ...string) HTMLWbr
- // ContentEditable specifies whether the content of an element is editable or not.
- ContentEditable(v bool) HTMLWbr
- // DataSet stores custom data private to the page or application.
- DataSet(k string, v any) HTMLWbr
- // Dir specifies the text direction for the content in an element.
- Dir(v string) HTMLWbr
- // Draggable specifies whether an element is draggable or not.
- Draggable(v bool) HTMLWbr
- // Hidden specifies that an element is not yet, or is no longer relevant.
- Hidden(v bool) HTMLWbr
- // ID specifies a unique id for an element.
- ID(v string) HTMLWbr
- // Lang specifies the language of the element's content.
- Lang(v string) HTMLWbr
- // Role specifies to parsing software the exact function of an element (and its children).
- Role(v string) HTMLWbr
- // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
- Spellcheck(v bool) HTMLWbr
- // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
- Style(k, v string) HTMLWbr
- // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
- Styles(s map[string]string) HTMLWbr
- // TabIndex specifies the tabbing order of an element.
- TabIndex(v int) HTMLWbr
- // Title specifies extra information about an element.
- Title(v string) HTMLWbr
- // On registers the given event handler to the specified event.
- On(event string, h EventHandler, scope ...any) HTMLWbr
- // OnBlur calls the given handler when the element loses focus.
- OnBlur(h EventHandler, scope ...any) HTMLWbr
- // OnChange calls the given handler when the value of the element is changed.
- OnChange(h EventHandler, scope ...any) HTMLWbr
- // OnClick calls the given handler when there is a mouse click on the element.
- OnClick(h EventHandler, scope ...any) HTMLWbr
- // OnContextMenu calls the given handler when a context menu is triggered.
- OnContextMenu(h EventHandler, scope ...any) HTMLWbr
- // OnCopy calls the given handler when the user copies the content of an element.
- OnCopy(h EventHandler, scope ...any) HTMLWbr
- // OnCut calls the given handler when the user cuts the content of an element.
- OnCut(h EventHandler, scope ...any) HTMLWbr
- // OnDblClick calls the given handler when there is a mouse double-click on the element.
- OnDblClick(h EventHandler, scope ...any) HTMLWbr
- // OnDrag calls the given handler when an element is dragged.
- OnDrag(h EventHandler, scope ...any) HTMLWbr
- // OnDragEnd calls the given handler at the end of a drag operation.
- OnDragEnd(h EventHandler, scope ...any) HTMLWbr
- // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
- OnDragEnter(h EventHandler, scope ...any) HTMLWbr
- // OnDragLeave calls the given handler when an element leaves a valid drop target.
- OnDragLeave(h EventHandler, scope ...any) HTMLWbr
- // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
- OnDragOver(h EventHandler, scope ...any) HTMLWbr
- // OnDragStart calls the given handler at the start of a drag operation.
- OnDragStart(h EventHandler, scope ...any) HTMLWbr
- // OnDrop calls the given handler when dragged element is being dropped.
- OnDrop(h EventHandler, scope ...any) HTMLWbr
- // OnFocus calls the given handler when the element gets focus.
- OnFocus(h EventHandler, scope ...any) HTMLWbr
- // OnInput calls the given handler when an element gets user input.
- OnInput(h EventHandler, scope ...any) HTMLWbr
- // OnInvalid calls the given handler when an element is invalid.
- OnInvalid(h EventHandler, scope ...any) HTMLWbr
- // OnKeyDown calls the given handler when a user is pressing a key.
- OnKeyDown(h EventHandler, scope ...any) HTMLWbr
- // OnKeyPress calls the given handler when a user presses a key.
- OnKeyPress(h EventHandler, scope ...any) HTMLWbr
- // OnKeyUp calls the given handler when a user releases a key.
- OnKeyUp(h EventHandler, scope ...any) HTMLWbr
- // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
- OnMouseDown(h EventHandler, scope ...any) HTMLWbr
- // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
- OnMouseMove(h EventHandler, scope ...any) HTMLWbr
- // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
- OnMouseOut(h EventHandler, scope ...any) HTMLWbr
- // OnMouseOver calls the given handler when the mouse pointer moves over an element.
- OnMouseOver(h EventHandler, scope ...any) HTMLWbr
- // OnMouseUp calls the given handler when a mouse button is released over an element.
- OnMouseUp(h EventHandler, scope ...any) HTMLWbr
- // OnPaste calls the given handler when the user pastes some content in an element.
- OnPaste(h EventHandler, scope ...any) HTMLWbr
- // OnReset calls the given handler when the Reset button in a form is clicked.
- OnReset(h EventHandler, scope ...any) HTMLWbr
- // OnScroll calls the given handler when an element's scrollbar is being scrolled.
- OnScroll(h EventHandler, scope ...any) HTMLWbr
- // OnSearch calls the given handler when the user writes something in a search field.
- OnSearch(h EventHandler, scope ...any) HTMLWbr
- // OnSelect calls the given handler after some text has been selected in an element.
- OnSelect(h EventHandler, scope ...any) HTMLWbr
- // OnSubmit calls the given handler when a form is submitted.
- OnSubmit(h EventHandler, scope ...any) HTMLWbr
- // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
- OnWheel(h EventHandler, scope ...any) HTMLWbr
- }
- // Wbr returns an HTML element that defines a possible line-break.
- func Wbr() HTMLWbr {
- e := &htmlWbr{
- htmlElement: htmlElement{
- tag: "wbr",
- isSelfClosing: false,
- },
- }
- return e
- }
- type htmlWbr struct {
- htmlElement
- }
- func (e *htmlWbr) Body(v ...UI) HTMLWbr {
- e.setChildren(v...)
- return e
- }
- func (e *htmlWbr) Text(v any) HTMLWbr {
- return e.Body(Text(v))
- }
- func (e *htmlWbr) AccessKey(v string) HTMLWbr {
- e.setAttr("accesskey", v)
- return e
- }
- func (e *htmlWbr) Aria(k string, v any) HTMLWbr {
- e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlWbr) Attr(n string, v any) HTMLWbr {
- e.setAttr(n, v)
- return e
- }
- func (e *htmlWbr) Class(v ...string) HTMLWbr {
- e.setAttr("class", strings.Join(v, " "))
- return e
- }
- func (e *htmlWbr) ContentEditable(v bool) HTMLWbr {
- e.setAttr("contenteditable", v)
- return e
- }
- func (e *htmlWbr) DataSet(k string, v any) HTMLWbr {
- e.setAttr("data-"+k, fmt.Sprintf("%v", v))
- return e
- }
- func (e *htmlWbr) Dir(v string) HTMLWbr {
- e.setAttr("dir", v)
- return e
- }
- func (e *htmlWbr) Draggable(v bool) HTMLWbr {
- e.setAttr("draggable", v)
- return e
- }
- func (e *htmlWbr) Hidden(v bool) HTMLWbr {
- e.setAttr("hidden", v)
- return e
- }
- func (e *htmlWbr) ID(v string) HTMLWbr {
- e.setAttr("id", v)
- return e
- }
- func (e *htmlWbr) Lang(v string) HTMLWbr {
- e.setAttr("lang", v)
- return e
- }
- func (e *htmlWbr) Role(v string) HTMLWbr {
- e.setAttr("role", v)
- return e
- }
- func (e *htmlWbr) Spellcheck(v bool) HTMLWbr {
- s := "false"
- if v {
- s = "true"
- }
- e.setAttr("spellcheck", s)
- return e
- }
- func (e *htmlWbr) Style(k, v string) HTMLWbr {
- e.setAttr("style", k+":"+v)
- return e
- }
- func (e *htmlWbr) Styles(s map[string]string) HTMLWbr {
- for k, v := range s {
- e.Style(k, v)
- }
- return e
- }
- func (e *htmlWbr) TabIndex(v int) HTMLWbr {
- e.setAttr("tabindex", v)
- return e
- }
- func (e *htmlWbr) Title(v string) HTMLWbr {
- e.setAttr("title", v)
- return e
- }
- func (e *htmlWbr) On(event string, h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler(event, h, scope...)
- return e
- }
- func (e *htmlWbr) OnBlur(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("blur", h, scope...)
- return e
- }
- func (e *htmlWbr) OnChange(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("change", h, scope...)
- return e
- }
- func (e *htmlWbr) OnClick(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("click", h, scope...)
- return e
- }
- func (e *htmlWbr) OnContextMenu(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("contextmenu", h, scope...)
- return e
- }
- func (e *htmlWbr) OnCopy(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("copy", h, scope...)
- return e
- }
- func (e *htmlWbr) OnCut(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("cut", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDblClick(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dblclick", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDrag(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("drag", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDragEnd(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dragend", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDragEnter(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dragenter", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDragLeave(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dragleave", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDragOver(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dragover", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDragStart(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("dragstart", h, scope...)
- return e
- }
- func (e *htmlWbr) OnDrop(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("drop", h, scope...)
- return e
- }
- func (e *htmlWbr) OnFocus(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("focus", h, scope...)
- return e
- }
- func (e *htmlWbr) OnInput(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("input", h, scope...)
- return e
- }
- func (e *htmlWbr) OnInvalid(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("invalid", h, scope...)
- return e
- }
- func (e *htmlWbr) OnKeyDown(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("keydown", h, scope...)
- return e
- }
- func (e *htmlWbr) OnKeyPress(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("keypress", h, scope...)
- return e
- }
- func (e *htmlWbr) OnKeyUp(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("keyup", h, scope...)
- return e
- }
- func (e *htmlWbr) OnMouseDown(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("mousedown", h, scope...)
- return e
- }
- func (e *htmlWbr) OnMouseMove(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("mousemove", h, scope...)
- return e
- }
- func (e *htmlWbr) OnMouseOut(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("mouseout", h, scope...)
- return e
- }
- func (e *htmlWbr) OnMouseOver(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("mouseover", h, scope...)
- return e
- }
- func (e *htmlWbr) OnMouseUp(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("mouseup", h, scope...)
- return e
- }
- func (e *htmlWbr) OnPaste(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("paste", h, scope...)
- return e
- }
- func (e *htmlWbr) OnReset(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("reset", h, scope...)
- return e
- }
- func (e *htmlWbr) OnScroll(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("scroll", h, scope...)
- return e
- }
- func (e *htmlWbr) OnSearch(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("search", h, scope...)
- return e
- }
- func (e *htmlWbr) OnSelect(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("select", h, scope...)
- return e
- }
- func (e *htmlWbr) OnSubmit(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("submit", h, scope...)
- return e
- }
- func (e *htmlWbr) OnWheel(h EventHandler, scope ...any) HTMLWbr {
- e.setEventHandler("wheel", h, scope...)
- return e
- }
|